apischema

package
v0.20231116.1162710 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: MPL-2.0 Imports: 10 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/apimanagement/2022-08-01/apischema Documentation

The apischema SDK allows for interaction with the Azure Resource Manager Service apimanagement (API Version 2022-08-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/apimanagement/2022-08-01/apischema"

Client Initialization

client := apischema.NewApiSchemaClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ApiSchemaClient.CreateOrUpdate

ctx := context.TODO()
id := apischema.NewApiSchemaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "apiIdValue", "schemaIdValue")

payload := apischema.SchemaContract{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload, apischema.DefaultCreateOrUpdateOperationOptions()); err != nil {
	// handle the error
}

Example Usage: ApiSchemaClient.Delete

ctx := context.TODO()
id := apischema.NewApiSchemaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "apiIdValue", "schemaIdValue")

read, err := client.Delete(ctx, id, apischema.DefaultDeleteOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ApiSchemaClient.Get

ctx := context.TODO()
id := apischema.NewApiSchemaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "apiIdValue", "schemaIdValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ApiSchemaClient.GetEntityTag

ctx := context.TODO()
id := apischema.NewApiSchemaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "apiIdValue", "schemaIdValue")

read, err := client.GetEntityTag(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ApiSchemaClient.ListByApi

ctx := context.TODO()
id := apischema.NewApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "apiIdValue")

// alternatively `client.ListByApi(ctx, id, apischema.DefaultListByApiOperationOptions())` can be used to do batched pagination
items, err := client.ListByApiComplete(ctx, id, apischema.DefaultListByApiOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateApiID

func ValidateApiID(input interface{}, key string) (warnings []string, errors []error)

ValidateApiID checks that 'input' can be parsed as a Api ID

func ValidateApiSchemaID added in v0.20230727.1090744

func ValidateApiSchemaID(input interface{}, key string) (warnings []string, errors []error)

ValidateApiSchemaID checks that 'input' can be parsed as a Api Schema ID

Types

type ApiId

type ApiId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServiceName       string
	ApiId             string
}

ApiId is a struct representing the Resource ID for a Api

func NewApiID

func NewApiID(subscriptionId string, resourceGroupName string, serviceName string, apiId string) ApiId

NewApiID returns a new ApiId struct

func ParseApiID

func ParseApiID(input string) (*ApiId, error)

ParseApiID parses 'input' into a ApiId

func ParseApiIDInsensitively

func ParseApiIDInsensitively(input string) (*ApiId, error)

ParseApiIDInsensitively parses 'input' case-insensitively into a ApiId note: this method should only be used for API response data and not user input

func (ApiId) ID

func (id ApiId) ID() string

ID returns the formatted Api ID

func (ApiId) Segments

func (id ApiId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Api ID

func (ApiId) String

func (id ApiId) String() string

String returns a human-readable description of this Api ID

type ApiSchemaClient

type ApiSchemaClient struct {
	Client *resourcemanager.Client
}

func NewApiSchemaClientWithBaseURI

func NewApiSchemaClientWithBaseURI(sdkApi sdkEnv.Api) (*ApiSchemaClient, error)

func (ApiSchemaClient) CreateOrUpdate

CreateOrUpdate ...

func (ApiSchemaClient) CreateOrUpdateThenPoll

func (c ApiSchemaClient) CreateOrUpdateThenPoll(ctx context.Context, id ApiSchemaId, input SchemaContract, options CreateOrUpdateOperationOptions) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (ApiSchemaClient) Delete

Delete ...

func (ApiSchemaClient) Get

Get ...

func (ApiSchemaClient) GetEntityTag

func (c ApiSchemaClient) GetEntityTag(ctx context.Context, id ApiSchemaId) (result GetEntityTagOperationResponse, err error)

GetEntityTag ...

func (ApiSchemaClient) ListByApi

ListByApi ...

func (ApiSchemaClient) ListByApiComplete

ListByApiComplete retrieves all the results into a single object

func (ApiSchemaClient) ListByApiCompleteMatchingPredicate

func (c ApiSchemaClient) ListByApiCompleteMatchingPredicate(ctx context.Context, id ApiId, options ListByApiOperationOptions, predicate SchemaContractOperationPredicate) (result ListByApiCompleteResult, err error)

ListByApiCompleteMatchingPredicate retrieves all the results and then applies the predicate

type ApiSchemaId added in v0.20230727.1090744

type ApiSchemaId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServiceName       string
	ApiId             string
	SchemaId          string
}

ApiSchemaId is a struct representing the Resource ID for a Api Schema

func NewApiSchemaID added in v0.20230727.1090744

func NewApiSchemaID(subscriptionId string, resourceGroupName string, serviceName string, apiId string, schemaId string) ApiSchemaId

NewApiSchemaID returns a new ApiSchemaId struct

func ParseApiSchemaID added in v0.20230727.1090744

func ParseApiSchemaID(input string) (*ApiSchemaId, error)

ParseApiSchemaID parses 'input' into a ApiSchemaId

func ParseApiSchemaIDInsensitively added in v0.20230727.1090744

func ParseApiSchemaIDInsensitively(input string) (*ApiSchemaId, error)

ParseApiSchemaIDInsensitively parses 'input' case-insensitively into a ApiSchemaId note: this method should only be used for API response data and not user input

func (ApiSchemaId) ID added in v0.20230727.1090744

func (id ApiSchemaId) ID() string

ID returns the formatted Api Schema ID

func (ApiSchemaId) Segments added in v0.20230727.1090744

func (id ApiSchemaId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Api Schema ID

func (ApiSchemaId) String added in v0.20230727.1090744

func (id ApiSchemaId) String() string

String returns a human-readable description of this Api Schema ID

type CreateOrUpdateOperationOptions

type CreateOrUpdateOperationOptions struct {
	IfMatch *string
}

func DefaultCreateOrUpdateOperationOptions

func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions

func (CreateOrUpdateOperationOptions) ToHeaders added in v0.20230801.1071415

func (CreateOrUpdateOperationOptions) ToOData added in v0.20230801.1071415

func (CreateOrUpdateOperationOptions) ToQuery added in v0.20230801.1071415

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DeleteOperationOptions

type DeleteOperationOptions struct {
	Force   *bool
	IfMatch *string
}

func DefaultDeleteOperationOptions

func DefaultDeleteOperationOptions() DeleteOperationOptions

func (DeleteOperationOptions) ToHeaders added in v0.20230801.1071415

func (o DeleteOperationOptions) ToHeaders() *client.Headers

func (DeleteOperationOptions) ToOData added in v0.20230801.1071415

func (o DeleteOperationOptions) ToOData() *odata.Query

func (DeleteOperationOptions) ToQuery added in v0.20230801.1071415

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetEntityTagOperationResponse

type GetEntityTagOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SchemaContract
}

type ListByApiCompleteResult

type ListByApiCompleteResult struct {
	Items []SchemaContract
}

type ListByApiOperationOptions

type ListByApiOperationOptions struct {
	Filter *string
	Skip   *int64
	Top    *int64
}

func DefaultListByApiOperationOptions

func DefaultListByApiOperationOptions() ListByApiOperationOptions

func (ListByApiOperationOptions) ToHeaders added in v0.20230801.1071415

func (o ListByApiOperationOptions) ToHeaders() *client.Headers

func (ListByApiOperationOptions) ToOData added in v0.20230801.1071415

func (o ListByApiOperationOptions) ToOData() *odata.Query

func (ListByApiOperationOptions) ToQuery added in v0.20230801.1071415

type ListByApiOperationResponse

type ListByApiOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]SchemaContract
}

type SchemaContract

type SchemaContract struct {
	Id         *string                   `json:"id,omitempty"`
	Name       *string                   `json:"name,omitempty"`
	Properties *SchemaContractProperties `json:"properties,omitempty"`
	Type       *string                   `json:"type,omitempty"`
}

type SchemaContractOperationPredicate

type SchemaContractOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (SchemaContractOperationPredicate) Matches

type SchemaContractProperties

type SchemaContractProperties struct {
	ContentType string                   `json:"contentType"`
	Document    SchemaDocumentProperties `json:"document"`
}

type SchemaDocumentProperties

type SchemaDocumentProperties struct {
	Components  *interface{} `json:"components,omitempty"`
	Definitions *interface{} `json:"definitions,omitempty"`
	Value       *string      `json:"value,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL