apischema

package
v0.20230220.1102648 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

README

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

The apischema SDK allows for interaction with the Azure Resource Manager Service apimanagement (API Version 2021-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/2021-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.NewSchemaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "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.NewSchemaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "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.NewSchemaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "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.NewSchemaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "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 ValidateSchemaID

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

ValidateSchemaID checks that 'input' can be parsed as a 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 autorest.Client
	// contains filtered or unexported fields
}

func NewApiSchemaClientWithBaseURI

func NewApiSchemaClientWithBaseURI(endpoint string) ApiSchemaClient

func (ApiSchemaClient) CreateOrUpdate

CreateOrUpdate ...

func (ApiSchemaClient) CreateOrUpdateThenPoll

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

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (ApiSchemaClient) Delete

Delete ...

func (ApiSchemaClient) Get

func (c ApiSchemaClient) Get(ctx context.Context, id SchemaId) (result GetOperationResponse, err error)

Get ...

func (ApiSchemaClient) GetEntityTag

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

GetEntityTag ...

func (ApiSchemaClient) ListByApi

ListByApi ...

func (ApiSchemaClient) ListByApiComplete

ListByApiComplete retrieves all of the results into a single object

func (ApiSchemaClient) ListByApiCompleteMatchingPredicate

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

ListByApiCompleteMatchingPredicate retrieves all of the results and then applied the predicate

type CreateOrUpdateOperationOptions

type CreateOrUpdateOperationOptions struct {
	IfMatch *string
}

func DefaultCreateOrUpdateOperationOptions

func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type DeleteOperationOptions

type DeleteOperationOptions struct {
	Force   *bool
	IfMatch *string
}

func DefaultDeleteOperationOptions

func DefaultDeleteOperationOptions() DeleteOperationOptions

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
}

type GetEntityTagOperationResponse

type GetEntityTagOperationResponse struct {
	HttpResponse *http.Response
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	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

type ListByApiOperationResponse

type ListByApiOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]SchemaContract
	// contains filtered or unexported fields
}

func (ListByApiOperationResponse) HasMore

func (r ListByApiOperationResponse) HasMore() bool

func (ListByApiOperationResponse) LoadMore

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,omitempty"`
}

type SchemaDocumentProperties

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

type SchemaId

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

SchemaId is a struct representing the Resource ID for a Schema

func NewSchemaID

func NewSchemaID(subscriptionId string, resourceGroupName string, serviceName string, schemaId string) SchemaId

NewSchemaID returns a new SchemaId struct

func ParseSchemaID

func ParseSchemaID(input string) (*SchemaId, error)

ParseSchemaID parses 'input' into a SchemaId

func ParseSchemaIDInsensitively

func ParseSchemaIDInsensitively(input string) (*SchemaId, error)

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

func (SchemaId) ID

func (id SchemaId) ID() string

ID returns the formatted Schema ID

func (SchemaId) Segments

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

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

func (SchemaId) String

func (id SchemaId) String() string

String returns a human-readable description of this Schema ID

Jump to

Keyboard shortcuts

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