apidefinitions

package
v0.20240627.1143641 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/apicenter/2024-03-01/apidefinitions Documentation

The apidefinitions SDK allows for interaction with the Azure Resource Manager Service apicenter (API Version 2024-03-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/apicenter/2024-03-01/apidefinitions"

Client Initialization

client := apidefinitions.NewApiDefinitionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ApiDefinitionsClient.CreateOrUpdate

ctx := context.TODO()
id := apidefinitions.NewDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceValue", "apiValue", "versionValue", "definitionValue")

payload := apidefinitions.ApiDefinition{
	// ...
}


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

Example Usage: ApiDefinitionsClient.Delete

ctx := context.TODO()
id := apidefinitions.NewDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceValue", "apiValue", "versionValue", "definitionValue")

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

Example Usage: ApiDefinitionsClient.ExportSpecification

ctx := context.TODO()
id := apidefinitions.NewDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceValue", "apiValue", "versionValue", "definitionValue")

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

Example Usage: ApiDefinitionsClient.Get

ctx := context.TODO()
id := apidefinitions.NewDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceValue", "apiValue", "versionValue", "definitionValue")

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: ApiDefinitionsClient.Head

ctx := context.TODO()
id := apidefinitions.NewDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceValue", "apiValue", "versionValue", "definitionValue")

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

Example Usage: ApiDefinitionsClient.ImportSpecification

ctx := context.TODO()
id := apidefinitions.NewDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceValue", "apiValue", "versionValue", "definitionValue")

payload := apidefinitions.ApiSpecImportRequest{
	// ...
}


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

Example Usage: ApiDefinitionsClient.List

ctx := context.TODO()
id := apidefinitions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceValue", "apiValue", "versionValue")

// alternatively `client.List(ctx, id, apidefinitions.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, apidefinitions.DefaultListOperationOptions())
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 PossibleValuesForApiSpecExportResultFormat

func PossibleValuesForApiSpecExportResultFormat() []string

func PossibleValuesForApiSpecImportSourceFormat

func PossibleValuesForApiSpecImportSourceFormat() []string

func ValidateDefinitionID

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

ValidateDefinitionID checks that 'input' can be parsed as a Definition ID

func ValidateVersionID

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

ValidateVersionID checks that 'input' can be parsed as a Version ID

Types

type ApiDefinition

type ApiDefinition struct {
	Id         *string                  `json:"id,omitempty"`
	Name       *string                  `json:"name,omitempty"`
	Properties *ApiDefinitionProperties `json:"properties,omitempty"`
	SystemData *systemdata.SystemData   `json:"systemData,omitempty"`
	Type       *string                  `json:"type,omitempty"`
}

type ApiDefinitionOperationPredicate

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

func (ApiDefinitionOperationPredicate) Matches

type ApiDefinitionProperties

type ApiDefinitionProperties struct {
	Description   *string                               `json:"description,omitempty"`
	Specification *ApiDefinitionPropertiesSpecification `json:"specification,omitempty"`
	Title         string                                `json:"title"`
}

type ApiDefinitionPropertiesSpecification

type ApiDefinitionPropertiesSpecification struct {
	Name    *string `json:"name,omitempty"`
	Version *string `json:"version,omitempty"`
}

type ApiDefinitionsClient

type ApiDefinitionsClient struct {
	Client *resourcemanager.Client
}

func NewApiDefinitionsClientWithBaseURI

func NewApiDefinitionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ApiDefinitionsClient, error)

func (ApiDefinitionsClient) CreateOrUpdate

CreateOrUpdate ...

func (ApiDefinitionsClient) Delete

Delete ...

func (ApiDefinitionsClient) ExportSpecification

func (c ApiDefinitionsClient) ExportSpecification(ctx context.Context, id DefinitionId) (result ExportSpecificationOperationResponse, err error)

ExportSpecification ...

func (ApiDefinitionsClient) ExportSpecificationThenPoll

func (c ApiDefinitionsClient) ExportSpecificationThenPoll(ctx context.Context, id DefinitionId) error

ExportSpecificationThenPoll performs ExportSpecification then polls until it's completed

func (ApiDefinitionsClient) Get

Get ...

func (ApiDefinitionsClient) Head

Head ...

func (ApiDefinitionsClient) ImportSpecification

ImportSpecification ...

func (ApiDefinitionsClient) ImportSpecificationThenPoll

func (c ApiDefinitionsClient) ImportSpecificationThenPoll(ctx context.Context, id DefinitionId, input ApiSpecImportRequest) error

ImportSpecificationThenPoll performs ImportSpecification then polls until it's completed

func (ApiDefinitionsClient) List

List ...

func (ApiDefinitionsClient) ListComplete

ListComplete retrieves all the results into a single object

func (ApiDefinitionsClient) ListCompleteMatchingPredicate

func (c ApiDefinitionsClient) ListCompleteMatchingPredicate(ctx context.Context, id VersionId, options ListOperationOptions, predicate ApiDefinitionOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type ApiSpecExportResult

type ApiSpecExportResult struct {
	Format *ApiSpecExportResultFormat `json:"format,omitempty"`
	Value  *string                    `json:"value,omitempty"`
}

type ApiSpecExportResultFormat

type ApiSpecExportResultFormat string
const (
	ApiSpecExportResultFormatInline ApiSpecExportResultFormat = "inline"
	ApiSpecExportResultFormatLink   ApiSpecExportResultFormat = "link"
)

func (*ApiSpecExportResultFormat) UnmarshalJSON

func (s *ApiSpecExportResultFormat) UnmarshalJSON(bytes []byte) error

type ApiSpecImportRequest

type ApiSpecImportRequest struct {
	Format        *ApiSpecImportSourceFormat         `json:"format,omitempty"`
	Specification *ApiSpecImportRequestSpecification `json:"specification,omitempty"`
	Value         *string                            `json:"value,omitempty"`
}

type ApiSpecImportRequestSpecification

type ApiSpecImportRequestSpecification struct {
	Name    *string `json:"name,omitempty"`
	Version *string `json:"version,omitempty"`
}

type ApiSpecImportSourceFormat

type ApiSpecImportSourceFormat string
const (
	ApiSpecImportSourceFormatInline ApiSpecImportSourceFormat = "inline"
	ApiSpecImportSourceFormatLink   ApiSpecImportSourceFormat = "link"
)

func (*ApiSpecImportSourceFormat) UnmarshalJSON

func (s *ApiSpecImportSourceFormat) UnmarshalJSON(bytes []byte) error

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ApiDefinition
}

type DefinitionId

type DefinitionId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServiceName       string
	WorkspaceName     string
	ApiName           string
	VersionName       string
	DefinitionName    string
}

DefinitionId is a struct representing the Resource ID for a Definition

func NewDefinitionID

func NewDefinitionID(subscriptionId string, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string) DefinitionId

NewDefinitionID returns a new DefinitionId struct

func ParseDefinitionID

func ParseDefinitionID(input string) (*DefinitionId, error)

ParseDefinitionID parses 'input' into a DefinitionId

func ParseDefinitionIDInsensitively

func ParseDefinitionIDInsensitively(input string) (*DefinitionId, error)

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

func (*DefinitionId) FromParseResult

func (id *DefinitionId) FromParseResult(input resourceids.ParseResult) error

func (DefinitionId) ID

func (id DefinitionId) ID() string

ID returns the formatted Definition ID

func (DefinitionId) Segments

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

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

func (DefinitionId) String

func (id DefinitionId) String() string

String returns a human-readable description of this Definition ID

type DeleteOperationResponse

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

type ExportSpecificationOperationResponse

type ExportSpecificationOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ApiSpecExportResult
}

type GetOperationResponse

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

type HeadOperationResponse

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

type ImportSpecificationOperationResponse

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

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []ApiDefinition
}

type ListOperationOptions

type ListOperationOptions struct {
	Filter *string
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

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

func (ListOperationOptions) ToOData

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

func (ListOperationOptions) ToQuery

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]ApiDefinition
}

type VersionId

type VersionId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServiceName       string
	WorkspaceName     string
	ApiName           string
	VersionName       string
}

VersionId is a struct representing the Resource ID for a Version

func NewVersionID

func NewVersionID(subscriptionId string, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string) VersionId

NewVersionID returns a new VersionId struct

func ParseVersionID

func ParseVersionID(input string) (*VersionId, error)

ParseVersionID parses 'input' into a VersionId

func ParseVersionIDInsensitively

func ParseVersionIDInsensitively(input string) (*VersionId, error)

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

func (*VersionId) FromParseResult

func (id *VersionId) FromParseResult(input resourceids.ParseResult) error

func (VersionId) ID

func (id VersionId) ID() string

ID returns the formatted Version ID

func (VersionId) Segments

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

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

func (VersionId) String

func (id VersionId) String() string

String returns a human-readable description of this Version ID

Jump to

Keyboard shortcuts

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