armapicenter

package module
v0.0.0-...-45adee8 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 14 Imported by: 0

README

Azure Apicenter Module for Go

The armapicenter module provides operations for working with Azure Apicenter.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Apicenter module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Apicenter. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Apicenter module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armapicenter.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
client, err := armapicenter.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewAPIDefinitionsClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Apicenter label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// The resource-specific properties for this resource.
	Properties *APIProperties

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

API entity.

func (API) MarshalJSON

func (a API) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type API.

func (*API) UnmarshalJSON

func (a *API) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type API.

type APIDefinition

type APIDefinition struct {
	// The resource-specific properties for this resource.
	Properties *APIDefinitionProperties

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

APIDefinition - API definition entity.

func (APIDefinition) MarshalJSON

func (a APIDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APIDefinition.

func (*APIDefinition) UnmarshalJSON

func (a *APIDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APIDefinition.

type APIDefinitionListResult

type APIDefinitionListResult struct {
	// READ-ONLY; The ApiDefinition items on this page
	Value []*APIDefinition

	// READ-ONLY; The link to the next page of items
	NextLink *string
}

APIDefinitionListResult - The response of a ApiDefinition list operation.

func (APIDefinitionListResult) MarshalJSON

func (a APIDefinitionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APIDefinitionListResult.

func (*APIDefinitionListResult) UnmarshalJSON

func (a *APIDefinitionListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APIDefinitionListResult.

type APIDefinitionProperties

type APIDefinitionProperties struct {
	// REQUIRED; API definition title.
	Title *string

	// API definition description.
	Description *string

	// READ-ONLY; API specification details.
	Specification *APIDefinitionPropertiesSpecification
}

APIDefinitionProperties - API definition properties entity.

func (APIDefinitionProperties) MarshalJSON

func (a APIDefinitionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APIDefinitionProperties.

func (*APIDefinitionProperties) UnmarshalJSON

func (a *APIDefinitionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APIDefinitionProperties.

type APIDefinitionPropertiesSpecification

type APIDefinitionPropertiesSpecification struct {
	// Specification name.
	Name *string

	// Specification version.
	Version *string
}

APIDefinitionPropertiesSpecification - API specification details.

func (APIDefinitionPropertiesSpecification) MarshalJSON

func (a APIDefinitionPropertiesSpecification) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APIDefinitionPropertiesSpecification.

func (*APIDefinitionPropertiesSpecification) UnmarshalJSON

func (a *APIDefinitionPropertiesSpecification) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APIDefinitionPropertiesSpecification.

type APIDefinitionsClient

type APIDefinitionsClient struct {
	// contains filtered or unexported fields
}

APIDefinitionsClient contains the methods for the APIDefinitions group. Don't use this type directly, use NewAPIDefinitionsClient() instead.

func NewAPIDefinitionsClient

func NewAPIDefinitionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIDefinitionsClient, error)

NewAPIDefinitionsClient creates a new instance of APIDefinitionsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIDefinitionsClient) BeginExportSpecification

func (client *APIDefinitionsClient) BeginExportSpecification(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, options *APIDefinitionsClientBeginExportSpecificationOptions) (*runtime.Poller[APIDefinitionsClientExportSpecificationResponse], error)

BeginExportSpecification - Exports the API specification. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • definitionName - The name of the API definition.
  • options - APIDefinitionsClientBeginExportSpecificationOptions contains the optional parameters for the APIDefinitionsClient.BeginExportSpecification method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_ExportSpecification.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIDefinitionsClient().BeginExportSpecification(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.APISpecExportResult = armapicenter.APISpecExportResult{
	// 	Format: to.Ptr(armapicenter.APISpecExportResultFormatInline),
	// 	Value: to.Ptr("{ ... }"),
	// }
}

func (*APIDefinitionsClient) BeginImportSpecification

func (client *APIDefinitionsClient) BeginImportSpecification(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, body APISpecImportRequest, options *APIDefinitionsClientBeginImportSpecificationOptions) (*runtime.Poller[APIDefinitionsClientImportSpecificationResponse], error)

BeginImportSpecification - Imports the API specification. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • definitionName - The name of the API definition.
  • body - The content of the action request
  • options - APIDefinitionsClientBeginImportSpecificationOptions contains the optional parameters for the APIDefinitionsClient.BeginImportSpecification method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_ImportSpecification.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIDefinitionsClient().BeginImportSpecification(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", armapicenter.APISpecImportRequest{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}

func (*APIDefinitionsClient) CreateOrUpdate

func (client *APIDefinitionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, resource APIDefinition, options *APIDefinitionsClientCreateOrUpdateOptions) (APIDefinitionsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates new or updates existing API definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • definitionName - The name of the API definition.
  • resource - Resource create parameters.
  • options - APIDefinitionsClientCreateOrUpdateOptions contains the optional parameters for the APIDefinitionsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIDefinitionsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "openapi", "2023-01-01", "openapi", armapicenter.APIDefinition{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.APIDefinition = armapicenter.APIDefinition{
	// 	Name: to.Ptr("openapi"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.APIDefinitionProperties{
	// 		Description: to.Ptr("Default spec"),
	// 		Specification: &armapicenter.APIDefinitionPropertiesSpecification{
	// 			Name: to.Ptr("openapi"),
	// 			Version: to.Ptr("3.0.6"),
	// 		},
	// 		Title: to.Ptr("OpenAPI"),
	// 	},
	// }
}

func (*APIDefinitionsClient) Delete

func (client *APIDefinitionsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, options *APIDefinitionsClientDeleteOptions) (APIDefinitionsClientDeleteResponse, error)

Delete - Deletes specified API definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • definitionName - The name of the API definition.
  • options - APIDefinitionsClientDeleteOptions contains the optional parameters for the APIDefinitionsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIDefinitionsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*APIDefinitionsClient) Get

func (client *APIDefinitionsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, options *APIDefinitionsClientGetOptions) (APIDefinitionsClientGetResponse, error)

Get - Returns details of the API definition. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • definitionName - The name of the API definition.
  • options - APIDefinitionsClientGetOptions contains the optional parameters for the APIDefinitionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIDefinitionsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.APIDefinition = armapicenter.APIDefinition{
	// 	Name: to.Ptr("openapi"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.APIDefinitionProperties{
	// 		Description: to.Ptr("Default spec"),
	// 		Specification: &armapicenter.APIDefinitionPropertiesSpecification{
	// 			Name: to.Ptr("openapi"),
	// 			Version: to.Ptr("3.0.6"),
	// 		},
	// 		Title: to.Ptr("OpenAPI"),
	// 	},
	// }
}

func (*APIDefinitionsClient) Head

func (client *APIDefinitionsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, options *APIDefinitionsClientHeadOptions) (APIDefinitionsClientHeadResponse, error)

Head - Checks if specified API definition exists.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • definitionName - The name of the API definition.
  • options - APIDefinitionsClientHeadOptions contains the optional parameters for the APIDefinitionsClient.Head method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Head.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIDefinitionsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*APIDefinitionsClient) NewListPager

func (client *APIDefinitionsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, options *APIDefinitionsClientListOptions) *runtime.Pager[APIDefinitionsClientListResponse]

NewListPager - Returns a collection of API definitions.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • options - APIDefinitionsClientListOptions contains the optional parameters for the APIDefinitionsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIDefinitionsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", "2023-01-01", &armapicenter.APIDefinitionsClientListOptions{Filter: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.APIDefinitionListResult = armapicenter.APIDefinitionListResult{
		// 	Value: []*armapicenter.APIDefinition{
		// 		{
		// 			Name: to.Ptr("openapi"),
		// 			Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"),
		// 			SystemData: &armapicenter.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 			},
		// 			Properties: &armapicenter.APIDefinitionProperties{
		// 				Description: to.Ptr("Default spec"),
		// 				Specification: &armapicenter.APIDefinitionPropertiesSpecification{
		// 					Name: to.Ptr("openapi"),
		// 					Version: to.Ptr("3.0.6"),
		// 				},
		// 				Title: to.Ptr("OpenAPI"),
		// 			},
		// 	}},
		// }
	}
}

type APIDefinitionsClientBeginExportSpecificationOptions

type APIDefinitionsClientBeginExportSpecificationOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

APIDefinitionsClientBeginExportSpecificationOptions contains the optional parameters for the APIDefinitionsClient.BeginExportSpecification method.

type APIDefinitionsClientBeginImportSpecificationOptions

type APIDefinitionsClientBeginImportSpecificationOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

APIDefinitionsClientBeginImportSpecificationOptions contains the optional parameters for the APIDefinitionsClient.BeginImportSpecification method.

type APIDefinitionsClientCreateOrUpdateOptions

type APIDefinitionsClientCreateOrUpdateOptions struct {
}

APIDefinitionsClientCreateOrUpdateOptions contains the optional parameters for the APIDefinitionsClient.CreateOrUpdate method.

type APIDefinitionsClientCreateOrUpdateResponse

type APIDefinitionsClientCreateOrUpdateResponse struct {
	// API definition entity.
	APIDefinition

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIDefinitionsClientCreateOrUpdateResponse contains the response from method APIDefinitionsClient.CreateOrUpdate.

type APIDefinitionsClientDeleteOptions

type APIDefinitionsClientDeleteOptions struct {
}

APIDefinitionsClientDeleteOptions contains the optional parameters for the APIDefinitionsClient.Delete method.

type APIDefinitionsClientDeleteResponse

type APIDefinitionsClientDeleteResponse struct {
}

APIDefinitionsClientDeleteResponse contains the response from method APIDefinitionsClient.Delete.

type APIDefinitionsClientExportSpecificationResponse

type APIDefinitionsClientExportSpecificationResponse struct {
	// The API specification export result.
	APISpecExportResult
}

APIDefinitionsClientExportSpecificationResponse contains the response from method APIDefinitionsClient.BeginExportSpecification.

type APIDefinitionsClientGetOptions

type APIDefinitionsClientGetOptions struct {
}

APIDefinitionsClientGetOptions contains the optional parameters for the APIDefinitionsClient.Get method.

type APIDefinitionsClientGetResponse

type APIDefinitionsClientGetResponse struct {
	// API definition entity.
	APIDefinition

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIDefinitionsClientGetResponse contains the response from method APIDefinitionsClient.Get.

type APIDefinitionsClientHeadOptions

type APIDefinitionsClientHeadOptions struct {
}

APIDefinitionsClientHeadOptions contains the optional parameters for the APIDefinitionsClient.Head method.

type APIDefinitionsClientHeadResponse

type APIDefinitionsClientHeadResponse struct {
	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIDefinitionsClientHeadResponse contains the response from method APIDefinitionsClient.Head.

type APIDefinitionsClientImportSpecificationResponse

type APIDefinitionsClientImportSpecificationResponse struct {
}

APIDefinitionsClientImportSpecificationResponse contains the response from method APIDefinitionsClient.BeginImportSpecification.

type APIDefinitionsClientListOptions

type APIDefinitionsClientListOptions struct {
	// OData filter parameter.
	Filter *string
}

APIDefinitionsClientListOptions contains the optional parameters for the APIDefinitionsClient.NewListPager method.

type APIDefinitionsClientListResponse

type APIDefinitionsClientListResponse struct {
	// The response of a ApiDefinition list operation.
	APIDefinitionListResult
}

APIDefinitionsClientListResponse contains the response from method APIDefinitionsClient.NewListPager.

type APIKind

type APIKind string

APIKind - The kind of the API

const (
	// APIKindGraphql - A Graph query language Api
	APIKindGraphql APIKind = "graphql"
	// APIKindGrpc - A gRPC Api
	APIKindGrpc APIKind = "grpc"
	// APIKindRest - A Representational State Transfer Api
	APIKindRest APIKind = "rest"
	// APIKindSoap - A SOAP Api
	APIKindSoap APIKind = "soap"
	// APIKindWebhook - Web Hook
	APIKindWebhook APIKind = "webhook"
	// APIKindWebsocket - Web Socket
	APIKindWebsocket APIKind = "websocket"
)

func PossibleAPIKindValues

func PossibleAPIKindValues() []APIKind

PossibleAPIKindValues returns the possible values for the APIKind const type.

type APIListResult

type APIListResult struct {
	// READ-ONLY; The Api items on this page
	Value []*API

	// READ-ONLY; The link to the next page of items
	NextLink *string
}

APIListResult - The response of a Api list operation.

func (APIListResult) MarshalJSON

func (a APIListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APIListResult.

func (*APIListResult) UnmarshalJSON

func (a *APIListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APIListResult.

type APIProperties

type APIProperties struct {
	// REQUIRED; Kind of API. For example, REST or GraphQL.
	Kind *APIKind

	// REQUIRED; API title.
	Title *string

	// The set of contacts
	Contacts []*Contact

	// The custom metadata defined for API catalog entities.
	CustomProperties any

	// Description of the API.
	Description *string

	// The set of external documentation
	ExternalDocumentation []*ExternalDocumentation

	// The license information for the API.
	License *License

	// Short description of the API.
	Summary *string

	// Terms of service for the API.
	TermsOfService *TermsOfService

	// READ-ONLY; Current lifecycle stage of the API.
	LifecycleStage *LifecycleStage
}

APIProperties - API properties.

func (APIProperties) MarshalJSON

func (a APIProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APIProperties.

func (*APIProperties) UnmarshalJSON

func (a *APIProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APIProperties.

type APISpecExportResult

type APISpecExportResult struct {
	// The format of exported result
	Format *APISpecExportResultFormat

	// The result of the export operation.
	Value *string
}

APISpecExportResult - The API specification export result.

func (APISpecExportResult) MarshalJSON

func (a APISpecExportResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APISpecExportResult.

func (*APISpecExportResult) UnmarshalJSON

func (a *APISpecExportResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APISpecExportResult.

type APISpecExportResultFormat

type APISpecExportResultFormat string

APISpecExportResultFormat - Result format for exported Api spec

const (
	// APISpecExportResultFormatInline - The inlined content of a specification document.
	APISpecExportResultFormatInline APISpecExportResultFormat = "inline"
	// APISpecExportResultFormatLink - The link to the result of the export operation. The URL is valid for 5 minutes.
	APISpecExportResultFormatLink APISpecExportResultFormat = "link"
)

func PossibleAPISpecExportResultFormatValues

func PossibleAPISpecExportResultFormatValues() []APISpecExportResultFormat

PossibleAPISpecExportResultFormatValues returns the possible values for the APISpecExportResultFormat const type.

type APISpecImportRequest

type APISpecImportRequest struct {
	// Format of the API specification source.
	Format *APISpecImportSourceFormat

	// API specification details.
	Specification *APISpecImportRequestSpecification

	// Value of the API specification source.
	Value *string
}

APISpecImportRequest - The API specification source entity properties.

func (APISpecImportRequest) MarshalJSON

func (a APISpecImportRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APISpecImportRequest.

func (*APISpecImportRequest) UnmarshalJSON

func (a *APISpecImportRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APISpecImportRequest.

type APISpecImportRequestSpecification

type APISpecImportRequestSpecification struct {
	// Specification name.
	Name *string

	// Specification version.
	Version *string
}

APISpecImportRequestSpecification - API specification details.

func (APISpecImportRequestSpecification) MarshalJSON

func (a APISpecImportRequestSpecification) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APISpecImportRequestSpecification.

func (*APISpecImportRequestSpecification) UnmarshalJSON

func (a *APISpecImportRequestSpecification) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APISpecImportRequestSpecification.

type APISpecImportSourceFormat

type APISpecImportSourceFormat string

APISpecImportSourceFormat - Source format for imported Api spec

const (
	// APISpecImportSourceFormatInline - The inlined content of a specification document.
	APISpecImportSourceFormatInline APISpecImportSourceFormat = "inline"
	// APISpecImportSourceFormatLink - The link to a specification document hosted on a publicly accessible internet
	// address.
	APISpecImportSourceFormatLink APISpecImportSourceFormat = "link"
)

func PossibleAPISpecImportSourceFormatValues

func PossibleAPISpecImportSourceFormatValues() []APISpecImportSourceFormat

PossibleAPISpecImportSourceFormatValues returns the possible values for the APISpecImportSourceFormat const type.

type APIVersion

type APIVersion struct {
	// The resource-specific properties for this resource.
	Properties *APIVersionProperties

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

APIVersion - API version entity.

func (APIVersion) MarshalJSON

func (a APIVersion) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APIVersion.

func (*APIVersion) UnmarshalJSON

func (a *APIVersion) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersion.

type APIVersionListResult

type APIVersionListResult struct {
	// READ-ONLY; The ApiVersion items on this page
	Value []*APIVersion

	// READ-ONLY; The link to the next page of items
	NextLink *string
}

APIVersionListResult - The response of a ApiVersion list operation.

func (APIVersionListResult) MarshalJSON

func (a APIVersionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APIVersionListResult.

func (*APIVersionListResult) UnmarshalJSON

func (a *APIVersionListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionListResult.

type APIVersionProperties

type APIVersionProperties struct {
	// REQUIRED; Current lifecycle stage of the API.
	LifecycleStage *LifecycleStage

	// REQUIRED; API version title.
	Title *string
}

APIVersionProperties - API version properties entity.

func (APIVersionProperties) MarshalJSON

func (a APIVersionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APIVersionProperties.

func (*APIVersionProperties) UnmarshalJSON

func (a *APIVersionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionProperties.

type APIVersionsClient

type APIVersionsClient struct {
	// contains filtered or unexported fields
}

APIVersionsClient contains the methods for the APIVersions group. Don't use this type directly, use NewAPIVersionsClient() instead.

func NewAPIVersionsClient

func NewAPIVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIVersionsClient, error)

NewAPIVersionsClient creates a new instance of APIVersionsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIVersionsClient) CreateOrUpdate

func (client *APIVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, resource APIVersion, options *APIVersionsClientCreateOrUpdateOptions) (APIVersionsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates new or updates existing API version. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • resource - Resource create parameters.
  • options - APIVersionsClientCreateOrUpdateOptions contains the optional parameters for the APIVersionsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIVersionsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", armapicenter.APIVersion{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.APIVersion = armapicenter.APIVersion{
	// 	Name: to.Ptr("2023-01-01"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/apis/versions"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.APIVersionProperties{
	// 		LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction),
	// 		Title: to.Ptr("2023-01-01"),
	// 	},
	// }
}

func (*APIVersionsClient) Delete

func (client *APIVersionsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, options *APIVersionsClientDeleteOptions) (APIVersionsClientDeleteResponse, error)

Delete - Deletes specified API version If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • options - APIVersionsClientDeleteOptions contains the optional parameters for the APIVersionsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIVersionsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*APIVersionsClient) Get

func (client *APIVersionsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, options *APIVersionsClientGetOptions) (APIVersionsClientGetResponse, error)

Get - Returns details of the API version. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • options - APIVersionsClientGetOptions contains the optional parameters for the APIVersionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIVersionsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.APIVersion = armapicenter.APIVersion{
	// 	Name: to.Ptr("2023-01-01"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/apis/versions"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.APIVersionProperties{
	// 		LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction),
	// 		Title: to.Ptr("2023-01-01"),
	// 	},
	// }
}

func (*APIVersionsClient) Head

func (client *APIVersionsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, options *APIVersionsClientHeadOptions) (APIVersionsClientHeadResponse, error)

Head - Checks if specified API version exists.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • versionName - The name of the API version.
  • options - APIVersionsClientHeadOptions contains the optional parameters for the APIVersionsClient.Head method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Head.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIVersionsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*APIVersionsClient) NewListPager

func (client *APIVersionsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, apiName string, options *APIVersionsClientListOptions) *runtime.Pager[APIVersionsClientListResponse]

NewListPager - Returns a collection of API versions.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • options - APIVersionsClientListOptions contains the optional parameters for the APIVersionsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIVersionsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", &armapicenter.APIVersionsClientListOptions{Filter: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.APIVersionListResult = armapicenter.APIVersionListResult{
		// 	Value: []*armapicenter.APIVersion{
		// 		{
		// 			Name: to.Ptr("public"),
		// 			Type: to.Ptr("Microsoft.ApiCenter/services/environments"),
		// 			ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"),
		// 			SystemData: &armapicenter.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 			},
		// 			Properties: &armapicenter.APIVersionProperties{
		// 				LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction),
		// 				Title: to.Ptr("2023-01-01"),
		// 			},
		// 	}},
		// }
	}
}

type APIVersionsClientCreateOrUpdateOptions

type APIVersionsClientCreateOrUpdateOptions struct {
}

APIVersionsClientCreateOrUpdateOptions contains the optional parameters for the APIVersionsClient.CreateOrUpdate method.

type APIVersionsClientCreateOrUpdateResponse

type APIVersionsClientCreateOrUpdateResponse struct {
	// API version entity.
	APIVersion

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIVersionsClientCreateOrUpdateResponse contains the response from method APIVersionsClient.CreateOrUpdate.

type APIVersionsClientDeleteOptions

type APIVersionsClientDeleteOptions struct {
}

APIVersionsClientDeleteOptions contains the optional parameters for the APIVersionsClient.Delete method.

type APIVersionsClientDeleteResponse

type APIVersionsClientDeleteResponse struct {
}

APIVersionsClientDeleteResponse contains the response from method APIVersionsClient.Delete.

type APIVersionsClientGetOptions

type APIVersionsClientGetOptions struct {
}

APIVersionsClientGetOptions contains the optional parameters for the APIVersionsClient.Get method.

type APIVersionsClientGetResponse

type APIVersionsClientGetResponse struct {
	// API version entity.
	APIVersion

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIVersionsClientGetResponse contains the response from method APIVersionsClient.Get.

type APIVersionsClientHeadOptions

type APIVersionsClientHeadOptions struct {
}

APIVersionsClientHeadOptions contains the optional parameters for the APIVersionsClient.Head method.

type APIVersionsClientHeadResponse

type APIVersionsClientHeadResponse struct {
	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIVersionsClientHeadResponse contains the response from method APIVersionsClient.Head.

type APIVersionsClientListOptions

type APIVersionsClientListOptions struct {
	// OData filter parameter.
	Filter *string
}

APIVersionsClientListOptions contains the optional parameters for the APIVersionsClient.NewListPager method.

type APIVersionsClientListResponse

type APIVersionsClientListResponse struct {
	// The response of a ApiVersion list operation.
	APIVersionListResult
}

APIVersionsClientListResponse contains the response from method APIVersionsClient.NewListPager.

type ActionType

type ActionType string

ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type ApisClient

type ApisClient struct {
	// contains filtered or unexported fields
}

ApisClient contains the methods for the Apis group. Don't use this type directly, use NewApisClient() instead.

func NewApisClient

func NewApisClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApisClient, error)

NewApisClient creates a new instance of ApisClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ApisClient) CreateOrUpdate

func (client *ApisClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, resource API, options *ApisClientCreateOrUpdateOptions) (ApisClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates new or updates existing API. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • resource - Resource create parameters.
  • options - ApisClientCreateOrUpdateOptions contains the optional parameters for the ApisClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewApisClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", armapicenter.API{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.API = armapicenter.API{
	// 	Name: to.Ptr("echo-api"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/apis"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.APIProperties{
	// 		Description: to.Ptr("A simple HTTP request/response service."),
	// 		CustomProperties: map[string]any{
	// 			"author": "John Doe",
	// 		},
	// 		ExternalDocumentation: []*armapicenter.ExternalDocumentation{
	// 			{
	// 				Title: to.Ptr("Onboarding docs"),
	// 				URL: to.Ptr("https://docs.contoso.com"),
	// 		}},
	// 		Kind: to.Ptr(armapicenter.APIKindRest),
	// 		License: &armapicenter.License{
	// 			URL: to.Ptr("https://contoso.com/license"),
	// 		},
	// 		LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign),
	// 		TermsOfService: &armapicenter.TermsOfService{
	// 			URL: to.Ptr("https://contoso.com/terms-of-service"),
	// 		},
	// 		Title: to.Ptr("Echo API"),
	// 	},
	// }
}

func (*ApisClient) Delete

func (client *ApisClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, options *ApisClientDeleteOptions) (ApisClientDeleteResponse, error)

Delete - Deletes specified API. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • options - ApisClientDeleteOptions contains the optional parameters for the ApisClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewApisClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*ApisClient) Get

func (client *ApisClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, options *ApisClientGetOptions) (ApisClientGetResponse, error)

Get - Returns details of the API. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • options - ApisClientGetOptions contains the optional parameters for the ApisClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewApisClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.API = armapicenter.API{
	// 	Name: to.Ptr("public"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/apis"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.APIProperties{
	// 		Description: to.Ptr("A simple HTTP request/response service."),
	// 		CustomProperties: map[string]any{
	// 			"author": "John Doe",
	// 		},
	// 		ExternalDocumentation: []*armapicenter.ExternalDocumentation{
	// 			{
	// 				Title: to.Ptr("Onboarding docs"),
	// 				URL: to.Ptr("https://docs.contoso.com"),
	// 		}},
	// 		Kind: to.Ptr(armapicenter.APIKindRest),
	// 		License: &armapicenter.License{
	// 			URL: to.Ptr("https://contoso.com/license"),
	// 		},
	// 		LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign),
	// 		TermsOfService: &armapicenter.TermsOfService{
	// 			URL: to.Ptr("https://contoso.com/terms-of-service"),
	// 		},
	// 		Title: to.Ptr("Echo API"),
	// 	},
	// }
}

func (*ApisClient) Head

func (client *ApisClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, options *ApisClientHeadOptions) (ApisClientHeadResponse, error)

Head - Checks if specified API exists.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • options - ApisClientHeadOptions contains the optional parameters for the ApisClient.Head method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Head.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewApisClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*ApisClient) NewListPager

func (client *ApisClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, options *ApisClientListOptions) *runtime.Pager[ApisClientListResponse]

NewListPager - Returns a collection of APIs.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • options - ApisClientListOptions contains the optional parameters for the ApisClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewApisClient().NewListPager("contoso-resources", "contoso", "default", &armapicenter.ApisClientListOptions{Filter: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.APIListResult = armapicenter.APIListResult{
		// 	Value: []*armapicenter.API{
		// 		{
		// 			Name: to.Ptr("echo-api"),
		// 			Type: to.Ptr("Microsoft.ApiCenter/services/environments"),
		// 			ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"),
		// 			SystemData: &armapicenter.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 			},
		// 			Properties: &armapicenter.APIProperties{
		// 				Description: to.Ptr("A simple HTTP request/response service."),
		// 				CustomProperties: map[string]any{
		// 					"author": "John Doe",
		// 				},
		// 				ExternalDocumentation: []*armapicenter.ExternalDocumentation{
		// 					{
		// 						Title: to.Ptr("Onboarding docs"),
		// 						URL: to.Ptr("https://docs.contoso.com"),
		// 				}},
		// 				Kind: to.Ptr(armapicenter.APIKindRest),
		// 				License: &armapicenter.License{
		// 					URL: to.Ptr("https://contoso.com/license"),
		// 				},
		// 				LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign),
		// 				TermsOfService: &armapicenter.TermsOfService{
		// 					URL: to.Ptr("https://contoso.com/terms-of-service"),
		// 				},
		// 				Title: to.Ptr("Echo API"),
		// 			},
		// 	}},
		// }
	}
}

type ApisClientCreateOrUpdateOptions

type ApisClientCreateOrUpdateOptions struct {
}

ApisClientCreateOrUpdateOptions contains the optional parameters for the ApisClient.CreateOrUpdate method.

type ApisClientCreateOrUpdateResponse

type ApisClientCreateOrUpdateResponse struct {
	// API entity.
	API

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ApisClientCreateOrUpdateResponse contains the response from method ApisClient.CreateOrUpdate.

type ApisClientDeleteOptions

type ApisClientDeleteOptions struct {
}

ApisClientDeleteOptions contains the optional parameters for the ApisClient.Delete method.

type ApisClientDeleteResponse

type ApisClientDeleteResponse struct {
}

ApisClientDeleteResponse contains the response from method ApisClient.Delete.

type ApisClientGetOptions

type ApisClientGetOptions struct {
}

ApisClientGetOptions contains the optional parameters for the ApisClient.Get method.

type ApisClientGetResponse

type ApisClientGetResponse struct {
	// API entity.
	API

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ApisClientGetResponse contains the response from method ApisClient.Get.

type ApisClientHeadOptions

type ApisClientHeadOptions struct {
}

ApisClientHeadOptions contains the optional parameters for the ApisClient.Head method.

type ApisClientHeadResponse

type ApisClientHeadResponse struct {
	// Success indicates if the operation succeeded or failed.
	Success bool
}

ApisClientHeadResponse contains the response from method ApisClient.Head.

type ApisClientListOptions

type ApisClientListOptions struct {
	// OData filter parameter.
	Filter *string
}

ApisClientListOptions contains the optional parameters for the ApisClient.NewListPager method.

type ApisClientListResponse

type ApisClientListResponse struct {
	// The response of a Api list operation.
	APIListResult
}

ApisClientListResponse contains the response from method ApisClient.NewListPager.

type ClientFactory

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewAPIDefinitionsClient

func (c *ClientFactory) NewAPIDefinitionsClient() *APIDefinitionsClient

NewAPIDefinitionsClient creates a new instance of APIDefinitionsClient.

func (*ClientFactory) NewAPIVersionsClient

func (c *ClientFactory) NewAPIVersionsClient() *APIVersionsClient

NewAPIVersionsClient creates a new instance of APIVersionsClient.

func (*ClientFactory) NewApisClient

func (c *ClientFactory) NewApisClient() *ApisClient

NewApisClient creates a new instance of ApisClient.

func (*ClientFactory) NewDeploymentsClient

func (c *ClientFactory) NewDeploymentsClient() *DeploymentsClient

NewDeploymentsClient creates a new instance of DeploymentsClient.

func (*ClientFactory) NewEnvironmentsClient

func (c *ClientFactory) NewEnvironmentsClient() *EnvironmentsClient

NewEnvironmentsClient creates a new instance of EnvironmentsClient.

func (*ClientFactory) NewMetadataSchemasClient

func (c *ClientFactory) NewMetadataSchemasClient() *MetadataSchemasClient

NewMetadataSchemasClient creates a new instance of MetadataSchemasClient.

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewServicesClient

func (c *ClientFactory) NewServicesClient() *ServicesClient

NewServicesClient creates a new instance of ServicesClient.

func (*ClientFactory) NewWorkspacesClient

func (c *ClientFactory) NewWorkspacesClient() *WorkspacesClient

NewWorkspacesClient creates a new instance of WorkspacesClient.

type Contact

type Contact struct {
	// Email address of the contact.
	Email *string

	// Name of the contact.
	Name *string

	// URL for the contact.
	URL *string
}

Contact information

func (Contact) MarshalJSON

func (c Contact) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Contact.

func (*Contact) UnmarshalJSON

func (c *Contact) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Contact.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type Deployment

type Deployment struct {
	// The resource-specific properties for this resource.
	Properties *DeploymentProperties

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Deployment - API deployment entity.

func (Deployment) MarshalJSON

func (d Deployment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Deployment.

func (*Deployment) UnmarshalJSON

func (d *Deployment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Deployment.

type DeploymentListResult

type DeploymentListResult struct {
	// READ-ONLY; The Deployment items on this page
	Value []*Deployment

	// READ-ONLY; The link to the next page of items
	NextLink *string
}

DeploymentListResult - The response of a Deployment list operation.

func (DeploymentListResult) MarshalJSON

func (d DeploymentListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeploymentListResult.

func (*DeploymentListResult) UnmarshalJSON

func (d *DeploymentListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentListResult.

type DeploymentProperties

type DeploymentProperties struct {
	// The custom metadata defined for API catalog entities.
	CustomProperties any

	// API center-scoped definition resource ID.
	DefinitionID *string

	// Description of the deployment.
	Description *string

	// API center-scoped environment resource ID.
	EnvironmentID *string

	// The deployment server
	Server *DeploymentServer

	// State of API deployment.
	State *DeploymentState

	// API deployment title
	Title *string
}

DeploymentProperties - API deployment entity properties.

func (DeploymentProperties) MarshalJSON

func (d DeploymentProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeploymentProperties.

func (*DeploymentProperties) UnmarshalJSON

func (d *DeploymentProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentProperties.

type DeploymentServer

type DeploymentServer struct {
	// Base runtime URLs for this deployment.
	RuntimeURI []*string
}

DeploymentServer - Server

func (DeploymentServer) MarshalJSON

func (d DeploymentServer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeploymentServer.

func (*DeploymentServer) UnmarshalJSON

func (d *DeploymentServer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentServer.

type DeploymentState

type DeploymentState string

DeploymentState - State of the Deployment

const (
	// DeploymentStateActive - Active State
	DeploymentStateActive DeploymentState = "active"
	// DeploymentStateInactive - Inactive State
	DeploymentStateInactive DeploymentState = "inactive"
)

func PossibleDeploymentStateValues

func PossibleDeploymentStateValues() []DeploymentState

PossibleDeploymentStateValues returns the possible values for the DeploymentState const type.

type DeploymentsClient

type DeploymentsClient struct {
	// contains filtered or unexported fields
}

DeploymentsClient contains the methods for the Deployments group. Don't use this type directly, use NewDeploymentsClient() instead.

func NewDeploymentsClient

func NewDeploymentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeploymentsClient, error)

NewDeploymentsClient creates a new instance of DeploymentsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*DeploymentsClient) CreateOrUpdate

func (client *DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, deploymentName string, resource Deployment, options *DeploymentsClientCreateOrUpdateOptions) (DeploymentsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates new or updates existing API deployment. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • deploymentName - The name of the API deployment.
  • resource - Resource create parameters.
  • options - DeploymentsClientCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDeploymentsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", armapicenter.Deployment{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Deployment = armapicenter.Deployment{
	// 	Name: to.Ptr("production"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"),
	// 	ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.DeploymentProperties{
	// 		Description: to.Ptr("Public cloud production deployment."),
	// 		DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"),
	// 		EnvironmentID: to.Ptr("/workspaces/default/environments/production"),
	// 		Server: &armapicenter.DeploymentServer{
	// 			RuntimeURI: []*string{
	// 				to.Ptr("https://api.contoso.com")},
	// 			},
	// 			State: to.Ptr(armapicenter.DeploymentStateActive),
	// 			Title: to.Ptr("Production deployment"),
	// 		},
	// 	}
}

func (*DeploymentsClient) Delete

func (client *DeploymentsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, deploymentName string, options *DeploymentsClientDeleteOptions) (DeploymentsClientDeleteResponse, error)

Delete - Deletes API deployment. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • deploymentName - The name of the API deployment.
  • options - DeploymentsClientDeleteOptions contains the optional parameters for the DeploymentsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewDeploymentsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*DeploymentsClient) Get

func (client *DeploymentsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, deploymentName string, options *DeploymentsClientGetOptions) (DeploymentsClientGetResponse, error)

Get - Returns details of the API deployment. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • deploymentName - The name of the API deployment.
  • options - DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDeploymentsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Deployment = armapicenter.Deployment{
	// 	Name: to.Ptr("public"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"),
	// 	ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.DeploymentProperties{
	// 		Description: to.Ptr("Public cloud production deployment."),
	// 		DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"),
	// 		EnvironmentID: to.Ptr("/workspaces/default/environments/production"),
	// 		Server: &armapicenter.DeploymentServer{
	// 			RuntimeURI: []*string{
	// 				to.Ptr("https://api.contoso.com")},
	// 			},
	// 			State: to.Ptr(armapicenter.DeploymentStateActive),
	// 			Title: to.Ptr("Production deployment"),
	// 		},
	// 	}
}

func (*DeploymentsClient) Head

func (client *DeploymentsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, deploymentName string, options *DeploymentsClientHeadOptions) (DeploymentsClientHeadResponse, error)

Head - Checks if specified API deployment exists.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • deploymentName - The name of the API deployment.
  • options - DeploymentsClientHeadOptions contains the optional parameters for the DeploymentsClient.Head method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Head.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewDeploymentsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*DeploymentsClient) NewListPager

func (client *DeploymentsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, apiName string, options *DeploymentsClientListOptions) *runtime.Pager[DeploymentsClientListResponse]

NewListPager - Returns a collection of API deployments.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • apiName - The name of the API.
  • options - DeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDeploymentsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", &armapicenter.DeploymentsClientListOptions{Filter: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.DeploymentListResult = armapicenter.DeploymentListResult{
		// 	Value: []*armapicenter.Deployment{
		// 		{
		// 			Name: to.Ptr("public"),
		// 			Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"),
		// 			ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"),
		// 			SystemData: &armapicenter.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 			},
		// 			Properties: &armapicenter.DeploymentProperties{
		// 				Description: to.Ptr("Public cloud production deployment."),
		// 				DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"),
		// 				EnvironmentID: to.Ptr("/workspaces/default/environments/production"),
		// 				Server: &armapicenter.DeploymentServer{
		// 					RuntimeURI: []*string{
		// 						to.Ptr("https://api.contoso.com")},
		// 					},
		// 					State: to.Ptr(armapicenter.DeploymentStateActive),
		// 					Title: to.Ptr("Development"),
		// 				},
		// 		}},
		// 	}
	}
}

type DeploymentsClientCreateOrUpdateOptions

type DeploymentsClientCreateOrUpdateOptions struct {
}

DeploymentsClientCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.CreateOrUpdate method.

type DeploymentsClientCreateOrUpdateResponse

type DeploymentsClientCreateOrUpdateResponse struct {
	// API deployment entity.
	Deployment

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

DeploymentsClientCreateOrUpdateResponse contains the response from method DeploymentsClient.CreateOrUpdate.

type DeploymentsClientDeleteOptions

type DeploymentsClientDeleteOptions struct {
}

DeploymentsClientDeleteOptions contains the optional parameters for the DeploymentsClient.Delete method.

type DeploymentsClientDeleteResponse

type DeploymentsClientDeleteResponse struct {
}

DeploymentsClientDeleteResponse contains the response from method DeploymentsClient.Delete.

type DeploymentsClientGetOptions

type DeploymentsClientGetOptions struct {
}

DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method.

type DeploymentsClientGetResponse

type DeploymentsClientGetResponse struct {
	// API deployment entity.
	Deployment

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

DeploymentsClientGetResponse contains the response from method DeploymentsClient.Get.

type DeploymentsClientHeadOptions

type DeploymentsClientHeadOptions struct {
}

DeploymentsClientHeadOptions contains the optional parameters for the DeploymentsClient.Head method.

type DeploymentsClientHeadResponse

type DeploymentsClientHeadResponse struct {
	// Success indicates if the operation succeeded or failed.
	Success bool
}

DeploymentsClientHeadResponse contains the response from method DeploymentsClient.Head.

type DeploymentsClientListOptions

type DeploymentsClientListOptions struct {
	// OData filter parameter.
	Filter *string
}

DeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method.

type DeploymentsClientListResponse

type DeploymentsClientListResponse struct {
	// The response of a Deployment list operation.
	DeploymentListResult
}

DeploymentsClientListResponse contains the response from method DeploymentsClient.NewListPager.

type Environment

type Environment struct {
	// The resource-specific properties for this resource.
	Properties *EnvironmentProperties

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Environment entity.

func (Environment) MarshalJSON

func (e Environment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Environment.

func (*Environment) UnmarshalJSON

func (e *Environment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Environment.

type EnvironmentKind

type EnvironmentKind string

EnvironmentKind - The kind of environment

const (
	// EnvironmentKindDevelopment - Development environment
	EnvironmentKindDevelopment EnvironmentKind = "development"
	// EnvironmentKindProduction - Production environment
	EnvironmentKindProduction EnvironmentKind = "production"
	// EnvironmentKindStaging - Staging environment
	EnvironmentKindStaging EnvironmentKind = "staging"
	// EnvironmentKindTesting - Testing environment
	EnvironmentKindTesting EnvironmentKind = "testing"
)

func PossibleEnvironmentKindValues

func PossibleEnvironmentKindValues() []EnvironmentKind

PossibleEnvironmentKindValues returns the possible values for the EnvironmentKind const type.

type EnvironmentListResult

type EnvironmentListResult struct {
	// READ-ONLY; The Environment items on this page
	Value []*Environment

	// READ-ONLY; The link to the next page of items
	NextLink *string
}

EnvironmentListResult - The response of a Environment list operation.

func (EnvironmentListResult) MarshalJSON

func (e EnvironmentListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EnvironmentListResult.

func (*EnvironmentListResult) UnmarshalJSON

func (e *EnvironmentListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentListResult.

type EnvironmentProperties

type EnvironmentProperties struct {
	// REQUIRED; Environment kind.
	Kind *EnvironmentKind

	// REQUIRED; Environment title.
	Title *string

	// The custom metadata defined for API catalog entities.
	CustomProperties any

	// The environment description.
	Description *string

	// Environment onboarding information
	Onboarding *Onboarding

	// Server information of the environment.
	Server *EnvironmentServer
}

EnvironmentProperties - Environment properties entity.

func (EnvironmentProperties) MarshalJSON

func (e EnvironmentProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EnvironmentProperties.

func (*EnvironmentProperties) UnmarshalJSON

func (e *EnvironmentProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentProperties.

type EnvironmentServer

type EnvironmentServer struct {
	// The location of the management portal
	ManagementPortalURI []*string

	// Type of the server that represents the environment.
	Type *EnvironmentServerType
}

EnvironmentServer - Server information of the environment.

func (EnvironmentServer) MarshalJSON

func (e EnvironmentServer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EnvironmentServer.

func (*EnvironmentServer) UnmarshalJSON

func (e *EnvironmentServer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentServer.

type EnvironmentServerType

type EnvironmentServerType string

EnvironmentServerType - The type of environment server

const (
	// EnvironmentServerTypeAWSAPIGateway - AWS Api Gateway server
	EnvironmentServerTypeAWSAPIGateway EnvironmentServerType = "AWS API Gateway"
	// EnvironmentServerTypeApigeeAPIManagement - Apigee server
	EnvironmentServerTypeApigeeAPIManagement EnvironmentServerType = "Apigee API Management"
	// EnvironmentServerTypeAzureAPIManagement - Api Management Server
	EnvironmentServerTypeAzureAPIManagement EnvironmentServerType = "Azure API Management"
	// EnvironmentServerTypeAzureComputeService - Compute server
	EnvironmentServerTypeAzureComputeService EnvironmentServerType = "Azure compute service"
	// EnvironmentServerTypeKongAPIGateway - Kong API Gateway server
	EnvironmentServerTypeKongAPIGateway EnvironmentServerType = "Kong API Gateway"
	// EnvironmentServerTypeKubernetes - Kubernetes server
	EnvironmentServerTypeKubernetes EnvironmentServerType = "Kubernetes"
	// EnvironmentServerTypeMuleSoftAPIManagement - Mulesoft Api Management server
	EnvironmentServerTypeMuleSoftAPIManagement EnvironmentServerType = "MuleSoft API Management"
)

func PossibleEnvironmentServerTypeValues

func PossibleEnvironmentServerTypeValues() []EnvironmentServerType

PossibleEnvironmentServerTypeValues returns the possible values for the EnvironmentServerType const type.

type EnvironmentsClient

type EnvironmentsClient struct {
	// contains filtered or unexported fields
}

EnvironmentsClient contains the methods for the Environments group. Don't use this type directly, use NewEnvironmentsClient() instead.

func NewEnvironmentsClient

func NewEnvironmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EnvironmentsClient, error)

NewEnvironmentsClient creates a new instance of EnvironmentsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*EnvironmentsClient) CreateOrUpdate

func (client *EnvironmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, environmentName string, resource Environment, options *EnvironmentsClientCreateOrUpdateOptions) (EnvironmentsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates new or updates existing environment. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • environmentName - The name of the environment.
  • resource - Resource create parameters.
  • options - EnvironmentsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEnvironmentsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "public", armapicenter.Environment{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Environment = armapicenter.Environment{
	// 	Name: to.Ptr("public"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/environments"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.EnvironmentProperties{
	// 		Description: to.Ptr("The primary Azure API Management service for the European division of Contoso."),
	// 		Kind: to.Ptr(armapicenter.EnvironmentKindProduction),
	// 		Onboarding: &armapicenter.Onboarding{
	// 			DeveloperPortalURI: []*string{
	// 				to.Ptr("https://developer.contoso.com")},
	// 				Instructions: to.Ptr("Sign in or sign up in the specified developer portal to request API access. You must complete the internal privacy training for your account to be approved."),
	// 			},
	// 			Server: &armapicenter.EnvironmentServer{
	// 				Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement),
	// 				ManagementPortalURI: []*string{
	// 					to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso")},
	// 				},
	// 				Title: to.Ptr("Contoso Europe Azure API Management"),
	// 			},
	// 		}
}

func (*EnvironmentsClient) Delete

func (client *EnvironmentsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, environmentName string, options *EnvironmentsClientDeleteOptions) (EnvironmentsClientDeleteResponse, error)

Delete - Deletes the environment. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • environmentName - The name of the environment.
  • options - EnvironmentsClientDeleteOptions contains the optional parameters for the EnvironmentsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewEnvironmentsClient().Delete(ctx, "contoso-resources", "contoso", "default", "public", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*EnvironmentsClient) Get

func (client *EnvironmentsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, environmentName string, options *EnvironmentsClientGetOptions) (EnvironmentsClientGetResponse, error)

Get - Returns details of the environment. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • environmentName - The name of the environment.
  • options - EnvironmentsClientGetOptions contains the optional parameters for the EnvironmentsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEnvironmentsClient().Get(ctx, "contoso-resources", "contoso", "default", "public", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Environment = armapicenter.Environment{
	// 	Name: to.Ptr("public"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/environments"),
	// 	ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.EnvironmentProperties{
	// 		CustomProperties: map[string]any{
	// 		},
	// 		Kind: to.Ptr(armapicenter.EnvironmentKindProduction),
	// 		Onboarding: &armapicenter.Onboarding{
	// 			DeveloperPortalURI: []*string{
	// 			},
	// 		},
	// 		Server: &armapicenter.EnvironmentServer{
	// 			Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement),
	// 			ManagementPortalURI: []*string{
	// 			},
	// 		},
	// 		Title: to.Ptr("Public"),
	// 	},
	// }
}

func (*EnvironmentsClient) Head

func (client *EnvironmentsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, environmentName string, options *EnvironmentsClientHeadOptions) (EnvironmentsClientHeadResponse, error)

Head - Checks if specified environment exists.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • environmentName - The name of the environment.
  • options - EnvironmentsClientHeadOptions contains the optional parameters for the EnvironmentsClient.Head method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Head.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewEnvironmentsClient().Head(ctx, "contoso-resources", "contoso", "default", "public", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*EnvironmentsClient) NewListPager

func (client *EnvironmentsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, options *EnvironmentsClientListOptions) *runtime.Pager[EnvironmentsClientListResponse]

NewListPager - Returns a collection of environments.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • options - EnvironmentsClientListOptions contains the optional parameters for the EnvironmentsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewEnvironmentsClient().NewListPager("contoso-resources", "contoso", "default", &armapicenter.EnvironmentsClientListOptions{Filter: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.EnvironmentListResult = armapicenter.EnvironmentListResult{
		// 	Value: []*armapicenter.Environment{
		// 		{
		// 			Name: to.Ptr("public"),
		// 			Type: to.Ptr("Microsoft.ApiCenter/services/environments"),
		// 			ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"),
		// 			SystemData: &armapicenter.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 			},
		// 			Properties: &armapicenter.EnvironmentProperties{
		// 				Description: to.Ptr("The primary Azure API Management service for the European division of Contoso."),
		// 				CustomProperties: map[string]any{
		// 				},
		// 				Kind: to.Ptr(armapicenter.EnvironmentKindProduction),
		// 				Onboarding: &armapicenter.Onboarding{
		// 					DeveloperPortalURI: []*string{
		// 					},
		// 				},
		// 				Server: &armapicenter.EnvironmentServer{
		// 					Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement),
		// 					ManagementPortalURI: []*string{
		// 					},
		// 				},
		// 				Title: to.Ptr("Contoso Europe Azure API Management"),
		// 			},
		// 	}},
		// }
	}
}

type EnvironmentsClientCreateOrUpdateOptions

type EnvironmentsClientCreateOrUpdateOptions struct {
}

EnvironmentsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentsClient.CreateOrUpdate method.

type EnvironmentsClientCreateOrUpdateResponse

type EnvironmentsClientCreateOrUpdateResponse struct {
	// Environment entity.
	Environment

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

EnvironmentsClientCreateOrUpdateResponse contains the response from method EnvironmentsClient.CreateOrUpdate.

type EnvironmentsClientDeleteOptions

type EnvironmentsClientDeleteOptions struct {
}

EnvironmentsClientDeleteOptions contains the optional parameters for the EnvironmentsClient.Delete method.

type EnvironmentsClientDeleteResponse

type EnvironmentsClientDeleteResponse struct {
}

EnvironmentsClientDeleteResponse contains the response from method EnvironmentsClient.Delete.

type EnvironmentsClientGetOptions

type EnvironmentsClientGetOptions struct {
}

EnvironmentsClientGetOptions contains the optional parameters for the EnvironmentsClient.Get method.

type EnvironmentsClientGetResponse

type EnvironmentsClientGetResponse struct {
	// Environment entity.
	Environment

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

EnvironmentsClientGetResponse contains the response from method EnvironmentsClient.Get.

type EnvironmentsClientHeadOptions

type EnvironmentsClientHeadOptions struct {
}

EnvironmentsClientHeadOptions contains the optional parameters for the EnvironmentsClient.Head method.

type EnvironmentsClientHeadResponse

type EnvironmentsClientHeadResponse struct {
	// Success indicates if the operation succeeded or failed.
	Success bool
}

EnvironmentsClientHeadResponse contains the response from method EnvironmentsClient.Head.

type EnvironmentsClientListOptions

type EnvironmentsClientListOptions struct {
	// OData filter parameter.
	Filter *string
}

EnvironmentsClientListOptions contains the optional parameters for the EnvironmentsClient.NewListPager method.

type EnvironmentsClientListResponse

type EnvironmentsClientListResponse struct {
	// The response of a Environment list operation.
	EnvironmentListResult
}

EnvironmentsClientListResponse contains the response from method EnvironmentsClient.NewListPager.

type ExternalDocumentation

type ExternalDocumentation struct {
	// REQUIRED; URL pointing to the documentation.
	URL *string

	// Description of the documentation.
	Description *string

	// Title of the documentation.
	Title *string
}

ExternalDocumentation - Additional, external documentation for the API.

func (ExternalDocumentation) MarshalJSON

func (e ExternalDocumentation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExternalDocumentation.

func (*ExternalDocumentation) UnmarshalJSON

func (e *ExternalDocumentation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExternalDocumentation.

type License

type License struct {
	// SPDX license information for the API. The identifier field is mutually exclusive of the URL field.
	Identifier *string

	// Name of the license.
	Name *string

	// URL pointing to the license details. The URL field is mutually exclusive of the identifier field.
	URL *string
}

License - The license information for the API.

func (License) MarshalJSON

func (l License) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type License.

func (*License) UnmarshalJSON

func (l *License) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type License.

type LifecycleStage

type LifecycleStage string

LifecycleStage - The stage of the Api development lifecycle

const (
	// LifecycleStageDeprecated - deprecated stage
	LifecycleStageDeprecated LifecycleStage = "deprecated"
	// LifecycleStageDesign - design stage
	LifecycleStageDesign LifecycleStage = "design"
	// LifecycleStageDevelopment - development stage
	LifecycleStageDevelopment LifecycleStage = "development"
	// LifecycleStagePreview - In preview
	LifecycleStagePreview LifecycleStage = "preview"
	// LifecycleStageProduction - In production
	LifecycleStageProduction LifecycleStage = "production"
	// LifecycleStageRetired - Retired stage
	LifecycleStageRetired LifecycleStage = "retired"
	// LifecycleStageTesting - testing stage
	LifecycleStageTesting LifecycleStage = "testing"
)

func PossibleLifecycleStageValues

func PossibleLifecycleStageValues() []LifecycleStage

PossibleLifecycleStageValues returns the possible values for the LifecycleStage const type.

type ManagedServiceIdentity

type ManagedServiceIdentity struct {
	// REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
	Type *ManagedServiceIdentityType

	// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM
	// resource ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
	// The dictionary values can be empty objects ({}) in
	// requests.
	UserAssignedIdentities map[string]*UserAssignedIdentity

	// READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	PrincipalID *string

	// READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.
	TenantID *string
}

ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities)

func (ManagedServiceIdentity) MarshalJSON

func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.

func (*ManagedServiceIdentity) UnmarshalJSON

func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.

type ManagedServiceIdentityType

type ManagedServiceIdentityType string

ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).

const (
	ManagedServiceIdentityTypeNone                       ManagedServiceIdentityType = "None"
	ManagedServiceIdentityTypeSystemAssigned             ManagedServiceIdentityType = "SystemAssigned"
	ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned"
	ManagedServiceIdentityTypeUserAssigned               ManagedServiceIdentityType = "UserAssigned"
)

func PossibleManagedServiceIdentityTypeValues

func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType

PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.

type MetadataAssignment

type MetadataAssignment struct {
	// Deprecated assignment
	Deprecated *bool

	// The entities this metadata schema component gets applied to.
	Entity *MetadataAssignmentEntity

	// Required assignment
	Required *bool
}

MetadataAssignment - Assignment metadata

func (MetadataAssignment) MarshalJSON

func (m MetadataAssignment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MetadataAssignment.

func (*MetadataAssignment) UnmarshalJSON

func (m *MetadataAssignment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MetadataAssignment.

type MetadataAssignmentEntity

type MetadataAssignmentEntity string

MetadataAssignmentEntity - Assignment entity for Metadata

const (
	// MetadataAssignmentEntityAPI - Assigned to API
	MetadataAssignmentEntityAPI MetadataAssignmentEntity = "api"
	// MetadataAssignmentEntityDeployment - Assigned to Deployment
	MetadataAssignmentEntityDeployment MetadataAssignmentEntity = "deployment"
	// MetadataAssignmentEntityEnvironment - Assigned to Environment
	MetadataAssignmentEntityEnvironment MetadataAssignmentEntity = "environment"
)

func PossibleMetadataAssignmentEntityValues

func PossibleMetadataAssignmentEntityValues() []MetadataAssignmentEntity

PossibleMetadataAssignmentEntityValues returns the possible values for the MetadataAssignmentEntity const type.

type MetadataSchema

type MetadataSchema struct {
	// The resource-specific properties for this resource.
	Properties *MetadataSchemaProperties

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

MetadataSchema - Metadata schema entity. Used to define metadata for the entities in API catalog.

func (MetadataSchema) MarshalJSON

func (m MetadataSchema) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MetadataSchema.

func (*MetadataSchema) UnmarshalJSON

func (m *MetadataSchema) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MetadataSchema.

type MetadataSchemaExportFormat

type MetadataSchemaExportFormat string

MetadataSchemaExportFormat - The format for schema export

const (
	// MetadataSchemaExportFormatInline - The inlined content of a schema document.
	MetadataSchemaExportFormatInline MetadataSchemaExportFormat = "inline"
	// MetadataSchemaExportFormatLink - The link to a schema document. The URL is valid for 5 minutes.
	MetadataSchemaExportFormatLink MetadataSchemaExportFormat = "link"
)

func PossibleMetadataSchemaExportFormatValues

func PossibleMetadataSchemaExportFormatValues() []MetadataSchemaExportFormat

PossibleMetadataSchemaExportFormatValues returns the possible values for the MetadataSchemaExportFormat const type.

type MetadataSchemaExportRequest

type MetadataSchemaExportRequest struct {
	// An entity the metadata schema is requested for.
	AssignedTo *MetadataAssignmentEntity
}

MetadataSchemaExportRequest - The metadata schema export request.

func (MetadataSchemaExportRequest) MarshalJSON

func (m MetadataSchemaExportRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MetadataSchemaExportRequest.

func (*MetadataSchemaExportRequest) UnmarshalJSON

func (m *MetadataSchemaExportRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MetadataSchemaExportRequest.

type MetadataSchemaExportResult

type MetadataSchemaExportResult struct {
	// The export format for the schema
	Format *MetadataSchemaExportFormat

	// The result of the export operation.
	Value *string
}

MetadataSchemaExportResult - The metadata schema export result.

func (MetadataSchemaExportResult) MarshalJSON

func (m MetadataSchemaExportResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MetadataSchemaExportResult.

func (*MetadataSchemaExportResult) UnmarshalJSON

func (m *MetadataSchemaExportResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MetadataSchemaExportResult.

type MetadataSchemaListResult

type MetadataSchemaListResult struct {
	// READ-ONLY; The MetadataSchema items on this page
	Value []*MetadataSchema

	// READ-ONLY; The link to the next page of items
	NextLink *string
}

MetadataSchemaListResult - The response of a MetadataSchema list operation.

func (MetadataSchemaListResult) MarshalJSON

func (m MetadataSchemaListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MetadataSchemaListResult.

func (*MetadataSchemaListResult) UnmarshalJSON

func (m *MetadataSchemaListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MetadataSchemaListResult.

type MetadataSchemaProperties

type MetadataSchemaProperties struct {
	// REQUIRED; The schema defining the type.
	Schema *string

	// The assignees
	AssignedTo []*MetadataAssignment
}

MetadataSchemaProperties - Metadata schema properties.

func (MetadataSchemaProperties) MarshalJSON

func (m MetadataSchemaProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MetadataSchemaProperties.

func (*MetadataSchemaProperties) UnmarshalJSON

func (m *MetadataSchemaProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MetadataSchemaProperties.

type MetadataSchemasClient

type MetadataSchemasClient struct {
	// contains filtered or unexported fields
}

MetadataSchemasClient contains the methods for the MetadataSchemas group. Don't use this type directly, use NewMetadataSchemasClient() instead.

func NewMetadataSchemasClient

func NewMetadataSchemasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MetadataSchemasClient, error)

NewMetadataSchemasClient creates a new instance of MetadataSchemasClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*MetadataSchemasClient) CreateOrUpdate

func (client *MetadataSchemasClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, metadataSchemaName string, resource MetadataSchema, options *MetadataSchemasClientCreateOrUpdateOptions) (MetadataSchemasClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates new or updates existing metadata schema. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • metadataSchemaName - The name of the metadata schema.
  • resource - Resource create parameters.
  • options - MetadataSchemasClientCreateOrUpdateOptions contains the optional parameters for the MetadataSchemasClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMetadataSchemasClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "author", armapicenter.MetadataSchema{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.MetadataSchema = armapicenter.MetadataSchema{
	// 	Name: to.Ptr("author"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"),
	// 	ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.MetadataSchemaProperties{
	// 		Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"),
	// 		AssignedTo: []*armapicenter.MetadataAssignment{
	// 			{
	// 				Deprecated: to.Ptr(true),
	// 				Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI),
	// 		}},
	// 	},
	// }
}

func (*MetadataSchemasClient) Delete

func (client *MetadataSchemasClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, metadataSchemaName string, options *MetadataSchemasClientDeleteOptions) (MetadataSchemasClientDeleteResponse, error)

Delete - Deletes specified metadata schema. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • metadataSchemaName - The name of the metadata schema.
  • options - MetadataSchemasClientDeleteOptions contains the optional parameters for the MetadataSchemasClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewMetadataSchemasClient().Delete(ctx, "contoso-resources", "contoso", "author", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*MetadataSchemasClient) Get

func (client *MetadataSchemasClient) Get(ctx context.Context, resourceGroupName string, serviceName string, metadataSchemaName string, options *MetadataSchemasClientGetOptions) (MetadataSchemasClientGetResponse, error)

Get - Returns details of the metadata schema. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • metadataSchemaName - The name of the metadata schema.
  • options - MetadataSchemasClientGetOptions contains the optional parameters for the MetadataSchemasClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMetadataSchemasClient().Get(ctx, "contoso-resources", "contoso", "lastName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.MetadataSchema = armapicenter.MetadataSchema{
	// 	Name: to.Ptr("author"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"),
	// 	ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.MetadataSchemaProperties{
	// 		Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"),
	// 		AssignedTo: []*armapicenter.MetadataAssignment{
	// 			{
	// 				Deprecated: to.Ptr(true),
	// 				Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI),
	// 		}},
	// 	},
	// }
}

func (*MetadataSchemasClient) Head

func (client *MetadataSchemasClient) Head(ctx context.Context, resourceGroupName string, serviceName string, metadataSchemaName string, options *MetadataSchemasClientHeadOptions) (MetadataSchemasClientHeadResponse, error)

Head - Checks if specified metadata schema exists.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • metadataSchemaName - The name of the metadata schema.
  • options - MetadataSchemasClientHeadOptions contains the optional parameters for the MetadataSchemasClient.Head method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Head.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewMetadataSchemasClient().Head(ctx, "contoso-resources", "contoso", "author", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*MetadataSchemasClient) NewListPager

func (client *MetadataSchemasClient) NewListPager(resourceGroupName string, serviceName string, options *MetadataSchemasClientListOptions) *runtime.Pager[MetadataSchemasClientListResponse]

NewListPager - Returns a collection of metadata schemas.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • options - MetadataSchemasClientListOptions contains the optional parameters for the MetadataSchemasClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewMetadataSchemasClient().NewListPager("contoso-resources", "contoso", &armapicenter.MetadataSchemasClientListOptions{Filter: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.MetadataSchemaListResult = armapicenter.MetadataSchemaListResult{
		// 	Value: []*armapicenter.MetadataSchema{
		// 		{
		// 			Name: to.Ptr("author"),
		// 			Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"),
		// 			ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"),
		// 			SystemData: &armapicenter.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 			},
		// 			Properties: &armapicenter.MetadataSchemaProperties{
		// 				Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"),
		// 				AssignedTo: []*armapicenter.MetadataAssignment{
		// 					{
		// 						Deprecated: to.Ptr(true),
		// 						Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI),
		// 				}},
		// 			},
		// 	}},
		// }
	}
}

type MetadataSchemasClientCreateOrUpdateOptions

type MetadataSchemasClientCreateOrUpdateOptions struct {
}

MetadataSchemasClientCreateOrUpdateOptions contains the optional parameters for the MetadataSchemasClient.CreateOrUpdate method.

type MetadataSchemasClientCreateOrUpdateResponse

type MetadataSchemasClientCreateOrUpdateResponse struct {
	// Metadata schema entity. Used to define metadata for the entities in API catalog.
	MetadataSchema

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

MetadataSchemasClientCreateOrUpdateResponse contains the response from method MetadataSchemasClient.CreateOrUpdate.

type MetadataSchemasClientDeleteOptions

type MetadataSchemasClientDeleteOptions struct {
}

MetadataSchemasClientDeleteOptions contains the optional parameters for the MetadataSchemasClient.Delete method.

type MetadataSchemasClientDeleteResponse

type MetadataSchemasClientDeleteResponse struct {
}

MetadataSchemasClientDeleteResponse contains the response from method MetadataSchemasClient.Delete.

type MetadataSchemasClientGetOptions

type MetadataSchemasClientGetOptions struct {
}

MetadataSchemasClientGetOptions contains the optional parameters for the MetadataSchemasClient.Get method.

type MetadataSchemasClientGetResponse

type MetadataSchemasClientGetResponse struct {
	// Metadata schema entity. Used to define metadata for the entities in API catalog.
	MetadataSchema

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

MetadataSchemasClientGetResponse contains the response from method MetadataSchemasClient.Get.

type MetadataSchemasClientHeadOptions

type MetadataSchemasClientHeadOptions struct {
}

MetadataSchemasClientHeadOptions contains the optional parameters for the MetadataSchemasClient.Head method.

type MetadataSchemasClientHeadResponse

type MetadataSchemasClientHeadResponse struct {
	// Success indicates if the operation succeeded or failed.
	Success bool
}

MetadataSchemasClientHeadResponse contains the response from method MetadataSchemasClient.Head.

type MetadataSchemasClientListOptions

type MetadataSchemasClientListOptions struct {
	// OData filter parameter.
	Filter *string
}

MetadataSchemasClientListOptions contains the optional parameters for the MetadataSchemasClient.NewListPager method.

type MetadataSchemasClientListResponse

type MetadataSchemasClientListResponse struct {
	// The response of a MetadataSchema list operation.
	MetadataSchemaListResult
}

MetadataSchemasClientListResponse contains the response from method MetadataSchemasClient.NewListPager.

type Onboarding

type Onboarding struct {
	// The location of the development portal
	DeveloperPortalURI []*string

	// Onboarding guide.
	Instructions *string
}

Onboarding information

func (Onboarding) MarshalJSON

func (o Onboarding) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Onboarding.

func (*Onboarding) UnmarshalJSON

func (o *Onboarding) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Onboarding.

type Operation

type Operation struct {
	// Localized display information for this particular operation.
	Display *OperationDisplay

	// READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
	ActionType *ActionType

	// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane
	// operations.
	IsDataAction *bool

	// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
	// "Microsoft.Compute/virtualMachines/capture/action"
	Name *string

	// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
	// value is "user,system"
	Origin *Origin
}

Operation - Details of a REST API operation, returned from the Resource Provider Operations API

func (Operation) MarshalJSON

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
	Description *string

	// READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
	// Machine", "Restart Virtual Machine".
	Operation *string

	// READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
	// Compute".
	Provider *string

	// READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
	// Schedule Collections".
	Resource *string
}

OperationDisplay - Localized display information for this particular operation.

func (OperationDisplay) MarshalJSON

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; URL to get the next set of operation list results (if there are any).
	NextLink *string

	// READ-ONLY; List of operations supported by the resource provider
	Value []*Operation
}

OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.

func (OperationListResult) MarshalJSON

func (o OperationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

func (o *OperationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager

NewListPager - List the operations for the provider

Generated from API version 2024-03-01

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Operations_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.OperationListResult = armapicenter.OperationListResult{
		// 	Value: []*armapicenter.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.ApiCenter/services/read"),
		// 			Display: &armapicenter.OperationDisplay{
		// 				Description: to.Ptr("Lists registered services"),
		// 				Operation: to.Ptr("Lists services"),
		// 				Provider: to.Ptr("Microsoft.ApiCenter"),
		// 				Resource: to.Ptr("services"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 	}},
		// }
	}
}

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Origin

type Origin string

Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"

const (
	OriginSystem     Origin = "system"
	OriginUser       Origin = "user"
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The provisioning state of the resource

const (
	// ProvisioningStateCanceled - Resource creation was canceled.
	ProvisioningStateCanceled ProvisioningState = "Canceled"
	// ProvisioningStateFailed - Resource creation failed.
	ProvisioningStateFailed ProvisioningState = "Failed"
	// ProvisioningStateSucceeded - Resource has been created.
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type Service

type Service struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// The managed service identities assigned to this resource.
	Identity *ManagedServiceIdentity

	// The resource-specific properties for this resource.
	Properties *ServiceProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Service - The service entity.

func (Service) MarshalJSON

func (s Service) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Service.

func (*Service) UnmarshalJSON

func (s *Service) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Service.

type ServiceListResult

type ServiceListResult struct {
	// READ-ONLY; The Service items on this page
	Value []*Service

	// READ-ONLY; The link to the next page of items
	NextLink *string
}

ServiceListResult - The response of a Service list operation.

func (ServiceListResult) MarshalJSON

func (s ServiceListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceListResult.

func (*ServiceListResult) UnmarshalJSON

func (s *ServiceListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceListResult.

type ServiceProperties

type ServiceProperties struct {
	// READ-ONLY; Provisioning state of the service.
	ProvisioningState *ProvisioningState
}

ServiceProperties - The properties of the service.

func (ServiceProperties) MarshalJSON

func (s ServiceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceProperties.

func (*ServiceProperties) UnmarshalJSON

func (s *ServiceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties.

type ServiceUpdate

type ServiceUpdate struct {
	// The managed service identities assigned to this resource.
	Identity *ManagedServiceIdentity

	// Resource tags.
	Tags map[string]*string
}

ServiceUpdate - The type used for update operations of the Service.

func (ServiceUpdate) MarshalJSON

func (s ServiceUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceUpdate.

func (*ServiceUpdate) UnmarshalJSON

func (s *ServiceUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdate.

type ServicesClient

type ServicesClient struct {
	// contains filtered or unexported fields
}

ServicesClient contains the methods for the Services group. Don't use this type directly, use NewServicesClient() instead.

func NewServicesClient

func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error)

NewServicesClient creates a new instance of ServicesClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ServicesClient) BeginExportMetadataSchema

BeginExportMetadataSchema - Exports the effective metadata schema. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • body - The content of the action request
  • options - ServicesClientBeginExportMetadataSchemaOptions contains the optional parameters for the ServicesClient.BeginExportMetadataSchema method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_ExportMetadataSchema.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServicesClient().BeginExportMetadataSchema(ctx, "contoso-resources", "contoso", armapicenter.MetadataSchemaExportRequest{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.MetadataSchemaExportResult = armapicenter.MetadataSchemaExportResult{
	// 	Format: to.Ptr(armapicenter.MetadataSchemaExportFormat("json-schema")),
	// 	Value: to.Ptr("{\"type\":\"object\",\"properties\":{ ... }}"),
	// }
}

func (*ServicesClient) CreateOrUpdate

func (client *ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, resource Service, options *ServicesClientCreateOrUpdateOptions) (ServicesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates new or updates existing API. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • resource - Resource create parameters.
  • options - ServicesClientCreateOrUpdateOptions contains the optional parameters for the ServicesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServicesClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", armapicenter.Service{
		Location: to.Ptr("East US"),
		Tags:     map[string]*string{},
		Identity: &armapicenter.ManagedServiceIdentity{
			Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
			UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{
				"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {},
			},
		},
		Properties: &armapicenter.ServiceProperties{},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Service = armapicenter.Service{
	// 	Name: to.Ptr("contoso"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Identity: &armapicenter.ManagedServiceIdentity{
	// 		Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
	// 		PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{
	// 			"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{
	// 				ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armapicenter.ServiceProperties{
	// 		ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded),
	// 	},
	// }
}

func (*ServicesClient) Delete

func (client *ServicesClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientDeleteOptions) (ServicesClientDeleteResponse, error)

Delete - Deletes specified service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • options - ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewServicesClient().Delete(ctx, "contoso-resources", "contoso", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*ServicesClient) Get

func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientGetOptions) (ServicesClientGetResponse, error)

Get - Returns details of the service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServicesClient().Get(ctx, "contoso-resources", "contoso", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Service = armapicenter.Service{
	// 	Name: to.Ptr("contoso"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Identity: &armapicenter.ManagedServiceIdentity{
	// 		Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
	// 		PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{
	// 			"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{
	// 				ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armapicenter.ServiceProperties{
	// 		ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded),
	// 	},
	// }
}

func (*ServicesClient) NewListByResourceGroupPager

func (client *ServicesClient) NewListByResourceGroupPager(resourceGroupName string, options *ServicesClientListByResourceGroupOptions) *runtime.Pager[ServicesClientListByResourceGroupResponse]

NewListByResourceGroupPager - Returns a collection of services within the resource group.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServicesClient().NewListByResourceGroupPager("contoso-resources", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ServiceListResult = armapicenter.ServiceListResult{
		// 	Value: []*armapicenter.Service{
		// 		{
		// 			Name: to.Ptr("contoso"),
		// 			Type: to.Ptr("Microsoft.ApiCenter/services"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Identity: &armapicenter.ManagedServiceIdentity{
		// 				Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
		// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{
		// 					"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{
		// 						ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 						PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 				},
		// 			},
		// 			Properties: &armapicenter.ServiceProperties{
		// 				ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}

func (*ServicesClient) NewListBySubscriptionPager

NewListBySubscriptionPager - Lists services within an Azure subscription.

Generated from API version 2024-03-01

  • options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_ListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServicesClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ServiceListResult = armapicenter.ServiceListResult{
		// 	Value: []*armapicenter.Service{
		// 		{
		// 			Name: to.Ptr("contoso"),
		// 			Type: to.Ptr("Microsoft.ApiCenter/services"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Identity: &armapicenter.ManagedServiceIdentity{
		// 				Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
		// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{
		// 					"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{
		// 						ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 						PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 				},
		// 			},
		// 			Properties: &armapicenter.ServiceProperties{
		// 				ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}

func (*ServicesClient) Update

func (client *ServicesClient) Update(ctx context.Context, resourceGroupName string, serviceName string, properties ServiceUpdate, options *ServicesClientUpdateOptions) (ServicesClientUpdateResponse, error)

Update - Updates existing service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • properties - The resource properties to be updated.
  • options - ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Update.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServicesClient().Update(ctx, "contoso-resources", "contoso", armapicenter.ServiceUpdate{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Service = armapicenter.Service{
	// 	Name: to.Ptr("contoso"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Identity: &armapicenter.ManagedServiceIdentity{
	// 		Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
	// 		PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{
	// 			"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{
	// 				ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armapicenter.ServiceProperties{
	// 		ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded),
	// 	},
	// }
}

type ServicesClientBeginExportMetadataSchemaOptions

type ServicesClientBeginExportMetadataSchemaOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ServicesClientBeginExportMetadataSchemaOptions contains the optional parameters for the ServicesClient.BeginExportMetadataSchema method.

type ServicesClientCreateOrUpdateOptions

type ServicesClientCreateOrUpdateOptions struct {
}

ServicesClientCreateOrUpdateOptions contains the optional parameters for the ServicesClient.CreateOrUpdate method.

type ServicesClientCreateOrUpdateResponse

type ServicesClientCreateOrUpdateResponse struct {
	// The service entity.
	Service
}

ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.CreateOrUpdate.

type ServicesClientDeleteOptions

type ServicesClientDeleteOptions struct {
}

ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method.

type ServicesClientDeleteResponse

type ServicesClientDeleteResponse struct {
}

ServicesClientDeleteResponse contains the response from method ServicesClient.Delete.

type ServicesClientExportMetadataSchemaResponse

type ServicesClientExportMetadataSchemaResponse struct {
	// The metadata schema export result.
	MetadataSchemaExportResult
}

ServicesClientExportMetadataSchemaResponse contains the response from method ServicesClient.BeginExportMetadataSchema.

type ServicesClientGetOptions

type ServicesClientGetOptions struct {
}

ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method.

type ServicesClientGetResponse

type ServicesClientGetResponse struct {
	// The service entity.
	Service
}

ServicesClientGetResponse contains the response from method ServicesClient.Get.

type ServicesClientListByResourceGroupOptions

type ServicesClientListByResourceGroupOptions struct {
}

ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager method.

type ServicesClientListByResourceGroupResponse

type ServicesClientListByResourceGroupResponse struct {
	// The response of a Service list operation.
	ServiceListResult
}

ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager.

type ServicesClientListBySubscriptionOptions

type ServicesClientListBySubscriptionOptions struct {
}

ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager method.

type ServicesClientListBySubscriptionResponse

type ServicesClientListBySubscriptionResponse struct {
	// The response of a Service list operation.
	ServiceListResult
}

ServicesClientListBySubscriptionResponse contains the response from method ServicesClient.NewListBySubscriptionPager.

type ServicesClientUpdateOptions

type ServicesClientUpdateOptions struct {
}

ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method.

type ServicesClientUpdateResponse

type ServicesClientUpdateResponse struct {
	// The service entity.
	Service
}

ServicesClientUpdateResponse contains the response from method ServicesClient.Update.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TermsOfService

type TermsOfService struct {
	// REQUIRED; URL pointing to the terms of service.
	URL *string
}

TermsOfService - Terms of service for the API.

func (TermsOfService) MarshalJSON

func (t TermsOfService) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TermsOfService.

func (*TermsOfService) UnmarshalJSON

func (t *TermsOfService) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TermsOfService.

type UserAssignedIdentity

type UserAssignedIdentity struct {
	// READ-ONLY; The client ID of the assigned identity.
	ClientID *string

	// READ-ONLY; The principal ID of the assigned identity.
	PrincipalID *string
}

UserAssignedIdentity - User assigned identity properties

func (UserAssignedIdentity) MarshalJSON

func (u UserAssignedIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.

func (*UserAssignedIdentity) UnmarshalJSON

func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.

type Workspace

type Workspace struct {
	// The resource-specific properties for this resource.
	Properties *WorkspaceProperties

	// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Workspace entity.

func (Workspace) MarshalJSON

func (w Workspace) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Workspace.

func (*Workspace) UnmarshalJSON

func (w *Workspace) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Workspace.

type WorkspaceListResult

type WorkspaceListResult struct {
	// READ-ONLY; The Workspace items on this page
	Value []*Workspace

	// READ-ONLY; The link to the next page of items
	NextLink *string
}

WorkspaceListResult - The response of a Workspace list operation.

func (WorkspaceListResult) MarshalJSON

func (w WorkspaceListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkspaceListResult.

func (*WorkspaceListResult) UnmarshalJSON

func (w *WorkspaceListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceListResult.

type WorkspaceProperties

type WorkspaceProperties struct {
	// REQUIRED; Workspace title.
	Title *string

	// Workspace description.
	Description *string
}

WorkspaceProperties - Workspace properties.

func (WorkspaceProperties) MarshalJSON

func (w WorkspaceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties.

func (*WorkspaceProperties) UnmarshalJSON

func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceProperties.

type WorkspacesClient

type WorkspacesClient struct {
	// contains filtered or unexported fields
}

WorkspacesClient contains the methods for the Workspaces group. Don't use this type directly, use NewWorkspacesClient() instead.

func NewWorkspacesClient

func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspacesClient, error)

NewWorkspacesClient creates a new instance of WorkspacesClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*WorkspacesClient) CreateOrUpdate

func (client *WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, resource Workspace, options *WorkspacesClientCreateOrUpdateOptions) (WorkspacesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates new or updates existing workspace. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • resource - Resource create parameters.
  • options - WorkspacesClientCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkspacesClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", armapicenter.Workspace{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Workspace = armapicenter.Workspace{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.WorkspaceProperties{
	// 		Title: to.Ptr("default"),
	// 	},
	// }
}

func (*WorkspacesClient) Delete

func (client *WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, options *WorkspacesClientDeleteOptions) (WorkspacesClientDeleteResponse, error)

Delete - Deletes specified workspace. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • options - WorkspacesClientDeleteOptions contains the optional parameters for the WorkspacesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewWorkspacesClient().Delete(ctx, "contoso-resources", "contoso", "default", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*WorkspacesClient) Get

func (client *WorkspacesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, options *WorkspacesClientGetOptions) (WorkspacesClientGetResponse, error)

Get - Returns details of the workspace. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkspacesClient().Get(ctx, "contoso-resources", "contoso", "default", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Workspace = armapicenter.Workspace{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"),
	// 	SystemData: &armapicenter.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
	// 	},
	// 	Properties: &armapicenter.WorkspaceProperties{
	// 		Title: to.Ptr("default"),
	// 	},
	// }
}

func (*WorkspacesClient) Head

func (client *WorkspacesClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, options *WorkspacesClientHeadOptions) (WorkspacesClientHeadResponse, error)

Head - Checks if specified workspace exists.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • workspaceName - The name of the workspace.
  • options - WorkspacesClientHeadOptions contains the optional parameters for the WorkspacesClient.Head method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Head.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewWorkspacesClient().Head(ctx, "contoso-resources", "contoso", "default", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

func (*WorkspacesClient) NewListPager

func (client *WorkspacesClient) NewListPager(resourceGroupName string, serviceName string, options *WorkspacesClientListOptions) *runtime.Pager[WorkspacesClientListResponse]

NewListPager - Returns a collection of workspaces.

Generated from API version 2024-03-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • serviceName - The name of Azure API Center service.
  • options - WorkspacesClientListOptions contains the optional parameters for the WorkspacesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWorkspacesClient().NewListPager("contoso-resources", "contoso", &armapicenter.WorkspacesClientListOptions{Filter: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.WorkspaceListResult = armapicenter.WorkspaceListResult{
		// 	Value: []*armapicenter.Workspace{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"),
		// 			SystemData: &armapicenter.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()),
		// 			},
		// 			Properties: &armapicenter.WorkspaceProperties{
		// 				Title: to.Ptr("default"),
		// 			},
		// 	}},
		// }
	}
}

type WorkspacesClientCreateOrUpdateOptions

type WorkspacesClientCreateOrUpdateOptions struct {
}

WorkspacesClientCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.CreateOrUpdate method.

type WorkspacesClientCreateOrUpdateResponse

type WorkspacesClientCreateOrUpdateResponse struct {
	// Workspace entity.
	Workspace

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

WorkspacesClientCreateOrUpdateResponse contains the response from method WorkspacesClient.CreateOrUpdate.

type WorkspacesClientDeleteOptions

type WorkspacesClientDeleteOptions struct {
}

WorkspacesClientDeleteOptions contains the optional parameters for the WorkspacesClient.Delete method.

type WorkspacesClientDeleteResponse

type WorkspacesClientDeleteResponse struct {
}

WorkspacesClientDeleteResponse contains the response from method WorkspacesClient.Delete.

type WorkspacesClientGetOptions

type WorkspacesClientGetOptions struct {
}

WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method.

type WorkspacesClientGetResponse

type WorkspacesClientGetResponse struct {
	// Workspace entity.
	Workspace

	// ETag contains the information returned from the ETag header response.
	ETag *string
}

WorkspacesClientGetResponse contains the response from method WorkspacesClient.Get.

type WorkspacesClientHeadOptions

type WorkspacesClientHeadOptions struct {
}

WorkspacesClientHeadOptions contains the optional parameters for the WorkspacesClient.Head method.

type WorkspacesClientHeadResponse

type WorkspacesClientHeadResponse struct {
	// Success indicates if the operation succeeded or failed.
	Success bool
}

WorkspacesClientHeadResponse contains the response from method WorkspacesClient.Head.

type WorkspacesClientListOptions

type WorkspacesClientListOptions struct {
	// OData filter parameter.
	Filter *string
}

WorkspacesClientListOptions contains the optional parameters for the WorkspacesClient.NewListPager method.

type WorkspacesClientListResponse

type WorkspacesClientListResponse struct {
	// The response of a Workspace list operation.
	WorkspaceListResult
}

WorkspacesClientListResponse contains the response from method WorkspacesClient.NewListPager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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