apis

package
v0.20240611.1085123 Latest Latest
Warning

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

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

README

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

The apis 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/apis"

Client Initialization

client := apis.NewApisClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ApisClient.CreateOrUpdate

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

payload := apis.Api{
	// ...
}


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: ApisClient.Delete

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

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: ApisClient.Get

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

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

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

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: ApisClient.List

ctx := context.TODO()
id := apis.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceValue", "workspaceValue")

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

func PossibleValuesForApiKind() []string

func PossibleValuesForLifecycleStage

func PossibleValuesForLifecycleStage() []string

func ValidateApiID

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

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

func ValidateWorkspaceID

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

ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID

Types

type Api

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

type ApiId

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

ApiId is a struct representing the Resource ID for a Api

func NewApiID

func NewApiID(subscriptionId string, resourceGroupName string, serviceName string, workspaceName string, apiName 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) FromParseResult

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

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 ApiKind

type ApiKind string
const (
	ApiKindGraphql   ApiKind = "graphql"
	ApiKindGrpc      ApiKind = "grpc"
	ApiKindRest      ApiKind = "rest"
	ApiKindSoap      ApiKind = "soap"
	ApiKindWebhook   ApiKind = "webhook"
	ApiKindWebsocket ApiKind = "websocket"
)

func (*ApiKind) UnmarshalJSON

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

type ApiOperationPredicate

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

func (ApiOperationPredicate) Matches

func (p ApiOperationPredicate) Matches(input Api) bool

type ApiProperties

type ApiProperties struct {
	Contacts              *[]Contact               `json:"contacts,omitempty"`
	CustomProperties      *interface{}             `json:"customProperties,omitempty"`
	Description           *string                  `json:"description,omitempty"`
	ExternalDocumentation *[]ExternalDocumentation `json:"externalDocumentation,omitempty"`
	Kind                  ApiKind                  `json:"kind"`
	License               *License                 `json:"license,omitempty"`
	LifecycleStage        *LifecycleStage          `json:"lifecycleStage,omitempty"`
	Summary               *string                  `json:"summary,omitempty"`
	TermsOfService        *TermsOfService          `json:"termsOfService,omitempty"`
	Title                 string                   `json:"title"`
}

type ApisClient

type ApisClient struct {
	Client *resourcemanager.Client
}

func NewApisClientWithBaseURI

func NewApisClientWithBaseURI(sdkApi sdkEnv.Api) (*ApisClient, error)

func (ApisClient) CreateOrUpdate

func (c ApisClient) CreateOrUpdate(ctx context.Context, id ApiId, input Api) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (ApisClient) Delete

func (c ApisClient) Delete(ctx context.Context, id ApiId) (result DeleteOperationResponse, err error)

Delete ...

func (ApisClient) Get

func (c ApisClient) Get(ctx context.Context, id ApiId) (result GetOperationResponse, err error)

Get ...

func (ApisClient) Head

func (c ApisClient) Head(ctx context.Context, id ApiId) (result HeadOperationResponse, err error)

Head ...

func (ApisClient) List

func (c ApisClient) List(ctx context.Context, id WorkspaceId, options ListOperationOptions) (result ListOperationResponse, err error)

List ...

func (ApisClient) ListComplete

ListComplete retrieves all the results into a single object

func (ApisClient) ListCompleteMatchingPredicate

func (c ApisClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options ListOperationOptions, predicate ApiOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type Contact

type Contact struct {
	Email *string `json:"email,omitempty"`
	Name  *string `json:"name,omitempty"`
	Url   *string `json:"url,omitempty"`
}

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type ExternalDocumentation

type ExternalDocumentation struct {
	Description *string `json:"description,omitempty"`
	Title       *string `json:"title,omitempty"`
	Url         string  `json:"url"`
}

type GetOperationResponse

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

type HeadOperationResponse

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

type License

type License struct {
	Identifier *string `json:"identifier,omitempty"`
	Name       *string `json:"name,omitempty"`
	Url        *string `json:"url,omitempty"`
}

type LifecycleStage

type LifecycleStage string
const (
	LifecycleStageDeprecated  LifecycleStage = "deprecated"
	LifecycleStageDesign      LifecycleStage = "design"
	LifecycleStageDevelopment LifecycleStage = "development"
	LifecycleStagePreview     LifecycleStage = "preview"
	LifecycleStageProduction  LifecycleStage = "production"
	LifecycleStageRetired     LifecycleStage = "retired"
	LifecycleStageTesting     LifecycleStage = "testing"
)

func (*LifecycleStage) UnmarshalJSON

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

type ListCompleteResult

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

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        *[]Api
}

type TermsOfService

type TermsOfService struct {
	Url string `json:"url"`
}

type WorkspaceId

type WorkspaceId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServiceName       string
	WorkspaceName     string
}

WorkspaceId is a struct representing the Resource ID for a Workspace

func NewWorkspaceID

func NewWorkspaceID(subscriptionId string, resourceGroupName string, serviceName string, workspaceName string) WorkspaceId

NewWorkspaceID returns a new WorkspaceId struct

func ParseWorkspaceID

func ParseWorkspaceID(input string) (*WorkspaceId, error)

ParseWorkspaceID parses 'input' into a WorkspaceId

func ParseWorkspaceIDInsensitively

func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error)

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

func (*WorkspaceId) FromParseResult

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

func (WorkspaceId) ID

func (id WorkspaceId) ID() string

ID returns the formatted Workspace ID

func (WorkspaceId) Segments

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

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

func (WorkspaceId) String

func (id WorkspaceId) String() string

String returns a human-readable description of this Workspace ID

Jump to

Keyboard shortcuts

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