armapimanagement

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 15 Imported by: 11

README

Azure API Management Module for Go

PkgGoDev

The armapimanagement module provides operations for working with Azure API Management.

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 API Management module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure API Management. 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 API Management 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 := armapimanagement.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,
    },
}
clientFactory, err := armapimanagement.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.NewServiceClient()

More sample code

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the API Management 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 APIClient

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

APIClient contains the methods for the API group. Don't use this type directly, use NewAPIClient() instead.

func NewAPIClient

func NewAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIClient, error)

NewAPIClient creates a new instance of APIClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIClient) BeginCreateOrUpdate

func (client *APIClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, parameters APICreateOrUpdateParameter, options *APIClientBeginCreateOrUpdateOptions) (*runtime.Poller[APIClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates new or updates existing specified API of the API Management service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • parameters - Create or update parameters.
  • options - APIClientBeginCreateOrUpdateOptions contains the optional parameters for the APIClient.BeginCreateOrUpdate method.
Example (ApiManagementCreateApi)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApi.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "tempgroup", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			Description: to.Ptr("apidescription5200"),
			AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{
				OAuth2: &armapimanagement.OAuth2AuthenticationSettingsContract{
					AuthorizationServerID: to.Ptr("authorizationServerId2283"),
					Scope:                 to.Ptr("oauth2scope2580"),
				},
			},
			SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
				Header: to.Ptr("header4520"),
				Query:  to.Ptr("query3037"),
			},
			Path:        to.Ptr("newapiPath"),
			DisplayName: to.Ptr("apiname1463"),
			Protocols: []*armapimanagement.Protocol{
				to.Ptr(armapimanagement.ProtocolHTTPS),
				to.Ptr(armapimanagement.ProtocolHTTP)},
			ServiceURL: to.Ptr("http://newechoapi.cloudapp.net/api"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("apiid9419"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/apiid9419"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		Description: to.Ptr("apidescription5200"),
	// 		APIRevision: to.Ptr("1"),
	// 		AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{
	// 			OAuth2: &armapimanagement.OAuth2AuthenticationSettingsContract{
	// 				AuthorizationServerID: to.Ptr("authorizationServerId2283"),
	// 				Scope: to.Ptr("oauth2scope2580"),
	// 			},
	// 		},
	// 		IsCurrent: to.Ptr(true),
	// 		IsOnline: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("header4520"),
	// 			Query: to.Ptr("query3037"),
	// 		},
	// 		Path: to.Ptr("newapiPath"),
	// 		DisplayName: to.Ptr("apiname1463"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTP),
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("http://newechoapi.cloudapp.net/api"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateApiClone)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiClone.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "echo-api2", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			Description:          to.Ptr("Copy of Existing Echo Api including Operations."),
			IsCurrent:            to.Ptr(true),
			SubscriptionRequired: to.Ptr(true),
			Path:                 to.Ptr("echo2"),
			DisplayName:          to.Ptr("Echo API2"),
			Protocols: []*armapimanagement.Protocol{
				to.Ptr(armapimanagement.ProtocolHTTP),
				to.Ptr(armapimanagement.ProtocolHTTPS)},
			ServiceURL:  to.Ptr("http://echoapi.cloudapp.net/api"),
			SourceAPIID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/58a4aeac497000007d040001"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("echoapi2"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echoapi2"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		Description: to.Ptr("Copy of Existing Echo Api including Operations."),
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		SubscriptionRequired: to.Ptr(true),
	// 		Path: to.Ptr("echo2"),
	// 		DisplayName: to.Ptr("Echo API2"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTP),
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("http://echoapi.cloudapp.net/api"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateApiNewVersionUsingExistingApi)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiNewVersionUsingExistingApi.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "echoapiv3", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			Description:          to.Ptr("Create Echo API into a new Version using Existing Version Set and Copy all Operations."),
			APIVersion:           to.Ptr("v4"),
			APIVersionSetID:      to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/aa9c59e6-c0cd-4258-9356-9ca7d2f0b458"),
			IsCurrent:            to.Ptr(true),
			SubscriptionRequired: to.Ptr(true),
			Path:                 to.Ptr("echo2"),
			DisplayName:          to.Ptr("Echo API2"),
			Protocols: []*armapimanagement.Protocol{
				to.Ptr(armapimanagement.ProtocolHTTP),
				to.Ptr(armapimanagement.ProtocolHTTPS)},
			ServiceURL:  to.Ptr("http://echoapi.cloudapp.net/api"),
			SourceAPIID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echoPath"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("echoapiv3"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echoapiv3"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		Description: to.Ptr("Create Echo API into a new Version using Existing Version Set and Copy all Operations."),
	// 		APIRevision: to.Ptr("1"),
	// 		APIVersion: to.Ptr("v4"),
	// 		APIVersionSetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/aa9c59e6-c0cd-4258-9356-9ca7d2f0b458"),
	// 		IsCurrent: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		SubscriptionRequired: to.Ptr(true),
	// 		Path: to.Ptr("echo2"),
	// 		APIVersionSet: &armapimanagement.APIVersionSetContractDetails{
	// 			Name: to.Ptr("Echo API2"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/aa9c59e6-c0cd-4258-9356-9ca7d2f0b458"),
	// 			VersioningScheme: to.Ptr(armapimanagement.APIVersionSetContractDetailsVersioningSchemeSegment),
	// 		},
	// 		DisplayName: to.Ptr("Echo API2"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTP),
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("http://echoapi.cloudapp.net/api"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateApiRevisionFromExistingApi)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiRevisionFromExistingApi.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "echo-api;rev=3", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			APIRevisionDescription: to.Ptr("Creating a Revision of an existing API"),
			Path:                   to.Ptr("echo"),
			ServiceURL:             to.Ptr("http://echoapi.cloudapp.net/apiv3"),
			SourceAPIID:            to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("echo-api;rev=3"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api;rev=3"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIRevision: to.Ptr("3"),
	// 		APIRevisionDescription: to.Ptr("Creating a Revision of an existing API"),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		SubscriptionRequired: to.Ptr(true),
	// 		Path: to.Ptr("echo"),
	// 		DisplayName: to.Ptr("Echo API"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("http://echoapi.cloudapp.net/apiv3"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateApiUsingImportOverrideServiceUrl)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingImportOverrideServiceUrl.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "apidocs", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			Path:       to.Ptr("petstoreapi123"),
			ServiceURL: to.Ptr("http://petstore.swagger.wordnik.com/api"),
			Format:     to.Ptr(armapimanagement.ContentFormat("swagger-link")),
			Value:      to.Ptr("http://apimpimportviaurl.azurewebsites.net/api/apidocs/"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("apidocs"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/apidocs"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		Description: to.Ptr("This is a sample server Petstore server.  You can find out more about Swagger \n    at <a href=\"http://swagger.wordnik.com\">http://swagger.wordnik.com</a> or on irc.freenode.net, #swagger.  For this sample,\n    you can use the api key \"special-key\" to test the authorization filters"),
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr("petstoreapi123"),
	// 		DisplayName: to.Ptr("Swagger Sample App"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("http://petstore.swagger.wordnik.com/api"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateApiUsingOai3Import)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingOai3Import.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "petstore", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			Path:   to.Ptr("petstore"),
			Format: to.Ptr(armapimanagement.ContentFormatOpenapiLink),
			Value:  to.Ptr("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("petstoreapi"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/petstoreapi"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr("petstore"),
	// 		DisplayName: to.Ptr("Swagger Petstore"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("http://petstore.swagger.io/v1"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateApiUsingSwaggerImport)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingSwaggerImport.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "petstore", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			Path:   to.Ptr("petstore"),
			Format: to.Ptr(armapimanagement.ContentFormatSwaggerLinkJSON),
			Value:  to.Ptr("http://petstore.swagger.io/v2/swagger.json"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("petstoreapi"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/petstoreapi"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		Description: to.Ptr("This is a sample server Petstore server.  You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).  For this sample, you can use the api key `special-key` to test the authorization filters."),
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr("petstore"),
	// 		DisplayName: to.Ptr("Swagger Petstore"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTP)},
	// 			ServiceURL: to.Ptr("http://petstore.swagger.io/v2"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateApiUsingWadlImport)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingWadlImport.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "petstore", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			Path:   to.Ptr("collector"),
			Format: to.Ptr(armapimanagement.ContentFormatWadlLinkJSON),
			Value:  to.Ptr("https://developer.cisco.com/media/wae-release-6-2-api-reference/wae-collector-rest-api/application.wadl"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("collectorwadl"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/collectorwadl"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		Description: to.Ptr(""),
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr("collector"),
	// 		DisplayName: to.Ptr("http://localhost:8080/collector-northbound"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("http://localhost:8080/collector-northbound"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateApiWithOpenIdConnect)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiWithOpenIdConnect.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "tempgroup", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			Description: to.Ptr("This is a sample server Petstore server.  You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).  For this sample, you can use the api key `special-key` to test the authorization filters."),
			AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{
				Openid: &armapimanagement.OpenIDAuthenticationSettingsContract{
					BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethods{
						to.Ptr(armapimanagement.BearerTokenSendingMethodsAuthorizationHeader)},
					OpenidProviderID: to.Ptr("testopenid"),
				},
			},
			SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
				Header: to.Ptr("Ocp-Apim-Subscription-Key"),
				Query:  to.Ptr("subscription-key"),
			},
			Path:        to.Ptr("petstore"),
			DisplayName: to.Ptr("Swagger Petstore"),
			Protocols: []*armapimanagement.Protocol{
				to.Ptr(armapimanagement.ProtocolHTTPS)},
			ServiceURL: to.Ptr("http://petstore.swagger.io/v2"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("58da4c4ccdae970a08121230"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/58da4c4ccdae970a08121230"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		Description: to.Ptr("This is a sample server Petstore server.  You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).  For this sample, you can use the api key `special-key` to test the authorization filters."),
	// 		APIRevision: to.Ptr("1"),
	// 		AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{
	// 			Openid: &armapimanagement.OpenIDAuthenticationSettingsContract{
	// 				BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethods{
	// 					to.Ptr(armapimanagement.BearerTokenSendingMethodsAuthorizationHeader)},
	// 					OpenidProviderID: to.Ptr("testopenid"),
	// 				},
	// 			},
	// 			IsCurrent: to.Ptr(true),
	// 			SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 				Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 				Query: to.Ptr("subscription-key"),
	// 			},
	// 			Path: to.Ptr("petstore"),
	// 			DisplayName: to.Ptr("Swagger Petstore"),
	// 			Protocols: []*armapimanagement.Protocol{
	// 				to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 				ServiceURL: to.Ptr("http://petstore.swagger.io/v2"),
	// 			},
	// 		}
}
Output:

Example (ApiManagementCreateGraphQlApi)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGraphQLApi.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "tempgroup", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			APIType:     to.Ptr(armapimanagement.APITypeGraphql),
			Description: to.Ptr("apidescription5200"),
			Path:        to.Ptr("graphql-api"),
			DisplayName: to.Ptr("apiname1463"),
			Protocols: []*armapimanagement.Protocol{
				to.Ptr(armapimanagement.ProtocolHTTP),
				to.Ptr(armapimanagement.ProtocolHTTPS)},
			ServiceURL: to.Ptr("https://api.spacex.land/graphql"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("apiid9419"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/apiid9419"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIType: to.Ptr(armapimanagement.APITypeGraphql),
	// 		Description: to.Ptr("apidescription5200"),
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		IsOnline: to.Ptr(true),
	// 		Path: to.Ptr("graphql-api"),
	// 		DisplayName: to.Ptr("apiname1463"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTP),
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("https://api.spacex.land/graphql"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateSoapPassThroughApiUsingWsdlImport)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSoapPassThroughApiUsingWsdlImport.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "soapApi", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			Path:        to.Ptr("currency"),
			Format:      to.Ptr(armapimanagement.ContentFormatWsdlLink),
			SoapAPIType: to.Ptr(armapimanagement.SoapAPITypeSoapPassThrough),
			Value:       to.Ptr("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL"),
			WsdlSelector: &armapimanagement.APICreateOrUpdatePropertiesWsdlSelector{
				WsdlEndpointName: to.Ptr("CurrencyConvertorSoap"),
				WsdlServiceName:  to.Ptr("CurrencyConvertor"),
			},
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("soapApi"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/soapApi"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIType: to.Ptr(armapimanagement.APITypeSoap),
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr("currency"),
	// 		DisplayName: to.Ptr("CurrencyConvertor"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("http://www.webservicex.net"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateSoapToRestApiUsingWsdlImport)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSoapToRestApiUsingWsdlImport.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "soapApi", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			Path:   to.Ptr("currency"),
			Format: to.Ptr(armapimanagement.ContentFormatWsdlLink),
			Value:  to.Ptr("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL"),
			WsdlSelector: &armapimanagement.APICreateOrUpdatePropertiesWsdlSelector{
				WsdlEndpointName: to.Ptr("CurrencyConvertorSoap"),
				WsdlServiceName:  to.Ptr("CurrencyConvertor"),
			},
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("soapApi"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/soapApi"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr("currency"),
	// 		DisplayName: to.Ptr("CurrencyConvertor"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("http://www.webservicex.net"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateWebSocketApi)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateWebsocketApi.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "tempgroup", armapimanagement.APICreateOrUpdateParameter{
		Properties: &armapimanagement.APICreateOrUpdateProperties{
			APIType:     to.Ptr(armapimanagement.APITypeWebsocket),
			Description: to.Ptr("apidescription5200"),
			Path:        to.Ptr("newapiPath"),
			DisplayName: to.Ptr("apiname1463"),
			Protocols: []*armapimanagement.Protocol{
				to.Ptr(armapimanagement.ProtocolWss),
				to.Ptr(armapimanagement.ProtocolWs)},
			ServiceURL: to.Ptr("wss://echo.websocket.org"),
		},
	}, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("apiid9419"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/apiid9419"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIType: to.Ptr(armapimanagement.APITypeWebsocket),
	// 		Description: to.Ptr("apidescription5200"),
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		IsOnline: to.Ptr(true),
	// 		Path: to.Ptr("newapiPath"),
	// 		DisplayName: to.Ptr("apiname1463"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolWs),
	// 			to.Ptr(armapimanagement.ProtocolWss)},
	// 			ServiceURL: to.Ptr("wss://echo.websocket.org"),
	// 		},
	// 	}
}
Output:

func (*APIClient) Delete

func (client *APIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, options *APIClientDeleteOptions) (APIClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APIClientDeleteOptions contains the optional parameters for the APIClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApi.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIClient().Delete(ctx, "rg1", "apimService1", "echo-api", "*", &armapimanagement.APIClientDeleteOptions{DeleteRevisions: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIClient) Get

func (client *APIClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIClientGetOptions) (APIClientGetResponse, error)

Get - Gets the details of the API specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - APIClientGetOptions contains the optional parameters for the APIClient.Get method.
Example (ApiManagementGetApiContract)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiContract.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIClient().Get(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("57d1f7558aa04f15146d9d8a"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIType: to.Ptr(armapimanagement.APITypeSoap),
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		IsOnline: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr("schulte"),
	// 		DisplayName: to.Ptr("Service"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("https://api.plexonline.com/DataSource/Service.asmx"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementGetApiRevisionContract)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiRevision.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIClient().Get(ctx, "rg1", "apimService1", "echo-api;rev=3", 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("echo-api;rev=3"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api;rev=3"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIRevision: to.Ptr("3"),
	// 		APIRevisionDescription: to.Ptr("fixed bug in contract"),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr("schulte"),
	// 		DisplayName: to.Ptr("Service"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("https://api.plexonline.com/DataSource/Service.asmx"),
	// 		},
	// 	}
}
Output:

func (*APIClient) GetEntityTag

func (client *APIClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIClientGetEntityTagOptions) (APIClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the API specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - APIClientGetEntityTagOptions contains the optional parameters for the APIClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApi.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIClient().GetEntityTag(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIClient) NewListByServicePager added in v0.5.0

func (client *APIClient) NewListByServicePager(resourceGroupName string, serviceName string, options *APIClientListByServiceOptions) *runtime.Pager[APIClientListByServiceResponse]

NewListByServicePager - Lists all APIs of the API Management service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - APIClientListByServiceOptions contains the optional parameters for the APIClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApis.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.APIClientListByServiceOptions{Filter: nil,
		Top:                 nil,
		Skip:                nil,
		Tags:                nil,
		ExpandAPIVersionSet: 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.APICollection = armapimanagement.APICollection{
		// 	Count: to.Ptr[int64](4),
		// 	Value: []*armapimanagement.APIContract{
		// 		{
		// 			Name: to.Ptr("a1"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1"),
		// 			Properties: &armapimanagement.APIContractProperties{
		// 				APIRevision: to.Ptr("1"),
		// 				APIVersionSetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/c48f96c9-1385-4e2d-b410-5ab591ce0fc4"),
		// 				IsCurrent: to.Ptr(true),
		// 				Path: to.Ptr("api1"),
		// 				DisplayName: to.Ptr("api1"),
		// 				Protocols: []*armapimanagement.Protocol{
		// 					to.Ptr(armapimanagement.ProtocolHTTPS)},
		// 					ServiceURL: to.Ptr("http://echoapi.cloudapp.net/api"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("5a73933b8f27f7cc82a2d533"),
		// 				Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
		// 				ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5a73933b8f27f7cc82a2d533"),
		// 				Properties: &armapimanagement.APIContractProperties{
		// 					APIRevision: to.Ptr("1"),
		// 					APIVersion: to.Ptr("v1"),
		// 					APIVersionSetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/c48f96c9-1385-4e2d-b410-5ab591ce0fc4"),
		// 					IsCurrent: to.Ptr(true),
		// 					Path: to.Ptr("api1"),
		// 					DisplayName: to.Ptr("api1"),
		// 					Protocols: []*armapimanagement.Protocol{
		// 						to.Ptr(armapimanagement.ProtocolHTTPS)},
		// 						ServiceURL: to.Ptr("http://echoapi.cloudapp.net/api"),
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("echo-api"),
		// 					Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
		// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"),
		// 					Properties: &armapimanagement.APIContractProperties{
		// 						APIRevision: to.Ptr("1"),
		// 						IsCurrent: to.Ptr(true),
		// 						Path: to.Ptr("echo"),
		// 						DisplayName: to.Ptr("Echo API"),
		// 						Protocols: []*armapimanagement.Protocol{
		// 							to.Ptr(armapimanagement.ProtocolHTTPS)},
		// 							ServiceURL: to.Ptr("http://echoapi.cloudapp.net/api"),
		// 						},
		// 					},
		// 					{
		// 						Name: to.Ptr("5a7390baa5816a110435aee0"),
		// 						Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
		// 						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5a7390baa5816a110435aee0"),
		// 						Properties: &armapimanagement.APIContractProperties{
		// 							Description: to.Ptr("A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification"),
		// 							APIRevision: to.Ptr("1"),
		// 							IsCurrent: to.Ptr(true),
		// 							Path: to.Ptr("vvv"),
		// 							DisplayName: to.Ptr("Swagger Petstore Extensive"),
		// 							Protocols: []*armapimanagement.Protocol{
		// 								to.Ptr(armapimanagement.ProtocolHTTPS)},
		// 								ServiceURL: to.Ptr("http://petstore.swagger.wordnik.com/api"),
		// 							},
		// 					}},
		// 				}
	}
}
Output:

func (*APIClient) NewListByTagsPager added in v0.5.0

func (client *APIClient) NewListByTagsPager(resourceGroupName string, serviceName string, options *APIClientListByTagsOptions) *runtime.Pager[APIClientListByTagsResponse]

NewListByTagsPager - Lists a collection of apis associated with tags.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - APIClientListByTagsOptions contains the optional parameters for the APIClient.NewListByTagsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApisByTags.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIClient().NewListByTagsPager("rg1", "apimService1", &armapimanagement.APIClientListByTagsOptions{Filter: nil,
		Top:                  nil,
		Skip:                 nil,
		IncludeNotTaggedApis: 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.TagResourceCollection = armapimanagement.TagResourceCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.TagResourceContract{
		// 		{
		// 			API: &armapimanagement.APITagResourceContractProperties{
		// 				APIRevision: to.Ptr("1"),
		// 				IsCurrent: to.Ptr(true),
		// 				Name: to.Ptr("Echo API"),
		// 				Path: to.Ptr("echo"),
		// 				ID: to.Ptr("/apis/echo-api"),
		// 				ServiceURL: to.Ptr("http://echoapi.cloudapp.net/api"),
		// 			},
		// 			Tag: &armapimanagement.TagResourceContractProperties{
		// 				Name: to.Ptr("awesomeTag"),
		// 				ID: to.Ptr("/tags/apitag123"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*APIClient) Update

func (client *APIClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, parameters APIUpdateContract, options *APIClientUpdateOptions) (APIClientUpdateResponse, error)

Update - Updates the specified API of the API Management service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - API Update Contract parameters.
  • options - APIClientUpdateOptions contains the optional parameters for the APIClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApi.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIClient().Update(ctx, "rg1", "apimService1", "echo-api", "*", armapimanagement.APIUpdateContract{
		Properties: &armapimanagement.APIContractUpdateProperties{
			Path:        to.Ptr("newecho"),
			DisplayName: to.Ptr("Echo API New"),
			ServiceURL:  to.Ptr("http://echoapi.cloudapp.net/api2"),
		},
	}, 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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("echo-api"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		IsOnline: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr("newecho"),
	// 		DisplayName: to.Ptr("Echo API New"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("http://echoapi.cloudapp.net/api2"),
	// 		},
	// 	}
}
Output:

type APIClientBeginCreateOrUpdateOptions added in v0.3.0

type APIClientBeginCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
	// Resumes the LRO from the provided token.
	ResumeToken string
}

APIClientBeginCreateOrUpdateOptions contains the optional parameters for the APIClient.BeginCreateOrUpdate method.

type APIClientCreateOrUpdateResponse added in v0.3.0

type APIClientCreateOrUpdateResponse struct {
	APIContract
}

APIClientCreateOrUpdateResponse contains the response from method APIClient.BeginCreateOrUpdate.

type APIClientDeleteOptions added in v0.3.0

type APIClientDeleteOptions struct {
	// Delete all revisions of the Api.
	DeleteRevisions *bool
}

APIClientDeleteOptions contains the optional parameters for the APIClient.Delete method.

type APIClientDeleteResponse added in v0.3.0

type APIClientDeleteResponse struct {
}

APIClientDeleteResponse contains the response from method APIClient.Delete.

type APIClientGetEntityTagOptions added in v0.3.0

type APIClientGetEntityTagOptions struct {
}

APIClientGetEntityTagOptions contains the optional parameters for the APIClient.GetEntityTag method.

type APIClientGetEntityTagResponse added in v0.3.0

type APIClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIClientGetEntityTagResponse contains the response from method APIClient.GetEntityTag.

type APIClientGetOptions added in v0.3.0

type APIClientGetOptions struct {
}

APIClientGetOptions contains the optional parameters for the APIClient.Get method.

type APIClientGetResponse added in v0.3.0

type APIClientGetResponse struct {
	APIContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIClientGetResponse contains the response from method APIClient.Get.

type APIClientListByServiceOptions added in v0.3.0

type APIClientListByServiceOptions struct {
	// Include full ApiVersionSet resource in response
	ExpandAPIVersionSet *bool
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | isCurrent | filter | eq, ne | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Include tags in the response.
	Tags *string
	// Number of records to return.
	Top *int32
}

APIClientListByServiceOptions contains the optional parameters for the APIClient.NewListByServicePager method.

type APIClientListByServiceResponse added in v0.3.0

type APIClientListByServiceResponse struct {
	APICollection
}

APIClientListByServiceResponse contains the response from method APIClient.NewListByServicePager.

type APIClientListByTagsOptions added in v0.3.0

type APIClientListByTagsOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | isCurrent | filter | eq | |
	Filter *string
	// Include not tagged APIs.
	IncludeNotTaggedApis *bool
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APIClientListByTagsOptions contains the optional parameters for the APIClient.NewListByTagsPager method.

type APIClientListByTagsResponse added in v0.3.0

type APIClientListByTagsResponse struct {
	TagResourceCollection
}

APIClientListByTagsResponse contains the response from method APIClient.NewListByTagsPager.

type APIClientUpdateOptions added in v0.3.0

type APIClientUpdateOptions struct {
}

APIClientUpdateOptions contains the optional parameters for the APIClient.Update method.

type APIClientUpdateResponse added in v0.3.0

type APIClientUpdateResponse struct {
	APIContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIClientUpdateResponse contains the response from method APIClient.Update.

type APICollection

type APICollection struct {
	// Total record count number across all pages.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Page values.
	Value []*APIContract
}

APICollection - Paged API list representation.

func (APICollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APICollection.

func (*APICollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APICollection.

type APIContactInformation

type APIContactInformation struct {
	// The email address of the contact person/organization. MUST be in the format of an email address
	Email *string

	// The identifying name of the contact person/organization
	Name *string

	// The URL pointing to the contact information. MUST be in the format of a URL
	URL *string
}

APIContactInformation - API contact information

func (APIContactInformation) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APIContactInformation.

func (*APIContactInformation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIContactInformation.

type APIContract

type APIContract struct {
	// API entity contract properties.
	Properties *APIContractProperties

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

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

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

APIContract - API details.

func (APIContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIContract.

func (*APIContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIContract.

type APIContractProperties

type APIContractProperties struct {
	// REQUIRED; Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance.
	// It is appended to the API endpoint base URL specified during the service instance
	// creation to form a public URL for this API.
	Path *string

	// Describes the revision of the API. If no value is provided, default revision 1 is created
	APIRevision *string

	// Description of the API Revision.
	APIRevisionDescription *string

	// Type of API.
	APIType *APIType

	// Indicates the version identifier of the API if the API is versioned
	APIVersion *string

	// Description of the API Version.
	APIVersionDescription *string

	// Version set details
	APIVersionSet *APIVersionSetContractDetails

	// A resource identifier for the related ApiVersionSet.
	APIVersionSetID *string

	// Collection of authentication settings included into this API.
	AuthenticationSettings *AuthenticationSettingsContract

	// Contact information for the API.
	Contact *APIContactInformation

	// Description of the API. May include HTML formatting tags.
	Description *string

	// API name. Must be 1 to 300 characters long.
	DisplayName *string

	// Indicates if API revision is current api revision.
	IsCurrent *bool

	// License information for the API.
	License *APILicenseInformation

	// Describes on which protocols the operations in this API can be invoked.
	Protocols []*Protocol

	// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.
	ServiceURL *string

	// API identifier of the source API.
	SourceAPIID *string

	// Protocols over which API is made available.
	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract

	// Specifies whether an API or Product subscription is required for accessing the API.
	SubscriptionRequired *bool

	// A URL to the Terms of Service for the API. MUST be in the format of a URL.
	TermsOfServiceURL *string

	// READ-ONLY; Indicates if API revision is accessible via the gateway.
	IsOnline *bool
}

APIContractProperties - API Entity Properties

func (APIContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIContractProperties.

func (*APIContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIContractProperties.

type APIContractUpdateProperties

type APIContractUpdateProperties struct {
	// Describes the revision of the API. If no value is provided, default revision 1 is created
	APIRevision *string

	// Description of the API Revision.
	APIRevisionDescription *string

	// Type of API.
	APIType *APIType

	// Indicates the version identifier of the API if the API is versioned
	APIVersion *string

	// Description of the API Version.
	APIVersionDescription *string

	// A resource identifier for the related ApiVersionSet.
	APIVersionSetID *string

	// Collection of authentication settings included into this API.
	AuthenticationSettings *AuthenticationSettingsContract

	// Contact information for the API.
	Contact *APIContactInformation

	// Description of the API. May include HTML formatting tags.
	Description *string

	// API name.
	DisplayName *string

	// Indicates if API revision is current api revision.
	IsCurrent *bool

	// License information for the API.
	License *APILicenseInformation

	// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It
	// is appended to the API endpoint base URL specified during the service instance
	// creation to form a public URL for this API.
	Path *string

	// Describes on which protocols the operations in this API can be invoked.
	Protocols []*Protocol

	// Absolute URL of the backend service implementing this API.
	ServiceURL *string

	// Protocols over which API is made available.
	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract

	// Specifies whether an API or Product subscription is required for accessing the API.
	SubscriptionRequired *bool

	// A URL to the Terms of Service for the API. MUST be in the format of a URL.
	TermsOfServiceURL *string

	// READ-ONLY; Indicates if API revision is accessible via the gateway.
	IsOnline *bool
}

APIContractUpdateProperties - API update contract properties.

func (APIContractUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIContractUpdateProperties.

func (*APIContractUpdateProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIContractUpdateProperties.

type APICreateOrUpdateParameter

type APICreateOrUpdateParameter struct {
	// API entity create of update properties.
	Properties *APICreateOrUpdateProperties
}

APICreateOrUpdateParameter - API Create or Update Parameters.

func (APICreateOrUpdateParameter) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APICreateOrUpdateParameter.

func (*APICreateOrUpdateParameter) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APICreateOrUpdateParameter.

type APICreateOrUpdateProperties

type APICreateOrUpdateProperties struct {
	// REQUIRED; Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance.
	// It is appended to the API endpoint base URL specified during the service instance
	// creation to form a public URL for this API.
	Path *string

	// Describes the revision of the API. If no value is provided, default revision 1 is created
	APIRevision *string

	// Description of the API Revision.
	APIRevisionDescription *string

	// Type of API.
	APIType *APIType

	// Indicates the version identifier of the API if the API is versioned
	APIVersion *string

	// Description of the API Version.
	APIVersionDescription *string

	// Version set details
	APIVersionSet *APIVersionSetContractDetails

	// A resource identifier for the related ApiVersionSet.
	APIVersionSetID *string

	// Collection of authentication settings included into this API.
	AuthenticationSettings *AuthenticationSettingsContract

	// Contact information for the API.
	Contact *APIContactInformation

	// Description of the API. May include HTML formatting tags.
	Description *string

	// API name. Must be 1 to 300 characters long.
	DisplayName *string

	// Format of the Content in which the API is getting imported.
	Format *ContentFormat

	// Indicates if API revision is current api revision.
	IsCurrent *bool

	// License information for the API.
	License *APILicenseInformation

	// Describes on which protocols the operations in this API can be invoked.
	Protocols []*Protocol

	// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.
	ServiceURL *string

	// Type of API to create.
	// * http creates a REST API
	// * soap creates a SOAP pass-through API
	// * websocket creates websocket API
	// * graphql creates GraphQL API.
	SoapAPIType *SoapAPIType

	// API identifier of the source API.
	SourceAPIID *string

	// Protocols over which API is made available.
	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract

	// Specifies whether an API or Product subscription is required for accessing the API.
	SubscriptionRequired *bool

	// A URL to the Terms of Service for the API. MUST be in the format of a URL.
	TermsOfServiceURL *string

	// Content value when Importing an API.
	Value *string

	// Criteria to limit import of WSDL to a subset of the document.
	WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector

	// READ-ONLY; Indicates if API revision is accessible via the gateway.
	IsOnline *bool
}

APICreateOrUpdateProperties - API Create or Update Properties.

func (APICreateOrUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APICreateOrUpdateProperties.

func (*APICreateOrUpdateProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APICreateOrUpdateProperties.

type APICreateOrUpdatePropertiesWsdlSelector

type APICreateOrUpdatePropertiesWsdlSelector struct {
	// Name of endpoint(port) to import from WSDL
	WsdlEndpointName *string

	// Name of service to import from WSDL
	WsdlServiceName *string
}

APICreateOrUpdatePropertiesWsdlSelector - Criteria to limit import of WSDL to a subset of the document.

func (APICreateOrUpdatePropertiesWsdlSelector) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APICreateOrUpdatePropertiesWsdlSelector.

func (*APICreateOrUpdatePropertiesWsdlSelector) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APICreateOrUpdatePropertiesWsdlSelector.

type APIDiagnosticClient

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

APIDiagnosticClient contains the methods for the APIDiagnostic group. Don't use this type directly, use NewAPIDiagnosticClient() instead.

func NewAPIDiagnosticClient

func NewAPIDiagnosticClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIDiagnosticClient, error)

NewAPIDiagnosticClient creates a new instance of APIDiagnosticClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIDiagnosticClient) CreateOrUpdate

func (client *APIDiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, parameters DiagnosticContract, options *APIDiagnosticClientCreateOrUpdateOptions) (APIDiagnosticClientCreateOrUpdateResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance.
  • parameters - Create parameters.
  • options - APIDiagnosticClientCreateOrUpdateOptions contains the optional parameters for the APIDiagnosticClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiDiagnostic.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIDiagnosticClient().CreateOrUpdate(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "applicationinsights", armapimanagement.DiagnosticContract{
		Properties: &armapimanagement.DiagnosticContractProperties{
			AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
			Backend: &armapimanagement.PipelineDiagnosticSettings{
				Response: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
				Request: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
			},
			Frontend: &armapimanagement.PipelineDiagnosticSettings{
				Response: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
				Request: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
			},
			LoggerID: to.Ptr("/loggers/applicationinsights"),
			Sampling: &armapimanagement.SamplingSettings{
				Percentage:   to.Ptr[float64](50),
				SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
			},
		},
	}, &armapimanagement.APIDiagnosticClientCreateOrUpdateOptions{IfMatch: 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.DiagnosticContract = armapimanagement.DiagnosticContract{
	// 	Name: to.Ptr("applicationinsights"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/diagnostics"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/diagnostics/applicationinsights"),
	// 	Properties: &armapimanagement.DiagnosticContractProperties{
	// 		AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
	// 		Backend: &armapimanagement.PipelineDiagnosticSettings{
	// 			Response: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](512),
	// 				},
	// 				Headers: []*string{
	// 					to.Ptr("Content-type")},
	// 				},
	// 				Request: &armapimanagement.HTTPMessageDiagnostic{
	// 					Body: &armapimanagement.BodyDiagnosticSettings{
	// 						Bytes: to.Ptr[int32](512),
	// 					},
	// 					Headers: []*string{
	// 						to.Ptr("Content-type")},
	// 					},
	// 				},
	// 				Frontend: &armapimanagement.PipelineDiagnosticSettings{
	// 					Response: &armapimanagement.HTTPMessageDiagnostic{
	// 						Body: &armapimanagement.BodyDiagnosticSettings{
	// 							Bytes: to.Ptr[int32](512),
	// 						},
	// 						Headers: []*string{
	// 							to.Ptr("Content-type")},
	// 						},
	// 						Request: &armapimanagement.HTTPMessageDiagnostic{
	// 							Body: &armapimanagement.BodyDiagnosticSettings{
	// 								Bytes: to.Ptr[int32](512),
	// 							},
	// 							Headers: []*string{
	// 								to.Ptr("Content-type")},
	// 							},
	// 						},
	// 						LoggerID: to.Ptr("/loggers/applicationinsights"),
	// 						Sampling: &armapimanagement.SamplingSettings{
	// 							Percentage: to.Ptr[float64](50),
	// 							SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
	// 						},
	// 					},
	// 				}
}
Output:

func (*APIDiagnosticClient) Delete

func (client *APIDiagnosticClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, ifMatch string, options *APIDiagnosticClientDeleteOptions) (APIDiagnosticClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APIDiagnosticClientDeleteOptions contains the optional parameters for the APIDiagnosticClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiDiagnostic.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIDiagnosticClient().Delete(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "applicationinsights", "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIDiagnosticClient) Get

func (client *APIDiagnosticClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, options *APIDiagnosticClientGetOptions) (APIDiagnosticClientGetResponse, error)

Get - Gets the details of the Diagnostic for an API specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance.
  • options - APIDiagnosticClientGetOptions contains the optional parameters for the APIDiagnosticClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiDiagnostic.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIDiagnosticClient().Get(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "applicationinsights", 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.DiagnosticContract = armapimanagement.DiagnosticContract{
	// 	Name: to.Ptr("applicationinsights"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/diagnostics"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api/diagnostics/applicationinsights"),
	// 	Properties: &armapimanagement.DiagnosticContractProperties{
	// 		AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
	// 		Backend: &armapimanagement.PipelineDiagnosticSettings{
	// 			Response: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 			Request: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 		},
	// 		Frontend: &armapimanagement.PipelineDiagnosticSettings{
	// 			Response: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 			Request: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 		},
	// 		HTTPCorrelationProtocol: to.Ptr(armapimanagement.HTTPCorrelationProtocolLegacy),
	// 		LogClientIP: to.Ptr(true),
	// 		LoggerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/aisamplingtest"),
	// 		Sampling: &armapimanagement.SamplingSettings{
	// 			Percentage: to.Ptr[float64](100),
	// 			SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
	// 		},
	// 	},
	// }
}
Output:

func (*APIDiagnosticClient) GetEntityTag

func (client *APIDiagnosticClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, options *APIDiagnosticClientGetEntityTagOptions) (APIDiagnosticClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance.
  • options - APIDiagnosticClientGetEntityTagOptions contains the optional parameters for the APIDiagnosticClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiDiagnostic.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIDiagnosticClient().GetEntityTag(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "applicationinsights", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIDiagnosticClient) NewListByServicePager added in v0.5.0

func (client *APIDiagnosticClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, options *APIDiagnosticClientListByServiceOptions) *runtime.Pager[APIDiagnosticClientListByServiceResponse]

NewListByServicePager - Lists all diagnostics of an API.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • options - APIDiagnosticClientListByServiceOptions contains the optional parameters for the APIDiagnosticClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiDiagnostics.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIDiagnosticClient().NewListByServicePager("rg1", "apimService1", "echo-api", &armapimanagement.APIDiagnosticClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.DiagnosticCollection = armapimanagement.DiagnosticCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.DiagnosticContract{
		// 		{
		// 			Name: to.Ptr("applicationinsights"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/diagnostics"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api/diagnostics/applicationinsights"),
		// 			Properties: &armapimanagement.DiagnosticContractProperties{
		// 				AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
		// 				Backend: &armapimanagement.PipelineDiagnosticSettings{
		// 					Response: &armapimanagement.HTTPMessageDiagnostic{
		// 						Body: &armapimanagement.BodyDiagnosticSettings{
		// 							Bytes: to.Ptr[int32](100),
		// 						},
		// 						Headers: []*string{
		// 						},
		// 					},
		// 					Request: &armapimanagement.HTTPMessageDiagnostic{
		// 						Body: &armapimanagement.BodyDiagnosticSettings{
		// 							Bytes: to.Ptr[int32](100),
		// 						},
		// 						Headers: []*string{
		// 						},
		// 					},
		// 				},
		// 				Frontend: &armapimanagement.PipelineDiagnosticSettings{
		// 					Response: &armapimanagement.HTTPMessageDiagnostic{
		// 						Body: &armapimanagement.BodyDiagnosticSettings{
		// 							Bytes: to.Ptr[int32](100),
		// 						},
		// 						Headers: []*string{
		// 						},
		// 					},
		// 					Request: &armapimanagement.HTTPMessageDiagnostic{
		// 						Body: &armapimanagement.BodyDiagnosticSettings{
		// 							Bytes: to.Ptr[int32](100),
		// 						},
		// 						Headers: []*string{
		// 						},
		// 					},
		// 				},
		// 				HTTPCorrelationProtocol: to.Ptr(armapimanagement.HTTPCorrelationProtocolLegacy),
		// 				LogClientIP: to.Ptr(true),
		// 				LoggerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/aisamplingtest"),
		// 				Sampling: &armapimanagement.SamplingSettings{
		// 					Percentage: to.Ptr[float64](100),
		// 					SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*APIDiagnosticClient) Update

func (client *APIDiagnosticClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, ifMatch string, parameters DiagnosticContract, options *APIDiagnosticClientUpdateOptions) (APIDiagnosticClientUpdateResponse, error)

Update - Updates the details of the Diagnostic for an API specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Diagnostic Update parameters.
  • options - APIDiagnosticClientUpdateOptions contains the optional parameters for the APIDiagnosticClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiDiagnostic.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIDiagnosticClient().Update(ctx, "rg1", "apimService1", "echo-api", "applicationinsights", "*", armapimanagement.DiagnosticContract{
		Properties: &armapimanagement.DiagnosticContractProperties{
			AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
			Backend: &armapimanagement.PipelineDiagnosticSettings{
				Response: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
				Request: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
			},
			Frontend: &armapimanagement.PipelineDiagnosticSettings{
				Response: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
				Request: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
			},
			LoggerID: to.Ptr("/loggers/applicationinsights"),
			Sampling: &armapimanagement.SamplingSettings{
				Percentage:   to.Ptr[float64](50),
				SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
			},
		},
	}, 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.DiagnosticContract = armapimanagement.DiagnosticContract{
	// 	Name: to.Ptr("applicationinsights"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/diagnostics"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api/diagnostics/applicationinsights"),
	// 	Properties: &armapimanagement.DiagnosticContractProperties{
	// 		AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
	// 		Backend: &armapimanagement.PipelineDiagnosticSettings{
	// 			Response: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 			Request: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 		},
	// 		Frontend: &armapimanagement.PipelineDiagnosticSettings{
	// 			Response: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 			Request: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 		},
	// 		HTTPCorrelationProtocol: to.Ptr(armapimanagement.HTTPCorrelationProtocolLegacy),
	// 		LogClientIP: to.Ptr(true),
	// 		LoggerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/aisamplingtest"),
	// 		Sampling: &armapimanagement.SamplingSettings{
	// 			Percentage: to.Ptr[float64](100),
	// 			SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
	// 		},
	// 	},
	// }
}
Output:

type APIDiagnosticClientCreateOrUpdateOptions added in v0.3.0

type APIDiagnosticClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

APIDiagnosticClientCreateOrUpdateOptions contains the optional parameters for the APIDiagnosticClient.CreateOrUpdate method.

type APIDiagnosticClientCreateOrUpdateResponse added in v0.3.0

type APIDiagnosticClientCreateOrUpdateResponse struct {
	DiagnosticContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIDiagnosticClientCreateOrUpdateResponse contains the response from method APIDiagnosticClient.CreateOrUpdate.

type APIDiagnosticClientDeleteOptions added in v0.3.0

type APIDiagnosticClientDeleteOptions struct {
}

APIDiagnosticClientDeleteOptions contains the optional parameters for the APIDiagnosticClient.Delete method.

type APIDiagnosticClientDeleteResponse added in v0.3.0

type APIDiagnosticClientDeleteResponse struct {
}

APIDiagnosticClientDeleteResponse contains the response from method APIDiagnosticClient.Delete.

type APIDiagnosticClientGetEntityTagOptions added in v0.3.0

type APIDiagnosticClientGetEntityTagOptions struct {
}

APIDiagnosticClientGetEntityTagOptions contains the optional parameters for the APIDiagnosticClient.GetEntityTag method.

type APIDiagnosticClientGetEntityTagResponse added in v0.3.0

type APIDiagnosticClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIDiagnosticClientGetEntityTagResponse contains the response from method APIDiagnosticClient.GetEntityTag.

type APIDiagnosticClientGetOptions added in v0.3.0

type APIDiagnosticClientGetOptions struct {
}

APIDiagnosticClientGetOptions contains the optional parameters for the APIDiagnosticClient.Get method.

type APIDiagnosticClientGetResponse added in v0.3.0

type APIDiagnosticClientGetResponse struct {
	DiagnosticContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIDiagnosticClientGetResponse contains the response from method APIDiagnosticClient.Get.

type APIDiagnosticClientListByServiceOptions added in v0.3.0

type APIDiagnosticClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APIDiagnosticClientListByServiceOptions contains the optional parameters for the APIDiagnosticClient.NewListByServicePager method.

type APIDiagnosticClientListByServiceResponse added in v0.3.0

type APIDiagnosticClientListByServiceResponse struct {
	DiagnosticCollection
}

APIDiagnosticClientListByServiceResponse contains the response from method APIDiagnosticClient.NewListByServicePager.

type APIDiagnosticClientUpdateOptions added in v0.3.0

type APIDiagnosticClientUpdateOptions struct {
}

APIDiagnosticClientUpdateOptions contains the optional parameters for the APIDiagnosticClient.Update method.

type APIDiagnosticClientUpdateResponse added in v0.3.0

type APIDiagnosticClientUpdateResponse struct {
	DiagnosticContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIDiagnosticClientUpdateResponse contains the response from method APIDiagnosticClient.Update.

type APIEntityBaseContract

type APIEntityBaseContract struct {
	// Describes the revision of the API. If no value is provided, default revision 1 is created
	APIRevision *string

	// Description of the API Revision.
	APIRevisionDescription *string

	// Type of API.
	APIType *APIType

	// Indicates the version identifier of the API if the API is versioned
	APIVersion *string

	// Description of the API Version.
	APIVersionDescription *string

	// A resource identifier for the related ApiVersionSet.
	APIVersionSetID *string

	// Collection of authentication settings included into this API.
	AuthenticationSettings *AuthenticationSettingsContract

	// Contact information for the API.
	Contact *APIContactInformation

	// Description of the API. May include HTML formatting tags.
	Description *string

	// Indicates if API revision is current api revision.
	IsCurrent *bool

	// License information for the API.
	License *APILicenseInformation

	// Protocols over which API is made available.
	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract

	// Specifies whether an API or Product subscription is required for accessing the API.
	SubscriptionRequired *bool

	// A URL to the Terms of Service for the API. MUST be in the format of a URL.
	TermsOfServiceURL *string

	// READ-ONLY; Indicates if API revision is accessible via the gateway.
	IsOnline *bool
}

APIEntityBaseContract - API base contract details.

func (APIEntityBaseContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIEntityBaseContract.

func (*APIEntityBaseContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIEntityBaseContract.

type APIExportClient

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

APIExportClient contains the methods for the APIExport group. Don't use this type directly, use NewAPIExportClient() instead.

func NewAPIExportClient

func NewAPIExportClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIExportClient, error)

NewAPIExportClient creates a new instance of APIExportClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIExportClient) Get

func (client *APIExportClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, formatParam ExportFormat, export ExportAPI, options *APIExportClientGetOptions) (APIExportClientGetResponse, error)

Get - Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid for 5 minutes. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • formatParam - Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes.
  • export - Query parameter required to export the API details.
  • options - APIExportClientGetOptions contains the optional parameters for the APIExportClient.Get method.
Example (ApiManagementGetApiExportInOpenApi2Dot0)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIExportClient().Get(ctx, "rg1", "apimService1", "echo-api", armapimanagement.ExportFormatSwagger, armapimanagement.ExportAPITrue, 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.APIExportResult = armapimanagement.APIExportResult{
	// 	ExportResultFormat: to.Ptr(armapimanagement.ExportResultFormatSwagger),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"),
	// 	Value: &armapimanagement.APIExportResultValue{
	// 		Link: to.Ptr("https://apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore Extensive.json?sv=2015-07-08&sr=b&sig=mxhLsFuOonu8EXIjyFPV%2FnDra0qTIoip7N7MuU%2BTFsA%3D&se=2019-04-10T22:41:31Z&sp=r"),
	// 	},
	// }
}
Output:

Example (ApiManagementGetApiExportInOpenApi3Dot0)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIExportClient().Get(ctx, "rg1", "apimService1", "aid9676", armapimanagement.ExportFormatOpenapi, armapimanagement.ExportAPITrue, 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.APIExportResult = armapimanagement.APIExportResult{
	// 	ExportResultFormat: to.Ptr(armapimanagement.ExportResultFormatOpenAPI),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/aid9676"),
	// 	Value: &armapimanagement.APIExportResultValue{
	// 		Link: to.Ptr("https: //apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore.yaml?sv=2015-07-08&sr=b&sig=qqtR1y5iTbz5P7USBduqB5vriIU4gmiGqe0lKVV8j9k%3D&se=2019-04-10T22:40:57Z&sp=r"),
	// 	},
	// }
}
Output:

type APIExportClientGetOptions added in v0.3.0

type APIExportClientGetOptions struct {
}

APIExportClientGetOptions contains the optional parameters for the APIExportClient.Get method.

type APIExportClientGetResponse added in v0.3.0

type APIExportClientGetResponse struct {
	APIExportResult
}

APIExportClientGetResponse contains the response from method APIExportClient.Get.

type APIExportResult

type APIExportResult struct {
	// Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes.
	ExportResultFormat *ExportResultFormat

	// ResourceId of the API which was exported.
	ID *string

	// The object defining the schema of the exported API Detail
	Value *APIExportResultValue
}

APIExportResult - API Export result.

func (APIExportResult) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APIExportResult.

func (*APIExportResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIExportResult.

type APIExportResultValue

type APIExportResultValue struct {
	// Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes.
	Link *string
}

APIExportResultValue - The object defining the schema of the exported API Detail

func (APIExportResultValue) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APIExportResultValue.

func (*APIExportResultValue) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIExportResultValue.

type APIIssueAttachmentClient

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

APIIssueAttachmentClient contains the methods for the APIIssueAttachment group. Don't use this type directly, use NewAPIIssueAttachmentClient() instead.

func NewAPIIssueAttachmentClient

func NewAPIIssueAttachmentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIIssueAttachmentClient, error)

NewAPIIssueAttachmentClient creates a new instance of APIIssueAttachmentClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIIssueAttachmentClient) CreateOrUpdate

func (client *APIIssueAttachmentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, parameters IssueAttachmentContract, options *APIIssueAttachmentClientCreateOrUpdateOptions) (APIIssueAttachmentClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a new Attachment for the Issue in an API or updates an existing one. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue.
  • parameters - Create parameters.
  • options - APIIssueAttachmentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueAttachmentClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssueAttachment.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIIssueAttachmentClient().CreateOrUpdate(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", "57d2ef278aa04f0888cba3f3", armapimanagement.IssueAttachmentContract{
		Properties: &armapimanagement.IssueAttachmentContractProperties{
			Content:       to.Ptr("IEJhc2U2NA=="),
			ContentFormat: to.Ptr("image/jpeg"),
			Title:         to.Ptr("Issue attachment."),
		},
	}, &armapimanagement.APIIssueAttachmentClientCreateOrUpdateOptions{IfMatch: 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.IssueAttachmentContract = armapimanagement.IssueAttachmentContract{
	// 	Name: to.Ptr("57d2ef278aa04f0888cba3f3"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/issues/attachments"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/issues/57d2ef278aa04f0ad01d6cdc/attachments/57d2ef278aa04f0888cba3f3"),
	// 	Properties: &armapimanagement.IssueAttachmentContractProperties{
	// 		Content: to.Ptr("https://.../image.jpg"),
	// 		ContentFormat: to.Ptr("link"),
	// 		Title: to.Ptr("Issue attachment."),
	// 	},
	// }
}
Output:

func (*APIIssueAttachmentClient) Delete

func (client *APIIssueAttachmentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, ifMatch string, options *APIIssueAttachmentClientDeleteOptions) (APIIssueAttachmentClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APIIssueAttachmentClientDeleteOptions contains the optional parameters for the APIIssueAttachmentClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssueAttachment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIIssueAttachmentClient().Delete(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", "57d2ef278aa04f0888cba3f3", "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIIssueAttachmentClient) Get

func (client *APIIssueAttachmentClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, options *APIIssueAttachmentClientGetOptions) (APIIssueAttachmentClientGetResponse, error)

Get - Gets the details of the issue Attachment for an API specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue.
  • options - APIIssueAttachmentClientGetOptions contains the optional parameters for the APIIssueAttachmentClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssueAttachment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIIssueAttachmentClient().Get(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", "57d2ef278aa04f0888cba3f3", 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.IssueAttachmentContract = armapimanagement.IssueAttachmentContract{
	// 	Name: to.Ptr("57d2ef278aa04f0888cba3f3"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/issues/attachments"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/issues/57d2ef278aa04f0ad01d6cdc/attachments/57d2ef278aa04f0888cba3f3"),
	// 	Properties: &armapimanagement.IssueAttachmentContractProperties{
	// 		Content: to.Ptr("https://.../image.jpg"),
	// 		ContentFormat: to.Ptr("link"),
	// 		Title: to.Ptr("Issue attachment."),
	// 	},
	// }
}
Output:

func (*APIIssueAttachmentClient) GetEntityTag

func (client *APIIssueAttachmentClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, options *APIIssueAttachmentClientGetEntityTagOptions) (APIIssueAttachmentClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue.
  • options - APIIssueAttachmentClientGetEntityTagOptions contains the optional parameters for the APIIssueAttachmentClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssueAttachment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIIssueAttachmentClient().GetEntityTag(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", "57d2ef278aa04f0888cba3f3", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIIssueAttachmentClient) NewListByServicePager added in v0.5.0

func (client *APIIssueAttachmentClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, issueID string, options *APIIssueAttachmentClientListByServiceOptions) *runtime.Pager[APIIssueAttachmentClientListByServiceResponse]

NewListByServicePager - Lists all attachments for the Issue associated with the specified API.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • options - APIIssueAttachmentClientListByServiceOptions contains the optional parameters for the APIIssueAttachmentClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssueAttachments.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIIssueAttachmentClient().NewListByServicePager("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", &armapimanagement.APIIssueAttachmentClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.IssueAttachmentCollection = armapimanagement.IssueAttachmentCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.IssueAttachmentContract{
		// 		{
		// 			Name: to.Ptr("57d2ef278aa04f0888cba3f3"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/issues/attachments"),
		// 			ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/issues/57d2ef278aa04f0ad01d6cdc/attachments/57d2ef278aa04f0888cba3f3"),
		// 			Properties: &armapimanagement.IssueAttachmentContractProperties{
		// 				Content: to.Ptr("https://.../image.jpg"),
		// 				ContentFormat: to.Ptr("link"),
		// 				Title: to.Ptr("Issue attachment."),
		// 			},
		// 	}},
		// }
	}
}
Output:

type APIIssueAttachmentClientCreateOrUpdateOptions added in v0.3.0

type APIIssueAttachmentClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

APIIssueAttachmentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueAttachmentClient.CreateOrUpdate method.

type APIIssueAttachmentClientCreateOrUpdateResponse added in v0.3.0

type APIIssueAttachmentClientCreateOrUpdateResponse struct {
	IssueAttachmentContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIIssueAttachmentClientCreateOrUpdateResponse contains the response from method APIIssueAttachmentClient.CreateOrUpdate.

type APIIssueAttachmentClientDeleteOptions added in v0.3.0

type APIIssueAttachmentClientDeleteOptions struct {
}

APIIssueAttachmentClientDeleteOptions contains the optional parameters for the APIIssueAttachmentClient.Delete method.

type APIIssueAttachmentClientDeleteResponse added in v0.3.0

type APIIssueAttachmentClientDeleteResponse struct {
}

APIIssueAttachmentClientDeleteResponse contains the response from method APIIssueAttachmentClient.Delete.

type APIIssueAttachmentClientGetEntityTagOptions added in v0.3.0

type APIIssueAttachmentClientGetEntityTagOptions struct {
}

APIIssueAttachmentClientGetEntityTagOptions contains the optional parameters for the APIIssueAttachmentClient.GetEntityTag method.

type APIIssueAttachmentClientGetEntityTagResponse added in v0.3.0

type APIIssueAttachmentClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIIssueAttachmentClientGetEntityTagResponse contains the response from method APIIssueAttachmentClient.GetEntityTag.

type APIIssueAttachmentClientGetOptions added in v0.3.0

type APIIssueAttachmentClientGetOptions struct {
}

APIIssueAttachmentClientGetOptions contains the optional parameters for the APIIssueAttachmentClient.Get method.

type APIIssueAttachmentClientGetResponse added in v0.3.0

type APIIssueAttachmentClientGetResponse struct {
	IssueAttachmentContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIIssueAttachmentClientGetResponse contains the response from method APIIssueAttachmentClient.Get.

type APIIssueAttachmentClientListByServiceOptions added in v0.3.0

type APIIssueAttachmentClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APIIssueAttachmentClientListByServiceOptions contains the optional parameters for the APIIssueAttachmentClient.NewListByServicePager method.

type APIIssueAttachmentClientListByServiceResponse added in v0.3.0

type APIIssueAttachmentClientListByServiceResponse struct {
	IssueAttachmentCollection
}

APIIssueAttachmentClientListByServiceResponse contains the response from method APIIssueAttachmentClient.NewListByServicePager.

type APIIssueClient

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

APIIssueClient contains the methods for the APIIssue group. Don't use this type directly, use NewAPIIssueClient() instead.

func NewAPIIssueClient

func NewAPIIssueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIIssueClient, error)

NewAPIIssueClient creates a new instance of APIIssueClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIIssueClient) CreateOrUpdate

func (client *APIIssueClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, parameters IssueContract, options *APIIssueClientCreateOrUpdateOptions) (APIIssueClientCreateOrUpdateResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • parameters - Create parameters.
  • options - APIIssueClientCreateOrUpdateOptions contains the optional parameters for the APIIssueClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssue.json

package main

import (
	"context"
	"log"

	"time"

	"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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIIssueClient().CreateOrUpdate(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", armapimanagement.IssueContract{
		Properties: &armapimanagement.IssueContractProperties{
			CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t }()),
			State:       to.Ptr(armapimanagement.StateOpen),
			Description: to.Ptr("New API issue description"),
			Title:       to.Ptr("New API issue"),
			UserID:      to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
		},
	}, &armapimanagement.APIIssueClientCreateOrUpdateOptions{IfMatch: 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.IssueContract = armapimanagement.IssueContract{
	// 	Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/issues"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/issues/57d2ef278aa04f0ad01d6cdc"),
	// 	Properties: &armapimanagement.IssueContractProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
	// 		State: to.Ptr(armapimanagement.StateOpen),
	// 		Description: to.Ptr("New API issue description"),
	// 		Title: to.Ptr("New API issue"),
	// 		UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
	// 	},
	// }
}
Output:

func (*APIIssueClient) Delete

func (client *APIIssueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, ifMatch string, options *APIIssueClientDeleteOptions) (APIIssueClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APIIssueClientDeleteOptions contains the optional parameters for the APIIssueClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssue.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIIssueClient().Delete(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIIssueClient) Get

func (client *APIIssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, options *APIIssueClientGetOptions) (APIIssueClientGetResponse, error)

Get - Gets the details of the Issue for an API specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • options - APIIssueClientGetOptions contains the optional parameters for the APIIssueClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssue.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIIssueClient().Get(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", &armapimanagement.APIIssueClientGetOptions{ExpandCommentsAttachments: 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.IssueContract = armapimanagement.IssueContract{
	// 	Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/issues"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/issues/57d2ef278aa04f0ad01d6cdc"),
	// 	Properties: &armapimanagement.IssueContractProperties{
	// 		APIID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
	// 		State: to.Ptr(armapimanagement.StateOpen),
	// 		Description: to.Ptr("New API issue description"),
	// 		Title: to.Ptr("New API issue"),
	// 		UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
	// 	},
	// }
}
Output:

func (*APIIssueClient) GetEntityTag

func (client *APIIssueClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, options *APIIssueClientGetEntityTagOptions) (APIIssueClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the Issue for an API specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • options - APIIssueClientGetEntityTagOptions contains the optional parameters for the APIIssueClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssue.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIIssueClient().GetEntityTag(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIIssueClient) NewListByServicePager added in v0.5.0

func (client *APIIssueClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, options *APIIssueClientListByServiceOptions) *runtime.Pager[APIIssueClientListByServiceResponse]

NewListByServicePager - Lists all issues associated with the specified API.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • options - APIIssueClientListByServiceOptions contains the optional parameters for the APIIssueClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssues.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIIssueClient().NewListByServicePager("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", &armapimanagement.APIIssueClientListByServiceOptions{Filter: nil,
		ExpandCommentsAttachments: nil,
		Top:                       nil,
		Skip:                      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.IssueCollection = armapimanagement.IssueCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.IssueContract{
		// 		{
		// 			Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/issues"),
		// 			ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/issues/57d2ef278aa04f0ad01d6cdc"),
		// 			Properties: &armapimanagement.IssueContractProperties{
		// 				APIID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a"),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
		// 				State: to.Ptr(armapimanagement.StateOpen),
		// 				Description: to.Ptr("New API issue description"),
		// 				Title: to.Ptr("New API issue"),
		// 				UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*APIIssueClient) Update

func (client *APIIssueClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, ifMatch string, parameters IssueUpdateContract, options *APIIssueClientUpdateOptions) (APIIssueClientUpdateResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - APIIssueClientUpdateOptions contains the optional parameters for the APIIssueClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiIssue.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIIssueClient().Update(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", "*", armapimanagement.IssueUpdateContract{
		Properties: &armapimanagement.IssueUpdateContractProperties{
			State: to.Ptr(armapimanagement.StateClosed),
		},
	}, 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.IssueContract = armapimanagement.IssueContract{
	// 	Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/issues"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/issues/57d2ef278aa04f0ad01d6cdc"),
	// 	Properties: &armapimanagement.IssueContractProperties{
	// 		APIID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
	// 		State: to.Ptr(armapimanagement.StateOpen),
	// 		Description: to.Ptr("New API issue description"),
	// 		Title: to.Ptr("New API issue"),
	// 		UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
	// 	},
	// }
}
Output:

type APIIssueClientCreateOrUpdateOptions added in v0.3.0

type APIIssueClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

APIIssueClientCreateOrUpdateOptions contains the optional parameters for the APIIssueClient.CreateOrUpdate method.

type APIIssueClientCreateOrUpdateResponse added in v0.3.0

type APIIssueClientCreateOrUpdateResponse struct {
	IssueContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIIssueClientCreateOrUpdateResponse contains the response from method APIIssueClient.CreateOrUpdate.

type APIIssueClientDeleteOptions added in v0.3.0

type APIIssueClientDeleteOptions struct {
}

APIIssueClientDeleteOptions contains the optional parameters for the APIIssueClient.Delete method.

type APIIssueClientDeleteResponse added in v0.3.0

type APIIssueClientDeleteResponse struct {
}

APIIssueClientDeleteResponse contains the response from method APIIssueClient.Delete.

type APIIssueClientGetEntityTagOptions added in v0.3.0

type APIIssueClientGetEntityTagOptions struct {
}

APIIssueClientGetEntityTagOptions contains the optional parameters for the APIIssueClient.GetEntityTag method.

type APIIssueClientGetEntityTagResponse added in v0.3.0

type APIIssueClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIIssueClientGetEntityTagResponse contains the response from method APIIssueClient.GetEntityTag.

type APIIssueClientGetOptions added in v0.3.0

type APIIssueClientGetOptions struct {
	// Expand the comment attachments.
	ExpandCommentsAttachments *bool
}

APIIssueClientGetOptions contains the optional parameters for the APIIssueClient.Get method.

type APIIssueClientGetResponse added in v0.3.0

type APIIssueClientGetResponse struct {
	IssueContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIIssueClientGetResponse contains the response from method APIIssueClient.Get.

type APIIssueClientListByServiceOptions added in v0.3.0

type APIIssueClientListByServiceOptions struct {
	// Expand the comment attachments.
	ExpandCommentsAttachments *bool
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | state | filter | eq | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APIIssueClientListByServiceOptions contains the optional parameters for the APIIssueClient.NewListByServicePager method.

type APIIssueClientListByServiceResponse added in v0.3.0

type APIIssueClientListByServiceResponse struct {
	IssueCollection
}

APIIssueClientListByServiceResponse contains the response from method APIIssueClient.NewListByServicePager.

type APIIssueClientUpdateOptions added in v0.3.0

type APIIssueClientUpdateOptions struct {
}

APIIssueClientUpdateOptions contains the optional parameters for the APIIssueClient.Update method.

type APIIssueClientUpdateResponse added in v0.3.0

type APIIssueClientUpdateResponse struct {
	IssueContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIIssueClientUpdateResponse contains the response from method APIIssueClient.Update.

type APIIssueCommentClient

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

APIIssueCommentClient contains the methods for the APIIssueComment group. Don't use this type directly, use NewAPIIssueCommentClient() instead.

func NewAPIIssueCommentClient

func NewAPIIssueCommentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIIssueCommentClient, error)

NewAPIIssueCommentClient creates a new instance of APIIssueCommentClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIIssueCommentClient) CreateOrUpdate

func (client *APIIssueCommentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, parameters IssueCommentContract, options *APIIssueCommentClientCreateOrUpdateOptions) (APIIssueCommentClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a new Comment for the Issue in an API or updates an existing one. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • commentID - Comment identifier within an Issue. Must be unique in the current Issue.
  • parameters - Create parameters.
  • options - APIIssueCommentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueCommentClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssueComment.json

package main

import (
	"context"
	"log"

	"time"

	"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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIIssueCommentClient().CreateOrUpdate(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", "599e29ab193c3c0bd0b3e2fb", armapimanagement.IssueCommentContract{
		Properties: &armapimanagement.IssueCommentContractProperties{
			CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t }()),
			Text:        to.Ptr("Issue comment."),
			UserID:      to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
		},
	}, &armapimanagement.APIIssueCommentClientCreateOrUpdateOptions{IfMatch: 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.IssueCommentContract = armapimanagement.IssueCommentContract{
	// 	Name: to.Ptr("599e29ab193c3c0bd0b3e2fb"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/issues/comments"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/issues/57d2ef278aa04f0ad01d6cdc/comments/599e29ab193c3c0bd0b3e2fb"),
	// 	Properties: &armapimanagement.IssueCommentContractProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
	// 		Text: to.Ptr("Issue comment."),
	// 		UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
	// 	},
	// }
}
Output:

func (*APIIssueCommentClient) Delete

func (client *APIIssueCommentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, ifMatch string, options *APIIssueCommentClientDeleteOptions) (APIIssueCommentClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • commentID - Comment identifier within an Issue. Must be unique in the current Issue.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APIIssueCommentClientDeleteOptions contains the optional parameters for the APIIssueCommentClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssueComment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIIssueCommentClient().Delete(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", "599e29ab193c3c0bd0b3e2fb", "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIIssueCommentClient) Get

func (client *APIIssueCommentClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, options *APIIssueCommentClientGetOptions) (APIIssueCommentClientGetResponse, error)

Get - Gets the details of the issue Comment for an API specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • commentID - Comment identifier within an Issue. Must be unique in the current Issue.
  • options - APIIssueCommentClientGetOptions contains the optional parameters for the APIIssueCommentClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssueComment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIIssueCommentClient().Get(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", "599e29ab193c3c0bd0b3e2fb", 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.IssueCommentContract = armapimanagement.IssueCommentContract{
	// 	Name: to.Ptr("599e29ab193c3c0bd0b3e2fb"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/issues/comments"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/issues/57d2ef278aa04f0ad01d6cdc/comments/599e29ab193c3c0bd0b3e2fb"),
	// 	Properties: &armapimanagement.IssueCommentContractProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
	// 		Text: to.Ptr("Issue comment."),
	// 		UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
	// 	},
	// }
}
Output:

func (*APIIssueCommentClient) GetEntityTag

func (client *APIIssueCommentClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, options *APIIssueCommentClientGetEntityTagOptions) (APIIssueCommentClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • commentID - Comment identifier within an Issue. Must be unique in the current Issue.
  • options - APIIssueCommentClientGetEntityTagOptions contains the optional parameters for the APIIssueCommentClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssueComment.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIIssueCommentClient().GetEntityTag(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", "599e29ab193c3c0bd0b3e2fb", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIIssueCommentClient) NewListByServicePager added in v0.5.0

func (client *APIIssueCommentClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, issueID string, options *APIIssueCommentClientListByServiceOptions) *runtime.Pager[APIIssueCommentClientListByServiceResponse]

NewListByServicePager - Lists all comments for the Issue associated with the specified API.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • options - APIIssueCommentClientListByServiceOptions contains the optional parameters for the APIIssueCommentClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssueComments.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIIssueCommentClient().NewListByServicePager("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", &armapimanagement.APIIssueCommentClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.IssueCommentCollection = armapimanagement.IssueCommentCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.IssueCommentContract{
		// 		{
		// 			Name: to.Ptr("599e29ab193c3c0bd0b3e2fb"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/issues/comments"),
		// 			ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/issues/57d2ef278aa04f0ad01d6cdc/comments/599e29ab193c3c0bd0b3e2fb"),
		// 			Properties: &armapimanagement.IssueCommentContractProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
		// 				Text: to.Ptr("Issue comment."),
		// 				UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type APIIssueCommentClientCreateOrUpdateOptions added in v0.3.0

type APIIssueCommentClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

APIIssueCommentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueCommentClient.CreateOrUpdate method.

type APIIssueCommentClientCreateOrUpdateResponse added in v0.3.0

type APIIssueCommentClientCreateOrUpdateResponse struct {
	IssueCommentContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIIssueCommentClientCreateOrUpdateResponse contains the response from method APIIssueCommentClient.CreateOrUpdate.

type APIIssueCommentClientDeleteOptions added in v0.3.0

type APIIssueCommentClientDeleteOptions struct {
}

APIIssueCommentClientDeleteOptions contains the optional parameters for the APIIssueCommentClient.Delete method.

type APIIssueCommentClientDeleteResponse added in v0.3.0

type APIIssueCommentClientDeleteResponse struct {
}

APIIssueCommentClientDeleteResponse contains the response from method APIIssueCommentClient.Delete.

type APIIssueCommentClientGetEntityTagOptions added in v0.3.0

type APIIssueCommentClientGetEntityTagOptions struct {
}

APIIssueCommentClientGetEntityTagOptions contains the optional parameters for the APIIssueCommentClient.GetEntityTag method.

type APIIssueCommentClientGetEntityTagResponse added in v0.3.0

type APIIssueCommentClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIIssueCommentClientGetEntityTagResponse contains the response from method APIIssueCommentClient.GetEntityTag.

type APIIssueCommentClientGetOptions added in v0.3.0

type APIIssueCommentClientGetOptions struct {
}

APIIssueCommentClientGetOptions contains the optional parameters for the APIIssueCommentClient.Get method.

type APIIssueCommentClientGetResponse added in v0.3.0

type APIIssueCommentClientGetResponse struct {
	IssueCommentContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIIssueCommentClientGetResponse contains the response from method APIIssueCommentClient.Get.

type APIIssueCommentClientListByServiceOptions added in v0.3.0

type APIIssueCommentClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APIIssueCommentClientListByServiceOptions contains the optional parameters for the APIIssueCommentClient.NewListByServicePager method.

type APIIssueCommentClientListByServiceResponse added in v0.3.0

type APIIssueCommentClientListByServiceResponse struct {
	IssueCommentCollection
}

APIIssueCommentClientListByServiceResponse contains the response from method APIIssueCommentClient.NewListByServicePager.

type APILicenseInformation

type APILicenseInformation struct {
	// The license name used for the API
	Name *string

	// A URL to the license used for the API. MUST be in the format of a URL
	URL *string
}

APILicenseInformation - API license information

func (APILicenseInformation) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APILicenseInformation.

func (*APILicenseInformation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APILicenseInformation.

type APIManagementSKUCapacityScaleType

type APIManagementSKUCapacityScaleType string

APIManagementSKUCapacityScaleType - The scale type applicable to the sku.

const (
	APIManagementSKUCapacityScaleTypeAutomatic APIManagementSKUCapacityScaleType = "Automatic"
	APIManagementSKUCapacityScaleTypeManual    APIManagementSKUCapacityScaleType = "Manual"
	APIManagementSKUCapacityScaleTypeNone      APIManagementSKUCapacityScaleType = "None"
)

func PossibleAPIManagementSKUCapacityScaleTypeValues

func PossibleAPIManagementSKUCapacityScaleTypeValues() []APIManagementSKUCapacityScaleType

PossibleAPIManagementSKUCapacityScaleTypeValues returns the possible values for the APIManagementSKUCapacityScaleType const type.

type APIManagementSKURestrictionsReasonCode

type APIManagementSKURestrictionsReasonCode string

APIManagementSKURestrictionsReasonCode - The reason for restriction.

const (
	APIManagementSKURestrictionsReasonCodeQuotaID                     APIManagementSKURestrictionsReasonCode = "QuotaId"
	APIManagementSKURestrictionsReasonCodeNotAvailableForSubscription APIManagementSKURestrictionsReasonCode = "NotAvailableForSubscription"
)

func PossibleAPIManagementSKURestrictionsReasonCodeValues

func PossibleAPIManagementSKURestrictionsReasonCodeValues() []APIManagementSKURestrictionsReasonCode

PossibleAPIManagementSKURestrictionsReasonCodeValues returns the possible values for the APIManagementSKURestrictionsReasonCode const type.

type APIManagementSKURestrictionsType

type APIManagementSKURestrictionsType string

APIManagementSKURestrictionsType - The type of restrictions.

const (
	APIManagementSKURestrictionsTypeLocation APIManagementSKURestrictionsType = "Location"
	APIManagementSKURestrictionsTypeZone     APIManagementSKURestrictionsType = "Zone"
)

func PossibleAPIManagementSKURestrictionsTypeValues

func PossibleAPIManagementSKURestrictionsTypeValues() []APIManagementSKURestrictionsType

PossibleAPIManagementSKURestrictionsTypeValues returns the possible values for the APIManagementSKURestrictionsType const type.

type APIOperationClient

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

APIOperationClient contains the methods for the APIOperation group. Don't use this type directly, use NewAPIOperationClient() instead.

func NewAPIOperationClient

func NewAPIOperationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIOperationClient, error)

NewAPIOperationClient creates a new instance of APIOperationClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIOperationClient) CreateOrUpdate

func (client *APIOperationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, parameters OperationContract, options *APIOperationClientCreateOrUpdateOptions) (APIOperationClientCreateOrUpdateResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • parameters - Create parameters.
  • options - APIOperationClientCreateOrUpdateOptions contains the optional parameters for the APIOperationClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperation.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIOperationClient().CreateOrUpdate(ctx, "rg1", "apimService1", "PetStoreTemplate2", "newoperations", armapimanagement.OperationContract{
		Properties: &armapimanagement.OperationContractProperties{
			Description:        to.Ptr("This can only be done by the logged in user."),
			TemplateParameters: []*armapimanagement.ParameterContract{},
			Request: &armapimanagement.RequestContract{
				Description:     to.Ptr("Created user object"),
				Headers:         []*armapimanagement.ParameterContract{},
				QueryParameters: []*armapimanagement.ParameterContract{},
				Representations: []*armapimanagement.RepresentationContract{
					{
						ContentType: to.Ptr("application/json"),
						SchemaID:    to.Ptr("592f6c1d0af5840ca8897f0c"),
						TypeName:    to.Ptr("User"),
					}},
			},
			Responses: []*armapimanagement.ResponseContract{
				{
					Description: to.Ptr("successful operation"),
					Headers:     []*armapimanagement.ParameterContract{},
					Representations: []*armapimanagement.RepresentationContract{
						{
							ContentType: to.Ptr("application/xml"),
						},
						{
							ContentType: to.Ptr("application/json"),
						}},
					StatusCode: to.Ptr[int32](200),
				}},
			Method:      to.Ptr("POST"),
			DisplayName: to.Ptr("createUser2"),
			URLTemplate: to.Ptr("/user1"),
		},
	}, &armapimanagement.APIOperationClientCreateOrUpdateOptions{IfMatch: 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.OperationContract = armapimanagement.OperationContract{
	// 	Name: to.Ptr("newoperations"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/PetStoreTemplate2/operations/newoperations"),
	// 	Properties: &armapimanagement.OperationContractProperties{
	// 		Description: to.Ptr("This can only be done by the logged in user."),
	// 		TemplateParameters: []*armapimanagement.ParameterContract{
	// 		},
	// 		Request: &armapimanagement.RequestContract{
	// 			Description: to.Ptr("Created user object"),
	// 			Headers: []*armapimanagement.ParameterContract{
	// 			},
	// 			QueryParameters: []*armapimanagement.ParameterContract{
	// 			},
	// 			Representations: []*armapimanagement.RepresentationContract{
	// 				{
	// 					ContentType: to.Ptr("application/json"),
	// 					SchemaID: to.Ptr("592f6c1d0af5840ca8897f0c"),
	// 					TypeName: to.Ptr("User"),
	// 			}},
	// 		},
	// 		Responses: []*armapimanagement.ResponseContract{
	// 			{
	// 				Description: to.Ptr("successful operation"),
	// 				Headers: []*armapimanagement.ParameterContract{
	// 				},
	// 				Representations: []*armapimanagement.RepresentationContract{
	// 					{
	// 						ContentType: to.Ptr("application/xml"),
	// 					},
	// 					{
	// 						ContentType: to.Ptr("application/json"),
	// 				}},
	// 				StatusCode: to.Ptr[int32](200),
	// 		}},
	// 		Method: to.Ptr("POST"),
	// 		DisplayName: to.Ptr("createUser2"),
	// 		URLTemplate: to.Ptr("/user1"),
	// 	},
	// }
}
Output:

func (*APIOperationClient) Delete

func (client *APIOperationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, ifMatch string, options *APIOperationClientDeleteOptions) (APIOperationClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APIOperationClientDeleteOptions contains the optional parameters for the APIOperationClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIOperationClient().Delete(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIOperationClient) Get

func (client *APIOperationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, options *APIOperationClientGetOptions) (APIOperationClientGetResponse, error)

Get - Gets the details of the API Operation specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • options - APIOperationClientGetOptions contains the optional parameters for the APIOperationClient.Get method.
Example (ApiManagementGetApiOperation)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIOperationClient().Get(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", 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.OperationContract = armapimanagement.OperationContract{
	// 	Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/operations/57d2ef278aa04f0ad01d6cdc"),
	// 	Properties: &armapimanagement.OperationContractProperties{
	// 		TemplateParameters: []*armapimanagement.ParameterContract{
	// 		},
	// 		Request: &armapimanagement.RequestContract{
	// 			Description: to.Ptr("IFazioService_CancelOrder_InputMessage"),
	// 			Headers: []*armapimanagement.ParameterContract{
	// 			},
	// 			QueryParameters: []*armapimanagement.ParameterContract{
	// 			},
	// 			Representations: []*armapimanagement.RepresentationContract{
	// 				{
	// 					ContentType: to.Ptr("text/xml"),
	// 					SchemaID: to.Ptr("6980a395-f08b-4a59-8295-1440cbd909b8"),
	// 					TypeName: to.Ptr("CancelOrder"),
	// 			}},
	// 		},
	// 		Responses: []*armapimanagement.ResponseContract{
	// 			{
	// 				Description: to.Ptr("IFazioService_CancelOrder_OutputMessage"),
	// 				Headers: []*armapimanagement.ParameterContract{
	// 				},
	// 				Representations: []*armapimanagement.RepresentationContract{
	// 					{
	// 						ContentType: to.Ptr("text/xml"),
	// 						SchemaID: to.Ptr("6980a395-f08b-4a59-8295-1440cbd909b8"),
	// 						TypeName: to.Ptr("CancelOrderResponse"),
	// 				}},
	// 				StatusCode: to.Ptr[int32](200),
	// 		}},
	// 		Method: to.Ptr("POST"),
	// 		DisplayName: to.Ptr("CancelOrder"),
	// 		URLTemplate: to.Ptr("/?soapAction=http://tempuri.org/IFazioService/CancelOrder"),
	// 	},
	// }
}
Output:

Example (ApiManagementGetApiOperationPetStore)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationPetStore.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIOperationClient().Get(ctx, "rg1", "apimService1", "swagger-petstore", "loginUser", 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.OperationContract = armapimanagement.OperationContract{
	// 	Name: to.Ptr("loginUser"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/swagger-petstore/operations/loginUser"),
	// 	Properties: &armapimanagement.OperationContractProperties{
	// 		Description: to.Ptr(""),
	// 		TemplateParameters: []*armapimanagement.ParameterContract{
	// 			{
	// 				Name: to.Ptr("username"),
	// 				Type: to.Ptr("string"),
	// 				Description: to.Ptr("The user name for login"),
	// 				Required: to.Ptr(true),
	// 				Values: []*string{
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("password"),
	// 				Type: to.Ptr("string"),
	// 				Description: to.Ptr("The password for login in clear text"),
	// 				Required: to.Ptr(true),
	// 				Values: []*string{
	// 				},
	// 		}},
	// 		Request: &armapimanagement.RequestContract{
	// 			Headers: []*armapimanagement.ParameterContract{
	// 			},
	// 			QueryParameters: []*armapimanagement.ParameterContract{
	// 			},
	// 			Representations: []*armapimanagement.RepresentationContract{
	// 			},
	// 		},
	// 		Responses: []*armapimanagement.ResponseContract{
	// 			{
	// 				Description: to.Ptr("successful operation"),
	// 				Headers: []*armapimanagement.ParameterContract{
	// 					{
	// 						Name: to.Ptr("X-Rate-Limit"),
	// 						Type: to.Ptr("integer"),
	// 						Description: to.Ptr("calls per hour allowed by the user"),
	// 						Values: []*string{
	// 						},
	// 					},
	// 					{
	// 						Name: to.Ptr("X-Expires-After"),
	// 						Type: to.Ptr("string"),
	// 						Description: to.Ptr("date in UTC when token expires"),
	// 						Values: []*string{
	// 						},
	// 				}},
	// 				Representations: []*armapimanagement.RepresentationContract{
	// 					{
	// 						ContentType: to.Ptr("application/xml"),
	// 						SchemaID: to.Ptr("5ba91a35f373b513a0bf31c6"),
	// 						TypeName: to.Ptr("UserLoginGet200ApplicationXmlResponse"),
	// 					},
	// 					{
	// 						ContentType: to.Ptr("application/json"),
	// 						SchemaID: to.Ptr("5ba91a35f373b513a0bf31c6"),
	// 						TypeName: to.Ptr("UserLoginGet200ApplicationJsonResponse"),
	// 				}},
	// 				StatusCode: to.Ptr[int32](200),
	// 			},
	// 			{
	// 				Description: to.Ptr("Invalid username/password supplied"),
	// 				Headers: []*armapimanagement.ParameterContract{
	// 				},
	// 				Representations: []*armapimanagement.RepresentationContract{
	// 					{
	// 						ContentType: to.Ptr("application/xml"),
	// 					},
	// 					{
	// 						ContentType: to.Ptr("application/json"),
	// 				}},
	// 				StatusCode: to.Ptr[int32](400),
	// 		}},
	// 		Method: to.Ptr("GET"),
	// 		DisplayName: to.Ptr("Logs user into the system"),
	// 		URLTemplate: to.Ptr("/user/login?username={username}&password={password}"),
	// 	},
	// }
}
Output:

func (*APIOperationClient) GetEntityTag

func (client *APIOperationClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, options *APIOperationClientGetEntityTagOptions) (APIOperationClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the API operation specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • options - APIOperationClientGetEntityTagOptions contains the optional parameters for the APIOperationClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIOperationClient().GetEntityTag(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIOperationClient) NewListByAPIPager added in v0.5.0

func (client *APIOperationClient) NewListByAPIPager(resourceGroupName string, serviceName string, apiID string, options *APIOperationClientListByAPIOptions) *runtime.Pager[APIOperationClientListByAPIResponse]

NewListByAPIPager - Lists a collection of the operations for the specified API.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - APIOperationClientListByAPIOptions contains the optional parameters for the APIOperationClient.NewListByAPIPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIOperationClient().NewListByAPIPager("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", &armapimanagement.APIOperationClientListByAPIOptions{Filter: nil,
		Top:  nil,
		Skip: nil,
		Tags: 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.OperationCollection = armapimanagement.OperationCollection{
		// 	Count: to.Ptr[int64](5),
		// 	Value: []*armapimanagement.OperationContract{
		// 		{
		// 			Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/operations/57d2ef278aa04f0ad01d6cdc"),
		// 			Properties: &armapimanagement.OperationContractProperties{
		// 				Method: to.Ptr("POST"),
		// 				DisplayName: to.Ptr("CancelOrder"),
		// 				URLTemplate: to.Ptr("/?soapAction=http://tempuri.org/IFazioService/CancelOrder"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("57d2ef278aa04f0ad01d6cda"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/operations/57d2ef278aa04f0ad01d6cda"),
		// 			Properties: &armapimanagement.OperationContractProperties{
		// 				Method: to.Ptr("POST"),
		// 				DisplayName: to.Ptr("GetMostRecentOrder"),
		// 				URLTemplate: to.Ptr("/?soapAction=http://tempuri.org/IFazioService/GetMostRecentOrder"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("57d2ef278aa04f0ad01d6cd9"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/operations/57d2ef278aa04f0ad01d6cd9"),
		// 			Properties: &armapimanagement.OperationContractProperties{
		// 				Method: to.Ptr("POST"),
		// 				DisplayName: to.Ptr("GetOpenOrders"),
		// 				URLTemplate: to.Ptr("/?soapAction=http://tempuri.org/IFazioService/GetOpenOrders"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("57d2ef278aa04f0ad01d6cdb"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/operations/57d2ef278aa04f0ad01d6cdb"),
		// 			Properties: &armapimanagement.OperationContractProperties{
		// 				Method: to.Ptr("POST"),
		// 				DisplayName: to.Ptr("GetOrder"),
		// 				URLTemplate: to.Ptr("/?soapAction=http://tempuri.org/IFazioService/GetOrder"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("57d2ef278aa04f0ad01d6cd8"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/operations/57d2ef278aa04f0ad01d6cd8"),
		// 			Properties: &armapimanagement.OperationContractProperties{
		// 				Method: to.Ptr("POST"),
		// 				DisplayName: to.Ptr("submitOrder"),
		// 				URLTemplate: to.Ptr("/?soapAction=http://tempuri.org/IFazioService/submitOrder"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*APIOperationClient) Update

func (client *APIOperationClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, ifMatch string, parameters OperationUpdateContract, options *APIOperationClientUpdateOptions) (APIOperationClientUpdateResponse, error)

Update - Updates the details of the operation in the API specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - API Operation Update parameters.
  • options - APIOperationClientUpdateOptions contains the optional parameters for the APIOperationClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiOperation.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIOperationClient().Update(ctx, "rg1", "apimService1", "echo-api", "operationId", "*", armapimanagement.OperationUpdateContract{
		Properties: &armapimanagement.OperationUpdateContractProperties{
			TemplateParameters: []*armapimanagement.ParameterContract{},
			Request: &armapimanagement.RequestContract{
				QueryParameters: []*armapimanagement.ParameterContract{
					{
						Name:         to.Ptr("param1"),
						Type:         to.Ptr("string"),
						Description:  to.Ptr("A sample parameter that is required and has a default value of \"sample\"."),
						DefaultValue: to.Ptr("sample"),
						Required:     to.Ptr(true),
						Values: []*string{
							to.Ptr("sample")},
					}},
			},
			Responses: []*armapimanagement.ResponseContract{
				{
					Description:     to.Ptr("Returned in all cases."),
					Headers:         []*armapimanagement.ParameterContract{},
					Representations: []*armapimanagement.RepresentationContract{},
					StatusCode:      to.Ptr[int32](200),
				},
				{
					Description:     to.Ptr("Server Error."),
					Headers:         []*armapimanagement.ParameterContract{},
					Representations: []*armapimanagement.RepresentationContract{},
					StatusCode:      to.Ptr[int32](500),
				}},
			Method:      to.Ptr("GET"),
			DisplayName: to.Ptr("Retrieve resource"),
			URLTemplate: to.Ptr("/resource"),
		},
	}, 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.OperationContract = armapimanagement.OperationContract{
	// 	Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/operations/57d2ef278aa04f0ad01d6cdc"),
	// 	Properties: &armapimanagement.OperationContractProperties{
	// 		TemplateParameters: []*armapimanagement.ParameterContract{
	// 		},
	// 		Request: &armapimanagement.RequestContract{
	// 			Description: to.Ptr("IFazioService_CancelOrder_InputMessage"),
	// 			Headers: []*armapimanagement.ParameterContract{
	// 			},
	// 			QueryParameters: []*armapimanagement.ParameterContract{
	// 			},
	// 			Representations: []*armapimanagement.RepresentationContract{
	// 				{
	// 					ContentType: to.Ptr("text/xml"),
	// 					SchemaID: to.Ptr("6980a395-f08b-4a59-8295-1440cbd909b8"),
	// 					TypeName: to.Ptr("CancelOrder"),
	// 			}},
	// 		},
	// 		Responses: []*armapimanagement.ResponseContract{
	// 			{
	// 				Description: to.Ptr("IFazioService_CancelOrder_OutputMessage"),
	// 				Headers: []*armapimanagement.ParameterContract{
	// 				},
	// 				Representations: []*armapimanagement.RepresentationContract{
	// 					{
	// 						ContentType: to.Ptr("text/xml"),
	// 						SchemaID: to.Ptr("6980a395-f08b-4a59-8295-1440cbd909b8"),
	// 						TypeName: to.Ptr("CancelOrderResponse"),
	// 				}},
	// 				StatusCode: to.Ptr[int32](200),
	// 		}},
	// 		Method: to.Ptr("POST"),
	// 		DisplayName: to.Ptr("CancelOrder"),
	// 		URLTemplate: to.Ptr("/?soapAction=http://tempuri.org/IFazioService/CancelOrder"),
	// 	},
	// }
}
Output:

type APIOperationClientCreateOrUpdateOptions added in v0.3.0

type APIOperationClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

APIOperationClientCreateOrUpdateOptions contains the optional parameters for the APIOperationClient.CreateOrUpdate method.

type APIOperationClientCreateOrUpdateResponse added in v0.3.0

type APIOperationClientCreateOrUpdateResponse struct {
	OperationContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIOperationClientCreateOrUpdateResponse contains the response from method APIOperationClient.CreateOrUpdate.

type APIOperationClientDeleteOptions added in v0.3.0

type APIOperationClientDeleteOptions struct {
}

APIOperationClientDeleteOptions contains the optional parameters for the APIOperationClient.Delete method.

type APIOperationClientDeleteResponse added in v0.3.0

type APIOperationClientDeleteResponse struct {
}

APIOperationClientDeleteResponse contains the response from method APIOperationClient.Delete.

type APIOperationClientGetEntityTagOptions added in v0.3.0

type APIOperationClientGetEntityTagOptions struct {
}

APIOperationClientGetEntityTagOptions contains the optional parameters for the APIOperationClient.GetEntityTag method.

type APIOperationClientGetEntityTagResponse added in v0.3.0

type APIOperationClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIOperationClientGetEntityTagResponse contains the response from method APIOperationClient.GetEntityTag.

type APIOperationClientGetOptions added in v0.3.0

type APIOperationClientGetOptions struct {
}

APIOperationClientGetOptions contains the optional parameters for the APIOperationClient.Get method.

type APIOperationClientGetResponse added in v0.3.0

type APIOperationClientGetResponse struct {
	OperationContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIOperationClientGetResponse contains the response from method APIOperationClient.Get.

type APIOperationClientListByAPIOptions added in v0.3.0

type APIOperationClientListByAPIOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Include tags in the response.
	Tags *string
	// Number of records to return.
	Top *int32
}

APIOperationClientListByAPIOptions contains the optional parameters for the APIOperationClient.NewListByAPIPager method.

type APIOperationClientListByAPIResponse added in v0.3.0

type APIOperationClientListByAPIResponse struct {
	OperationCollection
}

APIOperationClientListByAPIResponse contains the response from method APIOperationClient.NewListByAPIPager.

type APIOperationClientUpdateOptions added in v0.3.0

type APIOperationClientUpdateOptions struct {
}

APIOperationClientUpdateOptions contains the optional parameters for the APIOperationClient.Update method.

type APIOperationClientUpdateResponse added in v0.3.0

type APIOperationClientUpdateResponse struct {
	OperationContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIOperationClientUpdateResponse contains the response from method APIOperationClient.Update.

type APIOperationPolicyClient

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

APIOperationPolicyClient contains the methods for the APIOperationPolicy group. Don't use this type directly, use NewAPIOperationPolicyClient() instead.

func NewAPIOperationPolicyClient

func NewAPIOperationPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIOperationPolicyClient, error)

NewAPIOperationPolicyClient creates a new instance of APIOperationPolicyClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIOperationPolicyClient) CreateOrUpdate

func (client *APIOperationPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, parameters PolicyContract, options *APIOperationPolicyClientCreateOrUpdateOptions) (APIOperationPolicyClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates policy configuration for the API Operation level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • policyID - The identifier of the Policy.
  • parameters - The policy contents to apply.
  • options - APIOperationPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIOperationPolicyClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperationPolicy.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIOperationPolicyClient().CreateOrUpdate(ctx, "rg1", "apimService1", "5600b57e7e8880006a040001", "5600b57e7e8880006a080001", armapimanagement.PolicyIDNamePolicy, armapimanagement.PolicyContract{
		Properties: &armapimanagement.PolicyContractProperties{
			Format: to.Ptr(armapimanagement.PolicyContentFormatXML),
			Value:  to.Ptr("<policies> <inbound /> <backend>    <forward-request />  </backend>  <outbound /></policies>"),
		},
	}, &armapimanagement.APIOperationPolicyClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")})
	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.PolicyContract = armapimanagement.PolicyContract{
	// 	Name: to.Ptr("policy"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations/policies"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5600b57e7e8880006a040001/operations/5600b57e7e8880006a080001/policies/policy"),
	// 	Properties: &armapimanagement.PolicyContractProperties{
	// 		Value: to.Ptr("<policies>\r\n  <inbound />\r\n  <backend>\r\n    <forward-request />\r\n  </backend>\r\n  <outbound />\r\n</policies>"),
	// 	},
	// }
}
Output:

func (*APIOperationPolicyClient) Delete

func (client *APIOperationPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, ifMatch string, options *APIOperationPolicyClientDeleteOptions) (APIOperationPolicyClientDeleteResponse, error)

Delete - Deletes the policy configuration at the Api Operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • policyID - The identifier of the Policy.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APIOperationPolicyClientDeleteOptions contains the optional parameters for the APIOperationPolicyClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperationPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIOperationPolicyClient().Delete(ctx, "rg1", "apimService1", "testapi", "testoperation", armapimanagement.PolicyIDNamePolicy, "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIOperationPolicyClient) Get

func (client *APIOperationPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, options *APIOperationPolicyClientGetOptions) (APIOperationPolicyClientGetResponse, error)

Get - Get the policy configuration at the API Operation level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • policyID - The identifier of the Policy.
  • options - APIOperationPolicyClientGetOptions contains the optional parameters for the APIOperationPolicyClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIOperationPolicyClient().Get(ctx, "rg1", "apimService1", "5600b539c53f5b0062040001", "5600b53ac53f5b0062080006", armapimanagement.PolicyIDNamePolicy, &armapimanagement.APIOperationPolicyClientGetOptions{Format: 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.PolicyContract = armapimanagement.PolicyContract{
	// 	Name: to.Ptr("policy"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations/policies"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5600b539c53f5b0062040001/operations/5600b53ac53f5b0062080006/policies/policy"),
	// 	Properties: &armapimanagement.PolicyContractProperties{
	// 		Value: to.Ptr("<policies>\r\n  <inbound>\r\n    <base />\r\n  </inbound>\r\n  <backend>\r\n    <base />\r\n  </backend>\r\n  <outbound>\r\n    <base />\r\n    <set-header name=\"X-My-Sample\" exists-action=\"override\">\r\n      <value>This is a sample</value>\r\n      <!-- for multiple headers with the same name add additional value elements -->\r\n    </set-header>\r\n    <jsonp callback-parameter-name=\"ProcessResponse\" />\r\n  </outbound>\r\n</policies>"),
	// 	},
	// }
}
Output:

func (*APIOperationPolicyClient) GetEntityTag

func (client *APIOperationPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, options *APIOperationPolicyClientGetEntityTagOptions) (APIOperationPolicyClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the API operation policy specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • policyID - The identifier of the Policy.
  • options - APIOperationPolicyClientGetEntityTagOptions contains the optional parameters for the APIOperationPolicyClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperationPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIOperationPolicyClient().GetEntityTag(ctx, "rg1", "apimService1", "5600b539c53f5b0062040001", "5600b53ac53f5b0062080006", armapimanagement.PolicyIDNamePolicy, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIOperationPolicyClient) ListByOperation

func (client *APIOperationPolicyClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, options *APIOperationPolicyClientListByOperationOptions) (APIOperationPolicyClientListByOperationResponse, error)

ListByOperation - Get the list of policy configuration at the API Operation level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • options - APIOperationPolicyClientListByOperationOptions contains the optional parameters for the APIOperationPolicyClient.ListByOperation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationPolicies.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIOperationPolicyClient().ListByOperation(ctx, "rg1", "apimService1", "599e2953193c3c0bd0b3e2fa", "599e29ab193c3c0bd0b3e2fb", 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.PolicyCollection = armapimanagement.PolicyCollection{
	// 	Count: to.Ptr[int64](1),
	// 	Value: []*armapimanagement.PolicyContract{
	// 		{
	// 			Name: to.Ptr("policy"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations/policies"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/599e2953193c3c0bd0b3e2fa/operations/599e29ab193c3c0bd0b3e2fb/policies/policy"),
	// 			Properties: &armapimanagement.PolicyContractProperties{
	// 				Value: to.Ptr("<!--\r\n    IMPORTANT:\r\n    - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\r\n    - Only the <forward-request> policy element can appear within the <backend> section element.\r\n    - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\r\n    - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\r\n    - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\r\n    - To remove a policy, delete the corresponding policy statement from the policy document.\r\n    - Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.\r\n    - Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.\r\n    - Policies are applied in the order of their appearance, from the top down.\r\n-->\r\n<policies>\r\n  <inbound>\r\n    <validate-jwt header-name=\"dd\">\r\n      <required-claims>\r\n        <claim name=\"bla\" separator=\"\">\r\n          <value>xxx</value>\r\n        </claim>\r\n      </required-claims>\r\n    </validate-jwt>\r\n    <base />\r\n  </inbound>\r\n  <backend>\r\n    <base />\r\n  </backend>\r\n  <outbound>\r\n    <base />\r\n  </outbound>\r\n</policies>"),
	// 			},
	// 	}},
	// }
}
Output:

type APIOperationPolicyClientCreateOrUpdateOptions added in v0.3.0

type APIOperationPolicyClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

APIOperationPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIOperationPolicyClient.CreateOrUpdate method.

type APIOperationPolicyClientCreateOrUpdateResponse added in v0.3.0

type APIOperationPolicyClientCreateOrUpdateResponse struct {
	PolicyContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIOperationPolicyClientCreateOrUpdateResponse contains the response from method APIOperationPolicyClient.CreateOrUpdate.

type APIOperationPolicyClientDeleteOptions added in v0.3.0

type APIOperationPolicyClientDeleteOptions struct {
}

APIOperationPolicyClientDeleteOptions contains the optional parameters for the APIOperationPolicyClient.Delete method.

type APIOperationPolicyClientDeleteResponse added in v0.3.0

type APIOperationPolicyClientDeleteResponse struct {
}

APIOperationPolicyClientDeleteResponse contains the response from method APIOperationPolicyClient.Delete.

type APIOperationPolicyClientGetEntityTagOptions added in v0.3.0

type APIOperationPolicyClientGetEntityTagOptions struct {
}

APIOperationPolicyClientGetEntityTagOptions contains the optional parameters for the APIOperationPolicyClient.GetEntityTag method.

type APIOperationPolicyClientGetEntityTagResponse added in v0.3.0

type APIOperationPolicyClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIOperationPolicyClientGetEntityTagResponse contains the response from method APIOperationPolicyClient.GetEntityTag.

type APIOperationPolicyClientGetOptions added in v0.3.0

type APIOperationPolicyClientGetOptions struct {
	// Policy Export Format.
	Format *PolicyExportFormat
}

APIOperationPolicyClientGetOptions contains the optional parameters for the APIOperationPolicyClient.Get method.

type APIOperationPolicyClientGetResponse added in v0.3.0

type APIOperationPolicyClientGetResponse struct {
	PolicyContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIOperationPolicyClientGetResponse contains the response from method APIOperationPolicyClient.Get.

type APIOperationPolicyClientListByOperationOptions added in v0.3.0

type APIOperationPolicyClientListByOperationOptions struct {
}

APIOperationPolicyClientListByOperationOptions contains the optional parameters for the APIOperationPolicyClient.ListByOperation method.

type APIOperationPolicyClientListByOperationResponse added in v0.3.0

type APIOperationPolicyClientListByOperationResponse struct {
	PolicyCollection
}

APIOperationPolicyClientListByOperationResponse contains the response from method APIOperationPolicyClient.ListByOperation.

type APIPolicyClient

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

APIPolicyClient contains the methods for the APIPolicy group. Don't use this type directly, use NewAPIPolicyClient() instead.

func NewAPIPolicyClient

func NewAPIPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIPolicyClient, error)

NewAPIPolicyClient creates a new instance of APIPolicyClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIPolicyClient) CreateOrUpdate

func (client *APIPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, parameters PolicyContract, options *APIPolicyClientCreateOrUpdateOptions) (APIPolicyClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates policy configuration for the API. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • policyID - The identifier of the Policy.
  • parameters - The policy contents to apply.
  • options - APIPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIPolicyClient.CreateOrUpdate method.
Example (ApiManagementCreateApiPolicy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiPolicy.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIPolicyClient().CreateOrUpdate(ctx, "rg1", "apimService1", "5600b57e7e8880006a040001", armapimanagement.PolicyIDNamePolicy, armapimanagement.PolicyContract{
		Properties: &armapimanagement.PolicyContractProperties{
			Format: to.Ptr(armapimanagement.PolicyContentFormatXML),
			Value:  to.Ptr("<policies> <inbound /> <backend>    <forward-request />  </backend>  <outbound /></policies>"),
		},
	}, &armapimanagement.APIPolicyClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")})
	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.PolicyContract = armapimanagement.PolicyContract{
	// 	Name: to.Ptr("policy"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/policies"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5600b57e7e8880006a040001/policies/policy"),
	// 	Properties: &armapimanagement.PolicyContractProperties{
	// 		Value: to.Ptr("<policies>\r\n  <inbound />\r\n  <backend>\r\n    <forward-request />\r\n  </backend>\r\n  <outbound />\r\n</policies>"),
	// 	},
	// }
}
Output:

Example (ApiManagementCreateApiPolicyNonXmlEncoded)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiPolicyNonXmlEncoded.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIPolicyClient().CreateOrUpdate(ctx, "rg1", "apimService1", "5600b57e7e8880006a040001", armapimanagement.PolicyIDNamePolicy, armapimanagement.PolicyContract{
		Properties: &armapimanagement.PolicyContractProperties{
			Format: to.Ptr(armapimanagement.PolicyContentFormatRawxml),
			Value:  to.Ptr("<policies>\r\n     <inbound>\r\n     <base />\r\n  <set-header name=\"newvalue\" exists-action=\"override\">\r\n   <value>\"@(context.Request.Headers.FirstOrDefault(h => h.Ke==\"Via\"))\" </value>\r\n    </set-header>\r\n  </inbound>\r\n      </policies>"),
		},
	}, &armapimanagement.APIPolicyClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")})
	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.PolicyContract = armapimanagement.PolicyContract{
	// 	Name: to.Ptr("policy"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/operations/policies"),
	// 	ID: to.Ptr("/subscriptions/4c1a3bc6-89f9-46fe-a175-5d8984b25095/resourcegroups/Api-DF-West-US/providers/Microsoft.ApiManagement/service/samirmsiservice2/apis/echo-api/operations/create-resource/policies/policy"),
	// 	Properties: &armapimanagement.PolicyContractProperties{
	// 		Value: to.Ptr("<policies>\r\n  <inbound>\r\n    <base />\r\n    <set-header name=\"newvalue\" exists-action=\"override\">\r\n      <value>\"@(context.Request.Headers.FirstOrDefault(h =&gt; h.Ke==\"Via\"))\" </value>\r\n    </set-header>\r\n  </inbound>\r\n</policies>"),
	// 	},
	// }
}
Output:

func (*APIPolicyClient) Delete

func (client *APIPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, ifMatch string, options *APIPolicyClientDeleteOptions) (APIPolicyClientDeleteResponse, error)

Delete - Deletes the policy configuration at the Api. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • policyID - The identifier of the Policy.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APIPolicyClientDeleteOptions contains the optional parameters for the APIPolicyClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIPolicyClient().Delete(ctx, "rg1", "apimService1", "loggerId", armapimanagement.PolicyIDNamePolicy, "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIPolicyClient) Get

func (client *APIPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, options *APIPolicyClientGetOptions) (APIPolicyClientGetResponse, error)

Get - Get the policy configuration at the API level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • policyID - The identifier of the Policy.
  • options - APIPolicyClientGetOptions contains the optional parameters for the APIPolicyClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIPolicyClient().Get(ctx, "rg1", "apimService1", "5600b59475ff190048040001", armapimanagement.PolicyIDNamePolicy, &armapimanagement.APIPolicyClientGetOptions{Format: 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.PolicyContract = armapimanagement.PolicyContract{
	// 	Name: to.Ptr("policy"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/policies"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5600b59475ff190048040001/policies/policy"),
	// 	Properties: &armapimanagement.PolicyContractProperties{
	// 		Value: to.Ptr("<!--\r\n    IMPORTANT:\r\n    - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\r\n    - Only the <forward-request> policy element can appear within the <backend> section element.\r\n    - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\r\n    - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\r\n    - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\r\n    - To remove a policy, delete the corresponding policy statement from the policy document.\r\n    - Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.\r\n    - Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.\r\n    - Policies are applied in the order of their appearance, from the top down.\r\n-->\r\n<policies>\r\n  <inbound>\r\n    <quota-by-key calls=\"5\" bandwidth=\"2\" renewal-period=\"&#x9;P3Y6M4DT12H30M5S\" counter-key=\"ba\" />\r\n    <base />\r\n  </inbound>\r\n  <backend>\r\n    <base />\r\n  </backend>\r\n  <outbound>\r\n    <log-to-eventhub logger-id=\"apimService1\" partition-key=\"@(context.Subscription.Id)\">\r\n@{\r\n	Random Random = new Random();\r\n				const string Chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \";                \r\n                return string.Join(\",\", DateTime.UtcNow, new string(\r\n                    Enumerable.Repeat(Chars, Random.Next(2150400))\r\n                              .Select(s =&gt; s[Random.Next(s.Length)])\r\n                              .ToArray()));\r\n          }                           \r\n                        </log-to-eventhub>\r\n    <base />\r\n  </outbound>\r\n</policies>"),
	// 	},
	// }
}
Output:

func (*APIPolicyClient) GetEntityTag

func (client *APIPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, options *APIPolicyClientGetEntityTagOptions) (APIPolicyClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the API policy specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • policyID - The identifier of the Policy.
  • options - APIPolicyClientGetEntityTagOptions contains the optional parameters for the APIPolicyClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIPolicyClient().GetEntityTag(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", armapimanagement.PolicyIDNamePolicy, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIPolicyClient) ListByAPI

func (client *APIPolicyClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIPolicyClientListByAPIOptions) (APIPolicyClientListByAPIResponse, error)

ListByAPI - Get the policy configuration at the API level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - APIPolicyClientListByAPIOptions contains the optional parameters for the APIPolicyClient.ListByAPI method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiPolicies.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIPolicyClient().ListByAPI(ctx, "rg1", "apimService1", "5600b59475ff190048040001", 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.PolicyCollection = armapimanagement.PolicyCollection{
	// 	Count: to.Ptr[int64](1),
	// 	Value: []*armapimanagement.PolicyContract{
	// 		{
	// 			Name: to.Ptr("policy"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/policies"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5600b59475ff190048040001/policies/policy"),
	// 			Properties: &armapimanagement.PolicyContractProperties{
	// 				Value: to.Ptr("<!--\r\n    IMPORTANT:\r\n    - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\r\n    - Only the <forward-request> policy element can appear within the <backend> section element.\r\n    - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\r\n    - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\r\n    - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\r\n    - To remove a policy, delete the corresponding policy statement from the policy document.\r\n    - Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.\r\n    - Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.\r\n    - Policies are applied in the order of their appearance, from the top down.\r\n-->\r\n<policies>\r\n  <inbound>\r\n    <quota-by-key calls=\"5\" bandwidth=\"2\" renewal-period=\"&#x9;P3Y6M4DT12H30M5S\" counter-key=\"ba\" />\r\n    <base />\r\n  </inbound>\r\n  <backend>\r\n    <base />\r\n  </backend>\r\n  <outbound>\r\n    <log-to-eventhub logger-id=\"apimService1\" partition-key=\"@(context.Subscription.Id)\">\r\n@{\r\n	Random Random = new Random();\r\n				const string Chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \";                \r\n                return string.Join(\",\", DateTime.UtcNow, new string(\r\n                    Enumerable.Repeat(Chars, Random.Next(2150400))\r\n                              .Select(s =&gt; s[Random.Next(s.Length)])\r\n                              .ToArray()));\r\n          }                           \r\n                        </log-to-eventhub>\r\n    <base />\r\n  </outbound>\r\n</policies>"),
	// 			},
	// 	}},
	// }
}
Output:

type APIPolicyClientCreateOrUpdateOptions added in v0.3.0

type APIPolicyClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

APIPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIPolicyClient.CreateOrUpdate method.

type APIPolicyClientCreateOrUpdateResponse added in v0.3.0

type APIPolicyClientCreateOrUpdateResponse struct {
	PolicyContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIPolicyClientCreateOrUpdateResponse contains the response from method APIPolicyClient.CreateOrUpdate.

type APIPolicyClientDeleteOptions added in v0.3.0

type APIPolicyClientDeleteOptions struct {
}

APIPolicyClientDeleteOptions contains the optional parameters for the APIPolicyClient.Delete method.

type APIPolicyClientDeleteResponse added in v0.3.0

type APIPolicyClientDeleteResponse struct {
}

APIPolicyClientDeleteResponse contains the response from method APIPolicyClient.Delete.

type APIPolicyClientGetEntityTagOptions added in v0.3.0

type APIPolicyClientGetEntityTagOptions struct {
}

APIPolicyClientGetEntityTagOptions contains the optional parameters for the APIPolicyClient.GetEntityTag method.

type APIPolicyClientGetEntityTagResponse added in v0.3.0

type APIPolicyClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIPolicyClientGetEntityTagResponse contains the response from method APIPolicyClient.GetEntityTag.

type APIPolicyClientGetOptions added in v0.3.0

type APIPolicyClientGetOptions struct {
	// Policy Export Format.
	Format *PolicyExportFormat
}

APIPolicyClientGetOptions contains the optional parameters for the APIPolicyClient.Get method.

type APIPolicyClientGetResponse added in v0.3.0

type APIPolicyClientGetResponse struct {
	PolicyContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIPolicyClientGetResponse contains the response from method APIPolicyClient.Get.

type APIPolicyClientListByAPIOptions added in v0.3.0

type APIPolicyClientListByAPIOptions struct {
}

APIPolicyClientListByAPIOptions contains the optional parameters for the APIPolicyClient.ListByAPI method.

type APIPolicyClientListByAPIResponse added in v0.3.0

type APIPolicyClientListByAPIResponse struct {
	PolicyCollection
}

APIPolicyClientListByAPIResponse contains the response from method APIPolicyClient.ListByAPI.

type APIProductClient

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

APIProductClient contains the methods for the APIProduct group. Don't use this type directly, use NewAPIProductClient() instead.

func NewAPIProductClient

func NewAPIProductClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIProductClient, error)

NewAPIProductClient creates a new instance of APIProductClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIProductClient) NewListByApisPager added in v0.5.0

func (client *APIProductClient) NewListByApisPager(resourceGroupName string, serviceName string, apiID string, options *APIProductClientListByApisOptions) *runtime.Pager[APIProductClientListByApisResponse]

NewListByApisPager - Lists all Products, which the API is part of.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • options - APIProductClientListByApisOptions contains the optional parameters for the APIProductClient.NewListByApisPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiProducts.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIProductClient().NewListByApisPager("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", &armapimanagement.APIProductClientListByApisOptions{Filter: nil,
		Top:  nil,
		Skip: 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.ProductCollection = armapimanagement.ProductCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.ProductContract{
		// 		{
		// 			Name: to.Ptr("5600b539c53f5b0062060002"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/products"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b539c53f5b0062060002"),
		// 			Properties: &armapimanagement.ProductContractProperties{
		// 				Description: to.Ptr("Subscribers have completely unlimited access to the API. Administrator approval is required."),
		// 				ApprovalRequired: to.Ptr(true),
		// 				State: to.Ptr(armapimanagement.ProductStatePublished),
		// 				SubscriptionRequired: to.Ptr(true),
		// 				SubscriptionsLimit: to.Ptr[int32](1),
		// 				DisplayName: to.Ptr("Unlimited"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type APIProductClientListByApisOptions added in v0.3.0

type APIProductClientListByApisOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APIProductClientListByApisOptions contains the optional parameters for the APIProductClient.NewListByApisPager method.

type APIProductClientListByApisResponse added in v0.3.0

type APIProductClientListByApisResponse struct {
	ProductCollection
}

APIProductClientListByApisResponse contains the response from method APIProductClient.NewListByApisPager.

type APIReleaseClient

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

APIReleaseClient contains the methods for the APIRelease group. Don't use this type directly, use NewAPIReleaseClient() instead.

func NewAPIReleaseClient

func NewAPIReleaseClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIReleaseClient, error)

NewAPIReleaseClient creates a new instance of APIReleaseClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIReleaseClient) CreateOrUpdate

func (client *APIReleaseClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, parameters APIReleaseContract, options *APIReleaseClientCreateOrUpdateOptions) (APIReleaseClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a new Release for the API. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • releaseID - Release identifier within an API. Must be unique in the current API Management service instance.
  • parameters - Create parameters.
  • options - APIReleaseClientCreateOrUpdateOptions contains the optional parameters for the APIReleaseClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiRelease.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIReleaseClient().CreateOrUpdate(ctx, "rg1", "apimService1", "a1", "testrev", armapimanagement.APIReleaseContract{
		Properties: &armapimanagement.APIReleaseContractProperties{
			APIID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1"),
			Notes: to.Ptr("yahooagain"),
		},
	}, &armapimanagement.APIReleaseClientCreateOrUpdateOptions{IfMatch: 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.APIReleaseContract = armapimanagement.APIReleaseContract{
	// 	Name: to.Ptr("testrev"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/releases"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1/releases/testrev"),
	// 	Properties: &armapimanagement.APIReleaseContractProperties{
	// 		APIID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1"),
	// 		CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T20:52:00.65Z"); return t}()),
	// 		Notes: to.Ptr("yahooagain"),
	// 		UpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T20:52:00.65Z"); return t}()),
	// 	},
	// }
}
Output:

func (*APIReleaseClient) Delete

func (client *APIReleaseClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, ifMatch string, options *APIReleaseClientDeleteOptions) (APIReleaseClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • releaseID - Release identifier within an API. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APIReleaseClientDeleteOptions contains the optional parameters for the APIReleaseClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiRelease.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIReleaseClient().Delete(ctx, "rg1", "apimService1", "5a5fcc09124a7fa9b89f2f1d", "testrev", "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIReleaseClient) Get

func (client *APIReleaseClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, options *APIReleaseClientGetOptions) (APIReleaseClientGetResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • releaseID - Release identifier within an API. Must be unique in the current API Management service instance.
  • options - APIReleaseClientGetOptions contains the optional parameters for the APIReleaseClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiRelease.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIReleaseClient().Get(ctx, "rg1", "apimService1", "a1", "5a7cb545298324c53224a799", 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.APIReleaseContract = armapimanagement.APIReleaseContract{
	// 	Name: to.Ptr("5a7cb545298324c53224a799"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/releases"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1/releases/5a7cb545298324c53224a799"),
	// 	Properties: &armapimanagement.APIReleaseContractProperties{
	// 		APIID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1"),
	// 		CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T20:38:29.173Z"); return t}()),
	// 		Notes: to.Ptr("yahoo"),
	// 		UpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T20:38:29.173Z"); return t}()),
	// 	},
	// }
}
Output:

func (*APIReleaseClient) GetEntityTag

func (client *APIReleaseClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, options *APIReleaseClientGetEntityTagOptions) (APIReleaseClientGetEntityTagResponse, error)

GetEntityTag - Returns the etag of an API release.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • releaseID - Release identifier within an API. Must be unique in the current API Management service instance.
  • options - APIReleaseClientGetEntityTagOptions contains the optional parameters for the APIReleaseClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiRelease.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIReleaseClient().GetEntityTag(ctx, "rg1", "apimService1", "a1", "5a7cb545298324c53224a799", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIReleaseClient) NewListByServicePager added in v0.5.0

func (client *APIReleaseClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, options *APIReleaseClientListByServiceOptions) *runtime.Pager[APIReleaseClientListByServiceResponse]

NewListByServicePager - Lists all releases of an API. An API release is created when making an API Revision current. Releases are also used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip parameters.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • options - APIReleaseClientListByServiceOptions contains the optional parameters for the APIReleaseClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiReleases.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIReleaseClient().NewListByServicePager("rg1", "apimService1", "a1", &armapimanagement.APIReleaseClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.APIReleaseCollection = armapimanagement.APIReleaseCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.APIReleaseContract{
		// 		{
		// 			Name: to.Ptr("5a7cb545298324c53224a799"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/releases"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1/releases/5a7cb545298324c53224a799"),
		// 			Properties: &armapimanagement.APIReleaseContractProperties{
		// 				CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T20:38:29.173Z"); return t}()),
		// 				Notes: to.Ptr("yahoo"),
		// 				UpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T20:38:29.173Z"); return t}()),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*APIReleaseClient) Update

func (client *APIReleaseClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, ifMatch string, parameters APIReleaseContract, options *APIReleaseClientUpdateOptions) (APIReleaseClientUpdateResponse, error)

Update - Updates the details of the release of the API specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • releaseID - Release identifier within an API. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - API Release Update parameters.
  • options - APIReleaseClientUpdateOptions contains the optional parameters for the APIReleaseClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiRelease.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIReleaseClient().Update(ctx, "rg1", "apimService1", "a1", "testrev", "*", armapimanagement.APIReleaseContract{
		Properties: &armapimanagement.APIReleaseContractProperties{
			APIID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1"),
			Notes: to.Ptr("yahooagain"),
		},
	}, 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.APIReleaseContract = armapimanagement.APIReleaseContract{
	// 	Name: to.Ptr("testrev"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/releases"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1/releases/testrev"),
	// 	Properties: &armapimanagement.APIReleaseContractProperties{
	// 		APIID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1"),
	// 		CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T20:38:29.173Z"); return t}()),
	// 		Notes: to.Ptr("yahoo"),
	// 		UpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T20:38:29.173Z"); return t}()),
	// 	},
	// }
}
Output:

type APIReleaseClientCreateOrUpdateOptions added in v0.3.0

type APIReleaseClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

APIReleaseClientCreateOrUpdateOptions contains the optional parameters for the APIReleaseClient.CreateOrUpdate method.

type APIReleaseClientCreateOrUpdateResponse added in v0.3.0

type APIReleaseClientCreateOrUpdateResponse struct {
	APIReleaseContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIReleaseClientCreateOrUpdateResponse contains the response from method APIReleaseClient.CreateOrUpdate.

type APIReleaseClientDeleteOptions added in v0.3.0

type APIReleaseClientDeleteOptions struct {
}

APIReleaseClientDeleteOptions contains the optional parameters for the APIReleaseClient.Delete method.

type APIReleaseClientDeleteResponse added in v0.3.0

type APIReleaseClientDeleteResponse struct {
}

APIReleaseClientDeleteResponse contains the response from method APIReleaseClient.Delete.

type APIReleaseClientGetEntityTagOptions added in v0.3.0

type APIReleaseClientGetEntityTagOptions struct {
}

APIReleaseClientGetEntityTagOptions contains the optional parameters for the APIReleaseClient.GetEntityTag method.

type APIReleaseClientGetEntityTagResponse added in v0.3.0

type APIReleaseClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIReleaseClientGetEntityTagResponse contains the response from method APIReleaseClient.GetEntityTag.

type APIReleaseClientGetOptions added in v0.3.0

type APIReleaseClientGetOptions struct {
}

APIReleaseClientGetOptions contains the optional parameters for the APIReleaseClient.Get method.

type APIReleaseClientGetResponse added in v0.3.0

type APIReleaseClientGetResponse struct {
	APIReleaseContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIReleaseClientGetResponse contains the response from method APIReleaseClient.Get.

type APIReleaseClientListByServiceOptions added in v0.3.0

type APIReleaseClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APIReleaseClientListByServiceOptions contains the optional parameters for the APIReleaseClient.NewListByServicePager method.

type APIReleaseClientListByServiceResponse added in v0.3.0

type APIReleaseClientListByServiceResponse struct {
	APIReleaseCollection
}

APIReleaseClientListByServiceResponse contains the response from method APIReleaseClient.NewListByServicePager.

type APIReleaseClientUpdateOptions added in v0.3.0

type APIReleaseClientUpdateOptions struct {
}

APIReleaseClientUpdateOptions contains the optional parameters for the APIReleaseClient.Update method.

type APIReleaseClientUpdateResponse added in v0.3.0

type APIReleaseClientUpdateResponse struct {
	APIReleaseContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIReleaseClientUpdateResponse contains the response from method APIReleaseClient.Update.

type APIReleaseCollection

type APIReleaseCollection struct {
	// Total record count number across all pages.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Page values.
	Value []*APIReleaseContract
}

APIReleaseCollection - Paged ApiRelease list representation.

func (APIReleaseCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIReleaseCollection.

func (*APIReleaseCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIReleaseCollection.

type APIReleaseContract

type APIReleaseContract struct {
	// ApiRelease entity contract properties.
	Properties *APIReleaseContractProperties

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

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

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

APIReleaseContract - ApiRelease details.

func (APIReleaseContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIReleaseContract.

func (*APIReleaseContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIReleaseContract.

type APIReleaseContractProperties

type APIReleaseContractProperties struct {
	// Identifier of the API the release belongs to.
	APIID *string

	// Release Notes
	Notes *string

	// READ-ONLY; The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified
	// by the ISO 8601 standard.
	CreatedDateTime *time.Time

	// READ-ONLY; The time the API release was updated.
	UpdatedDateTime *time.Time
}

APIReleaseContractProperties - API Release details

func (APIReleaseContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIReleaseContractProperties.

func (*APIReleaseContractProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIReleaseContractProperties.

type APIRevisionClient

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

APIRevisionClient contains the methods for the APIRevision group. Don't use this type directly, use NewAPIRevisionClient() instead.

func NewAPIRevisionClient

func NewAPIRevisionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIRevisionClient, error)

NewAPIRevisionClient creates a new instance of APIRevisionClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIRevisionClient) NewListByServicePager added in v0.5.0

func (client *APIRevisionClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, options *APIRevisionClientListByServiceOptions) *runtime.Pager[APIRevisionClientListByServiceResponse]

NewListByServicePager - Lists all revisions of an API.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • options - APIRevisionClientListByServiceOptions contains the optional parameters for the APIRevisionClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiRevisions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIRevisionClient().NewListByServicePager("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", &armapimanagement.APIRevisionClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.APIRevisionCollection = armapimanagement.APIRevisionCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.APIRevisionContract{
		// 		{
		// 			APIID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1;rev=1"),
		// 			APIRevision: to.Ptr("1"),
		// 			CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
		// 			IsCurrent: to.Ptr(true),
		// 			IsOnline: to.Ptr(true),
		// 			UpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
		// 	}},
		// }
	}
}
Output:

type APIRevisionClientListByServiceOptions added in v0.3.0

type APIRevisionClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APIRevisionClientListByServiceOptions contains the optional parameters for the APIRevisionClient.NewListByServicePager method.

type APIRevisionClientListByServiceResponse added in v0.3.0

type APIRevisionClientListByServiceResponse struct {
	APIRevisionCollection
}

APIRevisionClientListByServiceResponse contains the response from method APIRevisionClient.NewListByServicePager.

type APIRevisionCollection

type APIRevisionCollection struct {
	// Total record count number across all pages.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Page values.
	Value []*APIRevisionContract
}

APIRevisionCollection - Paged API Revision list representation.

func (APIRevisionCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIRevisionCollection.

func (*APIRevisionCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIRevisionCollection.

type APIRevisionContract

type APIRevisionContract struct {
	// READ-ONLY; Identifier of the API Revision.
	APIID *string

	// READ-ONLY; Revision number of API.
	APIRevision *string

	// READ-ONLY; The time the API Revision was created. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified
	// by the ISO 8601 standard.
	CreatedDateTime *time.Time

	// READ-ONLY; Description of the API Revision.
	Description *string

	// READ-ONLY; Indicates if API revision is accessible via the gateway.
	IsCurrent *bool

	// READ-ONLY; Indicates if API revision is the current api revision.
	IsOnline *bool

	// READ-ONLY; Gateway URL for accessing the non-current API Revision.
	PrivateURL *string

	// READ-ONLY; The time the API Revision were updated. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified
	// by the ISO 8601 standard.
	UpdatedDateTime *time.Time
}

APIRevisionContract - Summary of revision metadata.

func (APIRevisionContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIRevisionContract.

func (*APIRevisionContract) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIRevisionContract.

type APIRevisionInfoContract

type APIRevisionInfoContract struct {
	// Description of new API Revision.
	APIRevisionDescription *string

	// Version identifier for the new API Version.
	APIVersionName *string

	// Version set details
	APIVersionSet *APIVersionSetContractDetails

	// Resource identifier of API to be used to create the revision from.
	SourceAPIID *string
}

APIRevisionInfoContract - Object used to create an API Revision or Version based on an existing API Revision

func (APIRevisionInfoContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APIRevisionInfoContract.

func (*APIRevisionInfoContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIRevisionInfoContract.

type APISchemaClient

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

APISchemaClient contains the methods for the APISchema group. Don't use this type directly, use NewAPISchemaClient() instead.

func NewAPISchemaClient

func NewAPISchemaClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APISchemaClient, error)

NewAPISchemaClient creates a new instance of APISchemaClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APISchemaClient) BeginCreateOrUpdate

func (client *APISchemaClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, parameters SchemaContract, options *APISchemaClientBeginCreateOrUpdateOptions) (*runtime.Poller[APISchemaClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates schema configuration for the API. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • schemaID - Schema id identifier. Must be unique in the current API Management service instance.
  • parameters - The schema contents to apply.
  • options - APISchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the APISchemaClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiSchema.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAPISchemaClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "ec12520d-9d48-4e7b-8f39-698ca2ac63f1", armapimanagement.SchemaContract{
		Properties: &armapimanagement.SchemaContractProperties{
			ContentType: to.Ptr("application/vnd.ms-azure-apim.xsd+xml"),
			Document: &armapimanagement.SchemaDocumentProperties{
				Value: to.Ptr("<s:schema elementFormDefault=\"qualified\" targetNamespace=\"http://ws.cdyne.com/WeatherWS/\" xmlns:tns=\"http://ws.cdyne.com/WeatherWS/\" xmlns:s=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://schemas.xmlsoap.org/wsdl/soap12/\" xmlns:mime=\"http://schemas.xmlsoap.org/wsdl/mime/\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:tm=\"http://microsoft.com/wsdl/mime/textMatching/\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:apim-wsdltns=\"http://ws.cdyne.com/WeatherWS/\">\r\n  <s:element name=\"GetWeatherInformation\">\r\n    <s:complexType />\r\n  </s:element>\r\n  <s:element name=\"GetWeatherInformationResponse\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"GetWeatherInformationResult\" type=\"tns:ArrayOfWeatherDescription\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:complexType name=\"ArrayOfWeatherDescription\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"WeatherDescription\" type=\"tns:WeatherDescription\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"WeatherDescription\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Description\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"PictureURL\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:element name=\"GetCityForecastByZIP\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ZIP\" type=\"s:string\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:element name=\"GetCityForecastByZIPResponse\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"GetCityForecastByZIPResult\" type=\"tns:ForecastReturn\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:complexType name=\"ForecastReturn\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Success\" type=\"s:boolean\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ResponseText\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"State\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"City\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WeatherStationCity\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ForecastResult\" type=\"tns:ArrayOfForecast\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"ArrayOfForecast\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"Forecast\" nillable=\"true\" type=\"tns:Forecast\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"Forecast\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Date\" type=\"s:dateTime\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Desciption\" type=\"s:string\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Temperatures\" type=\"tns:temp\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"ProbabilityOfPrecipiation\" type=\"tns:POP\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"temp\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"MorningLow\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"DaytimeHigh\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"POP\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Nighttime\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Daytime\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:element name=\"GetCityWeatherByZIP\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ZIP\" type=\"s:string\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:element name=\"GetCityWeatherByZIPResponse\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"GetCityWeatherByZIPResult\" type=\"tns:WeatherReturn\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:complexType name=\"WeatherReturn\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Success\" type=\"s:boolean\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ResponseText\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"State\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"City\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WeatherStationCity\" type=\"s:string\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Description\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Temperature\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"RelativeHumidity\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Wind\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Pressure\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Visibility\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WindChill\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Remarks\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:element name=\"ArrayOfWeatherDescription\" nillable=\"true\" type=\"tns:ArrayOfWeatherDescription\" />\r\n  <s:element name=\"ForecastReturn\" nillable=\"true\" type=\"tns:ForecastReturn\" />\r\n  <s:element name=\"WeatherReturn\" type=\"tns:WeatherReturn\" />\r\n</s:schema>"),
			},
		},
	}, &armapimanagement.APISchemaClientBeginCreateOrUpdateOptions{IfMatch: 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.SchemaContract = armapimanagement.SchemaContract{
	// 	Name: to.Ptr("ec12520d-9d48-4e7b-8f39-698ca2ac63f1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/schemas"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/59d6bb8f1f7fab13dc67ec9b/schemas/ec12520d-9d48-4e7b-8f39-698ca2ac63f1"),
	// 	Properties: &armapimanagement.SchemaContractProperties{
	// 		ContentType: to.Ptr("application/vnd.ms-azure-apim.xsd+xml"),
	// 		Document: &armapimanagement.SchemaDocumentProperties{
	// 			Value: to.Ptr("<s:schema elementFormDefault=\"qualified\" targetNamespace=\"http://ws.cdyne.com/WeatherWS/\" xmlns:tns=\"http://ws.cdyne.com/WeatherWS/\" xmlns:s=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://schemas.xmlsoap.org/wsdl/soap12/\" xmlns:mime=\"http://schemas.xmlsoap.org/wsdl/mime/\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:tm=\"http://microsoft.com/wsdl/mime/textMatching/\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:apim-wsdltns=\"http://ws.cdyne.com/WeatherWS/\">\r\n  <s:element name=\"GetWeatherInformation\">\r\n    <s:complexType />\r\n  </s:element>\r\n  <s:element name=\"GetWeatherInformationResponse\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"GetWeatherInformationResult\" type=\"tns:ArrayOfWeatherDescription\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:complexType name=\"ArrayOfWeatherDescription\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"WeatherDescription\" type=\"tns:WeatherDescription\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"WeatherDescription\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Description\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"PictureURL\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:element name=\"GetCityForecastByZIP\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ZIP\" type=\"s:string\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:element name=\"GetCityForecastByZIPResponse\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"GetCityForecastByZIPResult\" type=\"tns:ForecastReturn\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:complexType name=\"ForecastReturn\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Success\" type=\"s:boolean\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ResponseText\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"State\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"City\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WeatherStationCity\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ForecastResult\" type=\"tns:ArrayOfForecast\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"ArrayOfForecast\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"Forecast\" nillable=\"true\" type=\"tns:Forecast\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"Forecast\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Date\" type=\"s:dateTime\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Desciption\" type=\"s:string\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Temperatures\" type=\"tns:temp\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"ProbabilityOfPrecipiation\" type=\"tns:POP\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"temp\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"MorningLow\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"DaytimeHigh\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"POP\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Nighttime\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Daytime\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:element name=\"GetCityWeatherByZIP\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ZIP\" type=\"s:string\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:element name=\"GetCityWeatherByZIPResponse\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"GetCityWeatherByZIPResult\" type=\"tns:WeatherReturn\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:complexType name=\"WeatherReturn\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Success\" type=\"s:boolean\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ResponseText\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"State\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"City\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WeatherStationCity\" type=\"s:string\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Description\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Temperature\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"RelativeHumidity\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Wind\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Pressure\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Visibility\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WindChill\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Remarks\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:element name=\"ArrayOfWeatherDescription\" nillable=\"true\" type=\"tns:ArrayOfWeatherDescription\" />\r\n  <s:element name=\"ForecastReturn\" nillable=\"true\" type=\"tns:ForecastReturn\" />\r\n  <s:element name=\"WeatherReturn\" type=\"tns:WeatherReturn\" />\r\n</s:schema>"),
	// 		},
	// 	},
	// }
}
Output:

func (*APISchemaClient) Delete

func (client *APISchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, ifMatch string, options *APISchemaClientDeleteOptions) (APISchemaClientDeleteResponse, error)

Delete - Deletes the schema configuration at the Api. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • schemaID - Schema id identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APISchemaClientDeleteOptions contains the optional parameters for the APISchemaClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiSchema.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPISchemaClient().Delete(ctx, "rg1", "apimService1", "59d5b28d1f7fab116c282650", "59d5b28e1f7fab116402044e", "*", &armapimanagement.APISchemaClientDeleteOptions{Force: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APISchemaClient) Get

func (client *APISchemaClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, options *APISchemaClientGetOptions) (APISchemaClientGetResponse, error)

Get - Get the schema configuration at the API level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • schemaID - Schema id identifier. Must be unique in the current API Management service instance.
  • options - APISchemaClientGetOptions contains the optional parameters for the APISchemaClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiSchema.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPISchemaClient().Get(ctx, "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "ec12520d-9d48-4e7b-8f39-698ca2ac63f1", 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.SchemaContract = armapimanagement.SchemaContract{
	// 	Name: to.Ptr("ec12520d-9d48-4e7b-8f39-698ca2ac63f1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/schemas"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/59d6bb8f1f7fab13dc67ec9b/schemas/ec12520d-9d48-4e7b-8f39-698ca2ac63f1"),
	// 	Properties: &armapimanagement.SchemaContractProperties{
	// 		ContentType: to.Ptr("application/vnd.ms-azure-apim.xsd+xml"),
	// 		Document: &armapimanagement.SchemaDocumentProperties{
	// 			Value: to.Ptr("<s:schema elementFormDefault=\"qualified\" targetNamespace=\"http://ws.cdyne.com/WeatherWS/\" xmlns:tns=\"http://ws.cdyne.com/WeatherWS/\" xmlns:s=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://schemas.xmlsoap.org/wsdl/soap12/\" xmlns:mime=\"http://schemas.xmlsoap.org/wsdl/mime/\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:tm=\"http://microsoft.com/wsdl/mime/textMatching/\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:apim-wsdltns=\"http://ws.cdyne.com/WeatherWS/\">\r\n  <s:element name=\"GetWeatherInformation\">\r\n    <s:complexType />\r\n  </s:element>\r\n  <s:element name=\"GetWeatherInformationResponse\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"GetWeatherInformationResult\" type=\"tns:ArrayOfWeatherDescription\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:complexType name=\"ArrayOfWeatherDescription\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"WeatherDescription\" type=\"tns:WeatherDescription\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"WeatherDescription\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Description\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"PictureURL\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:element name=\"GetCityForecastByZIP\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ZIP\" type=\"s:string\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:element name=\"GetCityForecastByZIPResponse\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"GetCityForecastByZIPResult\" type=\"tns:ForecastReturn\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:complexType name=\"ForecastReturn\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Success\" type=\"s:boolean\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ResponseText\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"State\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"City\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WeatherStationCity\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ForecastResult\" type=\"tns:ArrayOfForecast\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"ArrayOfForecast\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"Forecast\" nillable=\"true\" type=\"tns:Forecast\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"Forecast\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Date\" type=\"s:dateTime\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Desciption\" type=\"s:string\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Temperatures\" type=\"tns:temp\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"ProbabilityOfPrecipiation\" type=\"tns:POP\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"temp\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"MorningLow\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"DaytimeHigh\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:complexType name=\"POP\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Nighttime\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Daytime\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:element name=\"GetCityWeatherByZIP\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ZIP\" type=\"s:string\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:element name=\"GetCityWeatherByZIPResponse\">\r\n    <s:complexType>\r\n      <s:sequence>\r\n        <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"GetCityWeatherByZIPResult\" type=\"tns:WeatherReturn\" />\r\n      </s:sequence>\r\n    </s:complexType>\r\n  </s:element>\r\n  <s:complexType name=\"WeatherReturn\">\r\n    <s:sequence>\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Success\" type=\"s:boolean\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ResponseText\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"State\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"City\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WeatherStationCity\" type=\"s:string\" />\r\n      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Description\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Temperature\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"RelativeHumidity\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Wind\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Pressure\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Visibility\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WindChill\" type=\"s:string\" />\r\n      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Remarks\" type=\"s:string\" />\r\n    </s:sequence>\r\n  </s:complexType>\r\n  <s:element name=\"ArrayOfWeatherDescription\" nillable=\"true\" type=\"tns:ArrayOfWeatherDescription\" />\r\n  <s:element name=\"ForecastReturn\" nillable=\"true\" type=\"tns:ForecastReturn\" />\r\n  <s:element name=\"WeatherReturn\" type=\"tns:WeatherReturn\" />\r\n</s:schema>"),
	// 		},
	// 	},
	// }
}
Output:

func (*APISchemaClient) GetEntityTag

func (client *APISchemaClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, options *APISchemaClientGetEntityTagOptions) (APISchemaClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the schema specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • schemaID - Schema id identifier. Must be unique in the current API Management service instance.
  • options - APISchemaClientGetEntityTagOptions contains the optional parameters for the APISchemaClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiSchema.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPISchemaClient().GetEntityTag(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "ec12520d-9d48-4e7b-8f39-698ca2ac63f1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APISchemaClient) NewListByAPIPager added in v0.5.0

func (client *APISchemaClient) NewListByAPIPager(resourceGroupName string, serviceName string, apiID string, options *APISchemaClientListByAPIOptions) *runtime.Pager[APISchemaClientListByAPIResponse]

NewListByAPIPager - Get the schema configuration at the API level.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - APISchemaClientListByAPIOptions contains the optional parameters for the APISchemaClient.NewListByAPIPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiSchemas.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPISchemaClient().NewListByAPIPager("rg1", "apimService1", "59d5b28d1f7fab116c282650", &armapimanagement.APISchemaClientListByAPIOptions{Filter: nil,
		Top:  nil,
		Skip: 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.SchemaCollection = armapimanagement.SchemaCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.SchemaContract{
		// 		{
		// 			Name: to.Ptr("59d5b28e1f7fab116402044e"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/apis/schemas"),
		// 			ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/59d5b28d1f7fab116c282650/schemas/59d5b28e1f7fab116402044e"),
		// 			Properties: &armapimanagement.SchemaContractProperties{
		// 				ContentType: to.Ptr("application/vnd.ms-azure-apim.swagger.definitions+json"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type APISchemaClientBeginCreateOrUpdateOptions added in v0.3.0

type APISchemaClientBeginCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
	// Resumes the LRO from the provided token.
	ResumeToken string
}

APISchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the APISchemaClient.BeginCreateOrUpdate method.

type APISchemaClientCreateOrUpdateResponse added in v0.3.0

type APISchemaClientCreateOrUpdateResponse struct {
	SchemaContract
}

APISchemaClientCreateOrUpdateResponse contains the response from method APISchemaClient.BeginCreateOrUpdate.

type APISchemaClientDeleteOptions added in v0.3.0

type APISchemaClientDeleteOptions struct {
	// If true removes all references to the schema before deleting it.
	Force *bool
}

APISchemaClientDeleteOptions contains the optional parameters for the APISchemaClient.Delete method.

type APISchemaClientDeleteResponse added in v0.3.0

type APISchemaClientDeleteResponse struct {
}

APISchemaClientDeleteResponse contains the response from method APISchemaClient.Delete.

type APISchemaClientGetEntityTagOptions added in v0.3.0

type APISchemaClientGetEntityTagOptions struct {
}

APISchemaClientGetEntityTagOptions contains the optional parameters for the APISchemaClient.GetEntityTag method.

type APISchemaClientGetEntityTagResponse added in v0.3.0

type APISchemaClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APISchemaClientGetEntityTagResponse contains the response from method APISchemaClient.GetEntityTag.

type APISchemaClientGetOptions added in v0.3.0

type APISchemaClientGetOptions struct {
}

APISchemaClientGetOptions contains the optional parameters for the APISchemaClient.Get method.

type APISchemaClientGetResponse added in v0.3.0

type APISchemaClientGetResponse struct {
	SchemaContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APISchemaClientGetResponse contains the response from method APISchemaClient.Get.

type APISchemaClientListByAPIOptions added in v0.3.0

type APISchemaClientListByAPIOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APISchemaClientListByAPIOptions contains the optional parameters for the APISchemaClient.NewListByAPIPager method.

type APISchemaClientListByAPIResponse added in v0.3.0

type APISchemaClientListByAPIResponse struct {
	SchemaCollection
}

APISchemaClientListByAPIResponse contains the response from method APISchemaClient.NewListByAPIPager.

type APITagDescriptionClient

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

APITagDescriptionClient contains the methods for the APITagDescription group. Don't use this type directly, use NewAPITagDescriptionClient() instead.

func NewAPITagDescriptionClient

func NewAPITagDescriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APITagDescriptionClient, error)

NewAPITagDescriptionClient creates a new instance of APITagDescriptionClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APITagDescriptionClient) CreateOrUpdate

func (client *APITagDescriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, parameters TagDescriptionCreateParameters, options *APITagDescriptionClientCreateOrUpdateOptions) (APITagDescriptionClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create/Update tag description in scope of the Api. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names.
  • parameters - Create parameters.
  • options - APITagDescriptionClientCreateOrUpdateOptions contains the optional parameters for the APITagDescriptionClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiTagDescription.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPITagDescriptionClient().CreateOrUpdate(ctx, "rg1", "apimService1", "5931a75ae4bbd512a88c680b", "tagId1", armapimanagement.TagDescriptionCreateParameters{
		Properties: &armapimanagement.TagDescriptionBaseProperties{
			Description:             to.Ptr("Some description that will be displayed for operation's tag if the tag is assigned to operation of the API"),
			ExternalDocsDescription: to.Ptr("Description of the external docs resource"),
			ExternalDocsURL:         to.Ptr("http://some.url/additionaldoc"),
		},
	}, &armapimanagement.APITagDescriptionClientCreateOrUpdateOptions{IfMatch: 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.TagDescriptionContract = armapimanagement.TagDescriptionContract{
	// 	Name: to.Ptr("tagId1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/tagDescriptions"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5931a75ae4bbd512a88c680b/tagDescriptions/tagId1"),
	// 	Properties: &armapimanagement.TagDescriptionContractProperties{
	// 		Description: to.Ptr("Some description that will be displayed for operation's tag if the tag is assigned to operation of the API"),
	// 		ExternalDocsDescription: to.Ptr("some additional info"),
	// 		ExternalDocsURL: to.Ptr("http://some_url.com"),
	// 		DisplayName: to.Ptr("tag1"),
	// 		TagID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/tagId1"),
	// 	},
	// }
}
Output:

func (*APITagDescriptionClient) Delete

func (client *APITagDescriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, ifMatch string, options *APITagDescriptionClientDeleteOptions) (APITagDescriptionClientDeleteResponse, error)

Delete - Delete tag description for the Api. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APITagDescriptionClientDeleteOptions contains the optional parameters for the APITagDescriptionClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiTagDescription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPITagDescriptionClient().Delete(ctx, "rg1", "apimService1", "59d5b28d1f7fab116c282650", "59d5b28e1f7fab116402044e", "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APITagDescriptionClient) Get

func (client *APITagDescriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, options *APITagDescriptionClientGetOptions) (APITagDescriptionClientGetResponse, error)

Get - Get Tag description in scope of API If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names.
  • options - APITagDescriptionClientGetOptions contains the optional parameters for the APITagDescriptionClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiTagDescription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPITagDescriptionClient().Get(ctx, "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59306a29e4bbd510dc24e5f9", 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.TagDescriptionContract = armapimanagement.TagDescriptionContract{
	// 	Name: to.Ptr("59306a29e4bbd510dc24e5f9"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis/tagDescriptions"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/59d6bb8f1f7fab13dc67ec9b/tagDescriptions/59306a29e4bbd510dc24e5f9"),
	// 	Properties: &armapimanagement.TagDescriptionContractProperties{
	// 		ExternalDocsDescription: to.Ptr("some additional info"),
	// 		ExternalDocsURL: to.Ptr("http://some_url.com"),
	// 		DisplayName: to.Ptr("tag1"),
	// 		TagID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/59306a29e4bbd510dc24e5f9"),
	// 	},
	// }
}
Output:

func (*APITagDescriptionClient) GetEntityTag

func (client *APITagDescriptionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, options *APITagDescriptionClientGetEntityTagOptions) (APITagDescriptionClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state version of the tag specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names.
  • options - APITagDescriptionClientGetEntityTagOptions contains the optional parameters for the APITagDescriptionClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiTagDescription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPITagDescriptionClient().GetEntityTag(ctx, "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59306a29e4bbd510dc24e5f9", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APITagDescriptionClient) NewListByServicePager added in v0.5.0

func (client *APITagDescriptionClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, options *APITagDescriptionClientListByServiceOptions) *runtime.Pager[APITagDescriptionClientListByServiceResponse]

NewListByServicePager - Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level but tag may be assigned to the Operations

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - APITagDescriptionClientListByServiceOptions contains the optional parameters for the APITagDescriptionClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiTagDescriptions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPITagDescriptionClient().NewListByServicePager("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", &armapimanagement.APITagDescriptionClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.TagDescriptionCollection = armapimanagement.TagDescriptionCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.TagDescriptionContract{
		// 		{
		// 			Name: to.Ptr("5600b539c53f5b0062060002"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tagDescriptions/5600b539c53f5b0062060002"),
		// 			Properties: &armapimanagement.TagDescriptionContractProperties{
		// 				ExternalDocsDescription: to.Ptr("some additional info"),
		// 				ExternalDocsURL: to.Ptr("http://some_url.com"),
		// 				DisplayName: to.Ptr("tag1"),
		// 				TagID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/5600b539c53f5b0062060002"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type APITagDescriptionClientCreateOrUpdateOptions added in v0.3.0

type APITagDescriptionClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

APITagDescriptionClientCreateOrUpdateOptions contains the optional parameters for the APITagDescriptionClient.CreateOrUpdate method.

type APITagDescriptionClientCreateOrUpdateResponse added in v0.3.0

type APITagDescriptionClientCreateOrUpdateResponse struct {
	TagDescriptionContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APITagDescriptionClientCreateOrUpdateResponse contains the response from method APITagDescriptionClient.CreateOrUpdate.

type APITagDescriptionClientDeleteOptions added in v0.3.0

type APITagDescriptionClientDeleteOptions struct {
}

APITagDescriptionClientDeleteOptions contains the optional parameters for the APITagDescriptionClient.Delete method.

type APITagDescriptionClientDeleteResponse added in v0.3.0

type APITagDescriptionClientDeleteResponse struct {
}

APITagDescriptionClientDeleteResponse contains the response from method APITagDescriptionClient.Delete.

type APITagDescriptionClientGetEntityTagOptions added in v0.3.0

type APITagDescriptionClientGetEntityTagOptions struct {
}

APITagDescriptionClientGetEntityTagOptions contains the optional parameters for the APITagDescriptionClient.GetEntityTag method.

type APITagDescriptionClientGetEntityTagResponse added in v0.3.0

type APITagDescriptionClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APITagDescriptionClientGetEntityTagResponse contains the response from method APITagDescriptionClient.GetEntityTag.

type APITagDescriptionClientGetOptions added in v0.3.0

type APITagDescriptionClientGetOptions struct {
}

APITagDescriptionClientGetOptions contains the optional parameters for the APITagDescriptionClient.Get method.

type APITagDescriptionClientGetResponse added in v0.3.0

type APITagDescriptionClientGetResponse struct {
	TagDescriptionContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APITagDescriptionClientGetResponse contains the response from method APITagDescriptionClient.Get.

type APITagDescriptionClientListByServiceOptions added in v0.3.0

type APITagDescriptionClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APITagDescriptionClientListByServiceOptions contains the optional parameters for the APITagDescriptionClient.NewListByServicePager method.

type APITagDescriptionClientListByServiceResponse added in v0.3.0

type APITagDescriptionClientListByServiceResponse struct {
	TagDescriptionCollection
}

APITagDescriptionClientListByServiceResponse contains the response from method APITagDescriptionClient.NewListByServicePager.

type APITagResourceContractProperties

type APITagResourceContractProperties struct {
	// Describes the revision of the API. If no value is provided, default revision 1 is created
	APIRevision *string

	// Description of the API Revision.
	APIRevisionDescription *string

	// Type of API.
	APIType *APIType

	// Indicates the version identifier of the API if the API is versioned
	APIVersion *string

	// Description of the API Version.
	APIVersionDescription *string

	// A resource identifier for the related ApiVersionSet.
	APIVersionSetID *string

	// Collection of authentication settings included into this API.
	AuthenticationSettings *AuthenticationSettingsContract

	// Contact information for the API.
	Contact *APIContactInformation

	// Description of the API. May include HTML formatting tags.
	Description *string

	// API identifier in the form /apis/{apiId}.
	ID *string

	// Indicates if API revision is current api revision.
	IsCurrent *bool

	// License information for the API.
	License *APILicenseInformation

	// API name.
	Name *string

	// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It
	// is appended to the API endpoint base URL specified during the service instance
	// creation to form a public URL for this API.
	Path *string

	// Describes on which protocols the operations in this API can be invoked.
	Protocols []*Protocol

	// Absolute URL of the backend service implementing this API.
	ServiceURL *string

	// Protocols over which API is made available.
	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract

	// Specifies whether an API or Product subscription is required for accessing the API.
	SubscriptionRequired *bool

	// A URL to the Terms of Service for the API. MUST be in the format of a URL.
	TermsOfServiceURL *string

	// READ-ONLY; Indicates if API revision is accessible via the gateway.
	IsOnline *bool
}

APITagResourceContractProperties - API contract properties for the Tag Resources.

func (APITagResourceContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APITagResourceContractProperties.

func (*APITagResourceContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APITagResourceContractProperties.

type APIType

type APIType string

APIType - Type of API.

const (
	APITypeGraphql   APIType = "graphql"
	APITypeHTTP      APIType = "http"
	APITypeSoap      APIType = "soap"
	APITypeWebsocket APIType = "websocket"
)

func PossibleAPITypeValues

func PossibleAPITypeValues() []APIType

PossibleAPITypeValues returns the possible values for the APIType const type.

type APIUpdateContract

type APIUpdateContract struct {
	// Properties of the API entity that can be updated.
	Properties *APIContractUpdateProperties
}

APIUpdateContract - API update contract details.

func (APIUpdateContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIUpdateContract.

func (*APIUpdateContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIUpdateContract.

type APIVersionConstraint

type APIVersionConstraint struct {
	// Limit control plane API calls to API Management service with version equal to or newer than this value.
	MinAPIVersion *string
}

APIVersionConstraint - Control Plane Apis version constraint for the API Management service.

func (APIVersionConstraint) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APIVersionConstraint.

func (*APIVersionConstraint) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionConstraint.

type APIVersionSetClient

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

APIVersionSetClient contains the methods for the APIVersionSet group. Don't use this type directly, use NewAPIVersionSetClient() instead.

func NewAPIVersionSetClient

func NewAPIVersionSetClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIVersionSetClient, error)

NewAPIVersionSetClient creates a new instance of APIVersionSetClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIVersionSetClient) CreateOrUpdate

func (client *APIVersionSetClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, parameters APIVersionSetContract, options *APIVersionSetClientCreateOrUpdateOptions) (APIVersionSetClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or Updates a Api Version Set. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance.
  • parameters - Create or update parameters.
  • options - APIVersionSetClientCreateOrUpdateOptions contains the optional parameters for the APIVersionSetClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiVersionSet.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIVersionSetClient().CreateOrUpdate(ctx, "rg1", "apimService1", "api1", armapimanagement.APIVersionSetContract{
		Properties: &armapimanagement.APIVersionSetContractProperties{
			Description:      to.Ptr("Version configuration"),
			DisplayName:      to.Ptr("api set 1"),
			VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment),
		},
	}, &armapimanagement.APIVersionSetClientCreateOrUpdateOptions{IfMatch: 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.APIVersionSetContract = armapimanagement.APIVersionSetContract{
	// 	Name: to.Ptr("api1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/api-version-sets"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/api1"),
	// 	Properties: &armapimanagement.APIVersionSetContractProperties{
	// 		Description: to.Ptr("Version configuration"),
	// 		DisplayName: to.Ptr("api set 1"),
	// 		VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment),
	// 	},
	// }
}
Output:

func (*APIVersionSetClient) Delete

func (client *APIVersionSetClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, ifMatch string, options *APIVersionSetClientDeleteOptions) (APIVersionSetClientDeleteResponse, error)

Delete - Deletes specific Api Version Set. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - APIVersionSetClientDeleteOptions contains the optional parameters for the APIVersionSetClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiVersionSet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*APIVersionSetClient) Get

func (client *APIVersionSetClient) Get(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, options *APIVersionSetClientGetOptions) (APIVersionSetClientGetResponse, error)

Get - Gets the details of the Api Version Set specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance.
  • options - APIVersionSetClientGetOptions contains the optional parameters for the APIVersionSetClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiVersionSet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIVersionSetClient().Get(ctx, "rg1", "apimService1", "vs1", 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.APIVersionSetContract = armapimanagement.APIVersionSetContract{
	// 	Name: to.Ptr("vs1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/api-version-sets"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/vs1"),
	// 	Properties: &armapimanagement.APIVersionSetContractProperties{
	// 		Description: to.Ptr("Version configuration"),
	// 		DisplayName: to.Ptr("Version Set 1"),
	// 		VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment),
	// 	},
	// }
}
Output:

func (*APIVersionSetClient) GetEntityTag

func (client *APIVersionSetClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, options *APIVersionSetClientGetEntityTagOptions) (APIVersionSetClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the Api Version Set specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance.
  • options - APIVersionSetClientGetEntityTagOptions contains the optional parameters for the APIVersionSetClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiVersionSet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAPIVersionSetClient().GetEntityTag(ctx, "rg1", "apimService1", "vs1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*APIVersionSetClient) NewListByServicePager added in v0.5.0

func (client *APIVersionSetClient) NewListByServicePager(resourceGroupName string, serviceName string, options *APIVersionSetClientListByServiceOptions) *runtime.Pager[APIVersionSetClientListByServiceResponse]

NewListByServicePager - Lists a collection of API Version Sets in the specified service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - APIVersionSetClientListByServiceOptions contains the optional parameters for the APIVersionSetClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiVersionSets.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAPIVersionSetClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.APIVersionSetClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.APIVersionSetCollection = armapimanagement.APIVersionSetCollection{
		// 	Count: to.Ptr[int64](2),
		// 	Value: []*armapimanagement.APIVersionSetContract{
		// 		{
		// 			Name: to.Ptr("vs1"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/api-version-sets"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/vs1"),
		// 			Properties: &armapimanagement.APIVersionSetContractProperties{
		// 				Description: to.Ptr("Version configuration"),
		// 				DisplayName: to.Ptr("api set 1"),
		// 				VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("vs2"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/api-version-sets"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/vs2"),
		// 			Properties: &armapimanagement.APIVersionSetContractProperties{
		// 				Description: to.Ptr("Version configuration 2"),
		// 				DisplayName: to.Ptr("api set 2"),
		// 				VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeQuery),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*APIVersionSetClient) Update

func (client *APIVersionSetClient) Update(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, ifMatch string, parameters APIVersionSetUpdateParameters, options *APIVersionSetClientUpdateOptions) (APIVersionSetClientUpdateResponse, error)

Update - Updates the details of the Api VersionSet specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - APIVersionSetClientUpdateOptions contains the optional parameters for the APIVersionSetClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiVersionSet.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIVersionSetClient().Update(ctx, "rg1", "apimService1", "vs1", "*", armapimanagement.APIVersionSetUpdateParameters{
		Properties: &armapimanagement.APIVersionSetUpdateParametersProperties{
			Description:      to.Ptr("Version configuration"),
			DisplayName:      to.Ptr("api set 1"),
			VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment),
		},
	}, 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.APIVersionSetContract = armapimanagement.APIVersionSetContract{
	// 	Name: to.Ptr("vs1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/api-version-sets"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/vs1"),
	// 	Properties: &armapimanagement.APIVersionSetContractProperties{
	// 		Description: to.Ptr("Version configuration"),
	// 		DisplayName: to.Ptr("api set 1"),
	// 		VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment),
	// 	},
	// }
}
Output:

type APIVersionSetClientCreateOrUpdateOptions added in v0.3.0

type APIVersionSetClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

APIVersionSetClientCreateOrUpdateOptions contains the optional parameters for the APIVersionSetClient.CreateOrUpdate method.

type APIVersionSetClientCreateOrUpdateResponse added in v0.3.0

type APIVersionSetClientCreateOrUpdateResponse struct {
	APIVersionSetContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIVersionSetClientCreateOrUpdateResponse contains the response from method APIVersionSetClient.CreateOrUpdate.

type APIVersionSetClientDeleteOptions added in v0.3.0

type APIVersionSetClientDeleteOptions struct {
}

APIVersionSetClientDeleteOptions contains the optional parameters for the APIVersionSetClient.Delete method.

type APIVersionSetClientDeleteResponse added in v0.3.0

type APIVersionSetClientDeleteResponse struct {
}

APIVersionSetClientDeleteResponse contains the response from method APIVersionSetClient.Delete.

type APIVersionSetClientGetEntityTagOptions added in v0.3.0

type APIVersionSetClientGetEntityTagOptions struct {
}

APIVersionSetClientGetEntityTagOptions contains the optional parameters for the APIVersionSetClient.GetEntityTag method.

type APIVersionSetClientGetEntityTagResponse added in v0.3.0

type APIVersionSetClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

APIVersionSetClientGetEntityTagResponse contains the response from method APIVersionSetClient.GetEntityTag.

type APIVersionSetClientGetOptions added in v0.3.0

type APIVersionSetClientGetOptions struct {
}

APIVersionSetClientGetOptions contains the optional parameters for the APIVersionSetClient.Get method.

type APIVersionSetClientGetResponse added in v0.3.0

type APIVersionSetClientGetResponse struct {
	APIVersionSetContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIVersionSetClientGetResponse contains the response from method APIVersionSetClient.Get.

type APIVersionSetClientListByServiceOptions added in v0.3.0

type APIVersionSetClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

APIVersionSetClientListByServiceOptions contains the optional parameters for the APIVersionSetClient.NewListByServicePager method.

type APIVersionSetClientListByServiceResponse added in v0.3.0

type APIVersionSetClientListByServiceResponse struct {
	APIVersionSetCollection
}

APIVersionSetClientListByServiceResponse contains the response from method APIVersionSetClient.NewListByServicePager.

type APIVersionSetClientUpdateOptions added in v0.3.0

type APIVersionSetClientUpdateOptions struct {
}

APIVersionSetClientUpdateOptions contains the optional parameters for the APIVersionSetClient.Update method.

type APIVersionSetClientUpdateResponse added in v0.3.0

type APIVersionSetClientUpdateResponse struct {
	APIVersionSetContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

APIVersionSetClientUpdateResponse contains the response from method APIVersionSetClient.Update.

type APIVersionSetCollection

type APIVersionSetCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*APIVersionSetContract
}

APIVersionSetCollection - Paged API Version Set list representation.

func (APIVersionSetCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIVersionSetCollection.

func (*APIVersionSetCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetCollection.

type APIVersionSetContract

type APIVersionSetContract struct {
	// API VersionSet contract properties.
	Properties *APIVersionSetContractProperties

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

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

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

APIVersionSetContract - API Version Set Contract details.

func (APIVersionSetContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIVersionSetContract.

func (*APIVersionSetContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetContract.

type APIVersionSetContractDetails

type APIVersionSetContractDetails struct {
	// Description of API Version Set.
	Description *string

	// Identifier for existing API Version Set. Omit this value to create a new Version Set.
	ID *string

	// The display Name of the API Version Set.
	Name *string

	// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to header.
	VersionHeaderName *string

	// Name of query parameter that indicates the API Version if versioningScheme is set to query.
	VersionQueryName *string

	// An value that determines where the API Version identifier will be located in a HTTP request.
	VersioningScheme *APIVersionSetContractDetailsVersioningScheme
}

APIVersionSetContractDetails - An API Version Set contains the common configuration for a set of API Versions relating

func (APIVersionSetContractDetails) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APIVersionSetContractDetails.

func (*APIVersionSetContractDetails) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetContractDetails.

type APIVersionSetContractDetailsVersioningScheme

type APIVersionSetContractDetailsVersioningScheme string

APIVersionSetContractDetailsVersioningScheme - An value that determines where the API Version identifier will be located in a HTTP request.

const (
	APIVersionSetContractDetailsVersioningSchemeHeader  APIVersionSetContractDetailsVersioningScheme = "Header"
	APIVersionSetContractDetailsVersioningSchemeQuery   APIVersionSetContractDetailsVersioningScheme = "Query"
	APIVersionSetContractDetailsVersioningSchemeSegment APIVersionSetContractDetailsVersioningScheme = "Segment"
)

func PossibleAPIVersionSetContractDetailsVersioningSchemeValues

func PossibleAPIVersionSetContractDetailsVersioningSchemeValues() []APIVersionSetContractDetailsVersioningScheme

PossibleAPIVersionSetContractDetailsVersioningSchemeValues returns the possible values for the APIVersionSetContractDetailsVersioningScheme const type.

type APIVersionSetContractProperties

type APIVersionSetContractProperties struct {
	// REQUIRED; Name of API Version Set
	DisplayName *string

	// REQUIRED; An value that determines where the API Version identifier will be located in a HTTP request.
	VersioningScheme *VersioningScheme

	// Description of API Version Set.
	Description *string

	// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to header.
	VersionHeaderName *string

	// Name of query parameter that indicates the API Version if versioningScheme is set to query.
	VersionQueryName *string
}

APIVersionSetContractProperties - Properties of an API Version Set.

func (APIVersionSetContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APIVersionSetContractProperties.

func (*APIVersionSetContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetContractProperties.

type APIVersionSetEntityBase

type APIVersionSetEntityBase struct {
	// Description of API Version Set.
	Description *string

	// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to header.
	VersionHeaderName *string

	// Name of query parameter that indicates the API Version if versioningScheme is set to query.
	VersionQueryName *string
}

APIVersionSetEntityBase - API Version set base parameters

func (APIVersionSetEntityBase) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APIVersionSetEntityBase.

func (*APIVersionSetEntityBase) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetEntityBase.

type APIVersionSetUpdateParameters

type APIVersionSetUpdateParameters struct {
	// Parameters to update or create an API Version Set Contract.
	Properties *APIVersionSetUpdateParametersProperties
}

APIVersionSetUpdateParameters - Parameters to update or create an API Version Set Contract.

func (APIVersionSetUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type APIVersionSetUpdateParameters.

func (*APIVersionSetUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetUpdateParameters.

type APIVersionSetUpdateParametersProperties

type APIVersionSetUpdateParametersProperties struct {
	// Description of API Version Set.
	Description *string

	// Name of API Version Set
	DisplayName *string

	// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to header.
	VersionHeaderName *string

	// Name of query parameter that indicates the API Version if versioningScheme is set to query.
	VersionQueryName *string

	// An value that determines where the API Version identifier will be located in a HTTP request.
	VersioningScheme *VersioningScheme
}

APIVersionSetUpdateParametersProperties - Properties used to create or update an API Version Set.

func (APIVersionSetUpdateParametersProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APIVersionSetUpdateParametersProperties.

func (*APIVersionSetUpdateParametersProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetUpdateParametersProperties.

type AccessIDName

type AccessIDName string
const (
	AccessIDNameAccess    AccessIDName = "access"
	AccessIDNameGitAccess AccessIDName = "gitAccess"
)

func PossibleAccessIDNameValues

func PossibleAccessIDNameValues() []AccessIDName

PossibleAccessIDNameValues returns the possible values for the AccessIDName const type.

type AccessInformationCollection

type AccessInformationCollection struct {
	// Total record count number across all pages.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Page values.
	Value []*AccessInformationContract
}

AccessInformationCollection - Paged AccessInformation list representation.

func (AccessInformationCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AccessInformationCollection.

func (*AccessInformationCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationCollection.

type AccessInformationContract

type AccessInformationContract struct {
	// AccessInformation entity contract properties.
	Properties *AccessInformationContractProperties

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

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

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

AccessInformationContract - Tenant Settings.

func (AccessInformationContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AccessInformationContract.

func (*AccessInformationContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationContract.

type AccessInformationContractProperties

type AccessInformationContractProperties struct {
	// Determines whether direct access is enabled.
	Enabled *bool

	// Access Information type ('access' or 'gitAccess')
	ID *string

	// Principal (User) Identifier.
	PrincipalID *string
}

AccessInformationContractProperties - Tenant access information contract of the API Management service.

func (AccessInformationContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type AccessInformationContractProperties.

func (*AccessInformationContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationContractProperties.

type AccessInformationCreateParameterProperties

type AccessInformationCreateParameterProperties struct {
	// Determines whether direct access is enabled.
	Enabled *bool

	// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
	PrimaryKey *string

	// Principal (User) Identifier.
	PrincipalID *string

	// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the
	// value.
	SecondaryKey *string
}

AccessInformationCreateParameterProperties - Tenant access information update parameters of the API Management service

func (AccessInformationCreateParameterProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type AccessInformationCreateParameterProperties.

func (*AccessInformationCreateParameterProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationCreateParameterProperties.

type AccessInformationCreateParameters

type AccessInformationCreateParameters struct {
	// Tenant access information update parameter properties.
	Properties *AccessInformationCreateParameterProperties
}

AccessInformationCreateParameters - Tenant access information update parameters.

func (AccessInformationCreateParameters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type AccessInformationCreateParameters.

func (*AccessInformationCreateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationCreateParameters.

type AccessInformationSecretsContract

type AccessInformationSecretsContract struct {
	// Determines whether direct access is enabled.
	Enabled *bool

	// Access Information type ('access' or 'gitAccess')
	ID *string

	// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
	PrimaryKey *string

	// Principal (User) Identifier.
	PrincipalID *string

	// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the
	// value.
	SecondaryKey *string
}

AccessInformationSecretsContract - Tenant access information contract of the API Management service.

func (AccessInformationSecretsContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type AccessInformationSecretsContract.

func (*AccessInformationSecretsContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationSecretsContract.

type AccessInformationUpdateParameterProperties

type AccessInformationUpdateParameterProperties struct {
	// Determines whether direct access is enabled.
	Enabled *bool
}

AccessInformationUpdateParameterProperties - Tenant access information update parameters of the API Management service

func (AccessInformationUpdateParameterProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type AccessInformationUpdateParameterProperties.

func (*AccessInformationUpdateParameterProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationUpdateParameterProperties.

type AccessInformationUpdateParameters

type AccessInformationUpdateParameters struct {
	// Tenant access information update parameter properties.
	Properties *AccessInformationUpdateParameterProperties
}

AccessInformationUpdateParameters - Tenant access information update parameters.

func (AccessInformationUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AccessInformationUpdateParameters.

func (*AccessInformationUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationUpdateParameters.

type AccessType

type AccessType string

AccessType - The type of access to be used for the storage account.

const (
	// AccessTypeAccessKey - Use access key.
	AccessTypeAccessKey AccessType = "AccessKey"
	// AccessTypeSystemAssignedManagedIdentity - Use system assigned managed identity.
	AccessTypeSystemAssignedManagedIdentity AccessType = "SystemAssignedManagedIdentity"
	// AccessTypeUserAssignedManagedIdentity - Use user assigned managed identity.
	AccessTypeUserAssignedManagedIdentity AccessType = "UserAssignedManagedIdentity"
)

func PossibleAccessTypeValues

func PossibleAccessTypeValues() []AccessType

PossibleAccessTypeValues returns the possible values for the AccessType const type.

type AdditionalLocation

type AdditionalLocation struct {
	// REQUIRED; The location name of the additional region among Azure Data center regions.
	Location *string

	// REQUIRED; SKU properties of the API Management service.
	SKU *ServiceSKUProperties

	// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway
	// in this additional location.
	DisableGateway *bool

	// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the location. Supported
	// only for Premium SKU being deployed in Virtual Network.
	PublicIPAddressID *string

	// Virtual network configuration for the location.
	VirtualNetworkConfiguration *VirtualNetworkConfiguration

	// A list of availability zones denoting where the resource needs to come from.
	Zones []*string

	// READ-ONLY; Gateway URL of the API Management service in the Region.
	GatewayRegionalURL *string

	// READ-ONLY; Compute Platform Version running the service.
	PlatformVersion *PlatformVersion

	// READ-ONLY; Private Static Load Balanced IP addresses of the API Management service which is deployed in an Internal Virtual
	// Network in a particular additional location. Available only for Basic, Standard,
	// Premium and Isolated SKU.
	PrivateIPAddresses []*string

	// READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in the additional location. Available
	// only for Basic, Standard, Premium and Isolated SKU.
	PublicIPAddresses []*string
}

AdditionalLocation - Description of an additional API Management resource location.

func (AdditionalLocation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AdditionalLocation.

func (*AdditionalLocation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalLocation.

type AlwaysLog

type AlwaysLog string

AlwaysLog - Specifies for what type of messages sampling settings should not apply.

const (
	// AlwaysLogAllErrors - Always log all erroneous request regardless of sampling settings.
	AlwaysLogAllErrors AlwaysLog = "allErrors"
)

func PossibleAlwaysLogValues

func PossibleAlwaysLogValues() []AlwaysLog

PossibleAlwaysLogValues returns the possible values for the AlwaysLog const type.

type ApimIdentityType

type ApimIdentityType string

ApimIdentityType - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.

const (
	ApimIdentityTypeNone                       ApimIdentityType = "None"
	ApimIdentityTypeSystemAssigned             ApimIdentityType = "SystemAssigned"
	ApimIdentityTypeSystemAssignedUserAssigned ApimIdentityType = "SystemAssigned, UserAssigned"
	ApimIdentityTypeUserAssigned               ApimIdentityType = "UserAssigned"
)

func PossibleApimIdentityTypeValues

func PossibleApimIdentityTypeValues() []ApimIdentityType

PossibleApimIdentityTypeValues returns the possible values for the ApimIdentityType const type.

type ApimResource

type ApimResource struct {
	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Resource ID.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
	Type *string
}

ApimResource - The Resource definition.

func (ApimResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ApimResource.

func (*ApimResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ApimResource.

type AppType

type AppType string
const (
	// AppTypeDeveloperPortal - User create request was sent by new developer portal.
	AppTypeDeveloperPortal AppType = "developerPortal"
	// AppTypePortal - User create request was sent by legacy developer portal.
	AppTypePortal AppType = "portal"
)

func PossibleAppTypeValues

func PossibleAppTypeValues() []AppType

PossibleAppTypeValues returns the possible values for the AppType const type.

type ArmIDWrapper

type ArmIDWrapper struct {
	// READ-ONLY
	ID *string
}

ArmIDWrapper - A wrapper for an ARM resource id

func (ArmIDWrapper) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ArmIDWrapper.

func (*ArmIDWrapper) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ArmIDWrapper.

type AssociationContract

type AssociationContract struct {
	// Association entity contract properties.
	Properties *AssociationContractProperties

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

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

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

AssociationContract - Association entity details.

func (AssociationContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AssociationContract.

func (*AssociationContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AssociationContract.

type AssociationContractProperties

type AssociationContractProperties struct {
	// Provisioning state.
	ProvisioningState *string
}

AssociationContractProperties - Association entity contract properties.

func (AssociationContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type AssociationContractProperties.

func (*AssociationContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AssociationContractProperties.

type AsyncOperationStatus

type AsyncOperationStatus string

AsyncOperationStatus - Status of an async operation.

const (
	AsyncOperationStatusStarted    AsyncOperationStatus = "Started"
	AsyncOperationStatusInProgress AsyncOperationStatus = "InProgress"
	AsyncOperationStatusSucceeded  AsyncOperationStatus = "Succeeded"
	AsyncOperationStatusFailed     AsyncOperationStatus = "Failed"
)

func PossibleAsyncOperationStatusValues

func PossibleAsyncOperationStatusValues() []AsyncOperationStatus

PossibleAsyncOperationStatusValues returns the possible values for the AsyncOperationStatus const type.

type AuthenticationSettingsContract

type AuthenticationSettingsContract struct {
	// OAuth2 Authentication settings
	OAuth2 *OAuth2AuthenticationSettingsContract

	// OpenID Connect Authentication Settings
	Openid *OpenIDAuthenticationSettingsContract
}

AuthenticationSettingsContract - API Authentication Settings.

func (AuthenticationSettingsContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type AuthenticationSettingsContract.

func (*AuthenticationSettingsContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AuthenticationSettingsContract.

type AuthorizationMethod

type AuthorizationMethod string
const (
	AuthorizationMethodHEAD    AuthorizationMethod = "HEAD"
	AuthorizationMethodOPTIONS AuthorizationMethod = "OPTIONS"
	AuthorizationMethodTRACE   AuthorizationMethod = "TRACE"
	AuthorizationMethodGET     AuthorizationMethod = "GET"
	AuthorizationMethodPOST    AuthorizationMethod = "POST"
	AuthorizationMethodPUT     AuthorizationMethod = "PUT"
	AuthorizationMethodPATCH   AuthorizationMethod = "PATCH"
	AuthorizationMethodDELETE  AuthorizationMethod = "DELETE"
)

func PossibleAuthorizationMethodValues

func PossibleAuthorizationMethodValues() []AuthorizationMethod

PossibleAuthorizationMethodValues returns the possible values for the AuthorizationMethod const type.

type AuthorizationServerClient

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

AuthorizationServerClient contains the methods for the AuthorizationServer group. Don't use this type directly, use NewAuthorizationServerClient() instead.

func NewAuthorizationServerClient

func NewAuthorizationServerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationServerClient, error)

NewAuthorizationServerClient creates a new instance of AuthorizationServerClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*AuthorizationServerClient) CreateOrUpdate

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • authsid - Identifier of the authorization server.
  • parameters - Create or update parameters.
  • options - AuthorizationServerClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationServerClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateAuthorizationServer.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAuthorizationServerClient().CreateOrUpdate(ctx, "rg1", "apimService1", "newauthServer", armapimanagement.AuthorizationServerContract{
		Properties: &armapimanagement.AuthorizationServerContractProperties{
			Description: to.Ptr("test server"),
			AuthorizationMethods: []*armapimanagement.AuthorizationMethod{
				to.Ptr(armapimanagement.AuthorizationMethodGET)},
			BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{
				to.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)},
			DefaultScope:               to.Ptr("read write"),
			ResourceOwnerPassword:      to.Ptr("pwd"),
			ResourceOwnerUsername:      to.Ptr("un"),
			SupportState:               to.Ptr(true),
			TokenEndpoint:              to.Ptr("https://www.contoso.com/oauth2/token"),
			AuthorizationEndpoint:      to.Ptr("https://www.contoso.com/oauth2/auth"),
			ClientID:                   to.Ptr("1"),
			ClientRegistrationEndpoint: to.Ptr("https://www.contoso.com/apps"),
			ClientSecret:               to.Ptr("2"),
			DisplayName:                to.Ptr("test2"),
			GrantTypes: []*armapimanagement.GrantType{
				to.Ptr(armapimanagement.GrantTypeAuthorizationCode),
				to.Ptr(armapimanagement.GrantTypeImplicit)},
		},
	}, &armapimanagement.AuthorizationServerClientCreateOrUpdateOptions{IfMatch: 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.AuthorizationServerContract = armapimanagement.AuthorizationServerContract{
	// 	Name: to.Ptr("newauthServer"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/authorizationServers"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers/newauthServer"),
	// 	Properties: &armapimanagement.AuthorizationServerContractProperties{
	// 		Description: to.Ptr("test server"),
	// 		AuthorizationMethods: []*armapimanagement.AuthorizationMethod{
	// 			to.Ptr(armapimanagement.AuthorizationMethodGET)},
	// 			BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{
	// 				to.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)},
	// 				DefaultScope: to.Ptr("read write"),
	// 				ResourceOwnerPassword: to.Ptr("pwd"),
	// 				ResourceOwnerUsername: to.Ptr("un"),
	// 				SupportState: to.Ptr(true),
	// 				TokenEndpoint: to.Ptr("https://www.contoso.com/oauth2/token"),
	// 				AuthorizationEndpoint: to.Ptr("https://www.contoso.com/oauth2/auth"),
	// 				ClientID: to.Ptr("1"),
	// 				ClientRegistrationEndpoint: to.Ptr("https://www.contoso.com/apps"),
	// 				DisplayName: to.Ptr("test2"),
	// 				GrantTypes: []*armapimanagement.GrantType{
	// 					to.Ptr(armapimanagement.GrantTypeAuthorizationCode),
	// 					to.Ptr(armapimanagement.GrantTypeImplicit)},
	// 				},
	// 			}
}
Output:

func (*AuthorizationServerClient) Delete

func (client *AuthorizationServerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, authsid string, ifMatch string, options *AuthorizationServerClientDeleteOptions) (AuthorizationServerClientDeleteResponse, error)

Delete - Deletes specific authorization server instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • authsid - Identifier of the authorization server.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - AuthorizationServerClientDeleteOptions contains the optional parameters for the AuthorizationServerClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteAuthorizationServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*AuthorizationServerClient) Get

Get - Gets the details of the authorization server specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • authsid - Identifier of the authorization server.
  • options - AuthorizationServerClientGetOptions contains the optional parameters for the AuthorizationServerClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetAuthorizationServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAuthorizationServerClient().Get(ctx, "rg1", "apimService1", "newauthServer2", 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.AuthorizationServerContract = armapimanagement.AuthorizationServerContract{
	// 	Name: to.Ptr("newauthServer2"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/authorizationServers"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers/newauthServer2"),
	// 	Properties: &armapimanagement.AuthorizationServerContractProperties{
	// 		Description: to.Ptr("test server"),
	// 		AuthorizationMethods: []*armapimanagement.AuthorizationMethod{
	// 			to.Ptr(armapimanagement.AuthorizationMethodGET)},
	// 			BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{
	// 				to.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)},
	// 				ClientAuthenticationMethod: []*armapimanagement.ClientAuthenticationMethod{
	// 					to.Ptr(armapimanagement.ClientAuthenticationMethodBasic)},
	// 					DefaultScope: to.Ptr("read write"),
	// 					ResourceOwnerPassword: to.Ptr("pwd"),
	// 					ResourceOwnerUsername: to.Ptr("un"),
	// 					SupportState: to.Ptr(true),
	// 					TokenEndpoint: to.Ptr("https://www.contoso.com/oauth2/token"),
	// 					AuthorizationEndpoint: to.Ptr("https://www.contoso.com/oauth2/auth"),
	// 					ClientID: to.Ptr("1"),
	// 					ClientRegistrationEndpoint: to.Ptr("https://www.contoso.com/apps"),
	// 					DisplayName: to.Ptr("test3"),
	// 					GrantTypes: []*armapimanagement.GrantType{
	// 						to.Ptr(armapimanagement.GrantTypeAuthorizationCode),
	// 						to.Ptr(armapimanagement.GrantTypeImplicit)},
	// 					},
	// 				}
}
Output:

func (*AuthorizationServerClient) GetEntityTag

GetEntityTag - Gets the entity state (Etag) version of the authorizationServer specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • authsid - Identifier of the authorization server.
  • options - AuthorizationServerClientGetEntityTagOptions contains the optional parameters for the AuthorizationServerClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadAuthorizationServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAuthorizationServerClient().GetEntityTag(ctx, "rg1", "apimService1", "newauthServer2", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*AuthorizationServerClient) ListSecrets

ListSecrets - Gets the client secret details of the authorization server. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • authsid - Identifier of the authorization server.
  • options - AuthorizationServerClientListSecretsOptions contains the optional parameters for the AuthorizationServerClient.ListSecrets method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementAuthorizationServerListSecrets.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAuthorizationServerClient().ListSecrets(ctx, "rg1", "apimService1", "newauthServer2", 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.AuthorizationServerSecretsContract = armapimanagement.AuthorizationServerSecretsContract{
	// 	ClientSecret: to.Ptr("2"),
	// 	ResourceOwnerPassword: to.Ptr("pwd"),
	// 	ResourceOwnerUsername: to.Ptr("un"),
	// }
}
Output:

func (*AuthorizationServerClient) NewListByServicePager added in v0.5.0

NewListByServicePager - Lists a collection of authorization servers defined within a service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - AuthorizationServerClientListByServiceOptions contains the optional parameters for the AuthorizationServerClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListAuthorizationServers.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAuthorizationServerClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.AuthorizationServerClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.AuthorizationServerCollection = armapimanagement.AuthorizationServerCollection{
		// 	Value: []*armapimanagement.AuthorizationServerContract{
		// 		{
		// 			Name: to.Ptr("newauthServer"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/authorizationServers"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers/newauthServer"),
		// 			Properties: &armapimanagement.AuthorizationServerContractProperties{
		// 				Description: to.Ptr("test server"),
		// 				AuthorizationMethods: []*armapimanagement.AuthorizationMethod{
		// 					to.Ptr(armapimanagement.AuthorizationMethodGET)},
		// 					BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{
		// 						to.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)},
		// 						DefaultScope: to.Ptr("read write"),
		// 						ResourceOwnerPassword: to.Ptr("pwd"),
		// 						ResourceOwnerUsername: to.Ptr("un"),
		// 						SupportState: to.Ptr(true),
		// 						TokenEndpoint: to.Ptr("https://www.contoso.com/oauth2/token"),
		// 						AuthorizationEndpoint: to.Ptr("https://www.contoso.com/oauth2/auth"),
		// 						ClientID: to.Ptr("1"),
		// 						ClientRegistrationEndpoint: to.Ptr("https://www.contoso.com/apps"),
		// 						DisplayName: to.Ptr("test2"),
		// 						GrantTypes: []*armapimanagement.GrantType{
		// 							to.Ptr(armapimanagement.GrantTypeAuthorizationCode),
		// 							to.Ptr(armapimanagement.GrantTypeImplicit)},
		// 						},
		// 					},
		// 					{
		// 						Name: to.Ptr("newauthServer2"),
		// 						Type: to.Ptr("Microsoft.ApiManagement/service/authorizationServers"),
		// 						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers/newauthServer2"),
		// 						Properties: &armapimanagement.AuthorizationServerContractProperties{
		// 							Description: to.Ptr("test server"),
		// 							AuthorizationMethods: []*armapimanagement.AuthorizationMethod{
		// 								to.Ptr(armapimanagement.AuthorizationMethodGET)},
		// 								BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{
		// 									to.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)},
		// 									ClientAuthenticationMethod: []*armapimanagement.ClientAuthenticationMethod{
		// 										to.Ptr(armapimanagement.ClientAuthenticationMethodBasic)},
		// 										DefaultScope: to.Ptr("read write"),
		// 										ResourceOwnerPassword: to.Ptr("pwd"),
		// 										ResourceOwnerUsername: to.Ptr("un"),
		// 										SupportState: to.Ptr(true),
		// 										TokenEndpoint: to.Ptr("https://www.contoso.com/oauth2/token"),
		// 										AuthorizationEndpoint: to.Ptr("https://www.contoso.com/oauth2/auth"),
		// 										ClientID: to.Ptr("1"),
		// 										ClientRegistrationEndpoint: to.Ptr("https://www.contoso.com/apps"),
		// 										DisplayName: to.Ptr("test3"),
		// 										GrantTypes: []*armapimanagement.GrantType{
		// 											to.Ptr(armapimanagement.GrantTypeAuthorizationCode),
		// 											to.Ptr(armapimanagement.GrantTypeImplicit)},
		// 										},
		// 								}},
		// 							}
	}
}
Output:

func (*AuthorizationServerClient) Update

Update - Updates the details of the authorization server specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • authsid - Identifier of the authorization server.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - OAuth2 Server settings Update parameters.
  • options - AuthorizationServerClientUpdateOptions contains the optional parameters for the AuthorizationServerClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateAuthorizationServer.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAuthorizationServerClient().Update(ctx, "rg1", "apimService1", "newauthServer", "*", armapimanagement.AuthorizationServerUpdateContract{
		Properties: &armapimanagement.AuthorizationServerUpdateContractProperties{
			ClientID:     to.Ptr("update"),
			ClientSecret: to.Ptr("updated"),
		},
	}, 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.AuthorizationServerContract = armapimanagement.AuthorizationServerContract{
	// 	Name: to.Ptr("newauthServer"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/authorizationServers"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers/newauthServer"),
	// 	Properties: &armapimanagement.AuthorizationServerContractProperties{
	// 		Description: to.Ptr("test server"),
	// 		AuthorizationMethods: []*armapimanagement.AuthorizationMethod{
	// 			to.Ptr(armapimanagement.AuthorizationMethodGET)},
	// 			BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{
	// 				to.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)},
	// 				ClientAuthenticationMethod: []*armapimanagement.ClientAuthenticationMethod{
	// 					to.Ptr(armapimanagement.ClientAuthenticationMethodBasic)},
	// 					DefaultScope: to.Ptr("read write"),
	// 					ResourceOwnerPassword: to.Ptr("pwd"),
	// 					ResourceOwnerUsername: to.Ptr("un"),
	// 					SupportState: to.Ptr(true),
	// 					TokenEndpoint: to.Ptr("https://www.contoso.com/oauth2/token"),
	// 					AuthorizationEndpoint: to.Ptr("https://www.contoso.com/oauth2/auth"),
	// 					ClientID: to.Ptr("updated"),
	// 					ClientRegistrationEndpoint: to.Ptr("https://www.contoso.com/apps"),
	// 					DisplayName: to.Ptr("test3"),
	// 					GrantTypes: []*armapimanagement.GrantType{
	// 						to.Ptr(armapimanagement.GrantTypeAuthorizationCode),
	// 						to.Ptr(armapimanagement.GrantTypeImplicit)},
	// 					},
	// 				}
}
Output:

type AuthorizationServerClientCreateOrUpdateOptions added in v0.3.0

type AuthorizationServerClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

AuthorizationServerClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationServerClient.CreateOrUpdate method.

type AuthorizationServerClientCreateOrUpdateResponse added in v0.3.0

type AuthorizationServerClientCreateOrUpdateResponse struct {
	AuthorizationServerContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

AuthorizationServerClientCreateOrUpdateResponse contains the response from method AuthorizationServerClient.CreateOrUpdate.

type AuthorizationServerClientDeleteOptions added in v0.3.0

type AuthorizationServerClientDeleteOptions struct {
}

AuthorizationServerClientDeleteOptions contains the optional parameters for the AuthorizationServerClient.Delete method.

type AuthorizationServerClientDeleteResponse added in v0.3.0

type AuthorizationServerClientDeleteResponse struct {
}

AuthorizationServerClientDeleteResponse contains the response from method AuthorizationServerClient.Delete.

type AuthorizationServerClientGetEntityTagOptions added in v0.3.0

type AuthorizationServerClientGetEntityTagOptions struct {
}

AuthorizationServerClientGetEntityTagOptions contains the optional parameters for the AuthorizationServerClient.GetEntityTag method.

type AuthorizationServerClientGetEntityTagResponse added in v0.3.0

type AuthorizationServerClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

AuthorizationServerClientGetEntityTagResponse contains the response from method AuthorizationServerClient.GetEntityTag.

type AuthorizationServerClientGetOptions added in v0.3.0

type AuthorizationServerClientGetOptions struct {
}

AuthorizationServerClientGetOptions contains the optional parameters for the AuthorizationServerClient.Get method.

type AuthorizationServerClientGetResponse added in v0.3.0

type AuthorizationServerClientGetResponse struct {
	AuthorizationServerContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

AuthorizationServerClientGetResponse contains the response from method AuthorizationServerClient.Get.

type AuthorizationServerClientListByServiceOptions added in v0.3.0

type AuthorizationServerClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

AuthorizationServerClientListByServiceOptions contains the optional parameters for the AuthorizationServerClient.NewListByServicePager method.

type AuthorizationServerClientListByServiceResponse added in v0.3.0

type AuthorizationServerClientListByServiceResponse struct {
	AuthorizationServerCollection
}

AuthorizationServerClientListByServiceResponse contains the response from method AuthorizationServerClient.NewListByServicePager.

type AuthorizationServerClientListSecretsOptions added in v0.3.0

type AuthorizationServerClientListSecretsOptions struct {
}

AuthorizationServerClientListSecretsOptions contains the optional parameters for the AuthorizationServerClient.ListSecrets method.

type AuthorizationServerClientListSecretsResponse added in v0.3.0

type AuthorizationServerClientListSecretsResponse struct {
	AuthorizationServerSecretsContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

AuthorizationServerClientListSecretsResponse contains the response from method AuthorizationServerClient.ListSecrets.

type AuthorizationServerClientUpdateOptions added in v0.3.0

type AuthorizationServerClientUpdateOptions struct {
}

AuthorizationServerClientUpdateOptions contains the optional parameters for the AuthorizationServerClient.Update method.

type AuthorizationServerClientUpdateResponse added in v0.3.0

type AuthorizationServerClientUpdateResponse struct {
	AuthorizationServerContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

AuthorizationServerClientUpdateResponse contains the response from method AuthorizationServerClient.Update.

type AuthorizationServerCollection

type AuthorizationServerCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*AuthorizationServerContract
}

AuthorizationServerCollection - Paged OAuth2 Authorization Servers list representation.

func (AuthorizationServerCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AuthorizationServerCollection.

func (*AuthorizationServerCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerCollection.

type AuthorizationServerContract

type AuthorizationServerContract struct {
	// Properties of the External OAuth authorization server Contract.
	Properties *AuthorizationServerContractProperties

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

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

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

AuthorizationServerContract - External OAuth authorization server settings.

func (AuthorizationServerContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContract.

func (*AuthorizationServerContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContract.

type AuthorizationServerContractBaseProperties

type AuthorizationServerContractBaseProperties struct {
	// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
	AuthorizationMethods []*AuthorizationMethod

	// Specifies the mechanism by which access token is passed to the API.
	BearerTokenSendingMethods []*BearerTokenSendingMethod

	// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or
	// Body. When Body is specified, client credentials and other parameters are passed
	// within the request body in the application/x-www-form-urlencoded format.
	ClientAuthenticationMethod []*ClientAuthenticationMethod

	// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in
	// the form of a string containing space-delimited values.
	DefaultScope *string

	// Description of the authorization server. Can contain HTML formatting tags.
	Description *string

	// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default
	// resource owner password.
	ResourceOwnerPassword *string

	// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default
	// resource owner username.
	ResourceOwnerUsername *string

	// If true, authorization server will include state parameter from the authorization request to its response. Client may use
	// state parameter to raise protocol security.
	SupportState *bool

	// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects
	// with name and value string properties, i.e. {"name" : "name value", "value":
	// "a value"}.
	TokenBodyParameters []*TokenBodyParameterContract

	// OAuth token endpoint. Contains absolute URI to entity being referenced.
	TokenEndpoint *string
}

AuthorizationServerContractBaseProperties - External OAuth authorization server Update settings contract.

func (AuthorizationServerContractBaseProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContractBaseProperties.

func (*AuthorizationServerContractBaseProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContractBaseProperties.

type AuthorizationServerContractProperties

type AuthorizationServerContractProperties struct {
	// REQUIRED; OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.
	AuthorizationEndpoint *string

	// REQUIRED; Client or app id registered with this authorization server.
	ClientID *string

	// REQUIRED; Optional reference to a page where client or app registration for this authorization server is performed. Contains
	// absolute URL to entity being referenced.
	ClientRegistrationEndpoint *string

	// REQUIRED; User-friendly authorization server name.
	DisplayName *string

	// REQUIRED; Form of an authorization grant, which the client uses to request the access token.
	GrantTypes []*GrantType

	// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
	AuthorizationMethods []*AuthorizationMethod

	// Specifies the mechanism by which access token is passed to the API.
	BearerTokenSendingMethods []*BearerTokenSendingMethod

	// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or
	// Body. When Body is specified, client credentials and other parameters are passed
	// within the request body in the application/x-www-form-urlencoded format.
	ClientAuthenticationMethod []*ClientAuthenticationMethod

	// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use
	// '/listSecrets' POST request to get the value.
	ClientSecret *string

	// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in
	// the form of a string containing space-delimited values.
	DefaultScope *string

	// Description of the authorization server. Can contain HTML formatting tags.
	Description *string

	// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default
	// resource owner password.
	ResourceOwnerPassword *string

	// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default
	// resource owner username.
	ResourceOwnerUsername *string

	// If true, authorization server will include state parameter from the authorization request to its response. Client may use
	// state parameter to raise protocol security.
	SupportState *bool

	// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects
	// with name and value string properties, i.e. {"name" : "name value", "value":
	// "a value"}.
	TokenBodyParameters []*TokenBodyParameterContract

	// OAuth token endpoint. Contains absolute URI to entity being referenced.
	TokenEndpoint *string
}

AuthorizationServerContractProperties - External OAuth authorization server settings Properties.

func (AuthorizationServerContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContractProperties.

func (*AuthorizationServerContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContractProperties.

type AuthorizationServerSecretsContract

type AuthorizationServerSecretsContract struct {
	// oAuth Authorization Server Secrets.
	ClientSecret *string

	// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default
	// resource owner password.
	ResourceOwnerPassword *string

	// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default
	// resource owner username.
	ResourceOwnerUsername *string
}

AuthorizationServerSecretsContract - OAuth Server Secrets Contract.

func (AuthorizationServerSecretsContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type AuthorizationServerSecretsContract.

func (*AuthorizationServerSecretsContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerSecretsContract.

type AuthorizationServerUpdateContract

type AuthorizationServerUpdateContract struct {
	// Properties of the External OAuth authorization server update Contract.
	Properties *AuthorizationServerUpdateContractProperties

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

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

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

AuthorizationServerUpdateContract - External OAuth authorization server settings.

func (AuthorizationServerUpdateContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AuthorizationServerUpdateContract.

func (*AuthorizationServerUpdateContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerUpdateContract.

type AuthorizationServerUpdateContractProperties

type AuthorizationServerUpdateContractProperties struct {
	// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.
	AuthorizationEndpoint *string

	// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
	AuthorizationMethods []*AuthorizationMethod

	// Specifies the mechanism by which access token is passed to the API.
	BearerTokenSendingMethods []*BearerTokenSendingMethod

	// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or
	// Body. When Body is specified, client credentials and other parameters are passed
	// within the request body in the application/x-www-form-urlencoded format.
	ClientAuthenticationMethod []*ClientAuthenticationMethod

	// Client or app id registered with this authorization server.
	ClientID *string

	// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute
	// URL to entity being referenced.
	ClientRegistrationEndpoint *string

	// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use
	// '/listSecrets' POST request to get the value.
	ClientSecret *string

	// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in
	// the form of a string containing space-delimited values.
	DefaultScope *string

	// Description of the authorization server. Can contain HTML formatting tags.
	Description *string

	// User-friendly authorization server name.
	DisplayName *string

	// Form of an authorization grant, which the client uses to request the access token.
	GrantTypes []*GrantType

	// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default
	// resource owner password.
	ResourceOwnerPassword *string

	// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default
	// resource owner username.
	ResourceOwnerUsername *string

	// If true, authorization server will include state parameter from the authorization request to its response. Client may use
	// state parameter to raise protocol security.
	SupportState *bool

	// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects
	// with name and value string properties, i.e. {"name" : "name value", "value":
	// "a value"}.
	TokenBodyParameters []*TokenBodyParameterContract

	// OAuth token endpoint. Contains absolute URI to entity being referenced.
	TokenEndpoint *string
}

AuthorizationServerUpdateContractProperties - External OAuth authorization server Update settings contract.

func (AuthorizationServerUpdateContractProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type AuthorizationServerUpdateContractProperties.

func (*AuthorizationServerUpdateContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerUpdateContractProperties.

type BackendAuthorizationHeaderCredentials

type BackendAuthorizationHeaderCredentials struct {
	// REQUIRED; Authentication Parameter value.
	Parameter *string

	// REQUIRED; Authentication Scheme name.
	Scheme *string
}

BackendAuthorizationHeaderCredentials - Authorization header information.

func (BackendAuthorizationHeaderCredentials) MarshalJSON added in v1.1.0

func (b BackendAuthorizationHeaderCredentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendAuthorizationHeaderCredentials.

func (*BackendAuthorizationHeaderCredentials) UnmarshalJSON added in v1.1.0

func (b *BackendAuthorizationHeaderCredentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendAuthorizationHeaderCredentials.

type BackendBaseParameters

type BackendBaseParameters struct {
	// Backend Credentials Contract Properties
	Credentials *BackendCredentialsContract

	// Backend Description.
	Description *string

	// Backend Properties contract
	Properties *BackendProperties

	// Backend Proxy Contract Properties
	Proxy *BackendProxyContract

	// Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or
	// API Apps.
	ResourceID *string

	// Backend TLS Properties
	TLS *BackendTLSProperties

	// Backend Title.
	Title *string
}

BackendBaseParameters - Backend entity base Parameter set.

func (BackendBaseParameters) MarshalJSON added in v1.1.0

func (b BackendBaseParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendBaseParameters.

func (*BackendBaseParameters) UnmarshalJSON added in v1.1.0

func (b *BackendBaseParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendBaseParameters.

type BackendClient

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

BackendClient contains the methods for the Backend group. Don't use this type directly, use NewBackendClient() instead.

func NewBackendClient

func NewBackendClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackendClient, error)

NewBackendClient creates a new instance of BackendClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*BackendClient) CreateOrUpdate

func (client *BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendContract, options *BackendClientCreateOrUpdateOptions) (BackendClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or Updates a backend. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance.
  • parameters - Create parameters.
  • options - BackendClientCreateOrUpdateOptions contains the optional parameters for the BackendClient.CreateOrUpdate method.
Example (ApiManagementCreateBackendProxyBackend)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateBackendProxyBackend.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewBackendClient().CreateOrUpdate(ctx, "rg1", "apimService1", "proxybackend", armapimanagement.BackendContract{
		Properties: &armapimanagement.BackendContractProperties{
			Description: to.Ptr("description5308"),
			Credentials: &armapimanagement.BackendCredentialsContract{
				Authorization: &armapimanagement.BackendAuthorizationHeaderCredentials{
					Parameter: to.Ptr("opensesma"),
					Scheme:    to.Ptr("Basic"),
				},
				Header: map[string][]*string{
					"x-my-1": {
						to.Ptr("val1"),
						to.Ptr("val2")},
				},
				Query: map[string][]*string{
					"sv": {
						to.Ptr("xx"),
						to.Ptr("bb"),
						to.Ptr("cc")},
				},
			},
			Proxy: &armapimanagement.BackendProxyContract{
				Password: to.Ptr("<password>"),
				URL:      to.Ptr("http://192.168.1.1:8080"),
				Username: to.Ptr("Contoso\\admin"),
			},
			TLS: &armapimanagement.BackendTLSProperties{
				ValidateCertificateChain: to.Ptr(true),
				ValidateCertificateName:  to.Ptr(true),
			},
			URL:      to.Ptr("https://backendname2644/"),
			Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
		},
	}, &armapimanagement.BackendClientCreateOrUpdateOptions{IfMatch: 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.BackendContract = armapimanagement.BackendContract{
	// 	Name: to.Ptr("proxybackend"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/backends"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/proxybackend"),
	// 	Properties: &armapimanagement.BackendContractProperties{
	// 		Description: to.Ptr("description5308"),
	// 		Credentials: &armapimanagement.BackendCredentialsContract{
	// 			Authorization: &armapimanagement.BackendAuthorizationHeaderCredentials{
	// 				Parameter: to.Ptr("opensesma"),
	// 				Scheme: to.Ptr("Basic"),
	// 			},
	// 			Header: map[string][]*string{
	// 				"x-my-1": []*string{
	// 					to.Ptr("val1"),
	// 					to.Ptr("val2")},
	// 				},
	// 				Query: map[string][]*string{
	// 					"sv": []*string{
	// 						to.Ptr("xx"),
	// 						to.Ptr("bb"),
	// 						to.Ptr("cc")},
	// 					},
	// 				},
	// 				Proxy: &armapimanagement.BackendProxyContract{
	// 					Password: to.Ptr("<password>"),
	// 					URL: to.Ptr("http://192.168.1.1:8080"),
	// 					Username: to.Ptr("Contoso\\admin"),
	// 				},
	// 				TLS: &armapimanagement.BackendTLSProperties{
	// 					ValidateCertificateChain: to.Ptr(false),
	// 					ValidateCertificateName: to.Ptr(false),
	// 				},
	// 				URL: to.Ptr("https://backendname2644/"),
	// 				Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
	// 			},
	// 		}
}
Output:

Example (ApiManagementCreateBackendServiceFabric)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateBackendServiceFabric.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewBackendClient().CreateOrUpdate(ctx, "rg1", "apimService1", "sfbackend", armapimanagement.BackendContract{
		Properties: &armapimanagement.BackendContractProperties{
			Description: to.Ptr("Service Fabric Test App 1"),
			Properties: &armapimanagement.BackendProperties{
				ServiceFabricCluster: &armapimanagement.BackendServiceFabricClusterProperties{
					ClientCertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"),
					ManagementEndpoints: []*string{
						to.Ptr("https://somecluster.com")},
					MaxPartitionResolutionRetries: to.Ptr[int32](5),
					ServerX509Names: []*armapimanagement.X509CertificateName{
						{
							Name:                        to.Ptr("ServerCommonName1"),
							IssuerCertificateThumbprint: to.Ptr("IssuerCertificateThumbprint1"),
						}},
				},
			},
			URL:      to.Ptr("fabric:/mytestapp/mytestservice"),
			Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
		},
	}, &armapimanagement.BackendClientCreateOrUpdateOptions{IfMatch: 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.BackendContract = armapimanagement.BackendContract{
	// 	Name: to.Ptr("sfbackend"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/backends"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/sfbackend"),
	// 	Properties: &armapimanagement.BackendContractProperties{
	// 		Description: to.Ptr("Service Fabric Test App 1"),
	// 		Properties: &armapimanagement.BackendProperties{
	// 			ServiceFabricCluster: &armapimanagement.BackendServiceFabricClusterProperties{
	// 				ClientCertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"),
	// 				ManagementEndpoints: []*string{
	// 					to.Ptr("https://somecluster.com")},
	// 					MaxPartitionResolutionRetries: to.Ptr[int32](5),
	// 					ServerX509Names: []*armapimanagement.X509CertificateName{
	// 						{
	// 							Name: to.Ptr("ServerCommonName1"),
	// 							IssuerCertificateThumbprint: to.Ptr("IssuerCertificateThumbprint1"),
	// 					}},
	// 				},
	// 			},
	// 			URL: to.Ptr("fabric:/mytestapp/mytestservice"),
	// 			Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
	// 		},
	// 	}
}
Output:

func (*BackendClient) Delete

func (client *BackendClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, backendID string, ifMatch string, options *BackendClientDeleteOptions) (BackendClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - BackendClientDeleteOptions contains the optional parameters for the BackendClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteBackend.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*BackendClient) Get

func (client *BackendClient) Get(ctx context.Context, resourceGroupName string, serviceName string, backendID string, options *BackendClientGetOptions) (BackendClientGetResponse, error)

Get - Gets the details of the backend specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance.
  • options - BackendClientGetOptions contains the optional parameters for the BackendClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetBackend.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewBackendClient().Get(ctx, "rg1", "apimService1", "sfbackend", 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.BackendContract = armapimanagement.BackendContract{
	// 	Name: to.Ptr("sfbackend"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/backends"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/sfbackend"),
	// 	Properties: &armapimanagement.BackendContractProperties{
	// 		Description: to.Ptr("Service Fabric Test App 1"),
	// 		Properties: &armapimanagement.BackendProperties{
	// 			ServiceFabricCluster: &armapimanagement.BackendServiceFabricClusterProperties{
	// 				ClientCertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"),
	// 				ManagementEndpoints: []*string{
	// 					to.Ptr("https://somecluster.com")},
	// 					MaxPartitionResolutionRetries: to.Ptr[int32](5),
	// 					ServerX509Names: []*armapimanagement.X509CertificateName{
	// 						{
	// 							Name: to.Ptr("ServerCommonName1"),
	// 							IssuerCertificateThumbprint: to.Ptr("IssuerCertificateThumbprint1"),
	// 					}},
	// 				},
	// 			},
	// 			URL: to.Ptr("fabric:/mytestapp/mytestservice"),
	// 			Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
	// 		},
	// 	}
}
Output:

func (*BackendClient) GetEntityTag

func (client *BackendClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, backendID string, options *BackendClientGetEntityTagOptions) (BackendClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the backend specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance.
  • options - BackendClientGetEntityTagOptions contains the optional parameters for the BackendClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadBackend.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewBackendClient().GetEntityTag(ctx, "rg1", "apimService1", "sfbackend", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*BackendClient) NewListByServicePager added in v0.5.0

func (client *BackendClient) NewListByServicePager(resourceGroupName string, serviceName string, options *BackendClientListByServiceOptions) *runtime.Pager[BackendClientListByServiceResponse]

NewListByServicePager - Lists a collection of backends in the specified service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - BackendClientListByServiceOptions contains the optional parameters for the BackendClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListBackends.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewBackendClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.BackendClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.BackendCollection = armapimanagement.BackendCollection{
		// 	Count: to.Ptr[int64](2),
		// 	Value: []*armapimanagement.BackendContract{
		// 		{
		// 			Name: to.Ptr("proxybackend"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/backends"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/proxybackend"),
		// 			Properties: &armapimanagement.BackendContractProperties{
		// 				Description: to.Ptr("description5308"),
		// 				Credentials: &armapimanagement.BackendCredentialsContract{
		// 					Authorization: &armapimanagement.BackendAuthorizationHeaderCredentials{
		// 						Parameter: to.Ptr("opensesma"),
		// 						Scheme: to.Ptr("Basic"),
		// 					},
		// 					Header: map[string][]*string{
		// 						"x-my-1": []*string{
		// 							to.Ptr("val1"),
		// 							to.Ptr("val2")},
		// 						},
		// 						Query: map[string][]*string{
		// 							"sv": []*string{
		// 								to.Ptr("xx"),
		// 								to.Ptr("bb"),
		// 								to.Ptr("cc")},
		// 							},
		// 						},
		// 						Proxy: &armapimanagement.BackendProxyContract{
		// 							Password: to.Ptr("<password>"),
		// 							URL: to.Ptr("http://192.168.1.1:8080"),
		// 							Username: to.Ptr("Contoso\\admin"),
		// 						},
		// 						TLS: &armapimanagement.BackendTLSProperties{
		// 							ValidateCertificateChain: to.Ptr(false),
		// 							ValidateCertificateName: to.Ptr(false),
		// 						},
		// 						URL: to.Ptr("https://backendname2644/"),
		// 						Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("sfbackend"),
		// 					Type: to.Ptr("Microsoft.ApiManagement/service/backends"),
		// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/sfbackend"),
		// 					Properties: &armapimanagement.BackendContractProperties{
		// 						Description: to.Ptr("Service Fabric Test App 1"),
		// 						Properties: &armapimanagement.BackendProperties{
		// 							ServiceFabricCluster: &armapimanagement.BackendServiceFabricClusterProperties{
		// 								ClientCertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"),
		// 								ManagementEndpoints: []*string{
		// 									to.Ptr("https://somecluster.com")},
		// 									MaxPartitionResolutionRetries: to.Ptr[int32](5),
		// 									ServerX509Names: []*armapimanagement.X509CertificateName{
		// 										{
		// 											Name: to.Ptr("ServerCommonName1"),
		// 											IssuerCertificateThumbprint: to.Ptr("IssuerCertificateThumbprint1"),
		// 									}},
		// 								},
		// 							},
		// 							URL: to.Ptr("fabric:/mytestapp/mytestservice"),
		// 							Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
		// 						},
		// 				}},
		// 			}
	}
}
Output:

func (*BackendClient) Reconnect

func (client *BackendClient) Reconnect(ctx context.Context, resourceGroupName string, serviceName string, backendID string, options *BackendClientReconnectOptions) (BackendClientReconnectResponse, error)

Reconnect - Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was specified, timeout of 2 minutes is used. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance.
  • options - BackendClientReconnectOptions contains the optional parameters for the BackendClient.Reconnect method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackendReconnect.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewBackendClient().Reconnect(ctx, "rg1", "apimService1", "proxybackend", &armapimanagement.BackendClientReconnectOptions{Parameters: &armapimanagement.BackendReconnectContract{
		Properties: &armapimanagement.BackendReconnectProperties{
			After: to.Ptr("PT3S"),
		},
	},
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*BackendClient) Update

func (client *BackendClient) Update(ctx context.Context, resourceGroupName string, serviceName string, backendID string, ifMatch string, parameters BackendUpdateParameters, options *BackendClientUpdateOptions) (BackendClientUpdateResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - BackendClientUpdateOptions contains the optional parameters for the BackendClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateBackend.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewBackendClient().Update(ctx, "rg1", "apimService1", "proxybackend", "*", armapimanagement.BackendUpdateParameters{
		Properties: &armapimanagement.BackendUpdateParameterProperties{
			Description: to.Ptr("description5308"),
			TLS: &armapimanagement.BackendTLSProperties{
				ValidateCertificateChain: to.Ptr(false),
				ValidateCertificateName:  to.Ptr(true),
			},
		},
	}, 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.BackendContract = armapimanagement.BackendContract{
	// 	Name: to.Ptr("proxybackend"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/backends"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/proxybackend"),
	// 	Properties: &armapimanagement.BackendContractProperties{
	// 		Description: to.Ptr("description5308"),
	// 		Credentials: &armapimanagement.BackendCredentialsContract{
	// 			Authorization: &armapimanagement.BackendAuthorizationHeaderCredentials{
	// 				Parameter: to.Ptr("opensesma"),
	// 				Scheme: to.Ptr("Basic"),
	// 			},
	// 			Header: map[string][]*string{
	// 				"x-my-1": []*string{
	// 					to.Ptr("val1"),
	// 					to.Ptr("val2")},
	// 				},
	// 				Query: map[string][]*string{
	// 					"sv": []*string{
	// 						to.Ptr("xx"),
	// 						to.Ptr("bb"),
	// 						to.Ptr("cc")},
	// 					},
	// 				},
	// 				Proxy: &armapimanagement.BackendProxyContract{
	// 					Password: to.Ptr("<password>"),
	// 					URL: to.Ptr("http://192.168.1.1:8080"),
	// 					Username: to.Ptr("Contoso\\admin"),
	// 				},
	// 				TLS: &armapimanagement.BackendTLSProperties{
	// 					ValidateCertificateChain: to.Ptr(false),
	// 					ValidateCertificateName: to.Ptr(true),
	// 				},
	// 				URL: to.Ptr("https://backendname2644/"),
	// 				Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
	// 			},
	// 		}
}
Output:

type BackendClientCreateOrUpdateOptions added in v0.3.0

type BackendClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

BackendClientCreateOrUpdateOptions contains the optional parameters for the BackendClient.CreateOrUpdate method.

type BackendClientCreateOrUpdateResponse added in v0.3.0

type BackendClientCreateOrUpdateResponse struct {
	BackendContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

BackendClientCreateOrUpdateResponse contains the response from method BackendClient.CreateOrUpdate.

type BackendClientDeleteOptions added in v0.3.0

type BackendClientDeleteOptions struct {
}

BackendClientDeleteOptions contains the optional parameters for the BackendClient.Delete method.

type BackendClientDeleteResponse added in v0.3.0

type BackendClientDeleteResponse struct {
}

BackendClientDeleteResponse contains the response from method BackendClient.Delete.

type BackendClientGetEntityTagOptions added in v0.3.0

type BackendClientGetEntityTagOptions struct {
}

BackendClientGetEntityTagOptions contains the optional parameters for the BackendClient.GetEntityTag method.

type BackendClientGetEntityTagResponse added in v0.3.0

type BackendClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

BackendClientGetEntityTagResponse contains the response from method BackendClient.GetEntityTag.

type BackendClientGetOptions added in v0.3.0

type BackendClientGetOptions struct {
}

BackendClientGetOptions contains the optional parameters for the BackendClient.Get method.

type BackendClientGetResponse added in v0.3.0

type BackendClientGetResponse struct {
	BackendContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

BackendClientGetResponse contains the response from method BackendClient.Get.

type BackendClientListByServiceOptions added in v0.3.0

type BackendClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | title | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | url | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

BackendClientListByServiceOptions contains the optional parameters for the BackendClient.NewListByServicePager method.

type BackendClientListByServiceResponse added in v0.3.0

type BackendClientListByServiceResponse struct {
	BackendCollection
}

BackendClientListByServiceResponse contains the response from method BackendClient.NewListByServicePager.

type BackendClientReconnectOptions added in v0.3.0

type BackendClientReconnectOptions struct {
	// Reconnect request parameters.
	Parameters *BackendReconnectContract
}

BackendClientReconnectOptions contains the optional parameters for the BackendClient.Reconnect method.

type BackendClientReconnectResponse added in v0.3.0

type BackendClientReconnectResponse struct {
}

BackendClientReconnectResponse contains the response from method BackendClient.Reconnect.

type BackendClientUpdateOptions added in v0.3.0

type BackendClientUpdateOptions struct {
}

BackendClientUpdateOptions contains the optional parameters for the BackendClient.Update method.

type BackendClientUpdateResponse added in v0.3.0

type BackendClientUpdateResponse struct {
	BackendContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

BackendClientUpdateResponse contains the response from method BackendClient.Update.

type BackendCollection

type BackendCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Backend values.
	Value []*BackendContract
}

BackendCollection - Paged Backend list representation.

func (BackendCollection) MarshalJSON

func (b BackendCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendCollection.

func (*BackendCollection) UnmarshalJSON added in v1.1.0

func (b *BackendCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendCollection.

type BackendContract

type BackendContract struct {
	// Backend entity contract properties.
	Properties *BackendContractProperties

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

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

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

BackendContract - Backend details.

func (BackendContract) MarshalJSON

func (b BackendContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendContract.

func (*BackendContract) UnmarshalJSON added in v1.1.0

func (b *BackendContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendContract.

type BackendContractProperties

type BackendContractProperties struct {
	// REQUIRED; Backend communication protocol.
	Protocol *BackendProtocol

	// REQUIRED; Runtime Url of the Backend.
	URL *string

	// Backend Credentials Contract Properties
	Credentials *BackendCredentialsContract

	// Backend Description.
	Description *string

	// Backend Properties contract
	Properties *BackendProperties

	// Backend Proxy Contract Properties
	Proxy *BackendProxyContract

	// Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or
	// API Apps.
	ResourceID *string

	// Backend TLS Properties
	TLS *BackendTLSProperties

	// Backend Title.
	Title *string
}

BackendContractProperties - Parameters supplied to the Create Backend operation.

func (BackendContractProperties) MarshalJSON added in v1.1.0

func (b BackendContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendContractProperties.

func (*BackendContractProperties) UnmarshalJSON added in v1.1.0

func (b *BackendContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendContractProperties.

type BackendCredentialsContract

type BackendCredentialsContract struct {
	// Authorization header authentication
	Authorization *BackendAuthorizationHeaderCredentials

	// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided.
	Certificate []*string

	// List of Client Certificate Ids.
	CertificateIDs []*string

	// Header Parameter description.
	Header map[string][]*string

	// Query Parameter description.
	Query map[string][]*string
}

BackendCredentialsContract - Details of the Credentials used to connect to Backend.

func (BackendCredentialsContract) MarshalJSON

func (b BackendCredentialsContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendCredentialsContract.

func (*BackendCredentialsContract) UnmarshalJSON added in v1.1.0

func (b *BackendCredentialsContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendCredentialsContract.

type BackendProperties

type BackendProperties struct {
	// Backend Service Fabric Cluster Properties
	ServiceFabricCluster *BackendServiceFabricClusterProperties
}

BackendProperties - Properties specific to the Backend Type.

func (BackendProperties) MarshalJSON added in v1.1.0

func (b BackendProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendProperties.

func (*BackendProperties) UnmarshalJSON added in v1.1.0

func (b *BackendProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendProperties.

type BackendProtocol

type BackendProtocol string

BackendProtocol - Backend communication protocol.

const (
	// BackendProtocolHTTP - The Backend is a RESTful service.
	BackendProtocolHTTP BackendProtocol = "http"
	// BackendProtocolSoap - The Backend is a SOAP service.
	BackendProtocolSoap BackendProtocol = "soap"
)

func PossibleBackendProtocolValues

func PossibleBackendProtocolValues() []BackendProtocol

PossibleBackendProtocolValues returns the possible values for the BackendProtocol const type.

type BackendProxyContract

type BackendProxyContract struct {
	// REQUIRED; WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all
	// fragments and query strings.
	URL *string

	// Password to connect to the WebProxy Server
	Password *string

	// Username to connect to the WebProxy server
	Username *string
}

BackendProxyContract - Details of the Backend WebProxy Server to use in the Request to Backend.

func (BackendProxyContract) MarshalJSON added in v1.1.0

func (b BackendProxyContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendProxyContract.

func (*BackendProxyContract) UnmarshalJSON added in v1.1.0

func (b *BackendProxyContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendProxyContract.

type BackendReconnectContract

type BackendReconnectContract struct {
	// Reconnect request properties.
	Properties *BackendReconnectProperties

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

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

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

BackendReconnectContract - Reconnect request parameters.

func (BackendReconnectContract) MarshalJSON

func (b BackendReconnectContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendReconnectContract.

func (*BackendReconnectContract) UnmarshalJSON added in v1.1.0

func (b *BackendReconnectContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendReconnectContract.

type BackendReconnectProperties

type BackendReconnectProperties struct {
	// Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M.
	After *string
}

BackendReconnectProperties - Properties to control reconnect requests.

func (BackendReconnectProperties) MarshalJSON added in v1.1.0

func (b BackendReconnectProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendReconnectProperties.

func (*BackendReconnectProperties) UnmarshalJSON added in v1.1.0

func (b *BackendReconnectProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendReconnectProperties.

type BackendServiceFabricClusterProperties

type BackendServiceFabricClusterProperties struct {
	// REQUIRED; The cluster management endpoint.
	ManagementEndpoints []*string

	// The client certificate id for the management endpoint.
	ClientCertificateID *string

	// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided
	ClientCertificatethumbprint *string

	// Maximum number of retries while attempting resolve the partition.
	MaxPartitionResolutionRetries *int32

	// Thumbprints of certificates cluster management service uses for tls communication
	ServerCertificateThumbprints []*string

	// Server X509 Certificate Names Collection
	ServerX509Names []*X509CertificateName
}

BackendServiceFabricClusterProperties - Properties of the Service Fabric Type Backend.

func (BackendServiceFabricClusterProperties) MarshalJSON

func (b BackendServiceFabricClusterProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendServiceFabricClusterProperties.

func (*BackendServiceFabricClusterProperties) UnmarshalJSON added in v1.1.0

func (b *BackendServiceFabricClusterProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendServiceFabricClusterProperties.

type BackendTLSProperties

type BackendTLSProperties struct {
	// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend
	// host.
	ValidateCertificateChain *bool

	// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend
	// host.
	ValidateCertificateName *bool
}

BackendTLSProperties - Properties controlling TLS Certificate Validation.

func (BackendTLSProperties) MarshalJSON added in v1.1.0

func (b BackendTLSProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendTLSProperties.

func (*BackendTLSProperties) UnmarshalJSON added in v1.1.0

func (b *BackendTLSProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendTLSProperties.

type BackendUpdateParameterProperties

type BackendUpdateParameterProperties struct {
	// Backend Credentials Contract Properties
	Credentials *BackendCredentialsContract

	// Backend Description.
	Description *string

	// Backend Properties contract
	Properties *BackendProperties

	// Backend communication protocol.
	Protocol *BackendProtocol

	// Backend Proxy Contract Properties
	Proxy *BackendProxyContract

	// Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or
	// API Apps.
	ResourceID *string

	// Backend TLS Properties
	TLS *BackendTLSProperties

	// Backend Title.
	Title *string

	// Runtime Url of the Backend.
	URL *string
}

BackendUpdateParameterProperties - Parameters supplied to the Update Backend operation.

func (BackendUpdateParameterProperties) MarshalJSON added in v1.1.0

func (b BackendUpdateParameterProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendUpdateParameterProperties.

func (*BackendUpdateParameterProperties) UnmarshalJSON added in v1.1.0

func (b *BackendUpdateParameterProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendUpdateParameterProperties.

type BackendUpdateParameters

type BackendUpdateParameters struct {
	// Backend entity update contract properties.
	Properties *BackendUpdateParameterProperties
}

BackendUpdateParameters - Backend update parameters.

func (BackendUpdateParameters) MarshalJSON

func (b BackendUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackendUpdateParameters.

func (*BackendUpdateParameters) UnmarshalJSON added in v1.1.0

func (b *BackendUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackendUpdateParameters.

type BearerTokenSendingMethod

type BearerTokenSendingMethod string
const (
	BearerTokenSendingMethodAuthorizationHeader BearerTokenSendingMethod = "authorizationHeader"
	BearerTokenSendingMethodQuery               BearerTokenSendingMethod = "query"
)

func PossibleBearerTokenSendingMethodValues

func PossibleBearerTokenSendingMethodValues() []BearerTokenSendingMethod

PossibleBearerTokenSendingMethodValues returns the possible values for the BearerTokenSendingMethod const type.

type BearerTokenSendingMethods

type BearerTokenSendingMethods string

BearerTokenSendingMethods - Form of an authorization grant, which the client uses to request the access token.

const (
	// BearerTokenSendingMethodsAuthorizationHeader - Access token will be transmitted in the Authorization header using Bearer
	// schema
	BearerTokenSendingMethodsAuthorizationHeader BearerTokenSendingMethods = "authorizationHeader"
	// BearerTokenSendingMethodsQuery - Access token will be transmitted as query parameters.
	BearerTokenSendingMethodsQuery BearerTokenSendingMethods = "query"
)

func PossibleBearerTokenSendingMethodsValues

func PossibleBearerTokenSendingMethodsValues() []BearerTokenSendingMethods

PossibleBearerTokenSendingMethodsValues returns the possible values for the BearerTokenSendingMethods const type.

type BodyDiagnosticSettings

type BodyDiagnosticSettings struct {
	// Number of request body bytes to log.
	Bytes *int32
}

BodyDiagnosticSettings - Body logging settings.

func (BodyDiagnosticSettings) MarshalJSON added in v1.1.0

func (b BodyDiagnosticSettings) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BodyDiagnosticSettings.

func (*BodyDiagnosticSettings) UnmarshalJSON added in v1.1.0

func (b *BodyDiagnosticSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BodyDiagnosticSettings.

type CacheClient

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

CacheClient contains the methods for the Cache group. Don't use this type directly, use NewCacheClient() instead.

func NewCacheClient

func NewCacheClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CacheClient, error)

NewCacheClient creates a new instance of CacheClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*CacheClient) CreateOrUpdate

func (client *CacheClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheContract, options *CacheClientCreateOrUpdateOptions) (CacheClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates an External Cache to be used in Api Management instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).
  • parameters - Create or Update parameters.
  • options - CacheClientCreateOrUpdateOptions contains the optional parameters for the CacheClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCache.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCacheClient().CreateOrUpdate(ctx, "rg1", "apimService1", "c1", armapimanagement.CacheContract{
		Properties: &armapimanagement.CacheContractProperties{
			Description:      to.Ptr("Redis cache instances in West India"),
			ConnectionString: to.Ptr("apim.redis.cache.windows.net:6380,password=xc,ssl=True,abortConnect=False"),
			ResourceID:       to.Ptr("https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/apimservice1"),
			UseFromLocation:  to.Ptr("default"),
		},
	}, &armapimanagement.CacheClientCreateOrUpdateOptions{IfMatch: 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.CacheContract = armapimanagement.CacheContract{
	// 	Name: to.Ptr("c1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/caches"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/c1"),
	// 	Properties: &armapimanagement.CacheContractProperties{
	// 		Description: to.Ptr("Redis cache instances in West India"),
	// 		ConnectionString: to.Ptr("{{5f7fbca77a891a2200f3db38}}"),
	// 		ResourceID: to.Ptr("https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/apimservice1"),
	// 		UseFromLocation: to.Ptr("default"),
	// 	},
	// }
}
Output:

func (*CacheClient) Delete

func (client *CacheClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, ifMatch string, options *CacheClientDeleteOptions) (CacheClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - CacheClientDeleteOptions contains the optional parameters for the CacheClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteCache.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*CacheClient) Get

func (client *CacheClient) Get(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, options *CacheClientGetOptions) (CacheClientGetResponse, error)

Get - Gets the details of the Cache specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).
  • options - CacheClientGetOptions contains the optional parameters for the CacheClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCache.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCacheClient().Get(ctx, "rg1", "apimService1", "c1", 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.CacheContract = armapimanagement.CacheContract{
	// 	Name: to.Ptr("c1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/caches"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/c1"),
	// 	Properties: &armapimanagement.CacheContractProperties{
	// 		Description: to.Ptr("Redis cache instances in West India"),
	// 		ConnectionString: to.Ptr("{{5f7fbca77a891a2200f3db38}}"),
	// 		ResourceID: to.Ptr("https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/apimservice1"),
	// 		UseFromLocation: to.Ptr("default"),
	// 	},
	// }
}
Output:

func (*CacheClient) GetEntityTag

func (client *CacheClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, options *CacheClientGetEntityTagOptions) (CacheClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the Cache specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).
  • options - CacheClientGetEntityTagOptions contains the optional parameters for the CacheClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadCache.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*CacheClient) NewListByServicePager added in v0.5.0

func (client *CacheClient) NewListByServicePager(resourceGroupName string, serviceName string, options *CacheClientListByServiceOptions) *runtime.Pager[CacheClientListByServiceResponse]

NewListByServicePager - Lists a collection of all external Caches in the specified service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - CacheClientListByServiceOptions contains the optional parameters for the CacheClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListCaches.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCacheClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.CacheClientListByServiceOptions{Top: nil,
		Skip: 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.CacheCollection = armapimanagement.CacheCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.CacheContract{
		// 		{
		// 			Name: to.Ptr("c1"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/caches"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/c1"),
		// 			Properties: &armapimanagement.CacheContractProperties{
		// 				Description: to.Ptr("Redis cache instances in West India"),
		// 				ConnectionString: to.Ptr("{{5f7fbca77a891a2200f3db38}}"),
		// 				ResourceID: to.Ptr("https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/apimservice1"),
		// 				UseFromLocation: to.Ptr("default"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*CacheClient) Update

func (client *CacheClient) Update(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, ifMatch string, parameters CacheUpdateParameters, options *CacheClientUpdateOptions) (CacheClientUpdateResponse, error)

Update - Updates the details of the cache specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - CacheClientUpdateOptions contains the optional parameters for the CacheClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateCache.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCacheClient().Update(ctx, "rg1", "apimService1", "c1", "*", armapimanagement.CacheUpdateParameters{
		Properties: &armapimanagement.CacheUpdateProperties{
			UseFromLocation: to.Ptr("westindia"),
		},
	}, 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.CacheContract = armapimanagement.CacheContract{
	// 	Name: to.Ptr("c1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/caches"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/c1"),
	// 	Properties: &armapimanagement.CacheContractProperties{
	// 		Description: to.Ptr("Redis cache instances in West India"),
	// 		ConnectionString: to.Ptr("{{5f7fbca77a891a2200f3db38}}"),
	// 		ResourceID: to.Ptr("https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/apimservice1"),
	// 		UseFromLocation: to.Ptr("westindia"),
	// 	},
	// }
}
Output:

type CacheClientCreateOrUpdateOptions added in v0.3.0

type CacheClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

CacheClientCreateOrUpdateOptions contains the optional parameters for the CacheClient.CreateOrUpdate method.

type CacheClientCreateOrUpdateResponse added in v0.3.0

type CacheClientCreateOrUpdateResponse struct {
	CacheContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

CacheClientCreateOrUpdateResponse contains the response from method CacheClient.CreateOrUpdate.

type CacheClientDeleteOptions added in v0.3.0

type CacheClientDeleteOptions struct {
}

CacheClientDeleteOptions contains the optional parameters for the CacheClient.Delete method.

type CacheClientDeleteResponse added in v0.3.0

type CacheClientDeleteResponse struct {
}

CacheClientDeleteResponse contains the response from method CacheClient.Delete.

type CacheClientGetEntityTagOptions added in v0.3.0

type CacheClientGetEntityTagOptions struct {
}

CacheClientGetEntityTagOptions contains the optional parameters for the CacheClient.GetEntityTag method.

type CacheClientGetEntityTagResponse added in v0.3.0

type CacheClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

CacheClientGetEntityTagResponse contains the response from method CacheClient.GetEntityTag.

type CacheClientGetOptions added in v0.3.0

type CacheClientGetOptions struct {
}

CacheClientGetOptions contains the optional parameters for the CacheClient.Get method.

type CacheClientGetResponse added in v0.3.0

type CacheClientGetResponse struct {
	CacheContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

CacheClientGetResponse contains the response from method CacheClient.Get.

type CacheClientListByServiceOptions added in v0.3.0

type CacheClientListByServiceOptions struct {
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

CacheClientListByServiceOptions contains the optional parameters for the CacheClient.NewListByServicePager method.

type CacheClientListByServiceResponse added in v0.3.0

type CacheClientListByServiceResponse struct {
	CacheCollection
}

CacheClientListByServiceResponse contains the response from method CacheClient.NewListByServicePager.

type CacheClientUpdateOptions added in v0.3.0

type CacheClientUpdateOptions struct {
}

CacheClientUpdateOptions contains the optional parameters for the CacheClient.Update method.

type CacheClientUpdateResponse added in v0.3.0

type CacheClientUpdateResponse struct {
	CacheContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

CacheClientUpdateResponse contains the response from method CacheClient.Update.

type CacheCollection

type CacheCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*CacheContract
}

CacheCollection - Paged Caches list representation.

func (CacheCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CacheCollection.

func (*CacheCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CacheCollection.

type CacheContract

type CacheContract struct {
	// Cache properties details.
	Properties *CacheContractProperties

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

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

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

CacheContract - Cache details.

func (CacheContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CacheContract.

func (*CacheContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CacheContract.

type CacheContractProperties

type CacheContractProperties struct {
	// REQUIRED; Runtime connection string to cache
	ConnectionString *string

	// REQUIRED; Location identifier to use cache from (should be either 'default' or valid Azure region identifier)
	UseFromLocation *string

	// Cache description
	Description *string

	// Original uri of entity in external system cache points to
	ResourceID *string
}

CacheContractProperties - Properties of the Cache contract.

func (CacheContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type CacheContractProperties.

func (*CacheContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CacheContractProperties.

type CacheUpdateParameters

type CacheUpdateParameters struct {
	// Cache update properties details.
	Properties *CacheUpdateProperties
}

CacheUpdateParameters - Cache update details.

func (CacheUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CacheUpdateParameters.

func (*CacheUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CacheUpdateParameters.

type CacheUpdateProperties

type CacheUpdateProperties struct {
	// Runtime connection string to cache
	ConnectionString *string

	// Cache description
	Description *string

	// Original uri of entity in external system cache points to
	ResourceID *string

	// Location identifier to use cache from (should be either 'default' or valid Azure region identifier)
	UseFromLocation *string
}

CacheUpdateProperties - Parameters supplied to the Update Cache operation.

func (CacheUpdateProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type CacheUpdateProperties.

func (*CacheUpdateProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CacheUpdateProperties.

type CertificateClient

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

CertificateClient contains the methods for the Certificate group. Don't use this type directly, use NewCertificateClient() instead.

func NewCertificateClient

func NewCertificateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CertificateClient, error)

NewCertificateClient creates a new instance of CertificateClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*CertificateClient) CreateOrUpdate

func (client *CertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, parameters CertificateCreateOrUpdateParameters, options *CertificateClientCreateOrUpdateOptions) (CertificateClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates the certificate being used for authentication with the backend. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance.
  • parameters - Create or Update parameters.
  • options - CertificateClientCreateOrUpdateOptions contains the optional parameters for the CertificateClient.CreateOrUpdate method.
Example (ApiManagementCreateCertificate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCertificate.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCertificateClient().CreateOrUpdate(ctx, "rg1", "apimService1", "tempcert", armapimanagement.CertificateCreateOrUpdateParameters{
		Properties: &armapimanagement.CertificateCreateOrUpdateProperties{
			Data:     to.Ptr("****************Base 64 Encoded Certificate *******************************"),
			Password: to.Ptr("****Certificate Password******"),
		},
	}, &armapimanagement.CertificateClientCreateOrUpdateOptions{IfMatch: 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.CertificateContract = armapimanagement.CertificateContract{
	// 	Name: to.Ptr("tempcert"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/certificates"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/tempcert"),
	// 	Properties: &armapimanagement.CertificateContractProperties{
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-17T21:55:07+00:00"); return t}()),
	// 		Subject: to.Ptr("CN=contoso.com"),
	// 		Thumbprint: to.Ptr("*******************3"),
	// 	},
	// }
}
Output:

Example (ApiManagementCreateCertificateWithKeyVault)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCertificateWithKeyVault.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCertificateClient().CreateOrUpdate(ctx, "rg1", "apimService1", "templateCertkv", armapimanagement.CertificateCreateOrUpdateParameters{
		Properties: &armapimanagement.CertificateCreateOrUpdateProperties{
			KeyVault: &armapimanagement.KeyVaultContractCreateProperties{
				IdentityClientID: to.Ptr("ceaa6b06-c00f-43ef-99ac-f53d1fe876a0"),
				SecretIdentifier: to.Ptr("https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert"),
			},
		},
	}, &armapimanagement.CertificateClientCreateOrUpdateOptions{IfMatch: 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.CertificateContract = armapimanagement.CertificateContract{
	// 	Name: to.Ptr("templateCertkv"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/certificates"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/templateCertkv"),
	// 	Properties: &armapimanagement.CertificateContractProperties{
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2037-01-01T07:00:00Z"); return t}()),
	// 		KeyVault: &armapimanagement.KeyVaultContractProperties{
	// 			IdentityClientID: to.Ptr("ceaa6b06-c00f-43ef-99ac-f53d1fe876a0"),
	// 			SecretIdentifier: to.Ptr("https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert"),
	// 			LastStatus: &armapimanagement.KeyVaultLastAccessStatusContractProperties{
	// 				Code: to.Ptr("Success"),
	// 				TimeStampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-22T00:24:53.3191468Z"); return t}()),
	// 			},
	// 		},
	// 		Subject: to.Ptr("CN=*.msitesting.net"),
	// 		Thumbprint: to.Ptr("EA**********************9AD690"),
	// 	},
	// }
}
Output:

func (*CertificateClient) Delete

func (client *CertificateClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, ifMatch string, options *CertificateClientDeleteOptions) (CertificateClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - CertificateClientDeleteOptions contains the optional parameters for the CertificateClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteCertificate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*CertificateClient) Get

func (client *CertificateClient) Get(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, options *CertificateClientGetOptions) (CertificateClientGetResponse, error)

Get - Gets the details of the certificate specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance.
  • options - CertificateClientGetOptions contains the optional parameters for the CertificateClient.Get method.
Example (ApiManagementGetCertificate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCertificate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCertificateClient().Get(ctx, "rg1", "apimService1", "templateCert1", 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.CertificateContract = armapimanagement.CertificateContract{
	// 	Name: to.Ptr("templateCert1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/certificates"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/templateCert1"),
	// 	Properties: &armapimanagement.CertificateContractProperties{
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-23T17:03:41Z"); return t}()),
	// 		Subject: to.Ptr("CN=mutual-authcert"),
	// 		Thumbprint: to.Ptr("EBA**********************8594A6"),
	// 	},
	// }
}
Output:

Example (ApiManagementGetCertificateWithKeyVault)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCertificateWithKeyVault.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCertificateClient().Get(ctx, "rg1", "apimService1", "templateCertkv", 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.CertificateContract = armapimanagement.CertificateContract{
	// 	Name: to.Ptr("templateCertkv"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/certificates"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/templateCertkv"),
	// 	Properties: &armapimanagement.CertificateContractProperties{
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2037-01-01T07:00:00Z"); return t}()),
	// 		KeyVault: &armapimanagement.KeyVaultContractProperties{
	// 			IdentityClientID: to.Ptr("ceaa6b06-c00f-43ef-99ac-f53d1fe876a0"),
	// 			SecretIdentifier: to.Ptr("https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert"),
	// 			LastStatus: &armapimanagement.KeyVaultLastAccessStatusContractProperties{
	// 				Code: to.Ptr("Success"),
	// 				TimeStampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-22T00:24:53.3191468Z"); return t}()),
	// 			},
	// 		},
	// 		Subject: to.Ptr("CN=*.msitesting.net"),
	// 		Thumbprint: to.Ptr("EA**********************9AD690"),
	// 	},
	// }
}
Output:

func (*CertificateClient) GetEntityTag

func (client *CertificateClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, options *CertificateClientGetEntityTagOptions) (CertificateClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the certificate specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance.
  • options - CertificateClientGetEntityTagOptions contains the optional parameters for the CertificateClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadCertificate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewCertificateClient().GetEntityTag(ctx, "rg1", "apimService1", "templateCert1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*CertificateClient) NewListByServicePager added in v0.5.0

func (client *CertificateClient) NewListByServicePager(resourceGroupName string, serviceName string, options *CertificateClientListByServiceOptions) *runtime.Pager[CertificateClientListByServiceResponse]

NewListByServicePager - Lists a collection of all certificates in the specified service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - CertificateClientListByServiceOptions contains the optional parameters for the CertificateClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListCertificates.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCertificateClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.CertificateClientListByServiceOptions{Filter: nil,
		Top:                     nil,
		Skip:                    nil,
		IsKeyVaultRefreshFailed: 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.CertificateCollection = armapimanagement.CertificateCollection{
		// 	Count: to.Ptr[int64](2),
		// 	Value: []*armapimanagement.CertificateContract{
		// 		{
		// 			Name: to.Ptr("templateCert1"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/certificates"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/kjoshiarmtemplateCert1"),
		// 			Properties: &armapimanagement.CertificateContractProperties{
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-23T17:03:41Z"); return t}()),
		// 				Subject: to.Ptr("CN=mutual-authcert"),
		// 				Thumbprint: to.Ptr("EBA************************48594A6"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("templateCertkv"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/certificates"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/templateCertkv"),
		// 			Properties: &armapimanagement.CertificateContractProperties{
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2037-01-01T07:00:00Z"); return t}()),
		// 				KeyVault: &armapimanagement.KeyVaultContractProperties{
		// 					IdentityClientID: to.Ptr("ceaa6b06-c00f-43ef-99ac-f53d1fe876a0"),
		// 					SecretIdentifier: to.Ptr("https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert"),
		// 					LastStatus: &armapimanagement.KeyVaultLastAccessStatusContractProperties{
		// 						Code: to.Ptr("Success"),
		// 						TimeStampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-22T00:24:53.3191468Z"); return t}()),
		// 					},
		// 				},
		// 				Subject: to.Ptr("CN=*.msitesting.net"),
		// 				Thumbprint: to.Ptr("EA**********************9AD690"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*CertificateClient) RefreshSecret

func (client *CertificateClient) RefreshSecret(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, options *CertificateClientRefreshSecretOptions) (CertificateClientRefreshSecretResponse, error)

RefreshSecret - From KeyVault, Refresh the certificate being used for authentication with the backend. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance.
  • options - CertificateClientRefreshSecretOptions contains the optional parameters for the CertificateClient.RefreshSecret method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRefreshCertificate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCertificateClient().RefreshSecret(ctx, "rg1", "apimService1", "templateCertkv", 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.CertificateContract = armapimanagement.CertificateContract{
	// 	Name: to.Ptr("templateCertkv"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/certificates"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/templateCertkv"),
	// 	Properties: &armapimanagement.CertificateContractProperties{
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2037-01-01T07:00:00Z"); return t}()),
	// 		KeyVault: &armapimanagement.KeyVaultContractProperties{
	// 			IdentityClientID: to.Ptr("ceaa6b06-c00f-43ef-99ac-f53d1fe876a0"),
	// 			SecretIdentifier: to.Ptr("https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert"),
	// 			LastStatus: &armapimanagement.KeyVaultLastAccessStatusContractProperties{
	// 				Code: to.Ptr("Success"),
	// 				TimeStampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-22T00:24:53.3191468Z"); return t}()),
	// 			},
	// 		},
	// 		Subject: to.Ptr("CN=*.msitesting.net"),
	// 		Thumbprint: to.Ptr("EA**********************9AD690"),
	// 	},
	// }
}
Output:

type CertificateClientCreateOrUpdateOptions added in v0.3.0

type CertificateClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

CertificateClientCreateOrUpdateOptions contains the optional parameters for the CertificateClient.CreateOrUpdate method.

type CertificateClientCreateOrUpdateResponse added in v0.3.0

type CertificateClientCreateOrUpdateResponse struct {
	CertificateContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

CertificateClientCreateOrUpdateResponse contains the response from method CertificateClient.CreateOrUpdate.

type CertificateClientDeleteOptions added in v0.3.0

type CertificateClientDeleteOptions struct {
}

CertificateClientDeleteOptions contains the optional parameters for the CertificateClient.Delete method.

type CertificateClientDeleteResponse added in v0.3.0

type CertificateClientDeleteResponse struct {
}

CertificateClientDeleteResponse contains the response from method CertificateClient.Delete.

type CertificateClientGetEntityTagOptions added in v0.3.0

type CertificateClientGetEntityTagOptions struct {
}

CertificateClientGetEntityTagOptions contains the optional parameters for the CertificateClient.GetEntityTag method.

type CertificateClientGetEntityTagResponse added in v0.3.0

type CertificateClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

CertificateClientGetEntityTagResponse contains the response from method CertificateClient.GetEntityTag.

type CertificateClientGetOptions added in v0.3.0

type CertificateClientGetOptions struct {
}

CertificateClientGetOptions contains the optional parameters for the CertificateClient.Get method.

type CertificateClientGetResponse added in v0.3.0

type CertificateClientGetResponse struct {
	CertificateContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

CertificateClientGetResponse contains the response from method CertificateClient.Get.

type CertificateClientListByServiceOptions added in v0.3.0

type CertificateClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | subject | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | thumbprint | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | expirationDate | filter | ge, le, eq, ne, gt, lt | |
	Filter *string
	// When set to true, the response contains only certificates entities which failed refresh.
	IsKeyVaultRefreshFailed *bool
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

CertificateClientListByServiceOptions contains the optional parameters for the CertificateClient.NewListByServicePager method.

type CertificateClientListByServiceResponse added in v0.3.0

type CertificateClientListByServiceResponse struct {
	CertificateCollection
}

CertificateClientListByServiceResponse contains the response from method CertificateClient.NewListByServicePager.

type CertificateClientRefreshSecretOptions added in v0.3.0

type CertificateClientRefreshSecretOptions struct {
}

CertificateClientRefreshSecretOptions contains the optional parameters for the CertificateClient.RefreshSecret method.

type CertificateClientRefreshSecretResponse added in v0.3.0

type CertificateClientRefreshSecretResponse struct {
	CertificateContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

CertificateClientRefreshSecretResponse contains the response from method CertificateClient.RefreshSecret.

type CertificateCollection

type CertificateCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*CertificateContract
}

CertificateCollection - Paged Certificates list representation.

func (CertificateCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CertificateCollection.

func (*CertificateCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCollection.

type CertificateConfiguration

type CertificateConfiguration struct {
	// REQUIRED; The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority
	// are valid locations.
	StoreName *CertificateConfigurationStoreName

	// Certificate information.
	Certificate *CertificateInformation

	// Certificate Password.
	CertificatePassword *string

	// Base64 Encoded certificate.
	EncodedCertificate *string
}

CertificateConfiguration - Certificate configuration which consist of non-trusted intermediates and root certificates.

func (CertificateConfiguration) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type CertificateConfiguration.

func (*CertificateConfiguration) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CertificateConfiguration.

type CertificateConfigurationStoreName

type CertificateConfigurationStoreName string

CertificateConfigurationStoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations.

const (
	CertificateConfigurationStoreNameCertificateAuthority CertificateConfigurationStoreName = "CertificateAuthority"
	CertificateConfigurationStoreNameRoot                 CertificateConfigurationStoreName = "Root"
)

func PossibleCertificateConfigurationStoreNameValues

func PossibleCertificateConfigurationStoreNameValues() []CertificateConfigurationStoreName

PossibleCertificateConfigurationStoreNameValues returns the possible values for the CertificateConfigurationStoreName const type.

type CertificateContract

type CertificateContract struct {
	// Certificate properties details.
	Properties *CertificateContractProperties

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

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

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

CertificateContract - Certificate details.

func (CertificateContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CertificateContract.

func (*CertificateContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CertificateContract.

type CertificateContractProperties

type CertificateContractProperties struct {
	// REQUIRED; Expiration date of the certificate. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified
	// by the ISO 8601 standard.
	ExpirationDate *time.Time

	// REQUIRED; Subject attribute of the certificate.
	Subject *string

	// REQUIRED; Thumbprint of the certificate.
	Thumbprint *string

	// KeyVault location details of the certificate.
	KeyVault *KeyVaultContractProperties
}

CertificateContractProperties - Properties of the Certificate contract.

func (CertificateContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CertificateContractProperties.

func (*CertificateContractProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CertificateContractProperties.

type CertificateCreateOrUpdateParameters

type CertificateCreateOrUpdateParameters struct {
	// Certificate create or update properties details.
	Properties *CertificateCreateOrUpdateProperties
}

CertificateCreateOrUpdateParameters - Certificate create or update details.

func (CertificateCreateOrUpdateParameters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type CertificateCreateOrUpdateParameters.

func (*CertificateCreateOrUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCreateOrUpdateParameters.

type CertificateCreateOrUpdateProperties

type CertificateCreateOrUpdateProperties struct {
	// Base 64 encoded certificate using the application/x-pkcs12 representation.
	Data *string

	// KeyVault location details of the certificate.
	KeyVault *KeyVaultContractCreateProperties

	// Password for the Certificate
	Password *string
}

CertificateCreateOrUpdateProperties - Parameters supplied to the CreateOrUpdate certificate operation.

func (CertificateCreateOrUpdateProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type CertificateCreateOrUpdateProperties.

func (*CertificateCreateOrUpdateProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCreateOrUpdateProperties.

type CertificateInformation

type CertificateInformation struct {
	// REQUIRED; Expiration date of the certificate. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified
	// by the ISO 8601 standard.
	Expiry *time.Time

	// REQUIRED; Subject of the certificate.
	Subject *string

	// REQUIRED; Thumbprint of the certificate.
	Thumbprint *string
}

CertificateInformation - SSL certificate information.

func (CertificateInformation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CertificateInformation.

func (*CertificateInformation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CertificateInformation.

type CertificateSource

type CertificateSource string

CertificateSource - Certificate Source.

const (
	CertificateSourceBuiltIn  CertificateSource = "BuiltIn"
	CertificateSourceCustom   CertificateSource = "Custom"
	CertificateSourceKeyVault CertificateSource = "KeyVault"
	CertificateSourceManaged  CertificateSource = "Managed"
)

func PossibleCertificateSourceValues

func PossibleCertificateSourceValues() []CertificateSource

PossibleCertificateSourceValues returns the possible values for the CertificateSource const type.

type CertificateStatus

type CertificateStatus string

CertificateStatus - Certificate Status.

const (
	CertificateStatusCompleted  CertificateStatus = "Completed"
	CertificateStatusFailed     CertificateStatus = "Failed"
	CertificateStatusInProgress CertificateStatus = "InProgress"
)

func PossibleCertificateStatusValues

func PossibleCertificateStatusValues() []CertificateStatus

PossibleCertificateStatusValues returns the possible values for the CertificateStatus const type.

type Client added in v0.3.0

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

Client contains the methods for the APIManagementClient group. Don't use this type directly, use NewClient() instead.

func NewClient added in v0.3.0

func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error)

NewClient creates a new instance of Client with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*Client) BeginPerformConnectivityCheckAsync added in v0.3.0

func (client *Client) BeginPerformConnectivityCheckAsync(ctx context.Context, resourceGroupName string, serviceName string, connectivityCheckRequestParams ConnectivityCheckRequest, options *ClientBeginPerformConnectivityCheckAsyncOptions) (*runtime.Poller[ClientPerformConnectivityCheckAsyncResponse], error)

BeginPerformConnectivityCheckAsync - Performs a connectivity check between the API Management service and a given destination, and returns metrics for the connection, as well as errors encountered while trying to establish it. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • connectivityCheckRequestParams - Connectivity Check request parameters.
  • options - ClientBeginPerformConnectivityCheckAsyncOptions contains the optional parameters for the Client.BeginPerformConnectivityCheckAsync method.
Example (HttpConnectivityCheck)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPerformConnectivityCheckHttpConnect.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewClient().BeginPerformConnectivityCheckAsync(ctx, "rg1", "apimService1", armapimanagement.ConnectivityCheckRequest{
		Destination: &armapimanagement.ConnectivityCheckRequestDestination{
			Address: to.Ptr("https://microsoft.com"),
			Port:    to.Ptr[int64](3306),
		},
		ProtocolConfiguration: &armapimanagement.ConnectivityCheckRequestProtocolConfiguration{
			HTTPConfiguration: &armapimanagement.ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration{
				Method: to.Ptr(armapimanagement.MethodGET),
				Headers: []*armapimanagement.HTTPHeader{
					{
						Name:  to.Ptr("Authorization"),
						Value: to.Ptr("Bearer myPreciousToken"),
					}},
				ValidStatusCodes: []*int64{
					to.Ptr[int64](200),
					to.Ptr[int64](204)},
			},
		},
		Source: &armapimanagement.ConnectivityCheckRequestSource{
			Region: to.Ptr("northeurope"),
		},
		Protocol: to.Ptr(armapimanagement.ConnectivityCheckProtocolHTTPS),
	}, 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.ConnectivityCheckResponse = armapimanagement.ConnectivityCheckResponse{
	// 	AvgLatencyInMs: to.Ptr[int64](260),
	// 	ConnectionStatus: to.Ptr(armapimanagement.ConnectionStatus("Reachable")),
	// 	Hops: []*armapimanagement.ConnectivityHop{
	// 		{
	// 			Type: to.Ptr("Source"),
	// 			Address: to.Ptr("20.82.216.48"),
	// 			ID: to.Ptr("c60e2296-5ebc-48cc-80e8-7e6d2981e7b2"),
	// 			Issues: []*armapimanagement.ConnectivityIssue{
	// 			},
	// 			NextHopIDs: []*string{
	// 				to.Ptr("26aa44e7-04f1-462f-aa5d-5951957b5650")},
	// 				ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 			},
	// 			{
	// 				Type: to.Ptr("Internet"),
	// 				Address: to.Ptr("40.113.200.201"),
	// 				ID: to.Ptr("26aa44e7-04f1-462f-aa5d-5951957b5650"),
	// 				Issues: []*armapimanagement.ConnectivityIssue{
	// 				},
	// 				NextHopIDs: []*string{
	// 				},
	// 		}},
	// 		MaxLatencyInMs: to.Ptr[int64](281),
	// 		MinLatencyInMs: to.Ptr[int64](250),
	// 		ProbesFailed: to.Ptr[int64](0),
	// 		ProbesSent: to.Ptr[int64](3),
	// 	}
}
Output:

Example (TcpConnectivityCheck)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPerformConnectivityCheck.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewClient().BeginPerformConnectivityCheckAsync(ctx, "rg1", "apimService1", armapimanagement.ConnectivityCheckRequest{
		Destination: &armapimanagement.ConnectivityCheckRequestDestination{
			Address: to.Ptr("8.8.8.8"),
			Port:    to.Ptr[int64](53),
		},
		PreferredIPVersion: to.Ptr(armapimanagement.PreferredIPVersionIPv4),
		Source: &armapimanagement.ConnectivityCheckRequestSource{
			Region: to.Ptr("northeurope"),
		},
	}, 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.ConnectivityCheckResponse = armapimanagement.ConnectivityCheckResponse{
	// 	AvgLatencyInMs: to.Ptr[int64](1),
	// 	ConnectionStatus: to.Ptr(armapimanagement.ConnectionStatusConnected),
	// 	Hops: []*armapimanagement.ConnectivityHop{
	// 		{
	// 			Type: to.Ptr("Source"),
	// 			Address: to.Ptr("10.1.1.4"),
	// 			ID: to.Ptr("7dbbe7aa-60ba-4650-831e-63d775d38e9e"),
	// 			Issues: []*armapimanagement.ConnectivityIssue{
	// 			},
	// 			NextHopIDs: []*string{
	// 				to.Ptr("75c8d819-b208-4584-a311-1aa45ce753f9")},
	// 				ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 			},
	// 			{
	// 				Type: to.Ptr("Internet"),
	// 				Address: to.Ptr("8.8.8.8"),
	// 				ID: to.Ptr("75c8d819-b208-4584-a311-1aa45ce753f9"),
	// 				Issues: []*armapimanagement.ConnectivityIssue{
	// 				},
	// 				NextHopIDs: []*string{
	// 				},
	// 		}},
	// 		MaxLatencyInMs: to.Ptr[int64](4),
	// 		MinLatencyInMs: to.Ptr[int64](1),
	// 		ProbesFailed: to.Ptr[int64](0),
	// 		ProbesSent: to.Ptr[int64](100),
	// 	}
}
Output:

type ClientAuthenticationMethod

type ClientAuthenticationMethod string
const (
	// ClientAuthenticationMethodBasic - Basic Client Authentication method.
	ClientAuthenticationMethodBasic ClientAuthenticationMethod = "Basic"
	// ClientAuthenticationMethodBody - Body based Authentication method.
	ClientAuthenticationMethodBody ClientAuthenticationMethod = "Body"
)

func PossibleClientAuthenticationMethodValues

func PossibleClientAuthenticationMethodValues() []ClientAuthenticationMethod

PossibleClientAuthenticationMethodValues returns the possible values for the ClientAuthenticationMethod const type.

type ClientBeginPerformConnectivityCheckAsyncOptions added in v0.3.0

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

ClientBeginPerformConnectivityCheckAsyncOptions contains the optional parameters for the Client.BeginPerformConnectivityCheckAsync method.

type ClientFactory added in v1.1.0

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 added in v1.1.0

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 - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewAPIClient added in v1.1.0

func (c *ClientFactory) NewAPIClient() *APIClient

func (*ClientFactory) NewAPIDiagnosticClient added in v1.1.0

func (c *ClientFactory) NewAPIDiagnosticClient() *APIDiagnosticClient

func (*ClientFactory) NewAPIExportClient added in v1.1.0

func (c *ClientFactory) NewAPIExportClient() *APIExportClient

func (*ClientFactory) NewAPIIssueAttachmentClient added in v1.1.0

func (c *ClientFactory) NewAPIIssueAttachmentClient() *APIIssueAttachmentClient

func (*ClientFactory) NewAPIIssueClient added in v1.1.0

func (c *ClientFactory) NewAPIIssueClient() *APIIssueClient

func (*ClientFactory) NewAPIIssueCommentClient added in v1.1.0

func (c *ClientFactory) NewAPIIssueCommentClient() *APIIssueCommentClient

func (*ClientFactory) NewAPIOperationClient added in v1.1.0

func (c *ClientFactory) NewAPIOperationClient() *APIOperationClient

func (*ClientFactory) NewAPIOperationPolicyClient added in v1.1.0

func (c *ClientFactory) NewAPIOperationPolicyClient() *APIOperationPolicyClient

func (*ClientFactory) NewAPIPolicyClient added in v1.1.0

func (c *ClientFactory) NewAPIPolicyClient() *APIPolicyClient

func (*ClientFactory) NewAPIProductClient added in v1.1.0

func (c *ClientFactory) NewAPIProductClient() *APIProductClient

func (*ClientFactory) NewAPIReleaseClient added in v1.1.0

func (c *ClientFactory) NewAPIReleaseClient() *APIReleaseClient

func (*ClientFactory) NewAPIRevisionClient added in v1.1.0

func (c *ClientFactory) NewAPIRevisionClient() *APIRevisionClient

func (*ClientFactory) NewAPISchemaClient added in v1.1.0

func (c *ClientFactory) NewAPISchemaClient() *APISchemaClient

func (*ClientFactory) NewAPITagDescriptionClient added in v1.1.0

func (c *ClientFactory) NewAPITagDescriptionClient() *APITagDescriptionClient

func (*ClientFactory) NewAPIVersionSetClient added in v1.1.0

func (c *ClientFactory) NewAPIVersionSetClient() *APIVersionSetClient

func (*ClientFactory) NewAuthorizationServerClient added in v1.1.0

func (c *ClientFactory) NewAuthorizationServerClient() *AuthorizationServerClient

func (*ClientFactory) NewBackendClient added in v1.1.0

func (c *ClientFactory) NewBackendClient() *BackendClient

func (*ClientFactory) NewCacheClient added in v1.1.0

func (c *ClientFactory) NewCacheClient() *CacheClient

func (*ClientFactory) NewCertificateClient added in v1.1.0

func (c *ClientFactory) NewCertificateClient() *CertificateClient

func (*ClientFactory) NewClient added in v1.1.0

func (c *ClientFactory) NewClient() *Client

func (*ClientFactory) NewContentItemClient added in v1.1.0

func (c *ClientFactory) NewContentItemClient() *ContentItemClient

func (*ClientFactory) NewContentTypeClient added in v1.1.0

func (c *ClientFactory) NewContentTypeClient() *ContentTypeClient

func (*ClientFactory) NewDelegationSettingsClient added in v1.1.0

func (c *ClientFactory) NewDelegationSettingsClient() *DelegationSettingsClient

func (*ClientFactory) NewDeletedServicesClient added in v1.1.0

func (c *ClientFactory) NewDeletedServicesClient() *DeletedServicesClient

func (*ClientFactory) NewDiagnosticClient added in v1.1.0

func (c *ClientFactory) NewDiagnosticClient() *DiagnosticClient

func (*ClientFactory) NewEmailTemplateClient added in v1.1.0

func (c *ClientFactory) NewEmailTemplateClient() *EmailTemplateClient

func (*ClientFactory) NewGatewayAPIClient added in v1.1.0

func (c *ClientFactory) NewGatewayAPIClient() *GatewayAPIClient

func (*ClientFactory) NewGatewayCertificateAuthorityClient added in v1.1.0

func (c *ClientFactory) NewGatewayCertificateAuthorityClient() *GatewayCertificateAuthorityClient

func (*ClientFactory) NewGatewayClient added in v1.1.0

func (c *ClientFactory) NewGatewayClient() *GatewayClient

func (*ClientFactory) NewGatewayHostnameConfigurationClient added in v1.1.0

func (c *ClientFactory) NewGatewayHostnameConfigurationClient() *GatewayHostnameConfigurationClient

func (*ClientFactory) NewGlobalSchemaClient added in v1.1.0

func (c *ClientFactory) NewGlobalSchemaClient() *GlobalSchemaClient

func (*ClientFactory) NewGroupClient added in v1.1.0

func (c *ClientFactory) NewGroupClient() *GroupClient

func (*ClientFactory) NewGroupUserClient added in v1.1.0

func (c *ClientFactory) NewGroupUserClient() *GroupUserClient

func (*ClientFactory) NewIdentityProviderClient added in v1.1.0

func (c *ClientFactory) NewIdentityProviderClient() *IdentityProviderClient

func (*ClientFactory) NewIssueClient added in v1.1.0

func (c *ClientFactory) NewIssueClient() *IssueClient

func (*ClientFactory) NewLoggerClient added in v1.1.0

func (c *ClientFactory) NewLoggerClient() *LoggerClient

func (*ClientFactory) NewNamedValueClient added in v1.1.0

func (c *ClientFactory) NewNamedValueClient() *NamedValueClient

func (*ClientFactory) NewNetworkStatusClient added in v1.1.0

func (c *ClientFactory) NewNetworkStatusClient() *NetworkStatusClient

func (*ClientFactory) NewNotificationClient added in v1.1.0

func (c *ClientFactory) NewNotificationClient() *NotificationClient

func (*ClientFactory) NewNotificationRecipientEmailClient added in v1.1.0

func (c *ClientFactory) NewNotificationRecipientEmailClient() *NotificationRecipientEmailClient

func (*ClientFactory) NewNotificationRecipientUserClient added in v1.1.0

func (c *ClientFactory) NewNotificationRecipientUserClient() *NotificationRecipientUserClient

func (*ClientFactory) NewOpenIDConnectProviderClient added in v1.1.0

func (c *ClientFactory) NewOpenIDConnectProviderClient() *OpenIDConnectProviderClient

func (*ClientFactory) NewOperationClient added in v1.1.0

func (c *ClientFactory) NewOperationClient() *OperationClient

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

func (*ClientFactory) NewOutboundNetworkDependenciesEndpointsClient added in v1.1.0

func (c *ClientFactory) NewOutboundNetworkDependenciesEndpointsClient() *OutboundNetworkDependenciesEndpointsClient

func (*ClientFactory) NewPolicyClient added in v1.1.0

func (c *ClientFactory) NewPolicyClient() *PolicyClient

func (*ClientFactory) NewPolicyDescriptionClient added in v1.1.0

func (c *ClientFactory) NewPolicyDescriptionClient() *PolicyDescriptionClient

func (*ClientFactory) NewPortalRevisionClient added in v1.1.0

func (c *ClientFactory) NewPortalRevisionClient() *PortalRevisionClient

func (*ClientFactory) NewPortalSettingsClient added in v1.1.0

func (c *ClientFactory) NewPortalSettingsClient() *PortalSettingsClient

func (*ClientFactory) NewPrivateEndpointConnectionClient added in v1.1.0

func (c *ClientFactory) NewPrivateEndpointConnectionClient() *PrivateEndpointConnectionClient

func (*ClientFactory) NewProductAPIClient added in v1.1.0

func (c *ClientFactory) NewProductAPIClient() *ProductAPIClient

func (*ClientFactory) NewProductClient added in v1.1.0

func (c *ClientFactory) NewProductClient() *ProductClient

func (*ClientFactory) NewProductGroupClient added in v1.1.0

func (c *ClientFactory) NewProductGroupClient() *ProductGroupClient

func (*ClientFactory) NewProductPolicyClient added in v1.1.0

func (c *ClientFactory) NewProductPolicyClient() *ProductPolicyClient

func (*ClientFactory) NewProductSubscriptionsClient added in v1.1.0

func (c *ClientFactory) NewProductSubscriptionsClient() *ProductSubscriptionsClient

func (*ClientFactory) NewQuotaByCounterKeysClient added in v1.1.0

func (c *ClientFactory) NewQuotaByCounterKeysClient() *QuotaByCounterKeysClient

func (*ClientFactory) NewQuotaByPeriodKeysClient added in v1.1.0

func (c *ClientFactory) NewQuotaByPeriodKeysClient() *QuotaByPeriodKeysClient

func (*ClientFactory) NewRegionClient added in v1.1.0

func (c *ClientFactory) NewRegionClient() *RegionClient

func (*ClientFactory) NewReportsClient added in v1.1.0

func (c *ClientFactory) NewReportsClient() *ReportsClient

func (*ClientFactory) NewSKUsClient added in v1.1.0

func (c *ClientFactory) NewSKUsClient() *SKUsClient

func (*ClientFactory) NewServiceClient added in v1.1.0

func (c *ClientFactory) NewServiceClient() *ServiceClient

func (*ClientFactory) NewServiceSKUsClient added in v1.1.0

func (c *ClientFactory) NewServiceSKUsClient() *ServiceSKUsClient

func (*ClientFactory) NewSignInSettingsClient added in v1.1.0

func (c *ClientFactory) NewSignInSettingsClient() *SignInSettingsClient

func (*ClientFactory) NewSignUpSettingsClient added in v1.1.0

func (c *ClientFactory) NewSignUpSettingsClient() *SignUpSettingsClient

func (*ClientFactory) NewSubscriptionClient added in v1.1.0

func (c *ClientFactory) NewSubscriptionClient() *SubscriptionClient

func (*ClientFactory) NewTagClient added in v1.1.0

func (c *ClientFactory) NewTagClient() *TagClient

func (*ClientFactory) NewTagResourceClient added in v1.1.0

func (c *ClientFactory) NewTagResourceClient() *TagResourceClient

func (*ClientFactory) NewTenantAccessClient added in v1.1.0

func (c *ClientFactory) NewTenantAccessClient() *TenantAccessClient

func (*ClientFactory) NewTenantAccessGitClient added in v1.1.0

func (c *ClientFactory) NewTenantAccessGitClient() *TenantAccessGitClient

func (*ClientFactory) NewTenantConfigurationClient added in v1.1.0

func (c *ClientFactory) NewTenantConfigurationClient() *TenantConfigurationClient

func (*ClientFactory) NewTenantSettingsClient added in v1.1.0

func (c *ClientFactory) NewTenantSettingsClient() *TenantSettingsClient

func (*ClientFactory) NewUserClient added in v1.1.0

func (c *ClientFactory) NewUserClient() *UserClient

func (*ClientFactory) NewUserConfirmationPasswordClient added in v1.1.0

func (c *ClientFactory) NewUserConfirmationPasswordClient() *UserConfirmationPasswordClient

func (*ClientFactory) NewUserGroupClient added in v1.1.0

func (c *ClientFactory) NewUserGroupClient() *UserGroupClient

func (*ClientFactory) NewUserIdentitiesClient added in v1.1.0

func (c *ClientFactory) NewUserIdentitiesClient() *UserIdentitiesClient

func (*ClientFactory) NewUserSubscriptionClient added in v1.1.0

func (c *ClientFactory) NewUserSubscriptionClient() *UserSubscriptionClient

type ClientPerformConnectivityCheckAsyncResponse added in v0.3.0

type ClientPerformConnectivityCheckAsyncResponse struct {
	ConnectivityCheckResponse
}

ClientPerformConnectivityCheckAsyncResponse contains the response from method Client.BeginPerformConnectivityCheckAsync.

type ClientSecretContract

type ClientSecretContract struct {
	// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
	ClientSecret *string
}

ClientSecretContract - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth.

func (ClientSecretContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ClientSecretContract.

func (*ClientSecretContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ClientSecretContract.

type ConfigurationIDName

type ConfigurationIDName string
const (
	ConfigurationIDNameConfiguration ConfigurationIDName = "configuration"
)

func PossibleConfigurationIDNameValues

func PossibleConfigurationIDNameValues() []ConfigurationIDName

PossibleConfigurationIDNameValues returns the possible values for the ConfigurationIDName const type.

type Confirmation

type Confirmation string

Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user.

const (
	// ConfirmationInvite - Send an e-mail inviting the user to sign-up and complete registration.
	ConfirmationInvite Confirmation = "invite"
	// ConfirmationSignup - Send an e-mail to the user confirming they have successfully signed up.
	ConfirmationSignup Confirmation = "signup"
)

func PossibleConfirmationValues

func PossibleConfirmationValues() []Confirmation

PossibleConfirmationValues returns the possible values for the Confirmation const type.

type ConnectionStatus

type ConnectionStatus string

ConnectionStatus - The connection status.

const (
	ConnectionStatusConnected    ConnectionStatus = "Connected"
	ConnectionStatusDegraded     ConnectionStatus = "Degraded"
	ConnectionStatusDisconnected ConnectionStatus = "Disconnected"
	ConnectionStatusUnknown      ConnectionStatus = "Unknown"
)

func PossibleConnectionStatusValues

func PossibleConnectionStatusValues() []ConnectionStatus

PossibleConnectionStatusValues returns the possible values for the ConnectionStatus const type.

type ConnectivityCheckProtocol

type ConnectivityCheckProtocol string

ConnectivityCheckProtocol - The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination address must be coherent with this value.

const (
	ConnectivityCheckProtocolHTTP  ConnectivityCheckProtocol = "HTTP"
	ConnectivityCheckProtocolHTTPS ConnectivityCheckProtocol = "HTTPS"
	ConnectivityCheckProtocolTCP   ConnectivityCheckProtocol = "TCP"
)

func PossibleConnectivityCheckProtocolValues

func PossibleConnectivityCheckProtocolValues() []ConnectivityCheckProtocol

PossibleConnectivityCheckProtocolValues returns the possible values for the ConnectivityCheckProtocol const type.

type ConnectivityCheckRequest

type ConnectivityCheckRequest struct {
	// REQUIRED; The connectivity check operation destination.
	Destination *ConnectivityCheckRequestDestination

	// REQUIRED; Definitions about the connectivity check origin.
	Source *ConnectivityCheckRequestSource

	// The IP version to be used. Only IPv4 is supported for now.
	PreferredIPVersion *PreferredIPVersion

	// The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination
	// address must be coherent with this value.
	Protocol *ConnectivityCheckProtocol

	// Protocol-specific configuration.
	ProtocolConfiguration *ConnectivityCheckRequestProtocolConfiguration
}

ConnectivityCheckRequest - A request to perform the connectivity check operation on a API Management service.

func (ConnectivityCheckRequest) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequest.

func (*ConnectivityCheckRequest) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequest.

type ConnectivityCheckRequestDestination

type ConnectivityCheckRequestDestination struct {
	// REQUIRED; Destination address. Can either be an IP address or a FQDN.
	Address *string

	// REQUIRED; Destination port.
	Port *int64
}

ConnectivityCheckRequestDestination - The connectivity check operation destination.

func (ConnectivityCheckRequestDestination) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestDestination.

func (*ConnectivityCheckRequestDestination) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestDestination.

type ConnectivityCheckRequestProtocolConfiguration

type ConnectivityCheckRequestProtocolConfiguration struct {
	// Configuration for HTTP or HTTPS requests.
	HTTPConfiguration *ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration
}

ConnectivityCheckRequestProtocolConfiguration - Protocol-specific configuration.

func (ConnectivityCheckRequestProtocolConfiguration) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestProtocolConfiguration.

func (*ConnectivityCheckRequestProtocolConfiguration) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestProtocolConfiguration.

type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration

type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration struct {
	// List of headers to be included in the request.
	Headers []*HTTPHeader

	// The HTTP method to be used.
	Method *Method

	// List of HTTP status codes considered valid for the request response.
	ValidStatusCodes []*int64
}

ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration - Configuration for HTTP or HTTPS requests.

func (ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration.

func (*ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration) UnmarshalJSON added in v1.1.0

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration.

type ConnectivityCheckRequestSource

type ConnectivityCheckRequestSource struct {
	// REQUIRED; The API Management service region from where to start the connectivity check operation.
	Region *string

	// The particular VMSS instance from which to fire the request.
	Instance *int64
}

ConnectivityCheckRequestSource - Definitions about the connectivity check origin.

func (ConnectivityCheckRequestSource) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestSource.

func (*ConnectivityCheckRequestSource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestSource.

type ConnectivityCheckResponse

type ConnectivityCheckResponse struct {
	// READ-ONLY; Average latency in milliseconds.
	AvgLatencyInMs *int64

	// READ-ONLY; The connection status.
	ConnectionStatus *ConnectionStatus

	// READ-ONLY; List of hops between the source and the destination.
	Hops []*ConnectivityHop

	// READ-ONLY; Maximum latency in milliseconds.
	MaxLatencyInMs *int64

	// READ-ONLY; Minimum latency in milliseconds.
	MinLatencyInMs *int64

	// READ-ONLY; Number of failed probes.
	ProbesFailed *int64

	// READ-ONLY; Total number of probes sent.
	ProbesSent *int64
}

ConnectivityCheckResponse - Information on the connectivity status.

func (ConnectivityCheckResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckResponse.

func (*ConnectivityCheckResponse) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckResponse.

type ConnectivityHop

type ConnectivityHop struct {
	// READ-ONLY; The IP address of the hop.
	Address *string

	// READ-ONLY; The ID of the hop.
	ID *string

	// READ-ONLY; List of issues.
	Issues []*ConnectivityIssue

	// READ-ONLY; List of next hop identifiers.
	NextHopIDs []*string

	// READ-ONLY; The ID of the resource corresponding to this hop.
	ResourceID *string

	// READ-ONLY; The type of the hop.
	Type *string
}

ConnectivityHop - Information about a hop between the source and the destination.

func (ConnectivityHop) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConnectivityHop.

func (*ConnectivityHop) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityHop.

type ConnectivityIssue

type ConnectivityIssue struct {
	// READ-ONLY; Provides additional context on the issue.
	Context []map[string]*string

	// READ-ONLY; The origin of the issue.
	Origin *Origin

	// READ-ONLY; The severity of the issue.
	Severity *Severity

	// READ-ONLY; The type of issue.
	Type *IssueType
}

ConnectivityIssue - Information about an issue encountered in the process of checking for connectivity.

func (ConnectivityIssue) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConnectivityIssue.

func (*ConnectivityIssue) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityIssue.

type ConnectivityStatusContract

type ConnectivityStatusContract struct {
	// REQUIRED; Whether this is optional.
	IsOptional *bool

	// REQUIRED; The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms
	// to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601
	// standard.
	LastStatusChange *time.Time

	// REQUIRED; The date when the resource connectivity status was last updated. This status should be updated every 15 minutes.
	// If this status has not been updated, then it means that the service has lost network
	// connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ
	// as specified by the ISO 8601 standard.
	LastUpdated *time.Time

	// REQUIRED; The hostname of the resource which the service depends on. This can be the database, storage or any other azure
	// resource on which the service depends upon.
	Name *string

	// REQUIRED; Resource Type.
	ResourceType *string

	// REQUIRED; Resource Connectivity Status Type identifier.
	Status *ConnectivityStatusType

	// Error details of the connectivity to the resource.
	Error *string
}

ConnectivityStatusContract - Details about connectivity to a resource.

func (ConnectivityStatusContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ConnectivityStatusContract.

func (*ConnectivityStatusContract) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityStatusContract.

type ConnectivityStatusType

type ConnectivityStatusType string

ConnectivityStatusType - Resource Connectivity Status Type identifier.

const (
	ConnectivityStatusTypeFailure      ConnectivityStatusType = "failure"
	ConnectivityStatusTypeInitializing ConnectivityStatusType = "initializing"
	ConnectivityStatusTypeSuccess      ConnectivityStatusType = "success"
)

func PossibleConnectivityStatusTypeValues

func PossibleConnectivityStatusTypeValues() []ConnectivityStatusType

PossibleConnectivityStatusTypeValues returns the possible values for the ConnectivityStatusType const type.

type ContentFormat

type ContentFormat string

ContentFormat - Format of the Content in which the API is getting imported.

const (
	// ContentFormatGraphqlLink - The GraphQL API endpoint hosted on a publicly accessible internet address.
	ContentFormatGraphqlLink ContentFormat = "graphql-link"
	// ContentFormatOpenapi - The contents are inline and Content Type is a OpenAPI 3.0 YAML Document.
	ContentFormatOpenapi ContentFormat = "openapi"
	// ContentFormatOpenapiJSON - The contents are inline and Content Type is a OpenAPI 3.0 JSON Document.
	ContentFormatOpenapiJSON ContentFormat = "openapi+json"
	// ContentFormatOpenapiJSONLink - The OpenAPI 3.0 JSON document is hosted on a publicly accessible internet address.
	ContentFormatOpenapiJSONLink ContentFormat = "openapi+json-link"
	// ContentFormatOpenapiLink - The OpenAPI 3.0 YAML document is hosted on a publicly accessible internet address.
	ContentFormatOpenapiLink ContentFormat = "openapi-link"
	// ContentFormatSwaggerJSON - The contents are inline and Content Type is a OpenAPI 2.0 JSON Document.
	ContentFormatSwaggerJSON ContentFormat = "swagger-json"
	// ContentFormatSwaggerLinkJSON - The OpenAPI 2.0 JSON document is hosted on a publicly accessible internet address.
	ContentFormatSwaggerLinkJSON ContentFormat = "swagger-link-json"
	// ContentFormatWadlLinkJSON - The WADL document is hosted on a publicly accessible internet address.
	ContentFormatWadlLinkJSON ContentFormat = "wadl-link-json"
	// ContentFormatWadlXML - The contents are inline and Content type is a WADL document.
	ContentFormatWadlXML ContentFormat = "wadl-xml"
	// ContentFormatWsdl - The contents are inline and the document is a WSDL/Soap document.
	ContentFormatWsdl ContentFormat = "wsdl"
	// ContentFormatWsdlLink - The WSDL document is hosted on a publicly accessible internet address.
	ContentFormatWsdlLink ContentFormat = "wsdl-link"
)

func PossibleContentFormatValues

func PossibleContentFormatValues() []ContentFormat

PossibleContentFormatValues returns the possible values for the ContentFormat const type.

type ContentItemClient

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

ContentItemClient contains the methods for the ContentItem group. Don't use this type directly, use NewContentItemClient() instead.

func NewContentItemClient

func NewContentItemClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContentItemClient, error)

NewContentItemClient creates a new instance of ContentItemClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ContentItemClient) CreateOrUpdate

func (client *ContentItemClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientCreateOrUpdateOptions) (ContentItemClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a new developer portal's content item specified by the provided content type. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • contentTypeID - Content type identifier.
  • contentItemID - Content item identifier.
  • options - ContentItemClientCreateOrUpdateOptions contains the optional parameters for the ContentItemClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateContentTypeContentItem.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewContentItemClient().CreateOrUpdate(ctx, "rg1", "apimService1", "page", "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", &armapimanagement.ContentItemClientCreateOrUpdateOptions{IfMatch: 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.ContentItemContract = armapimanagement.ContentItemContract{
	// 	Name: to.Ptr("4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/contentTypes/contentItems"),
	// 	ID: to.Ptr("/contentTypes/page/contentItems/4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8"),
	// 	Properties: map[string]any{
	// 		"en_us": map[string]any{
	// 			"description": "Short story about the company.",
	// 			"documentId": "contentTypes/document/contentItems/4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8",
	// 			"keywords": "company, about",
	// 			"permalink": "/about",
	// 			"title": "About",
	// 		},
	// 	},
	// }
}
Output:

func (*ContentItemClient) Delete

func (client *ContentItemClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, ifMatch string, options *ContentItemClientDeleteOptions) (ContentItemClientDeleteResponse, error)

Delete - Removes the specified developer portal's content item. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • contentTypeID - Content type identifier.
  • contentItemID - Content item identifier.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - ContentItemClientDeleteOptions contains the optional parameters for the ContentItemClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteContentTypeContentItem.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewContentItemClient().Delete(ctx, "rg1", "apimService1", "page", "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ContentItemClient) Get

func (client *ContentItemClient) Get(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientGetOptions) (ContentItemClientGetResponse, error)

Get - Returns the developer portal's content item specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • contentTypeID - Content type identifier.
  • contentItemID - Content item identifier.
  • options - ContentItemClientGetOptions contains the optional parameters for the ContentItemClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetContentTypeContentItem.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewContentItemClient().Get(ctx, "rg1", "apimService1", "page", "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", 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.ContentItemContract = armapimanagement.ContentItemContract{
	// 	Name: to.Ptr("4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/contentTypes/contentItems"),
	// 	ID: to.Ptr("/contentTypes/page/contentItems/4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8"),
	// 	Properties: map[string]any{
	// 		"en_us": map[string]any{
	// 			"description": "Short story about the company.",
	// 			"documentId": "contentTypes/document/contentItems/4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8",
	// 			"keywords": "company, about",
	// 			"permalink": "/about",
	// 			"title": "About",
	// 		},
	// 	},
	// }
}
Output:

func (*ContentItemClient) GetEntityTag

func (client *ContentItemClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientGetEntityTagOptions) (ContentItemClientGetEntityTagResponse, error)

GetEntityTag - Returns the entity state (ETag) version of the developer portal's content item specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • contentTypeID - Content type identifier.
  • contentItemID - Content item identifier.
  • options - ContentItemClientGetEntityTagOptions contains the optional parameters for the ContentItemClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadContentTypeContentItem.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewContentItemClient().GetEntityTag(ctx, "rg1", "apimService1", "page", "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ContentItemClient) NewListByServicePager added in v0.5.0

func (client *ContentItemClient) NewListByServicePager(resourceGroupName string, serviceName string, contentTypeID string, options *ContentItemClientListByServiceOptions) *runtime.Pager[ContentItemClientListByServiceResponse]

NewListByServicePager - Lists developer portal's content items specified by the provided content type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • contentTypeID - Content type identifier.
  • options - ContentItemClientListByServiceOptions contains the optional parameters for the ContentItemClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListContentTypeContentItems.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewContentItemClient().NewListByServicePager("rg1", "apimService1", "page", 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.ContentItemCollection = armapimanagement.ContentItemCollection{
		// 	Value: []*armapimanagement.ContentItemContract{
		// 		{
		// 			Name: to.Ptr("4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/contentTypes/contentItems"),
		// 			ID: to.Ptr("/contentTypes/page/contentItems/4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8"),
		// 			Properties: map[string]any{
		// 				"en_us": map[string]any{
		// 					"description": "Short story about the company.",
		// 					"documentId": "contentTypes/document/contentItems/4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8",
		// 					"keywords": "company, about",
		// 					"permalink": "/about",
		// 					"title": "About",
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

type ContentItemClientCreateOrUpdateOptions added in v0.3.0

type ContentItemClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

ContentItemClientCreateOrUpdateOptions contains the optional parameters for the ContentItemClient.CreateOrUpdate method.

type ContentItemClientCreateOrUpdateResponse added in v0.3.0

type ContentItemClientCreateOrUpdateResponse struct {
	ContentItemContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ContentItemClientCreateOrUpdateResponse contains the response from method ContentItemClient.CreateOrUpdate.

type ContentItemClientDeleteOptions added in v0.3.0

type ContentItemClientDeleteOptions struct {
}

ContentItemClientDeleteOptions contains the optional parameters for the ContentItemClient.Delete method.

type ContentItemClientDeleteResponse added in v0.3.0

type ContentItemClientDeleteResponse struct {
}

ContentItemClientDeleteResponse contains the response from method ContentItemClient.Delete.

type ContentItemClientGetEntityTagOptions added in v0.3.0

type ContentItemClientGetEntityTagOptions struct {
}

ContentItemClientGetEntityTagOptions contains the optional parameters for the ContentItemClient.GetEntityTag method.

type ContentItemClientGetEntityTagResponse added in v0.3.0

type ContentItemClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

ContentItemClientGetEntityTagResponse contains the response from method ContentItemClient.GetEntityTag.

type ContentItemClientGetOptions added in v0.3.0

type ContentItemClientGetOptions struct {
}

ContentItemClientGetOptions contains the optional parameters for the ContentItemClient.Get method.

type ContentItemClientGetResponse added in v0.3.0

type ContentItemClientGetResponse struct {
	ContentItemContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ContentItemClientGetResponse contains the response from method ContentItemClient.Get.

type ContentItemClientListByServiceOptions added in v0.3.0

type ContentItemClientListByServiceOptions struct {
}

ContentItemClientListByServiceOptions contains the optional parameters for the ContentItemClient.NewListByServicePager method.

type ContentItemClientListByServiceResponse added in v0.3.0

type ContentItemClientListByServiceResponse struct {
	ContentItemCollection
}

ContentItemClientListByServiceResponse contains the response from method ContentItemClient.NewListByServicePager.

type ContentItemCollection

type ContentItemCollection struct {
	// READ-ONLY; Next page link, if any.
	NextLink *string

	// READ-ONLY; Collection of content items.
	Value []*ContentItemContract
}

ContentItemCollection - Paged list of content items.

func (ContentItemCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ContentItemCollection.

func (*ContentItemCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContentItemCollection.

type ContentItemContract

type ContentItemContract struct {
	// Properties of the content item.
	Properties map[string]any

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

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

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

ContentItemContract - Content type contract details.

func (ContentItemContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ContentItemContract.

func (*ContentItemContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContentItemContract.

type ContentTypeClient

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

ContentTypeClient contains the methods for the ContentType group. Don't use this type directly, use NewContentTypeClient() instead.

func NewContentTypeClient

func NewContentTypeClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContentTypeClient, error)

NewContentTypeClient creates a new instance of ContentTypeClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ContentTypeClient) CreateOrUpdate

func (client *ContentTypeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, options *ContentTypeClientCreateOrUpdateOptions) (ContentTypeClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates the developer portal's content type. Content types describe content items' properties, validation rules, and constraints. Custom content types' identifiers need to start with the c- prefix. Built-in content types can't be modified. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • contentTypeID - Content type identifier.
  • options - ContentTypeClientCreateOrUpdateOptions contains the optional parameters for the ContentTypeClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateContentType.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewContentTypeClient().CreateOrUpdate(ctx, "rg1", "apimService1", "page", &armapimanagement.ContentTypeClientCreateOrUpdateOptions{IfMatch: 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.ContentTypeContract = armapimanagement.ContentTypeContract{
	// 	Name: to.Ptr("page"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/contentTypes"),
	// 	ID: to.Ptr("/contentTypes/page"),
	// 	Properties: &armapimanagement.ContentTypeContractProperties{
	// 		Name: to.Ptr("Page"),
	// 		Schema: map[string]any{
	// 			"additionalProperties": false,
	// 			"properties":map[string]any{
	// 				"en_us":map[string]any{
	// 					"type": "object",
	// 					"additionalProperties": false,
	// 					"properties":map[string]any{
	// 						"description":map[string]any{
	// 							"type": "string",
	// 							"description": "Page description. This property gets included in SEO attributes.",
	// 							"indexed": true,
	// 							"title": "Description",
	// 						},
	// 						"documentId":map[string]any{
	// 							"type": "string",
	// 							"description": "Reference to page content document.",
	// 							"title": "Document ID",
	// 						},
	// 						"keywords":map[string]any{
	// 							"type": "string",
	// 							"description": "Page keywords. This property gets included in SEO attributes.",
	// 							"indexed": true,
	// 							"title": "Keywords",
	// 						},
	// 						"permalink":map[string]any{
	// 							"type": "string",
	// 							"description": "Page permalink, e.g. '/about'.",
	// 							"indexed": true,
	// 							"title": "Permalink",
	// 						},
	// 						"title":map[string]any{
	// 							"type": "string",
	// 							"description": "Page title. This property gets included in SEO attributes.",
	// 							"indexed": true,
	// 							"title": "Title",
	// 						},
	// 					},
	// 					"required":[]any{
	// 						"title",
	// 						"permalink",
	// 						"documentId",
	// 					},
	// 				},
	// 			},
	// 		},
	// 		Description: to.Ptr("A regular page"),
	// 		Version: to.Ptr("1.0.0"),
	// 	},
	// }
}
Output:

func (*ContentTypeClient) Delete

func (client *ContentTypeClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, ifMatch string, options *ContentTypeClientDeleteOptions) (ContentTypeClientDeleteResponse, error)

Delete - Removes the specified developer portal's content type. Content types describe content items' properties, validation rules, and constraints. Built-in content types (with identifiers starting with the c- prefix) can't be removed. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • contentTypeID - Content type identifier.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - ContentTypeClientDeleteOptions contains the optional parameters for the ContentTypeClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteContentType.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*ContentTypeClient) Get

func (client *ContentTypeClient) Get(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, options *ContentTypeClientGetOptions) (ContentTypeClientGetResponse, error)

Get - Gets the details of the developer portal's content type. Content types describe content items' properties, validation rules, and constraints. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • contentTypeID - Content type identifier.
  • options - ContentTypeClientGetOptions contains the optional parameters for the ContentTypeClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetContentType.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewContentTypeClient().Get(ctx, "rg1", "apimService1", "page", 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.ContentTypeContract = armapimanagement.ContentTypeContract{
	// 	Name: to.Ptr("page"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/contentTypes"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/contentTypes/page"),
	// 	Properties: &armapimanagement.ContentTypeContractProperties{
	// 		Name: to.Ptr("Page"),
	// 		Schema: map[string]any{
	// 			"additionalProperties": false,
	// 			"properties":map[string]any{
	// 				"en_us":map[string]any{
	// 					"type": "object",
	// 					"additionalProperties": false,
	// 					"properties":map[string]any{
	// 						"description":map[string]any{
	// 							"type": "string",
	// 							"description": "Page description. This property gets included in SEO attributes.",
	// 							"indexed": true,
	// 							"title": "Description",
	// 						},
	// 						"documentId":map[string]any{
	// 							"type": "string",
	// 							"description": "Reference to page content document.",
	// 							"title": "Document ID",
	// 						},
	// 						"keywords":map[string]any{
	// 							"type": "string",
	// 							"description": "Page keywords. This property gets included in SEO attributes.",
	// 							"indexed": true,
	// 							"title": "Keywords",
	// 						},
	// 						"permalink":map[string]any{
	// 							"type": "string",
	// 							"description": "Page permalink, e.g. '/about'.",
	// 							"indexed": true,
	// 							"title": "Permalink",
	// 						},
	// 						"title":map[string]any{
	// 							"type": "string",
	// 							"description": "Page title. This property gets included in SEO attributes.",
	// 							"indexed": true,
	// 							"title": "Title",
	// 						},
	// 					},
	// 					"required":[]any{
	// 						"title",
	// 						"permalink",
	// 						"documentId",
	// 					},
	// 				},
	// 			},
	// 		},
	// 		Description: to.Ptr("A regular page"),
	// 		Version: to.Ptr("1.0.0"),
	// 	},
	// }
}
Output:

func (*ContentTypeClient) NewListByServicePager added in v0.5.0

func (client *ContentTypeClient) NewListByServicePager(resourceGroupName string, serviceName string, options *ContentTypeClientListByServiceOptions) *runtime.Pager[ContentTypeClientListByServiceResponse]

NewListByServicePager - Lists the developer portal's content types. Content types describe content items' properties, validation rules, and constraints.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - ContentTypeClientListByServiceOptions contains the optional parameters for the ContentTypeClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListContentTypes.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewContentTypeClient().NewListByServicePager("rg1", "apimService1", 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.ContentTypeCollection = armapimanagement.ContentTypeCollection{
		// 	Value: []*armapimanagement.ContentTypeContract{
		// 		{
		// 			Name: to.Ptr("page"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/contentTypes"),
		// 			ID: to.Ptr("/contentTypes/page"),
		// 			Properties: &armapimanagement.ContentTypeContractProperties{
		// 				Name: to.Ptr("Page"),
		// 				Schema: map[string]any{
		// 					"additionalProperties": false,
		// 					"properties":map[string]any{
		// 						"en_us":map[string]any{
		// 							"type": "object",
		// 							"additionalProperties": false,
		// 							"properties":map[string]any{
		// 								"description":map[string]any{
		// 									"type": "string",
		// 									"description": "Page description. This property gets included in SEO attributes.",
		// 									"indexed": true,
		// 									"title": "Description",
		// 								},
		// 								"documentId":map[string]any{
		// 									"type": "string",
		// 									"description": "Reference to page content document.",
		// 									"title": "Document ID",
		// 								},
		// 								"keywords":map[string]any{
		// 									"type": "string",
		// 									"description": "Page keywords. This property gets included in SEO attributes.",
		// 									"indexed": true,
		// 									"title": "Keywords",
		// 								},
		// 								"permalink":map[string]any{
		// 									"type": "string",
		// 									"description": "Page permalink, e.g. '/about'.",
		// 									"indexed": true,
		// 									"title": "Permalink",
		// 								},
		// 								"title":map[string]any{
		// 									"type": "string",
		// 									"description": "Page title. This property gets included in SEO attributes.",
		// 									"indexed": true,
		// 									"title": "Title",
		// 								},
		// 							},
		// 							"required":[]any{
		// 								"title",
		// 								"permalink",
		// 								"documentId",
		// 							},
		// 						},
		// 					},
		// 				},
		// 				Description: to.Ptr("A regular page"),
		// 				Version: to.Ptr("1.0.0"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ContentTypeClientCreateOrUpdateOptions added in v0.3.0

type ContentTypeClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

ContentTypeClientCreateOrUpdateOptions contains the optional parameters for the ContentTypeClient.CreateOrUpdate method.

type ContentTypeClientCreateOrUpdateResponse added in v0.3.0

type ContentTypeClientCreateOrUpdateResponse struct {
	ContentTypeContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ContentTypeClientCreateOrUpdateResponse contains the response from method ContentTypeClient.CreateOrUpdate.

type ContentTypeClientDeleteOptions added in v0.3.0

type ContentTypeClientDeleteOptions struct {
}

ContentTypeClientDeleteOptions contains the optional parameters for the ContentTypeClient.Delete method.

type ContentTypeClientDeleteResponse added in v0.3.0

type ContentTypeClientDeleteResponse struct {
}

ContentTypeClientDeleteResponse contains the response from method ContentTypeClient.Delete.

type ContentTypeClientGetOptions added in v0.3.0

type ContentTypeClientGetOptions struct {
}

ContentTypeClientGetOptions contains the optional parameters for the ContentTypeClient.Get method.

type ContentTypeClientGetResponse added in v0.3.0

type ContentTypeClientGetResponse struct {
	ContentTypeContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ContentTypeClientGetResponse contains the response from method ContentTypeClient.Get.

type ContentTypeClientListByServiceOptions added in v0.3.0

type ContentTypeClientListByServiceOptions struct {
}

ContentTypeClientListByServiceOptions contains the optional parameters for the ContentTypeClient.NewListByServicePager method.

type ContentTypeClientListByServiceResponse added in v0.3.0

type ContentTypeClientListByServiceResponse struct {
	ContentTypeCollection
}

ContentTypeClientListByServiceResponse contains the response from method ContentTypeClient.NewListByServicePager.

type ContentTypeCollection

type ContentTypeCollection struct {
	// READ-ONLY; Next page link, if any.
	NextLink *string

	// READ-ONLY; Collection of content types.
	Value []*ContentTypeContract
}

ContentTypeCollection - Paged list of content types.

func (ContentTypeCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ContentTypeCollection.

func (*ContentTypeCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeCollection.

type ContentTypeContract

type ContentTypeContract struct {
	// Properties of the content type.
	Properties *ContentTypeContractProperties

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

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

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

ContentTypeContract - Content type contract details.

func (ContentTypeContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ContentTypeContract.

func (*ContentTypeContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeContract.

type ContentTypeContractProperties

type ContentTypeContractProperties struct {
	// Content type description.
	Description *string

	// Content type identifier
	ID *string

	// Content type name. Must be 1 to 250 characters long.
	Name *string

	// Content type schema.
	Schema any

	// Content type version.
	Version *string
}

func (ContentTypeContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ContentTypeContractProperties.

func (*ContentTypeContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeContractProperties.

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 DataMasking

type DataMasking struct {
	// Masking settings for headers
	Headers []*DataMaskingEntity

	// Masking settings for Url query parameters
	QueryParams []*DataMaskingEntity
}

func (DataMasking) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataMasking.

func (*DataMasking) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataMasking.

type DataMaskingEntity

type DataMaskingEntity struct {
	// Data masking mode.
	Mode *DataMaskingMode

	// The name of an entity to mask (e.g. a name of a header or a query parameter).
	Value *string
}

func (DataMaskingEntity) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DataMaskingEntity.

func (*DataMaskingEntity) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingEntity.

type DataMaskingMode

type DataMaskingMode string

DataMaskingMode - Data masking mode.

const (
	// DataMaskingModeHide - Hide the presence of an entity.
	DataMaskingModeHide DataMaskingMode = "Hide"
	// DataMaskingModeMask - Mask the value of an entity.
	DataMaskingModeMask DataMaskingMode = "Mask"
)

func PossibleDataMaskingModeValues

func PossibleDataMaskingModeValues() []DataMaskingMode

PossibleDataMaskingModeValues returns the possible values for the DataMaskingMode const type.

type DelegationSettingsClient

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

DelegationSettingsClient contains the methods for the DelegationSettings group. Don't use this type directly, use NewDelegationSettingsClient() instead.

func NewDelegationSettingsClient

func NewDelegationSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DelegationSettingsClient, error)

NewDelegationSettingsClient creates a new instance of DelegationSettingsClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*DelegationSettingsClient) CreateOrUpdate

CreateOrUpdate - Create or Update Delegation settings. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • parameters - Create or update parameters.
  • options - DelegationSettingsClientCreateOrUpdateOptions contains the optional parameters for the DelegationSettingsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutDelegation.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDelegationSettingsClient().CreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.PortalDelegationSettings{
		Properties: &armapimanagement.PortalDelegationSettingsProperties{
			Subscriptions: &armapimanagement.SubscriptionsDelegationSettingsProperties{
				Enabled: to.Ptr(true),
			},
			URL: to.Ptr("http://contoso.com/delegation"),
			UserRegistration: &armapimanagement.RegistrationDelegationSettingsProperties{
				Enabled: to.Ptr(true),
			},
			ValidationKey: to.Ptr("<validationKey>"),
		},
	}, &armapimanagement.DelegationSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")})
	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.PortalDelegationSettings = armapimanagement.PortalDelegationSettings{
	// 	Name: to.Ptr("delegation"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/portalsettings"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/delegation"),
	// 	Properties: &armapimanagement.PortalDelegationSettingsProperties{
	// 		Subscriptions: &armapimanagement.SubscriptionsDelegationSettingsProperties{
	// 			Enabled: to.Ptr(true),
	// 		},
	// 		URL: to.Ptr("http://contoso.com/delegation"),
	// 		UserRegistration: &armapimanagement.RegistrationDelegationSettingsProperties{
	// 			Enabled: to.Ptr(true),
	// 		},
	// 	},
	// }
}
Output:

func (*DelegationSettingsClient) Get

Get - Get Delegation Settings for the Portal. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - DelegationSettingsClientGetOptions contains the optional parameters for the DelegationSettingsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetDelegation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDelegationSettingsClient().Get(ctx, "rg1", "apimService1", 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.PortalDelegationSettings = armapimanagement.PortalDelegationSettings{
	// 	Name: to.Ptr("delegation"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/portalsettings"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/delegation"),
	// 	Properties: &armapimanagement.PortalDelegationSettingsProperties{
	// 		Subscriptions: &armapimanagement.SubscriptionsDelegationSettingsProperties{
	// 			Enabled: to.Ptr(true),
	// 		},
	// 		URL: to.Ptr("http://contoso.com/delegation"),
	// 		UserRegistration: &armapimanagement.RegistrationDelegationSettingsProperties{
	// 			Enabled: to.Ptr(true),
	// 		},
	// 	},
	// }
}
Output:

func (*DelegationSettingsClient) GetEntityTag

GetEntityTag - Gets the entity state (Etag) version of the DelegationSettings.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - DelegationSettingsClientGetEntityTagOptions contains the optional parameters for the DelegationSettingsClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadDelegationSettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewDelegationSettingsClient().GetEntityTag(ctx, "rg1", "apimService1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*DelegationSettingsClient) ListSecrets

ListSecrets - Gets the secret validation key of the DelegationSettings. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - DelegationSettingsClientListSecretsOptions contains the optional parameters for the DelegationSettingsClient.ListSecrets method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSecretsPortalSettingsValidationKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDelegationSettingsClient().ListSecrets(ctx, "rg1", "apimService1", 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.PortalSettingValidationKeyContract = armapimanagement.PortalSettingValidationKeyContract{
	// 	ValidationKey: to.Ptr("<validationKey>"),
	// }
}
Output:

func (*DelegationSettingsClient) Update

Update - Update Delegation settings. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update Delegation settings.
  • options - DelegationSettingsClientUpdateOptions contains the optional parameters for the DelegationSettingsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateDelegation.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewDelegationSettingsClient().Update(ctx, "rg1", "apimService1", "*", armapimanagement.PortalDelegationSettings{
		Properties: &armapimanagement.PortalDelegationSettingsProperties{
			Subscriptions: &armapimanagement.SubscriptionsDelegationSettingsProperties{
				Enabled: to.Ptr(true),
			},
			URL: to.Ptr("http://contoso.com/delegation"),
			UserRegistration: &armapimanagement.RegistrationDelegationSettingsProperties{
				Enabled: to.Ptr(true),
			},
			ValidationKey: to.Ptr("<validationKey>"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

type DelegationSettingsClientCreateOrUpdateOptions added in v0.3.0

type DelegationSettingsClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

DelegationSettingsClientCreateOrUpdateOptions contains the optional parameters for the DelegationSettingsClient.CreateOrUpdate method.

type DelegationSettingsClientCreateOrUpdateResponse added in v0.3.0

type DelegationSettingsClientCreateOrUpdateResponse struct {
	PortalDelegationSettings
}

DelegationSettingsClientCreateOrUpdateResponse contains the response from method DelegationSettingsClient.CreateOrUpdate.

type DelegationSettingsClientGetEntityTagOptions added in v0.3.0

type DelegationSettingsClientGetEntityTagOptions struct {
}

DelegationSettingsClientGetEntityTagOptions contains the optional parameters for the DelegationSettingsClient.GetEntityTag method.

type DelegationSettingsClientGetEntityTagResponse added in v0.3.0

type DelegationSettingsClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

DelegationSettingsClientGetEntityTagResponse contains the response from method DelegationSettingsClient.GetEntityTag.

type DelegationSettingsClientGetOptions added in v0.3.0

type DelegationSettingsClientGetOptions struct {
}

DelegationSettingsClientGetOptions contains the optional parameters for the DelegationSettingsClient.Get method.

type DelegationSettingsClientGetResponse added in v0.3.0

type DelegationSettingsClientGetResponse struct {
	PortalDelegationSettings
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

DelegationSettingsClientGetResponse contains the response from method DelegationSettingsClient.Get.

type DelegationSettingsClientListSecretsOptions added in v0.3.0

type DelegationSettingsClientListSecretsOptions struct {
}

DelegationSettingsClientListSecretsOptions contains the optional parameters for the DelegationSettingsClient.ListSecrets method.

type DelegationSettingsClientListSecretsResponse added in v0.3.0

type DelegationSettingsClientListSecretsResponse struct {
	PortalSettingValidationKeyContract
}

DelegationSettingsClientListSecretsResponse contains the response from method DelegationSettingsClient.ListSecrets.

type DelegationSettingsClientUpdateOptions added in v0.3.0

type DelegationSettingsClientUpdateOptions struct {
}

DelegationSettingsClientUpdateOptions contains the optional parameters for the DelegationSettingsClient.Update method.

type DelegationSettingsClientUpdateResponse added in v0.3.0

type DelegationSettingsClientUpdateResponse struct {
}

DelegationSettingsClientUpdateResponse contains the response from method DelegationSettingsClient.Update.

type DeletedServiceContract

type DeletedServiceContract struct {
	// Deleted API Management Service details.
	Properties *DeletedServiceContractProperties

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

	// READ-ONLY; API Management Service Master Location.
	Location *string

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

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

DeletedServiceContract - Deleted API Management Service information.

func (DeletedServiceContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DeletedServiceContract.

func (*DeletedServiceContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceContract.

type DeletedServiceContractProperties

type DeletedServiceContractProperties struct {
	// UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified
	// by the ISO 8601 standard.
	DeletionDate *time.Time

	// UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ
	// as specified by the ISO 8601 standard.
	ScheduledPurgeDate *time.Time

	// Fully-qualified API Management Service Resource ID
	ServiceID *string
}

func (DeletedServiceContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DeletedServiceContractProperties.

func (*DeletedServiceContractProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceContractProperties.

type DeletedServicesClient

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

DeletedServicesClient contains the methods for the DeletedServices group. Don't use this type directly, use NewDeletedServicesClient() instead.

func NewDeletedServicesClient

func NewDeletedServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeletedServicesClient, error)

NewDeletedServicesClient creates a new instance of DeletedServicesClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*DeletedServicesClient) BeginPurge

BeginPurge - Purges Api Management Service (deletes it with no option to undelete). If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • serviceName - The name of the API Management service.
  • location - The location of the deleted API Management service.
  • options - DeletedServicesClientBeginPurgeOptions contains the optional parameters for the DeletedServicesClient.BeginPurge method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletedServicesPurge.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDeletedServicesClient().BeginPurge(ctx, "apimService3", "westus", 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)
	}
}
Output:

func (*DeletedServicesClient) GetByName

GetByName - Get soft-deleted Api Management Service by name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • serviceName - The name of the API Management service.
  • location - The location of the deleted API Management service.
  • options - DeletedServicesClientGetByNameOptions contains the optional parameters for the DeletedServicesClient.GetByName method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetDeletedServiceByName.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDeletedServicesClient().GetByName(ctx, "apimService3", "westus", 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.DeletedServiceContract = armapimanagement.DeletedServiceContract{
	// 	Name: to.Ptr("apimService3"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/deletedservices"),
	// 	ID: to.Ptr("/subscriptions/subid/providers/Microsoft.ApiManagement/locations/westus/deletedservices/apimService3"),
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armapimanagement.DeletedServiceContractProperties{
	// 		DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T15:33:55.5426123Z"); return t}()),
	// 		ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T15:33:55.5426123Z"); return t}()),
	// 		ServiceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService3"),
	// 	},
	// }
}
Output:

func (*DeletedServicesClient) NewListBySubscriptionPager added in v0.5.0

NewListBySubscriptionPager - Lists all soft-deleted services available for undelete for the given subscription.

Generated from API version 2021-08-01

  • options - DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletedServicesListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDeletedServicesClient().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.DeletedServicesCollection = armapimanagement.DeletedServicesCollection{
		// 	Value: []*armapimanagement.DeletedServiceContract{
		// 		{
		// 			Name: to.Ptr("apimService3"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/deletedservices"),
		// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.ApiManagement/locations/westus/deletedservices/apimService3"),
		// 			Location: to.Ptr("West US"),
		// 			Properties: &armapimanagement.DeletedServiceContractProperties{
		// 				DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T15:33:55.5426123Z"); return t}()),
		// 				ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T15:33:55.5426123Z"); return t}()),
		// 				ServiceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService3"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("apimService"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/deletedservices"),
		// 			ID: to.Ptr("/subscriptions/subid/providers/Microsoft.ApiManagement/locations/westus2/deletedservices/apimService"),
		// 			Location: to.Ptr("West US 2"),
		// 			Properties: &armapimanagement.DeletedServiceContractProperties{
		// 				DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T15:33:55.5426123Z"); return t}()),
		// 				ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T15:33:55.5426123Z"); return t}()),
		// 				ServiceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type DeletedServicesClientBeginPurgeOptions added in v0.3.0

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

DeletedServicesClientBeginPurgeOptions contains the optional parameters for the DeletedServicesClient.BeginPurge method.

type DeletedServicesClientGetByNameOptions added in v0.3.0

type DeletedServicesClientGetByNameOptions struct {
}

DeletedServicesClientGetByNameOptions contains the optional parameters for the DeletedServicesClient.GetByName method.

type DeletedServicesClientGetByNameResponse added in v0.3.0

type DeletedServicesClientGetByNameResponse struct {
	DeletedServiceContract
}

DeletedServicesClientGetByNameResponse contains the response from method DeletedServicesClient.GetByName.

type DeletedServicesClientListBySubscriptionOptions added in v0.3.0

type DeletedServicesClientListBySubscriptionOptions struct {
}

DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.NewListBySubscriptionPager method.

type DeletedServicesClientListBySubscriptionResponse added in v0.3.0

type DeletedServicesClientListBySubscriptionResponse struct {
	DeletedServicesCollection
}

DeletedServicesClientListBySubscriptionResponse contains the response from method DeletedServicesClient.NewListBySubscriptionPager.

type DeletedServicesClientPurgeResponse added in v0.3.0

type DeletedServicesClientPurgeResponse struct {
	DeletedServiceContract
}

DeletedServicesClientPurgeResponse contains the response from method DeletedServicesClient.BeginPurge.

type DeletedServicesCollection

type DeletedServicesCollection struct {
	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Page values.
	Value []*DeletedServiceContract
}

DeletedServicesCollection - Paged deleted API Management Services List Representation.

func (DeletedServicesCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DeletedServicesCollection.

func (*DeletedServicesCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServicesCollection.

type DeployConfigurationParameterProperties

type DeployConfigurationParameterProperties struct {
	// REQUIRED; The name of the Git branch from which the configuration is to be deployed to the configuration database.
	Branch *string

	// The value enforcing deleting subscriptions to products that are deleted in this update.
	Force *bool
}

DeployConfigurationParameterProperties - Parameters supplied to the Deploy Configuration operation.

func (DeployConfigurationParameterProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DeployConfigurationParameterProperties.

func (*DeployConfigurationParameterProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DeployConfigurationParameterProperties.

type DeployConfigurationParameters

type DeployConfigurationParameters struct {
	// Deploy Configuration Parameter contract properties.
	Properties *DeployConfigurationParameterProperties
}

DeployConfigurationParameters - Deploy Tenant Configuration Contract.

func (DeployConfigurationParameters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DeployConfigurationParameters.

func (*DeployConfigurationParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DeployConfigurationParameters.

type DiagnosticClient

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

DiagnosticClient contains the methods for the Diagnostic group. Don't use this type directly, use NewDiagnosticClient() instead.

func NewDiagnosticClient

func NewDiagnosticClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiagnosticClient, error)

NewDiagnosticClient creates a new instance of DiagnosticClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*DiagnosticClient) CreateOrUpdate

func (client *DiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, parameters DiagnosticContract, options *DiagnosticClientCreateOrUpdateOptions) (DiagnosticClientCreateOrUpdateResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance.
  • parameters - Create parameters.
  • options - DiagnosticClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateDiagnostic.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDiagnosticClient().CreateOrUpdate(ctx, "rg1", "apimService1", "applicationinsights", armapimanagement.DiagnosticContract{
		Properties: &armapimanagement.DiagnosticContractProperties{
			AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
			Backend: &armapimanagement.PipelineDiagnosticSettings{
				Response: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
				Request: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
			},
			Frontend: &armapimanagement.PipelineDiagnosticSettings{
				Response: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
				Request: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
			},
			LoggerID: to.Ptr("/loggers/azuremonitor"),
			Sampling: &armapimanagement.SamplingSettings{
				Percentage:   to.Ptr[float64](50),
				SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
			},
		},
	}, &armapimanagement.DiagnosticClientCreateOrUpdateOptions{IfMatch: 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.DiagnosticContract = armapimanagement.DiagnosticContract{
	// 	Name: to.Ptr("applicationinsights"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/diagnostics"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights"),
	// 	Properties: &armapimanagement.DiagnosticContractProperties{
	// 		AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
	// 		Backend: &armapimanagement.PipelineDiagnosticSettings{
	// 			Response: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](512),
	// 				},
	// 				Headers: []*string{
	// 					to.Ptr("Content-type")},
	// 				},
	// 				Request: &armapimanagement.HTTPMessageDiagnostic{
	// 					Body: &armapimanagement.BodyDiagnosticSettings{
	// 						Bytes: to.Ptr[int32](512),
	// 					},
	// 					Headers: []*string{
	// 						to.Ptr("Content-type")},
	// 					},
	// 				},
	// 				Frontend: &armapimanagement.PipelineDiagnosticSettings{
	// 					Response: &armapimanagement.HTTPMessageDiagnostic{
	// 						Body: &armapimanagement.BodyDiagnosticSettings{
	// 							Bytes: to.Ptr[int32](512),
	// 						},
	// 						Headers: []*string{
	// 							to.Ptr("Content-type")},
	// 						},
	// 						Request: &armapimanagement.HTTPMessageDiagnostic{
	// 							Body: &armapimanagement.BodyDiagnosticSettings{
	// 								Bytes: to.Ptr[int32](512),
	// 							},
	// 							Headers: []*string{
	// 								to.Ptr("Content-type")},
	// 							},
	// 						},
	// 						LoggerID: to.Ptr("/loggers/applicationinsights"),
	// 						Sampling: &armapimanagement.SamplingSettings{
	// 							Percentage: to.Ptr[float64](50),
	// 							SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
	// 						},
	// 					},
	// 				}
}
Output:

func (*DiagnosticClient) Delete

func (client *DiagnosticClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, ifMatch string, options *DiagnosticClientDeleteOptions) (DiagnosticClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - DiagnosticClientDeleteOptions contains the optional parameters for the DiagnosticClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteDiagnostic.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*DiagnosticClient) Get

func (client *DiagnosticClient) Get(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, options *DiagnosticClientGetOptions) (DiagnosticClientGetResponse, error)

Get - Gets the details of the Diagnostic specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance.
  • options - DiagnosticClientGetOptions contains the optional parameters for the DiagnosticClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetDiagnostic.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDiagnosticClient().Get(ctx, "rg1", "apimService1", "applicationinsights", 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.DiagnosticContract = armapimanagement.DiagnosticContract{
	// 	Name: to.Ptr("applicationinsights"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/diagnostics"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights"),
	// 	Properties: &armapimanagement.DiagnosticContractProperties{
	// 		AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
	// 		Backend: &armapimanagement.PipelineDiagnosticSettings{
	// 			Response: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 			Request: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 		},
	// 		Frontend: &armapimanagement.PipelineDiagnosticSettings{
	// 			Response: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 			Request: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](100),
	// 				},
	// 				Headers: []*string{
	// 				},
	// 			},
	// 		},
	// 		HTTPCorrelationProtocol: to.Ptr(armapimanagement.HTTPCorrelationProtocolLegacy),
	// 		LogClientIP: to.Ptr(true),
	// 		LoggerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/aisamplingtest"),
	// 		Sampling: &armapimanagement.SamplingSettings{
	// 			Percentage: to.Ptr[float64](100),
	// 			SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
	// 		},
	// 	},
	// }
}
Output:

func (*DiagnosticClient) GetEntityTag

func (client *DiagnosticClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, options *DiagnosticClientGetEntityTagOptions) (DiagnosticClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the Diagnostic specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance.
  • options - DiagnosticClientGetEntityTagOptions contains the optional parameters for the DiagnosticClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadDiagnostic.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewDiagnosticClient().GetEntityTag(ctx, "rg1", "apimService1", "applicationinsights", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*DiagnosticClient) NewListByServicePager added in v0.5.0

func (client *DiagnosticClient) NewListByServicePager(resourceGroupName string, serviceName string, options *DiagnosticClientListByServiceOptions) *runtime.Pager[DiagnosticClientListByServiceResponse]

NewListByServicePager - Lists all diagnostics of the API Management service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - DiagnosticClientListByServiceOptions contains the optional parameters for the DiagnosticClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListDiagnostics.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDiagnosticClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.DiagnosticClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.DiagnosticCollection = armapimanagement.DiagnosticCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.DiagnosticContract{
		// 		{
		// 			Name: to.Ptr("applicationinsights"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/diagnostics"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights"),
		// 			Properties: &armapimanagement.DiagnosticContractProperties{
		// 				AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
		// 				Backend: &armapimanagement.PipelineDiagnosticSettings{
		// 					Response: &armapimanagement.HTTPMessageDiagnostic{
		// 						Body: &armapimanagement.BodyDiagnosticSettings{
		// 							Bytes: to.Ptr[int32](0),
		// 						},
		// 						Headers: []*string{
		// 						},
		// 					},
		// 					Request: &armapimanagement.HTTPMessageDiagnostic{
		// 						Body: &armapimanagement.BodyDiagnosticSettings{
		// 							Bytes: to.Ptr[int32](0),
		// 						},
		// 						Headers: []*string{
		// 						},
		// 					},
		// 				},
		// 				Frontend: &armapimanagement.PipelineDiagnosticSettings{
		// 					Response: &armapimanagement.HTTPMessageDiagnostic{
		// 						Body: &armapimanagement.BodyDiagnosticSettings{
		// 							Bytes: to.Ptr[int32](0),
		// 						},
		// 						Headers: []*string{
		// 						},
		// 					},
		// 					Request: &armapimanagement.HTTPMessageDiagnostic{
		// 						Body: &armapimanagement.BodyDiagnosticSettings{
		// 							Bytes: to.Ptr[int32](0),
		// 						},
		// 						Headers: []*string{
		// 						},
		// 					},
		// 				},
		// 				HTTPCorrelationProtocol: to.Ptr(armapimanagement.HTTPCorrelationProtocolLegacy),
		// 				LogClientIP: to.Ptr(true),
		// 				LoggerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/aisamplingtest"),
		// 				Sampling: &armapimanagement.SamplingSettings{
		// 					Percentage: to.Ptr[float64](100),
		// 					SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
		// 				},
		// 				Verbosity: to.Ptr(armapimanagement.VerbosityInformation),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("azuremonitor"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/diagnostics"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/azuremonitor"),
		// 			Properties: &armapimanagement.DiagnosticContractProperties{
		// 				LogClientIP: to.Ptr(true),
		// 				LoggerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/azuremonitor"),
		// 				Sampling: &armapimanagement.SamplingSettings{
		// 					Percentage: to.Ptr[float64](100),
		// 					SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*DiagnosticClient) Update

func (client *DiagnosticClient) Update(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, ifMatch string, parameters DiagnosticContract, options *DiagnosticClientUpdateOptions) (DiagnosticClientUpdateResponse, error)

Update - Updates the details of the Diagnostic specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Diagnostic Update parameters.
  • options - DiagnosticClientUpdateOptions contains the optional parameters for the DiagnosticClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateDiagnostic.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDiagnosticClient().Update(ctx, "rg1", "apimService1", "applicationinsights", "*", armapimanagement.DiagnosticContract{
		Properties: &armapimanagement.DiagnosticContractProperties{
			AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
			Backend: &armapimanagement.PipelineDiagnosticSettings{
				Response: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
				Request: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
			},
			Frontend: &armapimanagement.PipelineDiagnosticSettings{
				Response: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
				Request: &armapimanagement.HTTPMessageDiagnostic{
					Body: &armapimanagement.BodyDiagnosticSettings{
						Bytes: to.Ptr[int32](512),
					},
					Headers: []*string{
						to.Ptr("Content-type")},
				},
			},
			LoggerID: to.Ptr("/loggers/applicationinsights"),
			Sampling: &armapimanagement.SamplingSettings{
				Percentage:   to.Ptr[float64](50),
				SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
			},
		},
	}, 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.DiagnosticContract = armapimanagement.DiagnosticContract{
	// 	Name: to.Ptr("applicationinsights"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/diagnostics"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights"),
	// 	Properties: &armapimanagement.DiagnosticContractProperties{
	// 		AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors),
	// 		Backend: &armapimanagement.PipelineDiagnosticSettings{
	// 			Response: &armapimanagement.HTTPMessageDiagnostic{
	// 				Body: &armapimanagement.BodyDiagnosticSettings{
	// 					Bytes: to.Ptr[int32](512),
	// 				},
	// 				Headers: []*string{
	// 					to.Ptr("Content-type")},
	// 				},
	// 				Request: &armapimanagement.HTTPMessageDiagnostic{
	// 					Body: &armapimanagement.BodyDiagnosticSettings{
	// 						Bytes: to.Ptr[int32](512),
	// 					},
	// 					Headers: []*string{
	// 						to.Ptr("Content-type")},
	// 					},
	// 				},
	// 				Frontend: &armapimanagement.PipelineDiagnosticSettings{
	// 					Response: &armapimanagement.HTTPMessageDiagnostic{
	// 						Body: &armapimanagement.BodyDiagnosticSettings{
	// 							Bytes: to.Ptr[int32](512),
	// 						},
	// 						Headers: []*string{
	// 							to.Ptr("Content-type")},
	// 						},
	// 						Request: &armapimanagement.HTTPMessageDiagnostic{
	// 							Body: &armapimanagement.BodyDiagnosticSettings{
	// 								Bytes: to.Ptr[int32](512),
	// 							},
	// 							Headers: []*string{
	// 								to.Ptr("Content-type")},
	// 							},
	// 						},
	// 						HTTPCorrelationProtocol: to.Ptr(armapimanagement.HTTPCorrelationProtocolLegacy),
	// 						LogClientIP: to.Ptr(true),
	// 						LoggerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/aisamplingtest"),
	// 						Sampling: &armapimanagement.SamplingSettings{
	// 							Percentage: to.Ptr[float64](50),
	// 							SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed),
	// 						},
	// 					},
	// 				}
}
Output:

type DiagnosticClientCreateOrUpdateOptions added in v0.3.0

type DiagnosticClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

DiagnosticClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticClient.CreateOrUpdate method.

type DiagnosticClientCreateOrUpdateResponse added in v0.3.0

type DiagnosticClientCreateOrUpdateResponse struct {
	DiagnosticContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

DiagnosticClientCreateOrUpdateResponse contains the response from method DiagnosticClient.CreateOrUpdate.

type DiagnosticClientDeleteOptions added in v0.3.0

type DiagnosticClientDeleteOptions struct {
}

DiagnosticClientDeleteOptions contains the optional parameters for the DiagnosticClient.Delete method.

type DiagnosticClientDeleteResponse added in v0.3.0

type DiagnosticClientDeleteResponse struct {
}

DiagnosticClientDeleteResponse contains the response from method DiagnosticClient.Delete.

type DiagnosticClientGetEntityTagOptions added in v0.3.0

type DiagnosticClientGetEntityTagOptions struct {
}

DiagnosticClientGetEntityTagOptions contains the optional parameters for the DiagnosticClient.GetEntityTag method.

type DiagnosticClientGetEntityTagResponse added in v0.3.0

type DiagnosticClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

DiagnosticClientGetEntityTagResponse contains the response from method DiagnosticClient.GetEntityTag.

type DiagnosticClientGetOptions added in v0.3.0

type DiagnosticClientGetOptions struct {
}

DiagnosticClientGetOptions contains the optional parameters for the DiagnosticClient.Get method.

type DiagnosticClientGetResponse added in v0.3.0

type DiagnosticClientGetResponse struct {
	DiagnosticContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

DiagnosticClientGetResponse contains the response from method DiagnosticClient.Get.

type DiagnosticClientListByServiceOptions added in v0.3.0

type DiagnosticClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

DiagnosticClientListByServiceOptions contains the optional parameters for the DiagnosticClient.NewListByServicePager method.

type DiagnosticClientListByServiceResponse added in v0.3.0

type DiagnosticClientListByServiceResponse struct {
	DiagnosticCollection
}

DiagnosticClientListByServiceResponse contains the response from method DiagnosticClient.NewListByServicePager.

type DiagnosticClientUpdateOptions added in v0.3.0

type DiagnosticClientUpdateOptions struct {
}

DiagnosticClientUpdateOptions contains the optional parameters for the DiagnosticClient.Update method.

type DiagnosticClientUpdateResponse added in v0.3.0

type DiagnosticClientUpdateResponse struct {
	DiagnosticContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

DiagnosticClientUpdateResponse contains the response from method DiagnosticClient.Update.

type DiagnosticCollection

type DiagnosticCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*DiagnosticContract
}

DiagnosticCollection - Paged Diagnostic list representation.

func (DiagnosticCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DiagnosticCollection.

func (*DiagnosticCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticCollection.

type DiagnosticContract

type DiagnosticContract struct {
	// Diagnostic entity contract properties.
	Properties *DiagnosticContractProperties

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

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

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

DiagnosticContract - Diagnostic details.

func (DiagnosticContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DiagnosticContract.

func (*DiagnosticContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticContract.

type DiagnosticContractProperties

type DiagnosticContractProperties struct {
	// REQUIRED; Resource Id of a target logger.
	LoggerID *string

	// Specifies for what type of messages sampling settings should not apply.
	AlwaysLog *AlwaysLog

	// Diagnostic settings for incoming/outgoing HTTP messages to the Backend
	Backend *PipelineDiagnosticSettings

	// Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
	Frontend *PipelineDiagnosticSettings

	// Sets correlation protocol to use for Application Insights diagnostics.
	HTTPCorrelationProtocol *HTTPCorrelationProtocol

	// Log the ClientIP. Default is false.
	LogClientIP *bool

	// The format of the Operation Name for Application Insights telemetries. Default is Name.
	OperationNameFormat *OperationNameFormat

	// Sampling settings for Diagnostic.
	Sampling *SamplingSettings

	// The verbosity level applied to traces emitted by trace policies.
	Verbosity *Verbosity
}

DiagnosticContractProperties - Diagnostic Entity Properties

func (DiagnosticContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DiagnosticContractProperties.

func (*DiagnosticContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticContractProperties.

type EmailTemplateClient

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

EmailTemplateClient contains the methods for the EmailTemplate group. Don't use this type directly, use NewEmailTemplateClient() instead.

func NewEmailTemplateClient

func NewEmailTemplateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EmailTemplateClient, error)

NewEmailTemplateClient creates a new instance of EmailTemplateClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*EmailTemplateClient) CreateOrUpdate

func (client *EmailTemplateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters, options *EmailTemplateClientCreateOrUpdateOptions) (EmailTemplateClientCreateOrUpdateResponse, error)

CreateOrUpdate - Updates an Email Template. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • templateName - Email Template Name Identifier.
  • parameters - Email Template update parameters.
  • options - EmailTemplateClientCreateOrUpdateOptions contains the optional parameters for the EmailTemplateClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTemplate.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEmailTemplateClient().CreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.TemplateNameNewIssueNotificationMessage, armapimanagement.EmailTemplateUpdateParameters{
		Properties: &armapimanagement.EmailTemplateUpdateParameterProperties{
			Subject: to.Ptr("Your request for $IssueName was successfully received."),
		},
	}, &armapimanagement.EmailTemplateClientCreateOrUpdateOptions{IfMatch: 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.EmailTemplateContract = armapimanagement.EmailTemplateContract{
	// 	Name: to.Ptr("NewIssueNotificationMessage"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/templates"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/templates/NewIssueNotificationMessage"),
	// 	Properties: &armapimanagement.EmailTemplateContractProperties{
	// 		Description: to.Ptr("This email is sent to developers after they create a new topic on the Issues page of the developer portal."),
	// 		Body: to.Ptr("<!DOCTYPE html >\r\n<html>\r\n  <head />\r\n  <body>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Dear $DevFirstName $DevLastName,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Thank you for contacting us. Our API team will review your issue and get back to you soon.</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">\r\n          Click this <a href=\"http://$DevPortalUrl/issues/$IssueId\">link</a> to view or edit your request.\r\n        </p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Best,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">The $OrganizationName API Team</p>\r\n  </body>\r\n</html>"),
	// 		IsDefault: to.Ptr(false),
	// 		Parameters: []*armapimanagement.EmailTemplateParametersContractProperties{
	// 			{
	// 				Name: to.Ptr("DevFirstName"),
	// 				Title: to.Ptr("Developer first name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("DevLastName"),
	// 				Title: to.Ptr("Developer last name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("IssueId"),
	// 				Title: to.Ptr("Issue id"),
	// 			},
	// 			{
	// 				Name: to.Ptr("IssueName"),
	// 				Title: to.Ptr("Issue name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("OrganizationName"),
	// 				Title: to.Ptr("Organization name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("DevPortalUrl"),
	// 				Title: to.Ptr("Developer portal URL"),
	// 		}},
	// 		Subject: to.Ptr("Your request for $IssueName was successfully received."),
	// 		Title: to.Ptr("New issue received"),
	// 	},
	// }
}
Output:

func (*EmailTemplateClient) Delete

func (client *EmailTemplateClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, ifMatch string, options *EmailTemplateClientDeleteOptions) (EmailTemplateClientDeleteResponse, error)

Delete - Reset the Email Template to default template provided by the API Management service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • templateName - Email Template Name Identifier.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - EmailTemplateClientDeleteOptions contains the optional parameters for the EmailTemplateClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteTemplate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*EmailTemplateClient) Get

func (client *EmailTemplateClient) Get(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, options *EmailTemplateClientGetOptions) (EmailTemplateClientGetResponse, error)

Get - Gets the details of the email template specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • templateName - Email Template Name Identifier.
  • options - EmailTemplateClientGetOptions contains the optional parameters for the EmailTemplateClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTemplate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEmailTemplateClient().Get(ctx, "rg1", "apimService1", armapimanagement.TemplateNameNewIssueNotificationMessage, 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.EmailTemplateContract = armapimanagement.EmailTemplateContract{
	// 	Name: to.Ptr("NewIssueNotificationMessage"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/templates"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/templates/NewIssueNotificationMessage"),
	// 	Properties: &armapimanagement.EmailTemplateContractProperties{
	// 		Description: to.Ptr("This email is sent to developers after they create a new topic on the Issues page of the developer portal."),
	// 		Body: to.Ptr("<!DOCTYPE html >\r\n<html>\r\n  <head />\r\n  <body>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Dear $DevFirstName $DevLastName,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Thank you for contacting us. Our API team will review your issue and get back to you soon.</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">\r\n          Click this <a href=\"http://$DevPortalUrl/issues/$IssueId\">link</a> to view or edit your request.\r\n        </p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Best,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">The $OrganizationName API Team</p>\r\n  </body>\r\n</html>"),
	// 		IsDefault: to.Ptr(true),
	// 		Parameters: []*armapimanagement.EmailTemplateParametersContractProperties{
	// 			{
	// 				Name: to.Ptr("DevFirstName"),
	// 				Title: to.Ptr("Developer first name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("DevLastName"),
	// 				Title: to.Ptr("Developer last name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("IssueId"),
	// 				Title: to.Ptr("Issue id"),
	// 			},
	// 			{
	// 				Name: to.Ptr("IssueName"),
	// 				Title: to.Ptr("Issue name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("OrganizationName"),
	// 				Title: to.Ptr("Organization name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("DevPortalUrl"),
	// 				Title: to.Ptr("Developer portal URL"),
	// 		}},
	// 		Subject: to.Ptr("Your request $IssueName was received"),
	// 		Title: to.Ptr("New issue received"),
	// 	},
	// }
}
Output:

func (*EmailTemplateClient) GetEntityTag

func (client *EmailTemplateClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, options *EmailTemplateClientGetEntityTagOptions) (EmailTemplateClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the email template specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • templateName - Email Template Name Identifier.
  • options - EmailTemplateClientGetEntityTagOptions contains the optional parameters for the EmailTemplateClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadEmailTemplate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewEmailTemplateClient().GetEntityTag(ctx, "rg1", "apimService1", armapimanagement.TemplateNameNewIssueNotificationMessage, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*EmailTemplateClient) NewListByServicePager added in v0.5.0

func (client *EmailTemplateClient) NewListByServicePager(resourceGroupName string, serviceName string, options *EmailTemplateClientListByServiceOptions) *runtime.Pager[EmailTemplateClientListByServiceResponse]

NewListByServicePager - Gets all email templates

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - EmailTemplateClientListByServiceOptions contains the optional parameters for the EmailTemplateClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTemplates.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewEmailTemplateClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.EmailTemplateClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.EmailTemplateCollection = armapimanagement.EmailTemplateCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.EmailTemplateContract{
		// 		{
		// 			Name: to.Ptr("ApplicationApprovedNotificationMessage"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/templates"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/templates/ApplicationApprovedNotificationMessage"),
		// 			Properties: &armapimanagement.EmailTemplateContractProperties{
		// 				Description: to.Ptr("Developers who submitted their application for publication in the application gallery on the developer portal receive this email after their submission is approved."),
		// 				Body: to.Ptr("<!DOCTYPE html >\r\n<html>\r\n  <head />\r\n  <body>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Dear $DevFirstName $DevLastName,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">\r\n          We are happy to let you know that your request to publish the $AppName application in the application gallery has been approved. Your application has been published and can be viewed <a href=\"http://$DevPortalUrl/Applications/Details/$AppId\">here</a>.\r\n        </p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Best,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">The $OrganizationName API Team</p>\r\n  </body>\r\n</html>"),
		// 				IsDefault: to.Ptr(true),
		// 				Parameters: []*armapimanagement.EmailTemplateParametersContractProperties{
		// 					{
		// 						Name: to.Ptr("AppId"),
		// 						Title: to.Ptr("Application id"),
		// 					},
		// 					{
		// 						Name: to.Ptr("AppName"),
		// 						Title: to.Ptr("Application name"),
		// 					},
		// 					{
		// 						Name: to.Ptr("DevFirstName"),
		// 						Title: to.Ptr("Developer first name"),
		// 					},
		// 					{
		// 						Name: to.Ptr("DevLastName"),
		// 						Title: to.Ptr("Developer last name"),
		// 					},
		// 					{
		// 						Name: to.Ptr("OrganizationName"),
		// 						Title: to.Ptr("Organization name"),
		// 					},
		// 					{
		// 						Name: to.Ptr("DevPortalUrl"),
		// 						Title: to.Ptr("Developer portal URL"),
		// 				}},
		// 				Subject: to.Ptr("Your application $AppName is published in the application gallery"),
		// 				Title: to.Ptr("Application gallery submission approved"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*EmailTemplateClient) Update

func (client *EmailTemplateClient) Update(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, ifMatch string, parameters EmailTemplateUpdateParameters, options *EmailTemplateClientUpdateOptions) (EmailTemplateClientUpdateResponse, error)

Update - Updates API Management email template If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • templateName - Email Template Name Identifier.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - EmailTemplateClientUpdateOptions contains the optional parameters for the EmailTemplateClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTemplate.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEmailTemplateClient().Update(ctx, "rg1", "apimService1", armapimanagement.TemplateNameNewIssueNotificationMessage, "*", armapimanagement.EmailTemplateUpdateParameters{
		Properties: &armapimanagement.EmailTemplateUpdateParameterProperties{
			Body:    to.Ptr("<!DOCTYPE html >\r\n<html>\r\n  <head />\r\n  <body>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Dear $DevFirstName $DevLastName,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">\r\n          We are happy to let you know that your request to publish the $AppName application in the gallery has been approved. Your application has been published and can be viewed <a href=\"http://$DevPortalUrl/Applications/Details/$AppId\">here</a>.\r\n        </p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Best,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">The $OrganizationName API Team</p>\r\n  </body>\r\n</html>"),
			Subject: to.Ptr("Your request $IssueName was received"),
		},
	}, 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.EmailTemplateContract = armapimanagement.EmailTemplateContract{
	// 	Name: to.Ptr("NewIssueNotificationMessage"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/templates"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/templates/NewIssueNotificationMessage"),
	// 	Properties: &armapimanagement.EmailTemplateContractProperties{
	// 		Description: to.Ptr("This email is sent to developers after they create a new topic on the Issues page of the developer portal."),
	// 		Body: to.Ptr("<!DOCTYPE html >\r\n<html>\r\n  <head />\r\n  <body>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Dear $DevFirstName $DevLastName,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Thank you for contacting us. Our API team will review your issue and get back to you soon.</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">\r\n          Click this <a href=\"http://$DevPortalUrl/issues/$IssueId\">link</a> to view or edit your request.\r\n        </p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Best,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">The $OrganizationName API Team</p>\r\n  </body>\r\n</html>"),
	// 		IsDefault: to.Ptr(true),
	// 		Parameters: []*armapimanagement.EmailTemplateParametersContractProperties{
	// 			{
	// 				Name: to.Ptr("DevFirstName"),
	// 				Title: to.Ptr("Developer first name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("DevLastName"),
	// 				Title: to.Ptr("Developer last name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("IssueId"),
	// 				Title: to.Ptr("Issue id"),
	// 			},
	// 			{
	// 				Name: to.Ptr("IssueName"),
	// 				Title: to.Ptr("Issue name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("OrganizationName"),
	// 				Title: to.Ptr("Organization name"),
	// 			},
	// 			{
	// 				Name: to.Ptr("DevPortalUrl"),
	// 				Title: to.Ptr("Developer portal URL"),
	// 		}},
	// 		Subject: to.Ptr("Your request $IssueName was received"),
	// 		Title: to.Ptr("New issue received"),
	// 	},
	// }
}
Output:

type EmailTemplateClientCreateOrUpdateOptions added in v0.3.0

type EmailTemplateClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

EmailTemplateClientCreateOrUpdateOptions contains the optional parameters for the EmailTemplateClient.CreateOrUpdate method.

type EmailTemplateClientCreateOrUpdateResponse added in v0.3.0

type EmailTemplateClientCreateOrUpdateResponse struct {
	EmailTemplateContract
}

EmailTemplateClientCreateOrUpdateResponse contains the response from method EmailTemplateClient.CreateOrUpdate.

type EmailTemplateClientDeleteOptions added in v0.3.0

type EmailTemplateClientDeleteOptions struct {
}

EmailTemplateClientDeleteOptions contains the optional parameters for the EmailTemplateClient.Delete method.

type EmailTemplateClientDeleteResponse added in v0.3.0

type EmailTemplateClientDeleteResponse struct {
}

EmailTemplateClientDeleteResponse contains the response from method EmailTemplateClient.Delete.

type EmailTemplateClientGetEntityTagOptions added in v0.3.0

type EmailTemplateClientGetEntityTagOptions struct {
}

EmailTemplateClientGetEntityTagOptions contains the optional parameters for the EmailTemplateClient.GetEntityTag method.

type EmailTemplateClientGetEntityTagResponse added in v0.3.0

type EmailTemplateClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

EmailTemplateClientGetEntityTagResponse contains the response from method EmailTemplateClient.GetEntityTag.

type EmailTemplateClientGetOptions added in v0.3.0

type EmailTemplateClientGetOptions struct {
}

EmailTemplateClientGetOptions contains the optional parameters for the EmailTemplateClient.Get method.

type EmailTemplateClientGetResponse added in v0.3.0

type EmailTemplateClientGetResponse struct {
	EmailTemplateContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

EmailTemplateClientGetResponse contains the response from method EmailTemplateClient.Get.

type EmailTemplateClientListByServiceOptions added in v0.3.0

type EmailTemplateClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

EmailTemplateClientListByServiceOptions contains the optional parameters for the EmailTemplateClient.NewListByServicePager method.

type EmailTemplateClientListByServiceResponse added in v0.3.0

type EmailTemplateClientListByServiceResponse struct {
	EmailTemplateCollection
}

EmailTemplateClientListByServiceResponse contains the response from method EmailTemplateClient.NewListByServicePager.

type EmailTemplateClientUpdateOptions added in v0.3.0

type EmailTemplateClientUpdateOptions struct {
}

EmailTemplateClientUpdateOptions contains the optional parameters for the EmailTemplateClient.Update method.

type EmailTemplateClientUpdateResponse added in v0.3.0

type EmailTemplateClientUpdateResponse struct {
	EmailTemplateContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

EmailTemplateClientUpdateResponse contains the response from method EmailTemplateClient.Update.

type EmailTemplateCollection

type EmailTemplateCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*EmailTemplateContract
}

EmailTemplateCollection - Paged email template list representation.

func (EmailTemplateCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EmailTemplateCollection.

func (*EmailTemplateCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateCollection.

type EmailTemplateContract

type EmailTemplateContract struct {
	// Email Template entity contract properties.
	Properties *EmailTemplateContractProperties

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

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

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

EmailTemplateContract - Email Template details.

func (EmailTemplateContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EmailTemplateContract.

func (*EmailTemplateContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateContract.

type EmailTemplateContractProperties

type EmailTemplateContractProperties struct {
	// REQUIRED; Email Template Body. This should be a valid XDocument
	Body *string

	// REQUIRED; Subject of the Template.
	Subject *string

	// Description of the Email Template.
	Description *string

	// Email Template Parameter values.
	Parameters []*EmailTemplateParametersContractProperties

	// Title of the Template.
	Title *string

	// READ-ONLY; Whether the template is the default template provided by API Management or has been edited.
	IsDefault *bool
}

EmailTemplateContractProperties - Email Template Contract properties.

func (EmailTemplateContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EmailTemplateContractProperties.

func (*EmailTemplateContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateContractProperties.

type EmailTemplateParametersContractProperties

type EmailTemplateParametersContractProperties struct {
	// Template parameter description.
	Description *string

	// Template parameter name.
	Name *string

	// Template parameter title.
	Title *string
}

EmailTemplateParametersContractProperties - Email Template Parameter contract.

func (EmailTemplateParametersContractProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type EmailTemplateParametersContractProperties.

func (*EmailTemplateParametersContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateParametersContractProperties.

type EmailTemplateUpdateParameterProperties

type EmailTemplateUpdateParameterProperties struct {
	// Email Template Body. This should be a valid XDocument
	Body *string

	// Description of the Email Template.
	Description *string

	// Email Template Parameter values.
	Parameters []*EmailTemplateParametersContractProperties

	// Subject of the Template.
	Subject *string

	// Title of the Template.
	Title *string
}

EmailTemplateUpdateParameterProperties - Email Template Update Contract properties.

func (EmailTemplateUpdateParameterProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EmailTemplateUpdateParameterProperties.

func (*EmailTemplateUpdateParameterProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateUpdateParameterProperties.

type EmailTemplateUpdateParameters

type EmailTemplateUpdateParameters struct {
	// Email Template Update contract properties.
	Properties *EmailTemplateUpdateParameterProperties
}

EmailTemplateUpdateParameters - Email Template update Parameters.

func (EmailTemplateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EmailTemplateUpdateParameters.

func (*EmailTemplateUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateUpdateParameters.

type EndpointDependency

type EndpointDependency struct {
	// The domain name of the dependency.
	DomainName *string

	// The Ports used when connecting to DomainName.
	EndpointDetails []*EndpointDetail
}

EndpointDependency - A domain name that a service is reached at.

func (EndpointDependency) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EndpointDependency.

func (*EndpointDependency) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency.

type EndpointDetail

type EndpointDetail struct {
	// The port an endpoint is connected to.
	Port *int32

	// The region of the dependency.
	Region *string
}

EndpointDetail - Current TCP connectivity information from the Api Management Service to a single endpoint.

func (EndpointDetail) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type EndpointDetail.

func (*EndpointDetail) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail.

type ErrorFieldContract

type ErrorFieldContract struct {
	// Property level error code.
	Code *string

	// Human-readable representation of property-level error.
	Message *string

	// Property name.
	Target *string
}

ErrorFieldContract - Error Field contract.

func (ErrorFieldContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorFieldContract.

func (*ErrorFieldContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorFieldContract.

type ErrorResponse

type ErrorResponse struct {
	// Properties of the Error Response.
	Error *ErrorResponseBody
}

ErrorResponse - Error Response.

func (ErrorResponse) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ErrorResponseBody

type ErrorResponseBody struct {
	// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
	Code *string

	// The list of invalid fields send in request, in case of validation error.
	Details []*ErrorFieldContract

	// Human-readable representation of the error.
	Message *string
}

ErrorResponseBody - Error Body contract.

func (ErrorResponseBody) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponseBody.

func (*ErrorResponseBody) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBody.

type ExportAPI

type ExportAPI string
const (
	ExportAPITrue ExportAPI = "true"
)

func PossibleExportAPIValues

func PossibleExportAPIValues() []ExportAPI

PossibleExportAPIValues returns the possible values for the ExportAPI const type.

type ExportFormat

type ExportFormat string
const (
	// ExportFormatOpenapi - Export the Api Definition in OpenAPI 3.0 Specification as YAML document to Storage Blob.
	ExportFormatOpenapi ExportFormat = "openapi-link"
	// ExportFormatOpenapiJSON - Export the Api Definition in OpenAPI 3.0 Specification as JSON document to Storage Blob.
	ExportFormatOpenapiJSON ExportFormat = "openapi+json-link"
	// ExportFormatSwagger - Export the Api Definition in OpenAPI 2.0 Specification as JSON document to the Storage Blob.
	ExportFormatSwagger ExportFormat = "swagger-link"
	// ExportFormatWadl - Export the Api Definition in WADL Schema to Storage Blob.
	ExportFormatWadl ExportFormat = "wadl-link"
	// ExportFormatWsdl - Export the Api Definition in WSDL Schema to Storage Blob. This is only supported for APIs of Type `soap`
	ExportFormatWsdl ExportFormat = "wsdl-link"
)

func PossibleExportFormatValues

func PossibleExportFormatValues() []ExportFormat

PossibleExportFormatValues returns the possible values for the ExportFormat const type.

type ExportResultFormat

type ExportResultFormat string

ExportResultFormat - Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes.

const (
	// ExportResultFormatOpenAPI - Export the API Definition in OpenAPI Specification 3.0 to Storage Blob.
	ExportResultFormatOpenAPI ExportResultFormat = "openapi-link"
	// ExportResultFormatSwagger - The API Definition is exported in OpenAPI Specification 2.0 format to the Storage Blob.
	ExportResultFormatSwagger ExportResultFormat = "swagger-link-json"
	// ExportResultFormatWadl - Export the API Definition in WADL Schema to Storage Blob.
	ExportResultFormatWadl ExportResultFormat = "wadl-link-json"
	// ExportResultFormatWsdl - The API Definition is exported in WSDL Schema to Storage Blob. This is only supported for APIs
	// of Type `soap`
	ExportResultFormatWsdl ExportResultFormat = "wsdl-link+xml"
)

func PossibleExportResultFormatValues

func PossibleExportResultFormatValues() []ExportResultFormat

PossibleExportResultFormatValues returns the possible values for the ExportResultFormat const type.

type GatewayAPIClient

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

GatewayAPIClient contains the methods for the GatewayAPI group. Don't use this type directly, use NewGatewayAPIClient() instead.

func NewGatewayAPIClient

func NewGatewayAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayAPIClient, error)

NewGatewayAPIClient creates a new instance of GatewayAPIClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GatewayAPIClient) CreateOrUpdate

func (client *GatewayAPIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiID string, options *GatewayAPIClientCreateOrUpdateOptions) (GatewayAPIClientCreateOrUpdateResponse, error)

CreateOrUpdate - Adds an API to the specified Gateway. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • options - GatewayAPIClientCreateOrUpdateOptions contains the optional parameters for the GatewayAPIClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayApi.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGatewayAPIClient().CreateOrUpdate(ctx, "rg1", "apimService1", "gw1", "echo-api", &armapimanagement.GatewayAPIClientCreateOrUpdateOptions{Parameters: &armapimanagement.AssociationContract{
		Properties: &armapimanagement.AssociationContractProperties{
			ProvisioningState: to.Ptr("created"),
		},
	},
	})
	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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("echo-api"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/gateways/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/apis/echo-api"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr(""),
	// 		DisplayName: to.Ptr("EchoApi"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTP),
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("https://contoso.com/apis/echo"),
	// 		},
	// 	}
}
Output:

func (*GatewayAPIClient) Delete

func (client *GatewayAPIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiID string, options *GatewayAPIClientDeleteOptions) (GatewayAPIClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • options - GatewayAPIClientDeleteOptions contains the optional parameters for the GatewayAPIClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayApi.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*GatewayAPIClient) GetEntityTag

func (client *GatewayAPIClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiID string, options *GatewayAPIClientGetEntityTagOptions) (GatewayAPIClientGetEntityTagResponse, error)

GetEntityTag - Checks that API entity specified by identifier is associated with the Gateway entity.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • apiID - API identifier. Must be unique in the current API Management service instance.
  • options - GatewayAPIClientGetEntityTagOptions contains the optional parameters for the GatewayAPIClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayApi.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewGatewayAPIClient().GetEntityTag(ctx, "rg1", "apimService1", "gw1", "api1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*GatewayAPIClient) NewListByServicePager added in v0.5.0

func (client *GatewayAPIClient) NewListByServicePager(resourceGroupName string, serviceName string, gatewayID string, options *GatewayAPIClientListByServiceOptions) *runtime.Pager[GatewayAPIClientListByServiceResponse]

NewListByServicePager - Lists a collection of the APIs associated with a gateway.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • options - GatewayAPIClientListByServiceOptions contains the optional parameters for the GatewayAPIClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayApis.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGatewayAPIClient().NewListByServicePager("rg1", "apimService1", "gw1", &armapimanagement.GatewayAPIClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.APICollection = armapimanagement.APICollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.APIContract{
		// 		{
		// 			Name: to.Ptr("57681820a40f7eb6c49f6aca"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/gateways/apis"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/apis/57681820a40f7eb6c49f6aca"),
		// 			Properties: &armapimanagement.APIContractProperties{
		// 				Description: to.Ptr("description_57681820a40f7eb6c49f6acc"),
		// 				APIRevision: to.Ptr("1"),
		// 				IsCurrent: to.Ptr(true),
		// 				Path: to.Ptr("suffix_57681820a40f7eb6c49f6ace"),
		// 				DisplayName: to.Ptr("api_57681820a40f7eb6c49f6acb"),
		// 				Protocols: []*armapimanagement.Protocol{
		// 					to.Ptr(armapimanagement.ProtocolHTTPS)},
		// 					ServiceURL: to.Ptr("http://contoso/57681820a40f7eb6c49f6acd"),
		// 				},
		// 		}},
		// 	}
	}
}
Output:

type GatewayAPIClientCreateOrUpdateOptions added in v0.3.0

type GatewayAPIClientCreateOrUpdateOptions struct {
	Parameters *AssociationContract
}

GatewayAPIClientCreateOrUpdateOptions contains the optional parameters for the GatewayAPIClient.CreateOrUpdate method.

type GatewayAPIClientCreateOrUpdateResponse added in v0.3.0

type GatewayAPIClientCreateOrUpdateResponse struct {
	APIContract
}

GatewayAPIClientCreateOrUpdateResponse contains the response from method GatewayAPIClient.CreateOrUpdate.

type GatewayAPIClientDeleteOptions added in v0.3.0

type GatewayAPIClientDeleteOptions struct {
}

GatewayAPIClientDeleteOptions contains the optional parameters for the GatewayAPIClient.Delete method.

type GatewayAPIClientDeleteResponse added in v0.3.0

type GatewayAPIClientDeleteResponse struct {
}

GatewayAPIClientDeleteResponse contains the response from method GatewayAPIClient.Delete.

type GatewayAPIClientGetEntityTagOptions added in v0.3.0

type GatewayAPIClientGetEntityTagOptions struct {
}

GatewayAPIClientGetEntityTagOptions contains the optional parameters for the GatewayAPIClient.GetEntityTag method.

type GatewayAPIClientGetEntityTagResponse added in v0.3.0

type GatewayAPIClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

GatewayAPIClientGetEntityTagResponse contains the response from method GatewayAPIClient.GetEntityTag.

type GatewayAPIClientListByServiceOptions added in v0.3.0

type GatewayAPIClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

GatewayAPIClientListByServiceOptions contains the optional parameters for the GatewayAPIClient.NewListByServicePager method.

type GatewayAPIClientListByServiceResponse added in v0.3.0

type GatewayAPIClientListByServiceResponse struct {
	APICollection
}

GatewayAPIClientListByServiceResponse contains the response from method GatewayAPIClient.NewListByServicePager.

type GatewayCertificateAuthorityClient

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

GatewayCertificateAuthorityClient contains the methods for the GatewayCertificateAuthority group. Don't use this type directly, use NewGatewayCertificateAuthorityClient() instead.

func NewGatewayCertificateAuthorityClient

func NewGatewayCertificateAuthorityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayCertificateAuthorityClient, error)

NewGatewayCertificateAuthorityClient creates a new instance of GatewayCertificateAuthorityClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GatewayCertificateAuthorityClient) CreateOrUpdate

CreateOrUpdate - Assign Certificate entity to Gateway entity as Certificate Authority. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance.
  • options - GatewayCertificateAuthorityClientCreateOrUpdateOptions contains the optional parameters for the GatewayCertificateAuthorityClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayCertificateAuthority.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGatewayCertificateAuthorityClient().CreateOrUpdate(ctx, "rg1", "apimService1", "gw1", "cert1", armapimanagement.GatewayCertificateAuthorityContract{
		Properties: &armapimanagement.GatewayCertificateAuthorityContractProperties{
			IsTrusted: to.Ptr(false),
		},
	}, &armapimanagement.GatewayCertificateAuthorityClientCreateOrUpdateOptions{IfMatch: 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.GatewayCertificateAuthorityContract = armapimanagement.GatewayCertificateAuthorityContract{
	// 	Name: to.Ptr("cert1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/gateways/certificateAuthorities"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/certificateAuthorities/cert1"),
	// 	Properties: &armapimanagement.GatewayCertificateAuthorityContractProperties{
	// 		IsTrusted: to.Ptr(false),
	// 	},
	// }
}
Output:

func (*GatewayCertificateAuthorityClient) Delete

func (client *GatewayCertificateAuthorityClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, certificateID string, ifMatch string, options *GatewayCertificateAuthorityClientDeleteOptions) (GatewayCertificateAuthorityClientDeleteResponse, error)

Delete - Remove relationship between Certificate Authority and Gateway entity. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - GatewayCertificateAuthorityClientDeleteOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayCertificateAuthority.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*GatewayCertificateAuthorityClient) Get

Get - Get assigned Gateway Certificate Authority details. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance.
  • options - GatewayCertificateAuthorityClientGetOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGatewayCertificateAuthority.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGatewayCertificateAuthorityClient().Get(ctx, "rg1", "apimService1", "gw1", "cert1", 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.GatewayCertificateAuthorityContract = armapimanagement.GatewayCertificateAuthorityContract{
	// 	Name: to.Ptr("cert1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/gateways/certificateAuthorities"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/certificateAuthorities/cert1"),
	// 	Properties: &armapimanagement.GatewayCertificateAuthorityContractProperties{
	// 		IsTrusted: to.Ptr(true),
	// 	},
	// }
}
Output:

func (*GatewayCertificateAuthorityClient) GetEntityTag

GetEntityTag - Checks if Certificate entity is assigned to Gateway entity as Certificate Authority.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance.
  • options - GatewayCertificateAuthorityClientGetEntityTagOptions contains the optional parameters for the GatewayCertificateAuthorityClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayCertificateAuthority.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewGatewayCertificateAuthorityClient().GetEntityTag(ctx, "rg1", "apimService1", "gw1", "cert1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*GatewayCertificateAuthorityClient) NewListByServicePager added in v0.5.0

NewListByServicePager - Lists the collection of Certificate Authorities for the specified Gateway entity.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • options - GatewayCertificateAuthorityClientListByServiceOptions contains the optional parameters for the GatewayCertificateAuthorityClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayCertificateAuthorities.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGatewayCertificateAuthorityClient().NewListByServicePager("rg1", "apimService1", "gw1", &armapimanagement.GatewayCertificateAuthorityClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.GatewayCertificateAuthorityCollection = armapimanagement.GatewayCertificateAuthorityCollection{
		// 	Value: []*armapimanagement.GatewayCertificateAuthorityContract{
		// 		{
		// 			Name: to.Ptr("cert1"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/gateways/certificateAuthorities"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/certificateAuthorities/cert1"),
		// 			Properties: &armapimanagement.GatewayCertificateAuthorityContractProperties{
		// 				IsTrusted: to.Ptr(false),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("cert2"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/gateways/certificateAuthorities"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/certificateAuthorities/cert2"),
		// 			Properties: &armapimanagement.GatewayCertificateAuthorityContractProperties{
		// 				IsTrusted: to.Ptr(true),
		// 			},
		// 	}},
		// }
	}
}
Output:

type GatewayCertificateAuthorityClientCreateOrUpdateOptions added in v0.3.0

type GatewayCertificateAuthorityClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

GatewayCertificateAuthorityClientCreateOrUpdateOptions contains the optional parameters for the GatewayCertificateAuthorityClient.CreateOrUpdate method.

type GatewayCertificateAuthorityClientCreateOrUpdateResponse added in v0.3.0

type GatewayCertificateAuthorityClientCreateOrUpdateResponse struct {
	GatewayCertificateAuthorityContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GatewayCertificateAuthorityClientCreateOrUpdateResponse contains the response from method GatewayCertificateAuthorityClient.CreateOrUpdate.

type GatewayCertificateAuthorityClientDeleteOptions added in v0.3.0

type GatewayCertificateAuthorityClientDeleteOptions struct {
}

GatewayCertificateAuthorityClientDeleteOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Delete method.

type GatewayCertificateAuthorityClientDeleteResponse added in v0.3.0

type GatewayCertificateAuthorityClientDeleteResponse struct {
}

GatewayCertificateAuthorityClientDeleteResponse contains the response from method GatewayCertificateAuthorityClient.Delete.

type GatewayCertificateAuthorityClientGetEntityTagOptions added in v0.3.0

type GatewayCertificateAuthorityClientGetEntityTagOptions struct {
}

GatewayCertificateAuthorityClientGetEntityTagOptions contains the optional parameters for the GatewayCertificateAuthorityClient.GetEntityTag method.

type GatewayCertificateAuthorityClientGetEntityTagResponse added in v0.3.0

type GatewayCertificateAuthorityClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

GatewayCertificateAuthorityClientGetEntityTagResponse contains the response from method GatewayCertificateAuthorityClient.GetEntityTag.

type GatewayCertificateAuthorityClientGetOptions added in v0.3.0

type GatewayCertificateAuthorityClientGetOptions struct {
}

GatewayCertificateAuthorityClientGetOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Get method.

type GatewayCertificateAuthorityClientGetResponse added in v0.3.0

type GatewayCertificateAuthorityClientGetResponse struct {
	GatewayCertificateAuthorityContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GatewayCertificateAuthorityClientGetResponse contains the response from method GatewayCertificateAuthorityClient.Get.

type GatewayCertificateAuthorityClientListByServiceOptions added in v0.3.0

type GatewayCertificateAuthorityClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | eq, ne | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

GatewayCertificateAuthorityClientListByServiceOptions contains the optional parameters for the GatewayCertificateAuthorityClient.NewListByServicePager method.

type GatewayCertificateAuthorityClientListByServiceResponse added in v0.3.0

type GatewayCertificateAuthorityClientListByServiceResponse struct {
	GatewayCertificateAuthorityCollection
}

GatewayCertificateAuthorityClientListByServiceResponse contains the response from method GatewayCertificateAuthorityClient.NewListByServicePager.

type GatewayCertificateAuthorityCollection

type GatewayCertificateAuthorityCollection struct {
	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Page values.
	Value []*GatewayCertificateAuthorityContract
}

GatewayCertificateAuthorityCollection - Paged Gateway certificate authority list representation.

func (GatewayCertificateAuthorityCollection) MarshalJSON

func (g GatewayCertificateAuthorityCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityCollection.

func (*GatewayCertificateAuthorityCollection) UnmarshalJSON added in v1.1.0

func (g *GatewayCertificateAuthorityCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityCollection.

type GatewayCertificateAuthorityContract

type GatewayCertificateAuthorityContract struct {
	// Gateway certificate authority details.
	Properties *GatewayCertificateAuthorityContractProperties

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

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

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

GatewayCertificateAuthorityContract - Gateway certificate authority details.

func (GatewayCertificateAuthorityContract) MarshalJSON

func (g GatewayCertificateAuthorityContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityContract.

func (*GatewayCertificateAuthorityContract) UnmarshalJSON added in v1.1.0

func (g *GatewayCertificateAuthorityContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityContract.

type GatewayCertificateAuthorityContractProperties

type GatewayCertificateAuthorityContractProperties struct {
	// Determines whether certificate authority is trusted.
	IsTrusted *bool
}

GatewayCertificateAuthorityContractProperties - Gateway certificate authority details.

func (GatewayCertificateAuthorityContractProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityContractProperties.

func (*GatewayCertificateAuthorityContractProperties) UnmarshalJSON added in v1.1.0

func (g *GatewayCertificateAuthorityContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityContractProperties.

type GatewayClient

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

GatewayClient contains the methods for the Gateway group. Don't use this type directly, use NewGatewayClient() instead.

func NewGatewayClient

func NewGatewayClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayClient, error)

NewGatewayClient creates a new instance of GatewayClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GatewayClient) CreateOrUpdate

func (client *GatewayClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, options *GatewayClientCreateOrUpdateOptions) (GatewayClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a Gateway to be used in Api Management instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • options - GatewayClientCreateOrUpdateOptions contains the optional parameters for the GatewayClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGateway.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGatewayClient().CreateOrUpdate(ctx, "rg1", "apimService1", "gw1", armapimanagement.GatewayContract{
		Properties: &armapimanagement.GatewayContractProperties{
			Description: to.Ptr("my gateway 1"),
			LocationData: &armapimanagement.ResourceLocationDataContract{
				Name: to.Ptr("my location"),
			},
		},
	}, &armapimanagement.GatewayClientCreateOrUpdateOptions{IfMatch: 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.GatewayContract = armapimanagement.GatewayContract{
	// 	Name: to.Ptr("a1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/gateways"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1"),
	// 	Properties: &armapimanagement.GatewayContractProperties{
	// 		Description: to.Ptr("my gateway 1"),
	// 		LocationData: &armapimanagement.ResourceLocationDataContract{
	// 			Name: to.Ptr("my location"),
	// 		},
	// 	},
	// }
}
Output:

func (*GatewayClient) Delete

func (client *GatewayClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, ifMatch string, options *GatewayClientDeleteOptions) (GatewayClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - GatewayClientDeleteOptions contains the optional parameters for the GatewayClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGateway.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*GatewayClient) GenerateToken

func (client *GatewayClient) GenerateToken(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayTokenRequestContract, options *GatewayClientGenerateTokenOptions) (GatewayClientGenerateTokenResponse, error)

GenerateToken - Gets the Shared Access Authorization Token for the gateway. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • options - GatewayClientGenerateTokenOptions contains the optional parameters for the GatewayClient.GenerateToken method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayGenerateToken.json

package main

import (
	"context"
	"log"

	"time"

	"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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGatewayClient().GenerateToken(ctx, "rg1", "apimService1", "gw1", armapimanagement.GatewayTokenRequestContract{
		Expiry:  to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-21T00:44:24.2845269Z"); return t }()),
		KeyType: to.Ptr(armapimanagement.KeyTypePrimary),
	}, 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.GatewayTokenContract = armapimanagement.GatewayTokenContract{
	// 	Value: to.Ptr("gw1&201904210044&9A1GR1f5WIhFvFmzQG+xxxxxxxxxxx/kBeu87DWad3tkasUXuvPL+MgzlwUHyg=="),
	// }
}
Output:

func (*GatewayClient) Get

func (client *GatewayClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, options *GatewayClientGetOptions) (GatewayClientGetResponse, error)

Get - Gets the details of the Gateway specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • options - GatewayClientGetOptions contains the optional parameters for the GatewayClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGateway.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGatewayClient().Get(ctx, "rg1", "apimService1", "gw1", 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.GatewayContract = armapimanagement.GatewayContract{
	// 	Name: to.Ptr("a1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/gateways"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1"),
	// 	Properties: &armapimanagement.GatewayContractProperties{
	// 		Description: to.Ptr("my gateway 1"),
	// 		LocationData: &armapimanagement.ResourceLocationDataContract{
	// 			Name: to.Ptr("my location"),
	// 		},
	// 	},
	// }
}
Output:

func (*GatewayClient) GetEntityTag

func (client *GatewayClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, options *GatewayClientGetEntityTagOptions) (GatewayClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the Gateway specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • options - GatewayClientGetEntityTagOptions contains the optional parameters for the GatewayClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGateway.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewGatewayClient().GetEntityTag(ctx, "rg1", "apimService1", "mygateway", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*GatewayClient) ListKeys

func (client *GatewayClient) ListKeys(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, options *GatewayClientListKeysOptions) (GatewayClientListKeysResponse, error)

ListKeys - Retrieves gateway keys. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • options - GatewayClientListKeysOptions contains the optional parameters for the GatewayClient.ListKeys method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayListKeys.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGatewayClient().ListKeys(ctx, "rg1", "apimService1", "gw1", 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.GatewayKeysContract = armapimanagement.GatewayKeysContract{
	// 	Primary: to.Ptr("primary_key_value"),
	// 	Secondary: to.Ptr("secondary_key_value"),
	// }
}
Output:

func (*GatewayClient) NewListByServicePager added in v0.5.0

func (client *GatewayClient) NewListByServicePager(resourceGroupName string, serviceName string, options *GatewayClientListByServiceOptions) *runtime.Pager[GatewayClientListByServiceResponse]

NewListByServicePager - Lists a collection of gateways registered with service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - GatewayClientListByServiceOptions contains the optional parameters for the GatewayClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGateways.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGatewayClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.GatewayClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.GatewayCollection = armapimanagement.GatewayCollection{
		// 	Count: to.Ptr[int64](2),
		// 	Value: []*armapimanagement.GatewayContract{
		// 		{
		// 			Name: to.Ptr("a1"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/gateways"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1"),
		// 			Properties: &armapimanagement.GatewayContractProperties{
		// 				Description: to.Ptr("my gateway 1"),
		// 				LocationData: &armapimanagement.ResourceLocationDataContract{
		// 					Name: to.Ptr("my location 1"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("5a73933b8f27f7cc82a2d533"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/gateways"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw2"),
		// 			Properties: &armapimanagement.GatewayContractProperties{
		// 				Description: to.Ptr("my gateway 2"),
		// 				LocationData: &armapimanagement.ResourceLocationDataContract{
		// 					Name: to.Ptr("my location 2"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*GatewayClient) RegenerateKey

func (client *GatewayClient) RegenerateKey(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayKeyRegenerationRequestContract, options *GatewayClientRegenerateKeyOptions) (GatewayClientRegenerateKeyResponse, error)

RegenerateKey - Regenerates specified gateway key invalidating any tokens created with it. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • options - GatewayClientRegenerateKeyOptions contains the optional parameters for the GatewayClient.RegenerateKey method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayRegenerateKey.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewGatewayClient().RegenerateKey(ctx, "rg1", "apimService1", "gwId", armapimanagement.GatewayKeyRegenerationRequestContract{
		KeyType: to.Ptr(armapimanagement.KeyTypePrimary),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*GatewayClient) Update

func (client *GatewayClient) Update(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, ifMatch string, parameters GatewayContract, options *GatewayClientUpdateOptions) (GatewayClientUpdateResponse, error)

Update - Updates the details of the gateway specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - GatewayClientUpdateOptions contains the optional parameters for the GatewayClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateGateway.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGatewayClient().Update(ctx, "rg1", "apimService1", "gw1", "*", armapimanagement.GatewayContract{
		Properties: &armapimanagement.GatewayContractProperties{
			Description: to.Ptr("my gateway 1"),
			LocationData: &armapimanagement.ResourceLocationDataContract{
				Name: to.Ptr("my location"),
			},
		},
	}, 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.GatewayContract = armapimanagement.GatewayContract{
	// 	Name: to.Ptr("a1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/gateways"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1"),
	// 	Properties: &armapimanagement.GatewayContractProperties{
	// 		Description: to.Ptr("my gateway 1"),
	// 		LocationData: &armapimanagement.ResourceLocationDataContract{
	// 			Name: to.Ptr("my location"),
	// 		},
	// 	},
	// }
}
Output:

type GatewayClientCreateOrUpdateOptions added in v0.3.0

type GatewayClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

GatewayClientCreateOrUpdateOptions contains the optional parameters for the GatewayClient.CreateOrUpdate method.

type GatewayClientCreateOrUpdateResponse added in v0.3.0

type GatewayClientCreateOrUpdateResponse struct {
	GatewayContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GatewayClientCreateOrUpdateResponse contains the response from method GatewayClient.CreateOrUpdate.

type GatewayClientDeleteOptions added in v0.3.0

type GatewayClientDeleteOptions struct {
}

GatewayClientDeleteOptions contains the optional parameters for the GatewayClient.Delete method.

type GatewayClientDeleteResponse added in v0.3.0

type GatewayClientDeleteResponse struct {
}

GatewayClientDeleteResponse contains the response from method GatewayClient.Delete.

type GatewayClientGenerateTokenOptions added in v0.3.0

type GatewayClientGenerateTokenOptions struct {
}

GatewayClientGenerateTokenOptions contains the optional parameters for the GatewayClient.GenerateToken method.

type GatewayClientGenerateTokenResponse added in v0.3.0

type GatewayClientGenerateTokenResponse struct {
	GatewayTokenContract
}

GatewayClientGenerateTokenResponse contains the response from method GatewayClient.GenerateToken.

type GatewayClientGetEntityTagOptions added in v0.3.0

type GatewayClientGetEntityTagOptions struct {
}

GatewayClientGetEntityTagOptions contains the optional parameters for the GatewayClient.GetEntityTag method.

type GatewayClientGetEntityTagResponse added in v0.3.0

type GatewayClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

GatewayClientGetEntityTagResponse contains the response from method GatewayClient.GetEntityTag.

type GatewayClientGetOptions added in v0.3.0

type GatewayClientGetOptions struct {
}

GatewayClientGetOptions contains the optional parameters for the GatewayClient.Get method.

type GatewayClientGetResponse added in v0.3.0

type GatewayClientGetResponse struct {
	GatewayContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GatewayClientGetResponse contains the response from method GatewayClient.Get.

type GatewayClientListByServiceOptions added in v0.3.0

type GatewayClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | region | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

GatewayClientListByServiceOptions contains the optional parameters for the GatewayClient.NewListByServicePager method.

type GatewayClientListByServiceResponse added in v0.3.0

type GatewayClientListByServiceResponse struct {
	GatewayCollection
}

GatewayClientListByServiceResponse contains the response from method GatewayClient.NewListByServicePager.

type GatewayClientListKeysOptions added in v0.3.0

type GatewayClientListKeysOptions struct {
}

GatewayClientListKeysOptions contains the optional parameters for the GatewayClient.ListKeys method.

type GatewayClientListKeysResponse added in v0.3.0

type GatewayClientListKeysResponse struct {
	GatewayKeysContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GatewayClientListKeysResponse contains the response from method GatewayClient.ListKeys.

type GatewayClientRegenerateKeyOptions added in v0.3.0

type GatewayClientRegenerateKeyOptions struct {
}

GatewayClientRegenerateKeyOptions contains the optional parameters for the GatewayClient.RegenerateKey method.

type GatewayClientRegenerateKeyResponse added in v0.3.0

type GatewayClientRegenerateKeyResponse struct {
}

GatewayClientRegenerateKeyResponse contains the response from method GatewayClient.RegenerateKey.

type GatewayClientUpdateOptions added in v0.3.0

type GatewayClientUpdateOptions struct {
}

GatewayClientUpdateOptions contains the optional parameters for the GatewayClient.Update method.

type GatewayClientUpdateResponse added in v0.3.0

type GatewayClientUpdateResponse struct {
	GatewayContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GatewayClientUpdateResponse contains the response from method GatewayClient.Update.

type GatewayCollection

type GatewayCollection struct {
	// Total record count number across all pages.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Page values.
	Value []*GatewayContract
}

GatewayCollection - Paged Gateway list representation.

func (GatewayCollection) MarshalJSON

func (g GatewayCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayCollection.

func (*GatewayCollection) UnmarshalJSON added in v1.1.0

func (g *GatewayCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCollection.

type GatewayContract

type GatewayContract struct {
	// Gateway details.
	Properties *GatewayContractProperties

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

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

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

GatewayContract - Gateway details.

func (GatewayContract) MarshalJSON

func (g GatewayContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayContract.

func (*GatewayContract) UnmarshalJSON added in v1.1.0

func (g *GatewayContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayContract.

type GatewayContractProperties

type GatewayContractProperties struct {
	// Gateway description
	Description *string

	// Gateway location.
	LocationData *ResourceLocationDataContract
}

GatewayContractProperties - Properties of the Gateway contract.

func (GatewayContractProperties) MarshalJSON added in v1.1.0

func (g GatewayContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayContractProperties.

func (*GatewayContractProperties) UnmarshalJSON added in v1.1.0

func (g *GatewayContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayContractProperties.

type GatewayHostnameConfigurationClient

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

GatewayHostnameConfigurationClient contains the methods for the GatewayHostnameConfiguration group. Don't use this type directly, use NewGatewayHostnameConfigurationClient() instead.

func NewGatewayHostnameConfigurationClient

func NewGatewayHostnameConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayHostnameConfigurationClient, error)

NewGatewayHostnameConfigurationClient creates a new instance of GatewayHostnameConfigurationClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GatewayHostnameConfigurationClient) CreateOrUpdate

CreateOrUpdate - Creates of updates hostname configuration for a Gateway. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity.
  • options - GatewayHostnameConfigurationClientCreateOrUpdateOptions contains the optional parameters for the GatewayHostnameConfigurationClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayHostnameConfiguration.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGatewayHostnameConfigurationClient().CreateOrUpdate(ctx, "rg1", "apimService1", "gw1", "default", armapimanagement.GatewayHostnameConfigurationContract{
		Properties: &armapimanagement.GatewayHostnameConfigurationContractProperties{
			CertificateID:              to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"),
			Hostname:                   to.Ptr("*"),
			HTTP2Enabled:               to.Ptr(true),
			NegotiateClientCertificate: to.Ptr(false),
			Tls10Enabled:               to.Ptr(false),
			Tls11Enabled:               to.Ptr(false),
		},
	}, &armapimanagement.GatewayHostnameConfigurationClientCreateOrUpdateOptions{IfMatch: 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.GatewayHostnameConfigurationContract = armapimanagement.GatewayHostnameConfigurationContract{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/gateways/hostnameConfigurations"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/hostnameConfigurations/default"),
	// 	Properties: &armapimanagement.GatewayHostnameConfigurationContractProperties{
	// 		CertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"),
	// 		Hostname: to.Ptr("*"),
	// 		HTTP2Enabled: to.Ptr(true),
	// 		NegotiateClientCertificate: to.Ptr(false),
	// 		Tls10Enabled: to.Ptr(false),
	// 		Tls11Enabled: to.Ptr(false),
	// 	},
	// }
}
Output:

func (*GatewayHostnameConfigurationClient) Delete

Delete - Deletes the specified hostname configuration from the specified Gateway. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - GatewayHostnameConfigurationClientDeleteOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayHostnameConfiguration.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*GatewayHostnameConfigurationClient) Get

Get - Get details of a hostname configuration If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity.
  • options - GatewayHostnameConfigurationClientGetOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGatewayHostnameConfiguration.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGatewayHostnameConfigurationClient().Get(ctx, "rg1", "apimService1", "gw1", "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.GatewayHostnameConfigurationContract = armapimanagement.GatewayHostnameConfigurationContract{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/gateways/hostnameConfigurations"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/hostnameConfigurations/default"),
	// 	Properties: &armapimanagement.GatewayHostnameConfigurationContractProperties{
	// 		CertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"),
	// 		Hostname: to.Ptr("*"),
	// 		NegotiateClientCertificate: to.Ptr(false),
	// 	},
	// }
}
Output:

func (*GatewayHostnameConfigurationClient) GetEntityTag

GetEntityTag - Checks that hostname configuration entity specified by identifier exists for specified Gateway entity.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity.
  • options - GatewayHostnameConfigurationClientGetEntityTagOptions contains the optional parameters for the GatewayHostnameConfigurationClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayHostnameConfiguration.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewGatewayHostnameConfigurationClient().GetEntityTag(ctx, "rg1", "apimService1", "gw1", "default", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*GatewayHostnameConfigurationClient) NewListByServicePager added in v0.5.0

NewListByServicePager - Lists the collection of hostname configurations for the specified gateway.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'
  • options - GatewayHostnameConfigurationClientListByServiceOptions contains the optional parameters for the GatewayHostnameConfigurationClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayHostnameConfigurations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGatewayHostnameConfigurationClient().NewListByServicePager("rg1", "apimService1", "gw1", &armapimanagement.GatewayHostnameConfigurationClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.GatewayHostnameConfigurationCollection = armapimanagement.GatewayHostnameConfigurationCollection{
		// 	Value: []*armapimanagement.GatewayHostnameConfigurationContract{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/gateways/hostnameConfigurations"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/hostnameConfigurations/default"),
		// 			Properties: &armapimanagement.GatewayHostnameConfigurationContractProperties{
		// 				CertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"),
		// 				Hostname: to.Ptr("*"),
		// 				NegotiateClientCertificate: to.Ptr(false),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/gateways/hostnameConfigurations"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/gateways/gw1/hostnameConfigurations/hostname1"),
		// 			Properties: &armapimanagement.GatewayHostnameConfigurationContractProperties{
		// 				CertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert2"),
		// 				Hostname: to.Ptr("foo.bar.com"),
		// 				NegotiateClientCertificate: to.Ptr(true),
		// 			},
		// 	}},
		// }
	}
}
Output:

type GatewayHostnameConfigurationClientCreateOrUpdateOptions added in v0.3.0

type GatewayHostnameConfigurationClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

GatewayHostnameConfigurationClientCreateOrUpdateOptions contains the optional parameters for the GatewayHostnameConfigurationClient.CreateOrUpdate method.

type GatewayHostnameConfigurationClientCreateOrUpdateResponse added in v0.3.0

type GatewayHostnameConfigurationClientCreateOrUpdateResponse struct {
	GatewayHostnameConfigurationContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GatewayHostnameConfigurationClientCreateOrUpdateResponse contains the response from method GatewayHostnameConfigurationClient.CreateOrUpdate.

type GatewayHostnameConfigurationClientDeleteOptions added in v0.3.0

type GatewayHostnameConfigurationClientDeleteOptions struct {
}

GatewayHostnameConfigurationClientDeleteOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Delete method.

type GatewayHostnameConfigurationClientDeleteResponse added in v0.3.0

type GatewayHostnameConfigurationClientDeleteResponse struct {
}

GatewayHostnameConfigurationClientDeleteResponse contains the response from method GatewayHostnameConfigurationClient.Delete.

type GatewayHostnameConfigurationClientGetEntityTagOptions added in v0.3.0

type GatewayHostnameConfigurationClientGetEntityTagOptions struct {
}

GatewayHostnameConfigurationClientGetEntityTagOptions contains the optional parameters for the GatewayHostnameConfigurationClient.GetEntityTag method.

type GatewayHostnameConfigurationClientGetEntityTagResponse added in v0.3.0

type GatewayHostnameConfigurationClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

GatewayHostnameConfigurationClientGetEntityTagResponse contains the response from method GatewayHostnameConfigurationClient.GetEntityTag.

type GatewayHostnameConfigurationClientGetOptions added in v0.3.0

type GatewayHostnameConfigurationClientGetOptions struct {
}

GatewayHostnameConfigurationClientGetOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Get method.

type GatewayHostnameConfigurationClientGetResponse added in v0.3.0

type GatewayHostnameConfigurationClientGetResponse struct {
	GatewayHostnameConfigurationContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GatewayHostnameConfigurationClientGetResponse contains the response from method GatewayHostnameConfigurationClient.Get.

type GatewayHostnameConfigurationClientListByServiceOptions added in v0.3.0

type GatewayHostnameConfigurationClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | hostname | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

GatewayHostnameConfigurationClientListByServiceOptions contains the optional parameters for the GatewayHostnameConfigurationClient.NewListByServicePager method.

type GatewayHostnameConfigurationClientListByServiceResponse added in v0.3.0

type GatewayHostnameConfigurationClientListByServiceResponse struct {
	GatewayHostnameConfigurationCollection
}

GatewayHostnameConfigurationClientListByServiceResponse contains the response from method GatewayHostnameConfigurationClient.NewListByServicePager.

type GatewayHostnameConfigurationCollection

type GatewayHostnameConfigurationCollection struct {
	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Page values.
	Value []*GatewayHostnameConfigurationContract
}

GatewayHostnameConfigurationCollection - Paged Gateway hostname configuration list representation.

func (GatewayHostnameConfigurationCollection) MarshalJSON

func (g GatewayHostnameConfigurationCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationCollection.

func (*GatewayHostnameConfigurationCollection) UnmarshalJSON added in v1.1.0

func (g *GatewayHostnameConfigurationCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationCollection.

type GatewayHostnameConfigurationContract

type GatewayHostnameConfigurationContract struct {
	// Gateway hostname configuration details.
	Properties *GatewayHostnameConfigurationContractProperties

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

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

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

GatewayHostnameConfigurationContract - Gateway hostname configuration details.

func (GatewayHostnameConfigurationContract) MarshalJSON

func (g GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationContract.

func (*GatewayHostnameConfigurationContract) UnmarshalJSON added in v1.1.0

func (g *GatewayHostnameConfigurationContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationContract.

type GatewayHostnameConfigurationContractProperties

type GatewayHostnameConfigurationContractProperties struct {
	// Identifier of Certificate entity that will be used for TLS connection establishment
	CertificateID *string

	// Specifies if HTTP/2.0 is supported
	HTTP2Enabled *bool

	// Hostname value. Supports valid domain name, partial or full wildcard
	Hostname *string

	// Determines whether gateway requests client certificate
	NegotiateClientCertificate *bool

	// Specifies if TLS 1.0 is supported
	Tls10Enabled *bool

	// Specifies if TLS 1.1 is supported
	Tls11Enabled *bool
}

GatewayHostnameConfigurationContractProperties - Gateway hostname configuration details.

func (GatewayHostnameConfigurationContractProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationContractProperties.

func (*GatewayHostnameConfigurationContractProperties) UnmarshalJSON added in v1.1.0

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationContractProperties.

type GatewayKeyRegenerationRequestContract

type GatewayKeyRegenerationRequestContract struct {
	// REQUIRED; The Key being regenerated.
	KeyType *KeyType
}

GatewayKeyRegenerationRequestContract - Gateway key regeneration request contract properties.

func (GatewayKeyRegenerationRequestContract) MarshalJSON added in v1.1.0

func (g GatewayKeyRegenerationRequestContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayKeyRegenerationRequestContract.

func (*GatewayKeyRegenerationRequestContract) UnmarshalJSON added in v1.1.0

func (g *GatewayKeyRegenerationRequestContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayKeyRegenerationRequestContract.

type GatewayKeysContract

type GatewayKeysContract struct {
	// Primary gateway key.
	Primary *string

	// Secondary gateway key.
	Secondary *string
}

GatewayKeysContract - Gateway authentication keys.

func (GatewayKeysContract) MarshalJSON added in v1.1.0

func (g GatewayKeysContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayKeysContract.

func (*GatewayKeysContract) UnmarshalJSON added in v1.1.0

func (g *GatewayKeysContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayKeysContract.

type GatewayTokenContract

type GatewayTokenContract struct {
	// Shared Access Authentication token value for the Gateway.
	Value *string
}

GatewayTokenContract - Gateway access token.

func (GatewayTokenContract) MarshalJSON added in v1.1.0

func (g GatewayTokenContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayTokenContract.

func (*GatewayTokenContract) UnmarshalJSON added in v1.1.0

func (g *GatewayTokenContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayTokenContract.

type GatewayTokenRequestContract

type GatewayTokenRequestContract struct {
	// REQUIRED; The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following
	// format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
	Expiry *time.Time

	// REQUIRED; The Key to be used to generate gateway token.
	KeyType *KeyType
}

GatewayTokenRequestContract - Gateway token request contract properties.

func (GatewayTokenRequestContract) MarshalJSON

func (g GatewayTokenRequestContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GatewayTokenRequestContract.

func (*GatewayTokenRequestContract) UnmarshalJSON

func (g *GatewayTokenRequestContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GatewayTokenRequestContract.

type GenerateSsoURLResult

type GenerateSsoURLResult struct {
	// Redirect Url containing the SSO URL value.
	Value *string
}

GenerateSsoURLResult - Generate SSO Url operations response details.

func (GenerateSsoURLResult) MarshalJSON added in v1.1.0

func (g GenerateSsoURLResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GenerateSsoURLResult.

func (*GenerateSsoURLResult) UnmarshalJSON added in v1.1.0

func (g *GenerateSsoURLResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateSsoURLResult.

type GlobalSchemaClient added in v0.3.0

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

GlobalSchemaClient contains the methods for the GlobalSchema group. Don't use this type directly, use NewGlobalSchemaClient() instead.

func NewGlobalSchemaClient added in v0.3.0

func NewGlobalSchemaClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GlobalSchemaClient, error)

NewGlobalSchemaClient creates a new instance of GlobalSchemaClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GlobalSchemaClient) BeginCreateOrUpdate added in v0.3.0

func (client *GlobalSchemaClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, parameters GlobalSchemaContract, options *GlobalSchemaClientBeginCreateOrUpdateOptions) (*runtime.Poller[GlobalSchemaClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates new or updates existing specified Schema of the API Management service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • schemaID - Schema id identifier. Must be unique in the current API Management service instance.
  • parameters - Create or update parameters.
  • options - GlobalSchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the GlobalSchemaClient.BeginCreateOrUpdate method.
Example (ApiManagementCreateSchema1)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema1.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewGlobalSchemaClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "schema1", armapimanagement.GlobalSchemaContract{
		Properties: &armapimanagement.GlobalSchemaContractProperties{
			Description: to.Ptr("sample schema description"),
			SchemaType:  to.Ptr(armapimanagement.SchemaTypeXML),
			Value:       "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n           xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           elementFormDefault=\"qualified\">\r\n <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>\r\n <xsd:complexType name=\"PurchaseOrderType\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>\r\n   <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>\r\n </xsd:complexType>\r\n\r\n <xsd:complexType name=\"USAddress\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"name\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"street\" type=\"xsd:string\"/>\r\n   <xsd:element name=\"city\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"state\"  type=\"xsd:string\"/>\r\n   <xsd:element name=\"zip\"    type=\"xsd:integer\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>\r\n </xsd:complexType>\r\n</xsd:schema>",
		},
	}, &armapimanagement.GlobalSchemaClientBeginCreateOrUpdateOptions{IfMatch: 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.GlobalSchemaContract = armapimanagement.GlobalSchemaContract{
	// 	Name: to.Ptr("schema1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/schemas"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1"),
	// 	Properties: &armapimanagement.GlobalSchemaContractProperties{
	// 		Description: to.Ptr("sample schema description"),
	// 		SchemaType: to.Ptr(armapimanagement.SchemaTypeXML),
	// 		Value: "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n           xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           elementFormDefault=\"qualified\">\r\n <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>\r\n <xsd:complexType name=\"PurchaseOrderType\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>\r\n   <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>\r\n </xsd:complexType>\r\n\r\n <xsd:complexType name=\"USAddress\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"name\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"street\" type=\"xsd:string\"/>\r\n   <xsd:element name=\"city\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"state\"  type=\"xsd:string\"/>\r\n   <xsd:element name=\"zip\"    type=\"xsd:integer\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>\r\n </xsd:complexType>\r\n</xsd:schema>",
	// 	},
	// }
}
Output:

Example (ApiManagementCreateSchema2)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema2.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewGlobalSchemaClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "schema1", armapimanagement.GlobalSchemaContract{
		Properties: &armapimanagement.GlobalSchemaContractProperties{
			Description: to.Ptr("sample schema description"),
			Document: map[string]any{
				"type":    "object",
				"$id":     "https://example.com/person.schema.json",
				"$schema": "https://json-schema.org/draft/2020-12/schema",
				"properties": map[string]any{
					"age": map[string]any{
						"type":        "integer",
						"description": "Age in years which must be equal to or greater than zero.",
						"minimum":     float64(0),
					},
					"firstName": map[string]any{
						"type":        "string",
						"description": "The person's first name.",
					},
					"lastName": map[string]any{
						"type":        "string",
						"description": "The person's last name.",
					},
				},
				"title": "Person",
			},
			SchemaType: to.Ptr(armapimanagement.SchemaTypeJSON),
		},
	}, &armapimanagement.GlobalSchemaClientBeginCreateOrUpdateOptions{IfMatch: 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.GlobalSchemaContract = armapimanagement.GlobalSchemaContract{
	// 	Name: to.Ptr("schema1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/schemas"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1"),
	// 	Properties: &armapimanagement.GlobalSchemaContractProperties{
	// 		Description: to.Ptr("sample schema description"),
	// 		Document: map[string]any{
	// 			"type": "object",
	// 			"$id": "https://example.com/person.schema.json",
	// 			"$schema": "https://json-schema.org/draft/2020-12/schema",
	// 			"properties":map[string]any{
	// 				"age":map[string]any{
	// 					"type": "integer",
	// 					"description": "Age in years which must be equal to or greater than zero.",
	// 					"minimum": float64(0),
	// 				},
	// 				"firstName":map[string]any{
	// 					"type": "string",
	// 					"description": "The person's first name.",
	// 				},
	// 				"lastName":map[string]any{
	// 					"type": "string",
	// 					"description": "The person's last name.",
	// 				},
	// 			},
	// 			"title": "Person",
	// 		},
	// 		SchemaType: to.Ptr(armapimanagement.SchemaTypeJSON),
	// 	},
	// }
}
Output:

func (*GlobalSchemaClient) Delete added in v0.3.0

func (client *GlobalSchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, ifMatch string, options *GlobalSchemaClientDeleteOptions) (GlobalSchemaClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • schemaID - Schema id identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - GlobalSchemaClientDeleteOptions contains the optional parameters for the GlobalSchemaClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGlobalSchema.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*GlobalSchemaClient) Get added in v0.3.0

func (client *GlobalSchemaClient) Get(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, options *GlobalSchemaClientGetOptions) (GlobalSchemaClientGetResponse, error)

Get - Gets the details of the Schema specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • schemaID - Schema id identifier. Must be unique in the current API Management service instance.
  • options - GlobalSchemaClientGetOptions contains the optional parameters for the GlobalSchemaClient.Get method.
Example (ApiManagementGetSchema1)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema1.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGlobalSchemaClient().Get(ctx, "rg1", "apimService1", "schema1", 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.GlobalSchemaContract = armapimanagement.GlobalSchemaContract{
	// 	Name: to.Ptr("schema1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/schemas"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1"),
	// 	Properties: &armapimanagement.GlobalSchemaContractProperties{
	// 		Description: to.Ptr("sample schema description"),
	// 		SchemaType: to.Ptr(armapimanagement.SchemaTypeXML),
	// 		Value: "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n           xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           elementFormDefault=\"qualified\">\r\n <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>\r\n <xsd:complexType name=\"PurchaseOrderType\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>\r\n   <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>\r\n </xsd:complexType>\r\n\r\n <xsd:complexType name=\"USAddress\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"name\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"street\" type=\"xsd:string\"/>\r\n   <xsd:element name=\"city\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"state\"  type=\"xsd:string\"/>\r\n   <xsd:element name=\"zip\"    type=\"xsd:integer\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>\r\n </xsd:complexType>\r\n</xsd:schema>",
	// 	},
	// }
}
Output:

Example (ApiManagementGetSchema2)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema2.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGlobalSchemaClient().Get(ctx, "rg1", "apimService1", "schema2", 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.GlobalSchemaContract = armapimanagement.GlobalSchemaContract{
	// 	Name: to.Ptr("schema2"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/schemas"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema2"),
	// 	Properties: &armapimanagement.GlobalSchemaContractProperties{
	// 		Description: to.Ptr("sample schema description"),
	// 		Document: map[string]any{
	// 			"type": "object",
	// 			"$id": "https://example.com/person.schema.json",
	// 			"$schema": "https://json-schema.org/draft/2020-12/schema",
	// 			"properties":map[string]any{
	// 				"age":map[string]any{
	// 					"type": "integer",
	// 					"description": "Age in years which must be equal to or greater than zero.",
	// 					"minimum": float64(0),
	// 				},
	// 				"firstName":map[string]any{
	// 					"type": "string",
	// 					"description": "The person's first name.",
	// 				},
	// 				"lastName":map[string]any{
	// 					"type": "string",
	// 					"description": "The person's last name.",
	// 				},
	// 			},
	// 			"title": "Person",
	// 		},
	// 		SchemaType: to.Ptr(armapimanagement.SchemaTypeJSON),
	// 	},
	// }
}
Output:

func (*GlobalSchemaClient) GetEntityTag added in v0.3.0

func (client *GlobalSchemaClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, options *GlobalSchemaClientGetEntityTagOptions) (GlobalSchemaClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the Schema specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • schemaID - Schema id identifier. Must be unique in the current API Management service instance.
  • options - GlobalSchemaClientGetEntityTagOptions contains the optional parameters for the GlobalSchemaClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGlobalSchema.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewGlobalSchemaClient().GetEntityTag(ctx, "rg1", "apimService1", "myschema", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*GlobalSchemaClient) NewListByServicePager added in v0.5.0

func (client *GlobalSchemaClient) NewListByServicePager(resourceGroupName string, serviceName string, options *GlobalSchemaClientListByServiceOptions) *runtime.Pager[GlobalSchemaClientListByServiceResponse]

NewListByServicePager - Lists a collection of schemas registered with service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - GlobalSchemaClientListByServiceOptions contains the optional parameters for the GlobalSchemaClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGlobalSchemas.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGlobalSchemaClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.GlobalSchemaClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.GlobalSchemaCollection = armapimanagement.GlobalSchemaCollection{
		// 	Count: to.Ptr[int64](2),
		// 	Value: []*armapimanagement.GlobalSchemaContract{
		// 		{
		// 			Name: to.Ptr("schema1"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/schemas"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1"),
		// 			Properties: &armapimanagement.GlobalSchemaContractProperties{
		// 				Description: to.Ptr("sample schema description"),
		// 				SchemaType: to.Ptr(armapimanagement.SchemaTypeXML),
		// 				Value: "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n           xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           elementFormDefault=\"qualified\">\r\n <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>\r\n <xsd:complexType name=\"PurchaseOrderType\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>\r\n   <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>\r\n </xsd:complexType>\r\n\r\n <xsd:complexType name=\"USAddress\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"name\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"street\" type=\"xsd:string\"/>\r\n   <xsd:element name=\"city\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"state\"  type=\"xsd:string\"/>\r\n   <xsd:element name=\"zip\"    type=\"xsd:integer\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>\r\n </xsd:complexType>\r\n</xsd:schema>",
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("schema2"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/schemas"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema2"),
		// 			Properties: &armapimanagement.GlobalSchemaContractProperties{
		// 				Description: to.Ptr("sample schema description"),
		// 				Document: map[string]any{
		// 					"type": "object",
		// 					"$id": "https://example.com/person.schema.json",
		// 					"$schema": "https://json-schema.org/draft/2020-12/schema",
		// 					"properties":map[string]any{
		// 						"age":map[string]any{
		// 							"type": "integer",
		// 							"description": "Age in years which must be equal to or greater than zero.",
		// 							"minimum": float64(0),
		// 						},
		// 						"firstName":map[string]any{
		// 							"type": "string",
		// 							"description": "The person's first name.",
		// 						},
		// 						"lastName":map[string]any{
		// 							"type": "string",
		// 							"description": "The person's last name.",
		// 						},
		// 					},
		// 					"title": "Person",
		// 				},
		// 				SchemaType: to.Ptr(armapimanagement.SchemaTypeJSON),
		// 			},
		// 	}},
		// }
	}
}
Output:

type GlobalSchemaClientBeginCreateOrUpdateOptions added in v0.3.0

type GlobalSchemaClientBeginCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GlobalSchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the GlobalSchemaClient.BeginCreateOrUpdate method.

type GlobalSchemaClientCreateOrUpdateResponse added in v0.3.0

type GlobalSchemaClientCreateOrUpdateResponse struct {
	GlobalSchemaContract
}

GlobalSchemaClientCreateOrUpdateResponse contains the response from method GlobalSchemaClient.BeginCreateOrUpdate.

type GlobalSchemaClientDeleteOptions added in v0.3.0

type GlobalSchemaClientDeleteOptions struct {
}

GlobalSchemaClientDeleteOptions contains the optional parameters for the GlobalSchemaClient.Delete method.

type GlobalSchemaClientDeleteResponse added in v0.3.0

type GlobalSchemaClientDeleteResponse struct {
}

GlobalSchemaClientDeleteResponse contains the response from method GlobalSchemaClient.Delete.

type GlobalSchemaClientGetEntityTagOptions added in v0.3.0

type GlobalSchemaClientGetEntityTagOptions struct {
}

GlobalSchemaClientGetEntityTagOptions contains the optional parameters for the GlobalSchemaClient.GetEntityTag method.

type GlobalSchemaClientGetEntityTagResponse added in v0.3.0

type GlobalSchemaClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

GlobalSchemaClientGetEntityTagResponse contains the response from method GlobalSchemaClient.GetEntityTag.

type GlobalSchemaClientGetOptions added in v0.3.0

type GlobalSchemaClientGetOptions struct {
}

GlobalSchemaClientGetOptions contains the optional parameters for the GlobalSchemaClient.Get method.

type GlobalSchemaClientGetResponse added in v0.3.0

type GlobalSchemaClientGetResponse struct {
	GlobalSchemaContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GlobalSchemaClientGetResponse contains the response from method GlobalSchemaClient.Get.

type GlobalSchemaClientListByServiceOptions added in v0.3.0

type GlobalSchemaClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

GlobalSchemaClientListByServiceOptions contains the optional parameters for the GlobalSchemaClient.NewListByServicePager method.

type GlobalSchemaClientListByServiceResponse added in v0.3.0

type GlobalSchemaClientListByServiceResponse struct {
	GlobalSchemaCollection
}

GlobalSchemaClientListByServiceResponse contains the response from method GlobalSchemaClient.NewListByServicePager.

type GlobalSchemaCollection added in v0.3.0

type GlobalSchemaCollection struct {
	// Total record count number.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Global Schema Contract value.
	Value []*GlobalSchemaContract
}

GlobalSchemaCollection - The response of the list schema operation.

func (GlobalSchemaCollection) MarshalJSON added in v0.3.0

func (g GlobalSchemaCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GlobalSchemaCollection.

func (*GlobalSchemaCollection) UnmarshalJSON added in v1.1.0

func (g *GlobalSchemaCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaCollection.

type GlobalSchemaContract added in v0.3.0

type GlobalSchemaContract struct {
	// Properties of the Global Schema.
	Properties *GlobalSchemaContractProperties

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

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

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

GlobalSchemaContract - Global Schema Contract details.

func (GlobalSchemaContract) MarshalJSON added in v1.1.0

func (g GlobalSchemaContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GlobalSchemaContract.

func (*GlobalSchemaContract) UnmarshalJSON added in v1.1.0

func (g *GlobalSchemaContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaContract.

type GlobalSchemaContractProperties added in v0.3.0

type GlobalSchemaContractProperties struct {
	// REQUIRED; Schema Type. Immutable.
	SchemaType *SchemaType

	// Free-form schema entity description.
	Description *string

	// Global Schema document object for json-based schema formats(e.g. json schema).
	Document any

	// Json-encoded string for non json-based schema.
	Value any
}

GlobalSchemaContractProperties - Schema create or update contract Properties.

func (GlobalSchemaContractProperties) MarshalJSON added in v1.1.0

func (g GlobalSchemaContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GlobalSchemaContractProperties.

func (*GlobalSchemaContractProperties) UnmarshalJSON added in v1.1.0

func (g *GlobalSchemaContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaContractProperties.

type GrantType

type GrantType string
const (
	// GrantTypeAuthorizationCode - Authorization Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.1.
	GrantTypeAuthorizationCode GrantType = "authorizationCode"
	// GrantTypeClientCredentials - Client Credentials Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.4.
	GrantTypeClientCredentials GrantType = "clientCredentials"
	// GrantTypeImplicit - Implicit Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.2.
	GrantTypeImplicit GrantType = "implicit"
	// GrantTypeResourceOwnerPassword - Resource Owner Password Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.3.
	GrantTypeResourceOwnerPassword GrantType = "resourceOwnerPassword"
)

func PossibleGrantTypeValues

func PossibleGrantTypeValues() []GrantType

PossibleGrantTypeValues returns the possible values for the GrantType const type.

type GroupClient

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

GroupClient contains the methods for the Group group. Don't use this type directly, use NewGroupClient() instead.

func NewGroupClient

func NewGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupClient, error)

NewGroupClient creates a new instance of GroupClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GroupClient) CreateOrUpdate

func (client *GroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupCreateParameters, options *GroupClientCreateOrUpdateOptions) (GroupClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or Updates a group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • parameters - Create parameters.
  • options - GroupClientCreateOrUpdateOptions contains the optional parameters for the GroupClient.CreateOrUpdate method.
Example (ApiManagementCreateGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroup.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGroupClient().CreateOrUpdate(ctx, "rg1", "apimService1", "tempgroup", armapimanagement.GroupCreateParameters{
		Properties: &armapimanagement.GroupCreateParametersProperties{
			DisplayName: to.Ptr("temp group"),
		},
	}, &armapimanagement.GroupClientCreateOrUpdateOptions{IfMatch: 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.GroupContract = armapimanagement.GroupContract{
	// 	Name: to.Ptr("tempgroup"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/groups"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/tempgroup"),
	// 	Properties: &armapimanagement.GroupContractProperties{
	// 		Type: to.Ptr(armapimanagement.GroupTypeCustom),
	// 		DisplayName: to.Ptr("temp group"),
	// 	},
	// }
}
Output:

Example (ApiManagementCreateGroupExternal)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroupExternal.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGroupClient().CreateOrUpdate(ctx, "rg1", "apimService1", "aadGroup", armapimanagement.GroupCreateParameters{
		Properties: &armapimanagement.GroupCreateParametersProperties{
			Type:        to.Ptr(armapimanagement.GroupTypeExternal),
			Description: to.Ptr("new group to test"),
			DisplayName: to.Ptr("NewGroup (samiraad.onmicrosoft.com)"),
			ExternalID:  to.Ptr("aad://samiraad.onmicrosoft.com/groups/83cf2753-5831-4675-bc0e-2f8dc067c58d"),
		},
	}, &armapimanagement.GroupClientCreateOrUpdateOptions{IfMatch: 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.GroupContract = armapimanagement.GroupContract{
	// 	Name: to.Ptr("aadGroup"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/groups"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/aadGroup"),
	// 	Properties: &armapimanagement.GroupContractProperties{
	// 		Type: to.Ptr(armapimanagement.GroupTypeExternal),
	// 		Description: to.Ptr("new group to test"),
	// 		DisplayName: to.Ptr("NewGroup (samiraad.onmicrosoft.com)"),
	// 		ExternalID: to.Ptr("aad://samiraad.onmicrosoft.com/groups/83cf2753-5831-4675-bc0e-2f8dc067c58d"),
	// 	},
	// }
}
Output:

func (*GroupClient) Delete

func (client *GroupClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, ifMatch string, options *GroupClientDeleteOptions) (GroupClientDeleteResponse, error)

Delete - Deletes specific group of the API Management service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - GroupClientDeleteOptions contains the optional parameters for the GroupClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*GroupClient) Get

func (client *GroupClient) Get(ctx context.Context, resourceGroupName string, serviceName string, groupID string, options *GroupClientGetOptions) (GroupClientGetResponse, error)

Get - Gets the details of the group specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • options - GroupClientGetOptions contains the optional parameters for the GroupClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGroupClient().Get(ctx, "rg1", "apimService1", "59306a29e4bbd510dc24e5f9", 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.GroupContract = armapimanagement.GroupContract{
	// 	Name: to.Ptr("59306a29e4bbd510dc24e5f9"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/groups"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/59306a29e4bbd510dc24e5f9"),
	// 	Properties: &armapimanagement.GroupContractProperties{
	// 		Type: to.Ptr(armapimanagement.GroupTypeExternal),
	// 		Description: to.Ptr("awesome group of people"),
	// 		BuiltIn: to.Ptr(false),
	// 		DisplayName: to.Ptr("AwesomeGroup (samiraad.onmicrosoft.com)"),
	// 		ExternalID: to.Ptr("aad://samiraad.onmicrosoft.com/groups/3773adf4-032e-4d25-9988-eaff9ca72eca"),
	// 	},
	// }
}
Output:

func (*GroupClient) GetEntityTag

func (client *GroupClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, groupID string, options *GroupClientGetEntityTagOptions) (GroupClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the group specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • options - GroupClientGetEntityTagOptions contains the optional parameters for the GroupClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewGroupClient().GetEntityTag(ctx, "rg1", "apimService1", "59306a29e4bbd510dc24e5f9", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*GroupClient) NewListByServicePager added in v0.5.0

func (client *GroupClient) NewListByServicePager(resourceGroupName string, serviceName string, options *GroupClientListByServiceOptions) *runtime.Pager[GroupClientListByServiceResponse]

NewListByServicePager - Lists a collection of groups defined within a service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - GroupClientListByServiceOptions contains the optional parameters for the GroupClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGroups.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGroupClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.GroupClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.GroupCollection = armapimanagement.GroupCollection{
		// 	Count: to.Ptr[int64](4),
		// 	Value: []*armapimanagement.GroupContract{
		// 		{
		// 			Name: to.Ptr("5600b59375ff190048020001"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/groups"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/5600b59375ff190048020001"),
		// 			Properties: &armapimanagement.GroupContractProperties{
		// 				Type: to.Ptr(armapimanagement.GroupTypeSystem),
		// 				Description: to.Ptr("Administrators is a built-in group. Its membership is managed by the system. Microsoft Azure subscription administrators fall into this group."),
		// 				BuiltIn: to.Ptr(true),
		// 				DisplayName: to.Ptr("Administrators"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("59306a29e4bbd510dc24e5f9"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/groups"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/59306a29e4bbd510dc24e5f9"),
		// 			Properties: &armapimanagement.GroupContractProperties{
		// 				Type: to.Ptr(armapimanagement.GroupTypeExternal),
		// 				Description: to.Ptr("awesome group of people"),
		// 				BuiltIn: to.Ptr(false),
		// 				DisplayName: to.Ptr("AwesomeGroup (samiraad.onmicrosoft.com)"),
		// 				ExternalID: to.Ptr("aad://samiraad.onmicrosoft.com/groups/3773adf4-032e-4d25-9988-eaff9ca72eca"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("5600b59375ff190048020002"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/groups"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/5600b59375ff190048020002"),
		// 			Properties: &armapimanagement.GroupContractProperties{
		// 				Type: to.Ptr(armapimanagement.GroupTypeSystem),
		// 				Description: to.Ptr("Developers is a built-in group. Its membership is managed by the system. Signed-in users fall into this group."),
		// 				BuiltIn: to.Ptr(true),
		// 				DisplayName: to.Ptr("Developers"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("5600b59375ff190048020003"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/groups"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/5600b59375ff190048020003"),
		// 			Properties: &armapimanagement.GroupContractProperties{
		// 				Type: to.Ptr(armapimanagement.GroupTypeSystem),
		// 				Description: to.Ptr("Guests is a built-in group. Its membership is managed by the system. Unauthenticated users visiting the developer portal fall into this group."),
		// 				BuiltIn: to.Ptr(true),
		// 				DisplayName: to.Ptr("Guests"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*GroupClient) Update

func (client *GroupClient) Update(ctx context.Context, resourceGroupName string, serviceName string, groupID string, ifMatch string, parameters GroupUpdateParameters, options *GroupClientUpdateOptions) (GroupClientUpdateResponse, error)

Update - Updates the details of the group specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - GroupClientUpdateOptions contains the optional parameters for the GroupClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateGroup.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGroupClient().Update(ctx, "rg1", "apimService1", "tempgroup", "*", armapimanagement.GroupUpdateParameters{
		Properties: &armapimanagement.GroupUpdateParametersProperties{
			DisplayName: to.Ptr("temp group"),
		},
	}, 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.GroupContract = armapimanagement.GroupContract{
	// 	Name: to.Ptr("tempgroup"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/groups"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/tempgroup"),
	// 	Properties: &armapimanagement.GroupContractProperties{
	// 		Type: to.Ptr(armapimanagement.GroupTypeExternal),
	// 		Description: to.Ptr("awesome group of people"),
	// 		BuiltIn: to.Ptr(false),
	// 		DisplayName: to.Ptr("tempgroup"),
	// 		ExternalID: to.Ptr("aad://samiraad.onmicrosoft.com/groups/3773adf4-032e-4d25-9988-eaff9ca72eca"),
	// 	},
	// }
}
Output:

type GroupClientCreateOrUpdateOptions added in v0.3.0

type GroupClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

GroupClientCreateOrUpdateOptions contains the optional parameters for the GroupClient.CreateOrUpdate method.

type GroupClientCreateOrUpdateResponse added in v0.3.0

type GroupClientCreateOrUpdateResponse struct {
	GroupContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GroupClientCreateOrUpdateResponse contains the response from method GroupClient.CreateOrUpdate.

type GroupClientDeleteOptions added in v0.3.0

type GroupClientDeleteOptions struct {
}

GroupClientDeleteOptions contains the optional parameters for the GroupClient.Delete method.

type GroupClientDeleteResponse added in v0.3.0

type GroupClientDeleteResponse struct {
}

GroupClientDeleteResponse contains the response from method GroupClient.Delete.

type GroupClientGetEntityTagOptions added in v0.3.0

type GroupClientGetEntityTagOptions struct {
}

GroupClientGetEntityTagOptions contains the optional parameters for the GroupClient.GetEntityTag method.

type GroupClientGetEntityTagResponse added in v0.3.0

type GroupClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

GroupClientGetEntityTagResponse contains the response from method GroupClient.GetEntityTag.

type GroupClientGetOptions added in v0.3.0

type GroupClientGetOptions struct {
}

GroupClientGetOptions contains the optional parameters for the GroupClient.Get method.

type GroupClientGetResponse added in v0.3.0

type GroupClientGetResponse struct {
	GroupContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GroupClientGetResponse contains the response from method GroupClient.Get.

type GroupClientListByServiceOptions added in v0.3.0

type GroupClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | externalId | filter | eq | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

GroupClientListByServiceOptions contains the optional parameters for the GroupClient.NewListByServicePager method.

type GroupClientListByServiceResponse added in v0.3.0

type GroupClientListByServiceResponse struct {
	GroupCollection
}

GroupClientListByServiceResponse contains the response from method GroupClient.NewListByServicePager.

type GroupClientUpdateOptions added in v0.3.0

type GroupClientUpdateOptions struct {
}

GroupClientUpdateOptions contains the optional parameters for the GroupClient.Update method.

type GroupClientUpdateResponse added in v0.3.0

type GroupClientUpdateResponse struct {
	GroupContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

GroupClientUpdateResponse contains the response from method GroupClient.Update.

type GroupCollection

type GroupCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*GroupContract
}

GroupCollection - Paged Group list representation.

func (GroupCollection) MarshalJSON

func (g GroupCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GroupCollection.

func (*GroupCollection) UnmarshalJSON added in v1.1.0

func (g *GroupCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GroupCollection.

type GroupContract

type GroupContract struct {
	// Group entity contract properties.
	Properties *GroupContractProperties

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

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

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

GroupContract - Contract details.

func (GroupContract) MarshalJSON

func (g GroupContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GroupContract.

func (*GroupContract) UnmarshalJSON added in v1.1.0

func (g *GroupContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GroupContract.

type GroupContractProperties

type GroupContractProperties struct {
	// REQUIRED; Group name.
	DisplayName *string

	// Group description. Can contain HTML formatting tags.
	Description *string

	// For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active
	// Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>; otherwise
	// the value is null.
	ExternalID *string

	// Group type.
	Type *GroupType

	// READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false.
	BuiltIn *bool
}

GroupContractProperties - Group contract Properties.

func (GroupContractProperties) MarshalJSON added in v1.1.0

func (g GroupContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GroupContractProperties.

func (*GroupContractProperties) UnmarshalJSON added in v1.1.0

func (g *GroupContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GroupContractProperties.

type GroupCreateParameters

type GroupCreateParameters struct {
	// Properties supplied to Create Group operation.
	Properties *GroupCreateParametersProperties
}

GroupCreateParameters - Parameters supplied to the Create Group operation.

func (GroupCreateParameters) MarshalJSON added in v1.1.0

func (g GroupCreateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GroupCreateParameters.

func (*GroupCreateParameters) UnmarshalJSON added in v1.1.0

func (g *GroupCreateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GroupCreateParameters.

type GroupCreateParametersProperties

type GroupCreateParametersProperties struct {
	// REQUIRED; Group name.
	DisplayName *string

	// Group description.
	Description *string

	// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g.
	// for Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object
	// id>; otherwise the value is null.
	ExternalID *string

	// Group type.
	Type *GroupType
}

GroupCreateParametersProperties - Parameters supplied to the Create Group operation.

func (GroupCreateParametersProperties) MarshalJSON added in v1.1.0

func (g GroupCreateParametersProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GroupCreateParametersProperties.

func (*GroupCreateParametersProperties) UnmarshalJSON added in v1.1.0

func (g *GroupCreateParametersProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GroupCreateParametersProperties.

type GroupType

type GroupType string

GroupType - Group type.

const (
	GroupTypeCustom   GroupType = "custom"
	GroupTypeSystem   GroupType = "system"
	GroupTypeExternal GroupType = "external"
)

func PossibleGroupTypeValues

func PossibleGroupTypeValues() []GroupType

PossibleGroupTypeValues returns the possible values for the GroupType const type.

type GroupUpdateParameters

type GroupUpdateParameters struct {
	// Group entity update contract properties.
	Properties *GroupUpdateParametersProperties
}

GroupUpdateParameters - Parameters supplied to the Update Group operation.

func (GroupUpdateParameters) MarshalJSON

func (g GroupUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GroupUpdateParameters.

func (*GroupUpdateParameters) UnmarshalJSON added in v1.1.0

func (g *GroupUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GroupUpdateParameters.

type GroupUpdateParametersProperties

type GroupUpdateParametersProperties struct {
	// Group description.
	Description *string

	// Group name.
	DisplayName *string

	// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g.
	// for Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object
	// id>; otherwise the value is null.
	ExternalID *string

	// Group type.
	Type *GroupType
}

GroupUpdateParametersProperties - Parameters supplied to the Update Group operation.

func (GroupUpdateParametersProperties) MarshalJSON added in v1.1.0

func (g GroupUpdateParametersProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GroupUpdateParametersProperties.

func (*GroupUpdateParametersProperties) UnmarshalJSON added in v1.1.0

func (g *GroupUpdateParametersProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GroupUpdateParametersProperties.

type GroupUserClient

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

GroupUserClient contains the methods for the GroupUser group. Don't use this type directly, use NewGroupUserClient() instead.

func NewGroupUserClient

func NewGroupUserClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupUserClient, error)

NewGroupUserClient creates a new instance of GroupUserClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GroupUserClient) CheckEntityExists

func (client *GroupUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string, options *GroupUserClientCheckEntityExistsOptions) (GroupUserClientCheckEntityExistsResponse, error)

CheckEntityExists - Checks that user entity specified by identifier is associated with the group entity.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - GroupUserClientCheckEntityExistsOptions contains the optional parameters for the GroupUserClient.CheckEntityExists method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGroupUser.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewGroupUserClient().CheckEntityExists(ctx, "rg1", "apimService1", "59306a29e4bbd510dc24e5f9", "5931a75ae4bbd512a88c680b", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*GroupUserClient) Create

func (client *GroupUserClient) Create(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string, options *GroupUserClientCreateOptions) (GroupUserClientCreateResponse, error)

Create - Add existing user to existing group If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - GroupUserClientCreateOptions contains the optional parameters for the GroupUserClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroupUser.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGroupUserClient().Create(ctx, "rg1", "apimService1", "tempgroup", "59307d350af58404d8a26300", 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.UserContract = armapimanagement.UserContract{
	// 	Name: to.Ptr("59307d350af58404d8a26300"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/groups/users"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/59307d350af58404d8a26300"),
	// 	Properties: &armapimanagement.UserContractProperties{
	// 		Identities: []*armapimanagement.UserIdentityContract{
	// 		},
	// 		State: to.Ptr(armapimanagement.UserStateActive),
	// 		Email: to.Ptr("testuser1@live.com"),
	// 		FirstName: to.Ptr("test"),
	// 		Groups: []*armapimanagement.GroupContractProperties{
	// 		},
	// 		LastName: to.Ptr("user"),
	// 		RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-01T20:46:45.437Z"); return t}()),
	// 	},
	// }
}
Output:

func (*GroupUserClient) Delete

func (client *GroupUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string, options *GroupUserClientDeleteOptions) (GroupUserClientDeleteResponse, error)

Delete - Remove existing user from existing group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - GroupUserClientDeleteOptions contains the optional parameters for the GroupUserClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGroupUser.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewGroupUserClient().Delete(ctx, "rg1", "apimService1", "templategroup", "59307d350af58404d8a26300", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*GroupUserClient) NewListPager added in v0.5.0

func (client *GroupUserClient) NewListPager(resourceGroupName string, serviceName string, groupID string, options *GroupUserClientListOptions) *runtime.Pager[GroupUserClientListResponse]

NewListPager - Lists a collection of user entities associated with the group.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • options - GroupUserClientListOptions contains the optional parameters for the GroupUserClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGroupUsers.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGroupUserClient().NewListPager("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", &armapimanagement.GroupUserClientListOptions{Filter: nil,
		Top:  nil,
		Skip: 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.UserCollection = armapimanagement.UserCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.UserContract{
		// 		{
		// 			Name: to.Ptr("armTemplateUser1"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/groups/users"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/kjoshiarmTemplateUser1"),
		// 			Properties: &armapimanagement.UserContractProperties{
		// 				Identities: []*armapimanagement.UserIdentityContract{
		// 					{
		// 						ID: to.Ptr("user1@live.com"),
		// 						Provider: to.Ptr("Basic"),
		// 				}},
		// 				Note: to.Ptr("note for user 1"),
		// 				State: to.Ptr(armapimanagement.UserStateActive),
		// 				Email: to.Ptr("user1@live.com"),
		// 				FirstName: to.Ptr("user1"),
		// 				LastName: to.Ptr("lastname1"),
		// 				RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-31T18:54:41.447Z"); return t}()),
		// 			},
		// 	}},
		// }
	}
}
Output:

type GroupUserClientCheckEntityExistsOptions added in v0.3.0

type GroupUserClientCheckEntityExistsOptions struct {
}

GroupUserClientCheckEntityExistsOptions contains the optional parameters for the GroupUserClient.CheckEntityExists method.

type GroupUserClientCheckEntityExistsResponse added in v0.3.0

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

GroupUserClientCheckEntityExistsResponse contains the response from method GroupUserClient.CheckEntityExists.

type GroupUserClientCreateOptions added in v0.3.0

type GroupUserClientCreateOptions struct {
}

GroupUserClientCreateOptions contains the optional parameters for the GroupUserClient.Create method.

type GroupUserClientCreateResponse added in v0.3.0

type GroupUserClientCreateResponse struct {
	UserContract
}

GroupUserClientCreateResponse contains the response from method GroupUserClient.Create.

type GroupUserClientDeleteOptions added in v0.3.0

type GroupUserClientDeleteOptions struct {
}

GroupUserClientDeleteOptions contains the optional parameters for the GroupUserClient.Delete method.

type GroupUserClientDeleteResponse added in v0.3.0

type GroupUserClientDeleteResponse struct {
}

GroupUserClientDeleteResponse contains the response from method GroupUserClient.Delete.

type GroupUserClientListOptions added in v0.3.0

type GroupUserClientListOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | registrationDate | filter | ge, le, eq, ne, gt, lt | |
	// | note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

GroupUserClientListOptions contains the optional parameters for the GroupUserClient.NewListPager method.

type GroupUserClientListResponse added in v0.3.0

type GroupUserClientListResponse struct {
	UserCollection
}

GroupUserClientListResponse contains the response from method GroupUserClient.NewListPager.

type HTTPCorrelationProtocol

type HTTPCorrelationProtocol string

HTTPCorrelationProtocol - Sets correlation protocol to use for Application Insights diagnostics.

const (
	// HTTPCorrelationProtocolLegacy - Inject Request-Id and Request-Context headers with request correlation data. See https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/HttpCorrelationProtocol.md.
	HTTPCorrelationProtocolLegacy HTTPCorrelationProtocol = "Legacy"
	// HTTPCorrelationProtocolNone - Do not read and inject correlation headers.
	HTTPCorrelationProtocolNone HTTPCorrelationProtocol = "None"
	// HTTPCorrelationProtocolW3C - Inject Trace Context headers. See https://w3c.github.io/trace-context.
	HTTPCorrelationProtocolW3C HTTPCorrelationProtocol = "W3C"
)

func PossibleHTTPCorrelationProtocolValues

func PossibleHTTPCorrelationProtocolValues() []HTTPCorrelationProtocol

PossibleHTTPCorrelationProtocolValues returns the possible values for the HTTPCorrelationProtocol const type.

type HTTPHeader

type HTTPHeader struct {
	// REQUIRED; Header name.
	Name *string

	// REQUIRED; Header value.
	Value *string
}

HTTPHeader - HTTP header and it's value.

func (HTTPHeader) MarshalJSON added in v1.1.0

func (h HTTPHeader) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HTTPHeader.

func (*HTTPHeader) UnmarshalJSON added in v1.1.0

func (h *HTTPHeader) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HTTPHeader.

type HTTPMessageDiagnostic

type HTTPMessageDiagnostic struct {
	// Body logging settings.
	Body *BodyDiagnosticSettings

	// Data masking settings.
	DataMasking *DataMasking

	// Array of HTTP Headers to log.
	Headers []*string
}

HTTPMessageDiagnostic - Http message diagnostic settings.

func (HTTPMessageDiagnostic) MarshalJSON

func (h HTTPMessageDiagnostic) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HTTPMessageDiagnostic.

func (*HTTPMessageDiagnostic) UnmarshalJSON added in v1.1.0

func (h *HTTPMessageDiagnostic) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HTTPMessageDiagnostic.

type HostnameConfiguration

type HostnameConfiguration struct {
	// REQUIRED; Hostname to configure on the Api Management service.
	HostName *string

	// REQUIRED; Hostname type.
	Type *HostnameType

	// Certificate information.
	Certificate *CertificateInformation

	// Certificate Password.
	CertificatePassword *string

	// Certificate Source.
	CertificateSource *CertificateSource

	// Certificate Status.
	CertificateStatus *CertificateStatus

	// Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not
	// send the SNI header, then this will be the certificate that will be challenged.
	// The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate.
	// The setting only applied to Proxy Hostname Type.
	DefaultSSLBinding *bool

	// Base64 Encoded certificate.
	EncodedCertificate *string

	// System or User Assigned Managed identity clientId as generated by Azure AD, which has GET access to the keyVault containing
	// the SSL certificate.
	IdentityClientID *string

	// Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update
	// of ssl certificate will not work. This requires Api Management service to be
	// configured with aka.ms/apimmsi. The secret should be of type application/x-pkcs12
	KeyVaultID *string

	// Specify true to always negotiate client certificate on the hostname. Default Value is false.
	NegotiateClientCertificate *bool
}

HostnameConfiguration - Custom hostname configuration.

func (HostnameConfiguration) MarshalJSON added in v1.1.0

func (h HostnameConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HostnameConfiguration.

func (*HostnameConfiguration) UnmarshalJSON added in v1.1.0

func (h *HostnameConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HostnameConfiguration.

type HostnameType

type HostnameType string

HostnameType - Hostname type.

const (
	HostnameTypeDeveloperPortal HostnameType = "DeveloperPortal"
	HostnameTypeManagement      HostnameType = "Management"
	HostnameTypePortal          HostnameType = "Portal"
	HostnameTypeProxy           HostnameType = "Proxy"
	HostnameTypeScm             HostnameType = "Scm"
)

func PossibleHostnameTypeValues

func PossibleHostnameTypeValues() []HostnameType

PossibleHostnameTypeValues returns the possible values for the HostnameType const type.

type IdentityProviderBaseParameters

type IdentityProviderBaseParameters struct {
	// List of Allowed Tenants when configuring Azure Active Directory login.
	AllowedTenants []*string

	// OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
	Authority *string

	// Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
	PasswordResetPolicyName *string

	// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
	ProfileEditingPolicyName *string

	// Signin Policy Name. Only applies to AAD B2C Identity Provider.
	SigninPolicyName *string

	// The TenantId to use instead of Common when logging into Active Directory
	SigninTenant *string

	// Signup Policy Name. Only applies to AAD B2C Identity Provider.
	SignupPolicyName *string

	// Identity Provider Type identifier.
	Type *IdentityProviderType
}

IdentityProviderBaseParameters - Identity Provider Base Parameter Properties.

func (IdentityProviderBaseParameters) MarshalJSON

func (i IdentityProviderBaseParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IdentityProviderBaseParameters.

func (*IdentityProviderBaseParameters) UnmarshalJSON added in v1.1.0

func (i *IdentityProviderBaseParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderBaseParameters.

type IdentityProviderClient

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

IdentityProviderClient contains the methods for the IdentityProvider group. Don't use this type directly, use NewIdentityProviderClient() instead.

func NewIdentityProviderClient

func NewIdentityProviderClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IdentityProviderClient, error)

NewIdentityProviderClient creates a new instance of IdentityProviderClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*IdentityProviderClient) CreateOrUpdate

CreateOrUpdate - Creates or Updates the IdentityProvider configuration. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • identityProviderName - Identity Provider Type identifier.
  • parameters - Create parameters.
  • options - IdentityProviderClientCreateOrUpdateOptions contains the optional parameters for the IdentityProviderClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateIdentityProvider.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewIdentityProviderClient().CreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.IdentityProviderTypeFacebook, armapimanagement.IdentityProviderCreateContract{
		Properties: &armapimanagement.IdentityProviderCreateContractProperties{
			ClientID:     to.Ptr("facebookid"),
			ClientSecret: to.Ptr("facebookapplicationsecret"),
		},
	}, &armapimanagement.IdentityProviderClientCreateOrUpdateOptions{IfMatch: 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.IdentityProviderContract = armapimanagement.IdentityProviderContract{
	// 	Name: to.Ptr("Facebook"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/identityProviders"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/Facebook"),
	// 	Properties: &armapimanagement.IdentityProviderContractProperties{
	// 		Type: to.Ptr(armapimanagement.IdentityProviderTypeFacebook),
	// 		ClientID: to.Ptr("facebookid"),
	// 	},
	// }
}
Output:

func (*IdentityProviderClient) Delete

func (client *IdentityProviderClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, ifMatch string, options *IdentityProviderClientDeleteOptions) (IdentityProviderClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • identityProviderName - Identity Provider Type identifier.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - IdentityProviderClientDeleteOptions contains the optional parameters for the IdentityProviderClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteIdentityProvider.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*IdentityProviderClient) Get

func (client *IdentityProviderClient) Get(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, options *IdentityProviderClientGetOptions) (IdentityProviderClientGetResponse, error)

Get - Gets the configuration details of the identity Provider configured in specified service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • identityProviderName - Identity Provider Type identifier.
  • options - IdentityProviderClientGetOptions contains the optional parameters for the IdentityProviderClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetIdentityProvider.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewIdentityProviderClient().Get(ctx, "rg1", "apimService1", armapimanagement.IdentityProviderTypeAADB2C, 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.IdentityProviderContract = armapimanagement.IdentityProviderContract{
	// 	Name: to.Ptr("AadB2C"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/identityProviders"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/AadB2C"),
	// 	Properties: &armapimanagement.IdentityProviderContractProperties{
	// 		Type: to.Ptr(armapimanagement.IdentityProviderTypeAADB2C),
	// 		AllowedTenants: []*string{
	// 			to.Ptr("contosoaadb2c.onmicrosoft.com"),
	// 			to.Ptr("contoso2aadb2c.onmicrosoft.com")},
	// 			Authority: to.Ptr("login.microsoftonline.com"),
	// 			SigninPolicyName: to.Ptr("B2C_1_policy-signin"),
	// 			SigninTenant: to.Ptr("contosoaadb2c.onmicrosoft.com"),
	// 			SignupPolicyName: to.Ptr("B2C_1_policy-signup"),
	// 			ClientID: to.Ptr("f02dafe2-b8b8-48ec-a38e-27e5c16c51e5"),
	// 		},
	// 	}
}
Output:

func (*IdentityProviderClient) GetEntityTag

func (client *IdentityProviderClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, options *IdentityProviderClientGetEntityTagOptions) (IdentityProviderClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the identityProvider specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • identityProviderName - Identity Provider Type identifier.
  • options - IdentityProviderClientGetEntityTagOptions contains the optional parameters for the IdentityProviderClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadIdentityProvider.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewIdentityProviderClient().GetEntityTag(ctx, "rg1", "apimService1", armapimanagement.IdentityProviderTypeAADB2C, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*IdentityProviderClient) ListSecrets

func (client *IdentityProviderClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, options *IdentityProviderClientListSecretsOptions) (IdentityProviderClientListSecretsResponse, error)

ListSecrets - Gets the client secret details of the Identity Provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • identityProviderName - Identity Provider Type identifier.
  • options - IdentityProviderClientListSecretsOptions contains the optional parameters for the IdentityProviderClient.ListSecrets method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementIdentityProviderListSecrets.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewIdentityProviderClient().ListSecrets(ctx, "rg1", "apimService1", armapimanagement.IdentityProviderTypeAADB2C, 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.ClientSecretContract = armapimanagement.ClientSecretContract{
	// 	ClientSecret: to.Ptr("XXXXXXX"),
	// }
}
Output:

func (*IdentityProviderClient) NewListByServicePager added in v0.5.0

func (client *IdentityProviderClient) NewListByServicePager(resourceGroupName string, serviceName string, options *IdentityProviderClientListByServiceOptions) *runtime.Pager[IdentityProviderClientListByServiceResponse]

NewListByServicePager - Lists a collection of Identity Provider configured in the specified service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - IdentityProviderClientListByServiceOptions contains the optional parameters for the IdentityProviderClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListIdentityProviders.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewIdentityProviderClient().NewListByServicePager("rg1", "apimService1", 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.IdentityProviderList = armapimanagement.IdentityProviderList{
		// 	Count: to.Ptr[int64](3),
		// 	Value: []*armapimanagement.IdentityProviderContract{
		// 		{
		// 			Name: to.Ptr("Google"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/identityProviders"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/Google"),
		// 			Properties: &armapimanagement.IdentityProviderContractProperties{
		// 				Type: to.Ptr(armapimanagement.IdentityProviderTypeGoogle),
		// 				ClientID: to.Ptr("googleId"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Aad"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/identityProviders"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/Aad"),
		// 			Properties: &armapimanagement.IdentityProviderContractProperties{
		// 				Type: to.Ptr(armapimanagement.IdentityProviderTypeAAD),
		// 				AllowedTenants: []*string{
		// 					to.Ptr("samiraad.onmicrosoft.com")},
		// 					ClientID: to.Ptr("aadapplicationid"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("AadB2C"),
		// 				Type: to.Ptr("Microsoft.ApiManagement/service/identityProviders"),
		// 				ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/AadB2C"),
		// 				Properties: &armapimanagement.IdentityProviderContractProperties{
		// 					Type: to.Ptr(armapimanagement.IdentityProviderTypeAADB2C),
		// 					AllowedTenants: []*string{
		// 						to.Ptr("samirtestbc.onmicrosoft.com")},
		// 						SigninPolicyName: to.Ptr("B2C_1_Signin_Default"),
		// 						SignupPolicyName: to.Ptr("B2C_1_Signup_Default"),
		// 						ClientID: to.Ptr("aadb2clientId"),
		// 					},
		// 			}},
		// 		}
	}
}
Output:

func (*IdentityProviderClient) Update

func (client *IdentityProviderClient) Update(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, ifMatch string, parameters IdentityProviderUpdateParameters, options *IdentityProviderClientUpdateOptions) (IdentityProviderClientUpdateResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • identityProviderName - Identity Provider Type identifier.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - IdentityProviderClientUpdateOptions contains the optional parameters for the IdentityProviderClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateIdentityProvider.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewIdentityProviderClient().Update(ctx, "rg1", "apimService1", armapimanagement.IdentityProviderTypeFacebook, "*", armapimanagement.IdentityProviderUpdateParameters{
		Properties: &armapimanagement.IdentityProviderUpdateProperties{
			ClientID:     to.Ptr("updatedfacebookid"),
			ClientSecret: to.Ptr("updatedfacebooksecret"),
		},
	}, 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.IdentityProviderContract = armapimanagement.IdentityProviderContract{
	// 	Name: to.Ptr("AadB2C"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/identityProviders"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/identityProviders/AadB2C"),
	// 	Properties: &armapimanagement.IdentityProviderContractProperties{
	// 		Type: to.Ptr(armapimanagement.IdentityProviderTypeAADB2C),
	// 		AllowedTenants: []*string{
	// 			to.Ptr("contosoaadb2c.onmicrosoft.com"),
	// 			to.Ptr("contoso2aadb2c.onmicrosoft.com")},
	// 			Authority: to.Ptr("login.microsoftonline.com"),
	// 			SigninPolicyName: to.Ptr("B2C_1_policy-signin"),
	// 			SigninTenant: to.Ptr("contosoaadb2c.onmicrosoft.com"),
	// 			SignupPolicyName: to.Ptr("B2C_1_policy-signup"),
	// 			ClientID: to.Ptr("f02dafe2-b8b8-48ec-a38e-27e5c16c51e5"),
	// 		},
	// 	}
}
Output:

type IdentityProviderClientCreateOrUpdateOptions added in v0.3.0

type IdentityProviderClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

IdentityProviderClientCreateOrUpdateOptions contains the optional parameters for the IdentityProviderClient.CreateOrUpdate method.

type IdentityProviderClientCreateOrUpdateResponse added in v0.3.0

type IdentityProviderClientCreateOrUpdateResponse struct {
	IdentityProviderContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

IdentityProviderClientCreateOrUpdateResponse contains the response from method IdentityProviderClient.CreateOrUpdate.

type IdentityProviderClientDeleteOptions added in v0.3.0

type IdentityProviderClientDeleteOptions struct {
}

IdentityProviderClientDeleteOptions contains the optional parameters for the IdentityProviderClient.Delete method.

type IdentityProviderClientDeleteResponse added in v0.3.0

type IdentityProviderClientDeleteResponse struct {
}

IdentityProviderClientDeleteResponse contains the response from method IdentityProviderClient.Delete.

type IdentityProviderClientGetEntityTagOptions added in v0.3.0

type IdentityProviderClientGetEntityTagOptions struct {
}

IdentityProviderClientGetEntityTagOptions contains the optional parameters for the IdentityProviderClient.GetEntityTag method.

type IdentityProviderClientGetEntityTagResponse added in v0.3.0

type IdentityProviderClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

IdentityProviderClientGetEntityTagResponse contains the response from method IdentityProviderClient.GetEntityTag.

type IdentityProviderClientGetOptions added in v0.3.0

type IdentityProviderClientGetOptions struct {
}

IdentityProviderClientGetOptions contains the optional parameters for the IdentityProviderClient.Get method.

type IdentityProviderClientGetResponse added in v0.3.0

type IdentityProviderClientGetResponse struct {
	IdentityProviderContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

IdentityProviderClientGetResponse contains the response from method IdentityProviderClient.Get.

type IdentityProviderClientListByServiceOptions added in v0.3.0

type IdentityProviderClientListByServiceOptions struct {
}

IdentityProviderClientListByServiceOptions contains the optional parameters for the IdentityProviderClient.NewListByServicePager method.

type IdentityProviderClientListByServiceResponse added in v0.3.0

type IdentityProviderClientListByServiceResponse struct {
	IdentityProviderList
}

IdentityProviderClientListByServiceResponse contains the response from method IdentityProviderClient.NewListByServicePager.

type IdentityProviderClientListSecretsOptions added in v0.3.0

type IdentityProviderClientListSecretsOptions struct {
}

IdentityProviderClientListSecretsOptions contains the optional parameters for the IdentityProviderClient.ListSecrets method.

type IdentityProviderClientListSecretsResponse added in v0.3.0

type IdentityProviderClientListSecretsResponse struct {
	ClientSecretContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

IdentityProviderClientListSecretsResponse contains the response from method IdentityProviderClient.ListSecrets.

type IdentityProviderClientUpdateOptions added in v0.3.0

type IdentityProviderClientUpdateOptions struct {
}

IdentityProviderClientUpdateOptions contains the optional parameters for the IdentityProviderClient.Update method.

type IdentityProviderClientUpdateResponse added in v0.3.0

type IdentityProviderClientUpdateResponse struct {
	IdentityProviderContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

IdentityProviderClientUpdateResponse contains the response from method IdentityProviderClient.Update.

type IdentityProviderContract

type IdentityProviderContract struct {
	// Identity Provider contract properties.
	Properties *IdentityProviderContractProperties

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

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

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

IdentityProviderContract - Identity Provider details.

func (IdentityProviderContract) MarshalJSON

func (i IdentityProviderContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IdentityProviderContract.

func (*IdentityProviderContract) UnmarshalJSON added in v1.1.0

func (i *IdentityProviderContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderContract.

type IdentityProviderContractProperties

type IdentityProviderContractProperties struct {
	// REQUIRED; Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for
	// Google login, App ID for Microsoft.
	ClientID *string

	// List of Allowed Tenants when configuring Azure Active Directory login.
	AllowedTenants []*string

	// OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
	Authority *string

	// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is
	// App Secret for Facebook login, API Key for Google login, Public Key for
	// Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
	ClientSecret *string

	// Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
	PasswordResetPolicyName *string

	// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
	ProfileEditingPolicyName *string

	// Signin Policy Name. Only applies to AAD B2C Identity Provider.
	SigninPolicyName *string

	// The TenantId to use instead of Common when logging into Active Directory
	SigninTenant *string

	// Signup Policy Name. Only applies to AAD B2C Identity Provider.
	SignupPolicyName *string

	// Identity Provider Type identifier.
	Type *IdentityProviderType
}

IdentityProviderContractProperties - The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management service developer portal for all users.

func (IdentityProviderContractProperties) MarshalJSON

func (i IdentityProviderContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IdentityProviderContractProperties.

func (*IdentityProviderContractProperties) UnmarshalJSON added in v1.1.0

func (i *IdentityProviderContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderContractProperties.

type IdentityProviderCreateContract

type IdentityProviderCreateContract struct {
	// Identity Provider contract properties.
	Properties *IdentityProviderCreateContractProperties

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

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

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

IdentityProviderCreateContract - Identity Provider details.

func (IdentityProviderCreateContract) MarshalJSON

func (i IdentityProviderCreateContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IdentityProviderCreateContract.

func (*IdentityProviderCreateContract) UnmarshalJSON added in v1.1.0

func (i *IdentityProviderCreateContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderCreateContract.

type IdentityProviderCreateContractProperties

type IdentityProviderCreateContractProperties struct {
	// REQUIRED; Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for
	// Google login, App ID for Microsoft.
	ClientID *string

	// REQUIRED; Client secret of the Application in external Identity Provider, used to authenticate login request. For example,
	// it is App Secret for Facebook login, API Key for Google login, Public Key for
	// Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
	ClientSecret *string

	// List of Allowed Tenants when configuring Azure Active Directory login.
	AllowedTenants []*string

	// OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
	Authority *string

	// Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
	PasswordResetPolicyName *string

	// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
	ProfileEditingPolicyName *string

	// Signin Policy Name. Only applies to AAD B2C Identity Provider.
	SigninPolicyName *string

	// The TenantId to use instead of Common when logging into Active Directory
	SigninTenant *string

	// Signup Policy Name. Only applies to AAD B2C Identity Provider.
	SignupPolicyName *string

	// Identity Provider Type identifier.
	Type *IdentityProviderType
}

IdentityProviderCreateContractProperties - The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management service developer portal for all users.

func (IdentityProviderCreateContractProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type IdentityProviderCreateContractProperties.

func (*IdentityProviderCreateContractProperties) UnmarshalJSON added in v1.1.0

func (i *IdentityProviderCreateContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderCreateContractProperties.

type IdentityProviderList

type IdentityProviderList struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Identity Provider configuration values.
	Value []*IdentityProviderContract
}

IdentityProviderList - List of all the Identity Providers configured on the service instance.

func (IdentityProviderList) MarshalJSON

func (i IdentityProviderList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IdentityProviderList.

func (*IdentityProviderList) UnmarshalJSON added in v1.1.0

func (i *IdentityProviderList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderList.

type IdentityProviderType

type IdentityProviderType string
const (
	// IdentityProviderTypeAAD - Azure Active Directory as Identity provider.
	IdentityProviderTypeAAD IdentityProviderType = "aad"
	// IdentityProviderTypeAADB2C - Azure Active Directory B2C as Identity provider.
	IdentityProviderTypeAADB2C IdentityProviderType = "aadB2C"
	// IdentityProviderTypeFacebook - Facebook as Identity provider.
	IdentityProviderTypeFacebook IdentityProviderType = "facebook"
	// IdentityProviderTypeGoogle - Google as Identity provider.
	IdentityProviderTypeGoogle IdentityProviderType = "google"
	// IdentityProviderTypeMicrosoft - Microsoft Live as Identity provider.
	IdentityProviderTypeMicrosoft IdentityProviderType = "microsoft"
	// IdentityProviderTypeTwitter - Twitter as Identity provider.
	IdentityProviderTypeTwitter IdentityProviderType = "twitter"
)

func PossibleIdentityProviderTypeValues

func PossibleIdentityProviderTypeValues() []IdentityProviderType

PossibleIdentityProviderTypeValues returns the possible values for the IdentityProviderType const type.

type IdentityProviderUpdateParameters

type IdentityProviderUpdateParameters struct {
	// Identity Provider update properties.
	Properties *IdentityProviderUpdateProperties
}

IdentityProviderUpdateParameters - Parameters supplied to update Identity Provider

func (IdentityProviderUpdateParameters) MarshalJSON

func (i IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IdentityProviderUpdateParameters.

func (*IdentityProviderUpdateParameters) UnmarshalJSON added in v1.1.0

func (i *IdentityProviderUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderUpdateParameters.

type IdentityProviderUpdateProperties

type IdentityProviderUpdateProperties struct {
	// List of Allowed Tenants when configuring Azure Active Directory login.
	AllowedTenants []*string

	// OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
	Authority *string

	// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login,
	// App ID for Microsoft.
	ClientID *string

	// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is
	// App Secret for Facebook login, API Key for Google login, Public Key for
	// Microsoft.
	ClientSecret *string

	// Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
	PasswordResetPolicyName *string

	// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
	ProfileEditingPolicyName *string

	// Signin Policy Name. Only applies to AAD B2C Identity Provider.
	SigninPolicyName *string

	// The TenantId to use instead of Common when logging into Active Directory
	SigninTenant *string

	// Signup Policy Name. Only applies to AAD B2C Identity Provider.
	SignupPolicyName *string

	// Identity Provider Type identifier.
	Type *IdentityProviderType
}

IdentityProviderUpdateProperties - Parameters supplied to the Update Identity Provider operation.

func (IdentityProviderUpdateProperties) MarshalJSON

func (i IdentityProviderUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IdentityProviderUpdateProperties.

func (*IdentityProviderUpdateProperties) UnmarshalJSON added in v1.1.0

func (i *IdentityProviderUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderUpdateProperties.

type IssueAttachmentCollection

type IssueAttachmentCollection struct {
	// Total record count number across all pages.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Issue Attachment values.
	Value []*IssueAttachmentContract
}

IssueAttachmentCollection - Paged Issue Attachment list representation.

func (IssueAttachmentCollection) MarshalJSON

func (i IssueAttachmentCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueAttachmentCollection.

func (*IssueAttachmentCollection) UnmarshalJSON added in v1.1.0

func (i *IssueAttachmentCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentCollection.

type IssueAttachmentContract

type IssueAttachmentContract struct {
	// Properties of the Issue Attachment.
	Properties *IssueAttachmentContractProperties

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

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

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

IssueAttachmentContract - Issue Attachment Contract details.

func (IssueAttachmentContract) MarshalJSON

func (i IssueAttachmentContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueAttachmentContract.

func (*IssueAttachmentContract) UnmarshalJSON added in v1.1.0

func (i *IssueAttachmentContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentContract.

type IssueAttachmentContractProperties

type IssueAttachmentContractProperties struct {
	// REQUIRED; An HTTP link or Base64-encoded binary data.
	Content *string

	// REQUIRED; Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided
	// in the 'content' property.
	ContentFormat *string

	// REQUIRED; Filename by which the binary data will be saved.
	Title *string
}

IssueAttachmentContractProperties - Issue Attachment contract Properties.

func (IssueAttachmentContractProperties) MarshalJSON added in v1.1.0

func (i IssueAttachmentContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueAttachmentContractProperties.

func (*IssueAttachmentContractProperties) UnmarshalJSON added in v1.1.0

func (i *IssueAttachmentContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentContractProperties.

type IssueClient

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

IssueClient contains the methods for the Issue group. Don't use this type directly, use NewIssueClient() instead.

func NewIssueClient

func NewIssueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IssueClient, error)

NewIssueClient creates a new instance of IssueClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*IssueClient) Get

func (client *IssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, issueID string, options *IssueClientGetOptions) (IssueClientGetResponse, error)

Get - Gets API Management issue details If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • issueID - Issue identifier. Must be unique in the current API Management service instance.
  • options - IssueClientGetOptions contains the optional parameters for the IssueClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetIssue.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewIssueClient().Get(ctx, "rg1", "apimService1", "57d2ef278aa04f0ad01d6cdc", 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.IssueContract = armapimanagement.IssueContract{
	// 	Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/issues"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/issues/57d2ef278aa04f0ad01d6cdc"),
	// 	Properties: &armapimanagement.IssueContractProperties{
	// 		APIID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
	// 		State: to.Ptr(armapimanagement.StateOpen),
	// 		Description: to.Ptr("New API issue description"),
	// 		Title: to.Ptr("New API issue"),
	// 		UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
	// 	},
	// }
}
Output:

func (*IssueClient) NewListByServicePager added in v0.5.0

func (client *IssueClient) NewListByServicePager(resourceGroupName string, serviceName string, options *IssueClientListByServiceOptions) *runtime.Pager[IssueClientListByServiceResponse]

NewListByServicePager - Lists a collection of issues in the specified service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - IssueClientListByServiceOptions contains the optional parameters for the IssueClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListIssues.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewIssueClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.IssueClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.IssueCollection = armapimanagement.IssueCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.IssueContract{
		// 		{
		// 			Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/issues"),
		// 			ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/issues/57d2ef278aa04f0ad01d6cdc"),
		// 			Properties: &armapimanagement.IssueContractProperties{
		// 				APIID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a"),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t}()),
		// 				State: to.Ptr(armapimanagement.StateOpen),
		// 				Description: to.Ptr("New API issue description"),
		// 				Title: to.Ptr("New API issue"),
		// 				UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type IssueClientGetOptions added in v0.3.0

type IssueClientGetOptions struct {
}

IssueClientGetOptions contains the optional parameters for the IssueClient.Get method.

type IssueClientGetResponse added in v0.3.0

type IssueClientGetResponse struct {
	IssueContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

IssueClientGetResponse contains the response from method IssueClient.Get.

type IssueClientListByServiceOptions added in v0.3.0

type IssueClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | title | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | authorName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | state | filter | eq | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

IssueClientListByServiceOptions contains the optional parameters for the IssueClient.NewListByServicePager method.

type IssueClientListByServiceResponse added in v0.3.0

type IssueClientListByServiceResponse struct {
	IssueCollection
}

IssueClientListByServiceResponse contains the response from method IssueClient.NewListByServicePager.

type IssueCollection

type IssueCollection struct {
	// Total record count number across all pages.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Issue values.
	Value []*IssueContract
}

IssueCollection - Paged Issue list representation.

func (IssueCollection) MarshalJSON

func (i IssueCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueCollection.

func (*IssueCollection) UnmarshalJSON added in v1.1.0

func (i *IssueCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueCollection.

type IssueCommentCollection

type IssueCommentCollection struct {
	// Total record count number across all pages.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Issue Comment values.
	Value []*IssueCommentContract
}

IssueCommentCollection - Paged Issue Comment list representation.

func (IssueCommentCollection) MarshalJSON

func (i IssueCommentCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueCommentCollection.

func (*IssueCommentCollection) UnmarshalJSON added in v1.1.0

func (i *IssueCommentCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentCollection.

type IssueCommentContract

type IssueCommentContract struct {
	// Properties of the Issue Comment.
	Properties *IssueCommentContractProperties

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

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

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

IssueCommentContract - Issue Comment Contract details.

func (IssueCommentContract) MarshalJSON

func (i IssueCommentContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueCommentContract.

func (*IssueCommentContract) UnmarshalJSON added in v1.1.0

func (i *IssueCommentContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentContract.

type IssueCommentContractProperties

type IssueCommentContractProperties struct {
	// REQUIRED; Comment text.
	Text *string

	// REQUIRED; A resource identifier for the user who left the comment.
	UserID *string

	// Date and time when the comment was created.
	CreatedDate *time.Time
}

IssueCommentContractProperties - Issue Comment contract Properties.

func (IssueCommentContractProperties) MarshalJSON

func (i IssueCommentContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueCommentContractProperties.

func (*IssueCommentContractProperties) UnmarshalJSON

func (i *IssueCommentContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentContractProperties.

type IssueContract

type IssueContract struct {
	// Properties of the Issue.
	Properties *IssueContractProperties

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

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

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

IssueContract - Issue Contract details.

func (IssueContract) MarshalJSON

func (i IssueContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueContract.

func (*IssueContract) UnmarshalJSON added in v1.1.0

func (i *IssueContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueContract.

type IssueContractBaseProperties

type IssueContractBaseProperties struct {
	// A resource identifier for the API the issue was created for.
	APIID *string

	// Date and time when the issue was created.
	CreatedDate *time.Time

	// Status of the issue.
	State *State
}

IssueContractBaseProperties - Issue contract Base Properties.

func (IssueContractBaseProperties) MarshalJSON

func (i IssueContractBaseProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueContractBaseProperties.

func (*IssueContractBaseProperties) UnmarshalJSON

func (i *IssueContractBaseProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueContractBaseProperties.

type IssueContractProperties

type IssueContractProperties struct {
	// REQUIRED; Text describing the issue.
	Description *string

	// REQUIRED; The issue title.
	Title *string

	// REQUIRED; A resource identifier for the user created the issue.
	UserID *string

	// A resource identifier for the API the issue was created for.
	APIID *string

	// Date and time when the issue was created.
	CreatedDate *time.Time

	// Status of the issue.
	State *State
}

IssueContractProperties - Issue contract Properties.

func (IssueContractProperties) MarshalJSON

func (i IssueContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueContractProperties.

func (*IssueContractProperties) UnmarshalJSON

func (i *IssueContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueContractProperties.

type IssueType

type IssueType string

IssueType - The type of issue.

const (
	IssueTypeAgentStopped        IssueType = "AgentStopped"
	IssueTypeDNSResolution       IssueType = "DnsResolution"
	IssueTypeGuestFirewall       IssueType = "GuestFirewall"
	IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule"
	IssueTypePlatform            IssueType = "Platform"
	IssueTypePortThrottled       IssueType = "PortThrottled"
	IssueTypeSocketBind          IssueType = "SocketBind"
	IssueTypeUnknown             IssueType = "Unknown"
	IssueTypeUserDefinedRoute    IssueType = "UserDefinedRoute"
)

func PossibleIssueTypeValues

func PossibleIssueTypeValues() []IssueType

PossibleIssueTypeValues returns the possible values for the IssueType const type.

type IssueUpdateContract

type IssueUpdateContract struct {
	// Issue entity Update contract properties.
	Properties *IssueUpdateContractProperties
}

IssueUpdateContract - Issue update Parameters.

func (IssueUpdateContract) MarshalJSON

func (i IssueUpdateContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueUpdateContract.

func (*IssueUpdateContract) UnmarshalJSON added in v1.1.0

func (i *IssueUpdateContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueUpdateContract.

type IssueUpdateContractProperties

type IssueUpdateContractProperties struct {
	// A resource identifier for the API the issue was created for.
	APIID *string

	// Date and time when the issue was created.
	CreatedDate *time.Time

	// Text describing the issue.
	Description *string

	// Status of the issue.
	State *State

	// The issue title.
	Title *string

	// A resource identifier for the user created the issue.
	UserID *string
}

IssueUpdateContractProperties - Issue contract Update Properties.

func (IssueUpdateContractProperties) MarshalJSON

func (i IssueUpdateContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssueUpdateContractProperties.

func (*IssueUpdateContractProperties) UnmarshalJSON

func (i *IssueUpdateContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssueUpdateContractProperties.

type KeyType

type KeyType string

KeyType - The Key to be used to generate token for user.

const (
	KeyTypePrimary   KeyType = "primary"
	KeyTypeSecondary KeyType = "secondary"
)

func PossibleKeyTypeValues

func PossibleKeyTypeValues() []KeyType

PossibleKeyTypeValues returns the possible values for the KeyType const type.

type KeyVaultContractCreateProperties

type KeyVaultContractCreateProperties struct {
	// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.
	IdentityClientID *string

	// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires
	// API Management service to be configured with aka.ms/apimmsi
	SecretIdentifier *string
}

KeyVaultContractCreateProperties - Create keyVault contract details.

func (KeyVaultContractCreateProperties) MarshalJSON added in v1.1.0

func (k KeyVaultContractCreateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyVaultContractCreateProperties.

func (*KeyVaultContractCreateProperties) UnmarshalJSON added in v1.1.0

func (k *KeyVaultContractCreateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultContractCreateProperties.

type KeyVaultContractProperties

type KeyVaultContractProperties struct {
	// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.
	IdentityClientID *string

	// Last time sync and refresh status of secret from key vault.
	LastStatus *KeyVaultLastAccessStatusContractProperties

	// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires
	// API Management service to be configured with aka.ms/apimmsi
	SecretIdentifier *string
}

KeyVaultContractProperties - KeyVault contract details.

func (KeyVaultContractProperties) MarshalJSON added in v1.1.0

func (k KeyVaultContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyVaultContractProperties.

func (*KeyVaultContractProperties) UnmarshalJSON added in v1.1.0

func (k *KeyVaultContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultContractProperties.

type KeyVaultLastAccessStatusContractProperties

type KeyVaultLastAccessStatusContractProperties struct {
	// Last status code for sync and refresh of secret from key vault.
	Code *string

	// Details of the error else empty.
	Message *string

	// Last time secret was accessed. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO
	// 8601 standard.
	TimeStampUTC *time.Time
}

KeyVaultLastAccessStatusContractProperties - Issue contract Update Properties.

func (KeyVaultLastAccessStatusContractProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type KeyVaultLastAccessStatusContractProperties.

func (*KeyVaultLastAccessStatusContractProperties) UnmarshalJSON

func (k *KeyVaultLastAccessStatusContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultLastAccessStatusContractProperties.

type LoggerClient

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

LoggerClient contains the methods for the Logger group. Don't use this type directly, use NewLoggerClient() instead.

func NewLoggerClient

func NewLoggerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoggerClient, error)

NewLoggerClient creates a new instance of LoggerClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*LoggerClient) CreateOrUpdate

func (client *LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerContract, options *LoggerClientCreateOrUpdateOptions) (LoggerClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or Updates a logger. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • loggerID - Logger identifier. Must be unique in the API Management service instance.
  • parameters - Create parameters.
  • options - LoggerClientCreateOrUpdateOptions contains the optional parameters for the LoggerClient.CreateOrUpdate method.
Example (ApiManagementCreateAiLogger)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateAILogger.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLoggerClient().CreateOrUpdate(ctx, "rg1", "apimService1", "loggerId", armapimanagement.LoggerContract{
		Properties: &armapimanagement.LoggerContractProperties{
			Description: to.Ptr("adding a new logger"),
			Credentials: map[string]*string{
				"instrumentationKey": to.Ptr("11................a1"),
			},
			LoggerType: to.Ptr(armapimanagement.LoggerTypeApplicationInsights),
		},
	}, &armapimanagement.LoggerClientCreateOrUpdateOptions{IfMatch: 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.LoggerContract = armapimanagement.LoggerContract{
	// 	Name: to.Ptr("loggerId"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/loggers"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/loggerId"),
	// 	Properties: &armapimanagement.LoggerContractProperties{
	// 		Credentials: map[string]*string{
	// 			"instrumentationKey": to.Ptr("{{5a.......2a}}"),
	// 		},
	// 		IsBuffered: to.Ptr(false),
	// 		LoggerType: to.Ptr(armapimanagement.LoggerTypeApplicationInsights),
	// 	},
	// }
}
Output:

Example (ApiManagementCreateEhLogger)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateEHLogger.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLoggerClient().CreateOrUpdate(ctx, "rg1", "apimService1", "eh1", armapimanagement.LoggerContract{
		Properties: &armapimanagement.LoggerContractProperties{
			Description: to.Ptr("adding a new logger"),
			Credentials: map[string]*string{
				"name":             to.Ptr("hydraeventhub"),
				"connectionString": to.Ptr("Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********="),
			},
			LoggerType: to.Ptr(armapimanagement.LoggerTypeAzureEventHub),
		},
	}, &armapimanagement.LoggerClientCreateOrUpdateOptions{IfMatch: 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.LoggerContract = armapimanagement.LoggerContract{
	// 	Name: to.Ptr("eh1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/loggers"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1"),
	// 	Properties: &armapimanagement.LoggerContractProperties{
	// 		Description: to.Ptr("adding a new logger"),
	// 		Credentials: map[string]*string{
	// 			"connectionString": to.Ptr("{{Logger-Credentials-5f28745bbebeeb13cc3f7301}}"),
	// 		},
	// 		IsBuffered: to.Ptr(true),
	// 		LoggerType: to.Ptr(armapimanagement.LoggerTypeAzureEventHub),
	// 	},
	// }
}
Output:

func (*LoggerClient) Delete

func (client *LoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, ifMatch string, options *LoggerClientDeleteOptions) (LoggerClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • loggerID - Logger identifier. Must be unique in the API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - LoggerClientDeleteOptions contains the optional parameters for the LoggerClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteLogger.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*LoggerClient) Get

func (client *LoggerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, options *LoggerClientGetOptions) (LoggerClientGetResponse, error)

Get - Gets the details of the logger specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • loggerID - Logger identifier. Must be unique in the API Management service instance.
  • options - LoggerClientGetOptions contains the optional parameters for the LoggerClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetLogger.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLoggerClient().Get(ctx, "rg1", "apimService1", "templateLogger", 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.LoggerContract = armapimanagement.LoggerContract{
	// 	Name: to.Ptr("kloudapilogger1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/loggers"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/kloudapilogger1"),
	// 	Properties: &armapimanagement.LoggerContractProperties{
	// 		Description: to.Ptr("testeventhub3again"),
	// 		Credentials: map[string]*string{
	// 			"name": to.Ptr("testeventhub4"),
	// 			"connectionString": to.Ptr("Endpoint=sb://eventhubapim.servicebus.windows.net/;SharedAccessKeyName=Sender;SharedAccessKey=************"),
	// 		},
	// 		IsBuffered: to.Ptr(true),
	// 		LoggerType: to.Ptr(armapimanagement.LoggerTypeAzureEventHub),
	// 		ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.EventHub/namespaces/eventhubapim"),
	// 	},
	// }
}
Output:

func (*LoggerClient) GetEntityTag

func (client *LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, options *LoggerClientGetEntityTagOptions) (LoggerClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the logger specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • loggerID - Logger identifier. Must be unique in the API Management service instance.
  • options - LoggerClientGetEntityTagOptions contains the optional parameters for the LoggerClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadLogger.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewLoggerClient().GetEntityTag(ctx, "rg1", "apimService1", "templateLogger", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*LoggerClient) NewListByServicePager added in v0.5.0

func (client *LoggerClient) NewListByServicePager(resourceGroupName string, serviceName string, options *LoggerClientListByServiceOptions) *runtime.Pager[LoggerClientListByServiceResponse]

NewListByServicePager - Lists a collection of loggers in the specified service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - LoggerClientListByServiceOptions contains the optional parameters for the LoggerClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListLoggers.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLoggerClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.LoggerClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.LoggerCollection = armapimanagement.LoggerCollection{
		// 	Count: to.Ptr[int64](3),
		// 	Value: []*armapimanagement.LoggerContract{
		// 		{
		// 			Name: to.Ptr("azuremonitor"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/loggers"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/azuremonitor"),
		// 			Properties: &armapimanagement.LoggerContractProperties{
		// 				IsBuffered: to.Ptr(true),
		// 				LoggerType: to.Ptr(armapimanagement.LoggerTypeAzureMonitor),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("vvktest"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/loggers"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/vvktest"),
		// 			Properties: &armapimanagement.LoggerContractProperties{
		// 				Credentials: map[string]*string{
		// 					"instrumentationKey": to.Ptr("{{Logger-Credentials-5b1a17ef2b3f91153004b10d}}"),
		// 				},
		// 				IsBuffered: to.Ptr(true),
		// 				LoggerType: to.Ptr(armapimanagement.LoggerTypeApplicationInsights),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("applicationinsights"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/loggers"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/applicationinsights"),
		// 			Properties: &armapimanagement.LoggerContractProperties{
		// 				Description: to.Ptr("miaoappinsight"),
		// 				Credentials: map[string]*string{
		// 					"instrumentationKey": to.Ptr("{{Logger-Credentials-5b2056062b3f911ae84a3069}}"),
		// 				},
		// 				IsBuffered: to.Ptr(true),
		// 				LoggerType: to.Ptr(armapimanagement.LoggerTypeApplicationInsights),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*LoggerClient) Update

func (client *LoggerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, ifMatch string, parameters LoggerUpdateContract, options *LoggerClientUpdateOptions) (LoggerClientUpdateResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • loggerID - Logger identifier. Must be unique in the API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - LoggerClientUpdateOptions contains the optional parameters for the LoggerClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateLogger.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLoggerClient().Update(ctx, "rg1", "apimService1", "eh1", "*", armapimanagement.LoggerUpdateContract{
		Properties: &armapimanagement.LoggerUpdateParameters{
			Description: to.Ptr("updating description"),
			LoggerType:  to.Ptr(armapimanagement.LoggerTypeAzureEventHub),
		},
	}, 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.LoggerContract = armapimanagement.LoggerContract{
	// 	Name: to.Ptr("eh1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/loggers"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1"),
	// 	Properties: &armapimanagement.LoggerContractProperties{
	// 		Description: to.Ptr("updating description"),
	// 		Credentials: map[string]*string{
	// 			"connectionString": to.Ptr("{{Logger-Credentials-5f28745bbebeeb13cc3f7301}}"),
	// 		},
	// 		IsBuffered: to.Ptr(true),
	// 		LoggerType: to.Ptr(armapimanagement.LoggerTypeAzureEventHub),
	// 	},
	// }
}
Output:

type LoggerClientCreateOrUpdateOptions added in v0.3.0

type LoggerClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

LoggerClientCreateOrUpdateOptions contains the optional parameters for the LoggerClient.CreateOrUpdate method.

type LoggerClientCreateOrUpdateResponse added in v0.3.0

type LoggerClientCreateOrUpdateResponse struct {
	LoggerContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

LoggerClientCreateOrUpdateResponse contains the response from method LoggerClient.CreateOrUpdate.

type LoggerClientDeleteOptions added in v0.3.0

type LoggerClientDeleteOptions struct {
}

LoggerClientDeleteOptions contains the optional parameters for the LoggerClient.Delete method.

type LoggerClientDeleteResponse added in v0.3.0

type LoggerClientDeleteResponse struct {
}

LoggerClientDeleteResponse contains the response from method LoggerClient.Delete.

type LoggerClientGetEntityTagOptions added in v0.3.0

type LoggerClientGetEntityTagOptions struct {
}

LoggerClientGetEntityTagOptions contains the optional parameters for the LoggerClient.GetEntityTag method.

type LoggerClientGetEntityTagResponse added in v0.3.0

type LoggerClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

LoggerClientGetEntityTagResponse contains the response from method LoggerClient.GetEntityTag.

type LoggerClientGetOptions added in v0.3.0

type LoggerClientGetOptions struct {
}

LoggerClientGetOptions contains the optional parameters for the LoggerClient.Get method.

type LoggerClientGetResponse added in v0.3.0

type LoggerClientGetResponse struct {
	LoggerContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

LoggerClientGetResponse contains the response from method LoggerClient.Get.

type LoggerClientListByServiceOptions added in v0.3.0

type LoggerClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | loggerType | filter | eq | |
	// | resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

LoggerClientListByServiceOptions contains the optional parameters for the LoggerClient.NewListByServicePager method.

type LoggerClientListByServiceResponse added in v0.3.0

type LoggerClientListByServiceResponse struct {
	LoggerCollection
}

LoggerClientListByServiceResponse contains the response from method LoggerClient.NewListByServicePager.

type LoggerClientUpdateOptions added in v0.3.0

type LoggerClientUpdateOptions struct {
}

LoggerClientUpdateOptions contains the optional parameters for the LoggerClient.Update method.

type LoggerClientUpdateResponse added in v0.3.0

type LoggerClientUpdateResponse struct {
	LoggerContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

LoggerClientUpdateResponse contains the response from method LoggerClient.Update.

type LoggerCollection

type LoggerCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Logger values.
	Value []*LoggerContract
}

LoggerCollection - Paged Logger list representation.

func (LoggerCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LoggerCollection.

func (*LoggerCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LoggerCollection.

type LoggerContract

type LoggerContract struct {
	// Logger entity contract properties.
	Properties *LoggerContractProperties

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

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

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

LoggerContract - Logger details.

func (LoggerContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LoggerContract.

func (*LoggerContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LoggerContract.

type LoggerContractProperties

type LoggerContractProperties struct {
	// REQUIRED; Logger type.
	LoggerType *LoggerType

	// The name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights
	// logger.
	Credentials map[string]*string

	// Logger description.
	Description *string

	// Whether records are buffered in the logger before publishing. Default is assumed to be true.
	IsBuffered *bool

	// Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).
	ResourceID *string
}

LoggerContractProperties - The Logger entity in API Management represents an event sink that you can use to log API Management events. Currently the Logger entity supports logging API Management events to Azure Event Hubs.

func (LoggerContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LoggerContractProperties.

func (*LoggerContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LoggerContractProperties.

type LoggerType

type LoggerType string

LoggerType - Logger type.

const (
	// LoggerTypeApplicationInsights - Azure Application Insights as log destination.
	LoggerTypeApplicationInsights LoggerType = "applicationInsights"
	// LoggerTypeAzureEventHub - Azure Event Hub as log destination.
	LoggerTypeAzureEventHub LoggerType = "azureEventHub"
	// LoggerTypeAzureMonitor - Azure Monitor
	LoggerTypeAzureMonitor LoggerType = "azureMonitor"
)

func PossibleLoggerTypeValues

func PossibleLoggerTypeValues() []LoggerType

PossibleLoggerTypeValues returns the possible values for the LoggerType const type.

type LoggerUpdateContract

type LoggerUpdateContract struct {
	// Logger entity update contract properties.
	Properties *LoggerUpdateParameters
}

LoggerUpdateContract - Logger update contract.

func (LoggerUpdateContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LoggerUpdateContract.

func (*LoggerUpdateContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LoggerUpdateContract.

type LoggerUpdateParameters

type LoggerUpdateParameters struct {
	// Logger credentials.
	Credentials map[string]*string

	// Logger description.
	Description *string

	// Whether records are buffered in the logger before publishing. Default is assumed to be true.
	IsBuffered *bool

	// Logger type.
	LoggerType *LoggerType
}

LoggerUpdateParameters - Parameters supplied to the Update Logger operation.

func (LoggerUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LoggerUpdateParameters.

func (*LoggerUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LoggerUpdateParameters.

type Method

type Method string

Method - The HTTP method to be used.

const (
	MethodGET  Method = "GET"
	MethodPOST Method = "POST"
)

func PossibleMethodValues

func PossibleMethodValues() []Method

PossibleMethodValues returns the possible values for the Method const type.

type NameAvailabilityReason

type NameAvailabilityReason string

NameAvailabilityReason - Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable.

const (
	NameAvailabilityReasonValid         NameAvailabilityReason = "Valid"
	NameAvailabilityReasonInvalid       NameAvailabilityReason = "Invalid"
	NameAvailabilityReasonAlreadyExists NameAvailabilityReason = "AlreadyExists"
)

func PossibleNameAvailabilityReasonValues

func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason

PossibleNameAvailabilityReasonValues returns the possible values for the NameAvailabilityReason const type.

type NamedValueClient

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

NamedValueClient contains the methods for the NamedValue group. Don't use this type directly, use NewNamedValueClient() instead.

func NewNamedValueClient

func NewNamedValueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NamedValueClient, error)

NewNamedValueClient creates a new instance of NamedValueClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*NamedValueClient) BeginCreateOrUpdate

func (client *NamedValueClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueCreateContract, options *NamedValueClientBeginCreateOrUpdateOptions) (*runtime.Poller[NamedValueClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates named value. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • namedValueID - Identifier of the NamedValue.
  • parameters - Create parameters.
  • options - NamedValueClientBeginCreateOrUpdateOptions contains the optional parameters for the NamedValueClient.BeginCreateOrUpdate method.
Example (ApiManagementCreateNamedValue)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNamedValue.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewNamedValueClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "testprop2", armapimanagement.NamedValueCreateContract{
		Properties: &armapimanagement.NamedValueCreateContractProperties{
			Secret: to.Ptr(false),
			Tags: []*string{
				to.Ptr("foo"),
				to.Ptr("bar")},
			DisplayName: to.Ptr("prop3name"),
			Value:       to.Ptr("propValue"),
		},
	}, &armapimanagement.NamedValueClientBeginCreateOrUpdateOptions{IfMatch: 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.NamedValueContract = armapimanagement.NamedValueContract{
	// 	Name: to.Ptr("testprop2"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/namedValues"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop2"),
	// 	Properties: &armapimanagement.NamedValueContractProperties{
	// 		Secret: to.Ptr(false),
	// 		Tags: []*string{
	// 			to.Ptr("foo"),
	// 			to.Ptr("bar")},
	// 			DisplayName: to.Ptr("prop3name"),
	// 			Value: to.Ptr("propValue"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateNamedValueWithKeyVault)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNamedValueWithKeyVault.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewNamedValueClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "testprop6", armapimanagement.NamedValueCreateContract{
		Properties: &armapimanagement.NamedValueCreateContractProperties{
			Secret: to.Ptr(true),
			Tags: []*string{
				to.Ptr("foo"),
				to.Ptr("bar")},
			DisplayName: to.Ptr("prop6namekv"),
			KeyVault: &armapimanagement.KeyVaultContractCreateProperties{
				IdentityClientID: to.Ptr("ceaa6b06-c00f-43ef-99ac-f53d1fe876a0"),
				SecretIdentifier: to.Ptr("https://contoso.vault.azure.net/secrets/aadSecret"),
			},
		},
	}, &armapimanagement.NamedValueClientBeginCreateOrUpdateOptions{IfMatch: 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.NamedValueContract = armapimanagement.NamedValueContract{
	// 	Name: to.Ptr("testprop6"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/namedValues"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6"),
	// 	Properties: &armapimanagement.NamedValueContractProperties{
	// 		Secret: to.Ptr(true),
	// 		Tags: []*string{
	// 			to.Ptr("foo"),
	// 			to.Ptr("bar")},
	// 			DisplayName: to.Ptr("prop6namekv"),
	// 			KeyVault: &armapimanagement.KeyVaultContractProperties{
	// 				IdentityClientID: to.Ptr("ceaa6b06-c00f-43ef-99ac-f53d1fe876a0"),
	// 				SecretIdentifier: to.Ptr("https://contoso.vault.azure.net/secrets/aadSecret"),
	// 				LastStatus: &armapimanagement.KeyVaultLastAccessStatusContractProperties{
	// 					Code: to.Ptr("Success"),
	// 					TimeStampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-11T00:54:31.8024882Z"); return t}()),
	// 				},
	// 			},
	// 		},
	// 	}
}
Output:

func (*NamedValueClient) BeginRefreshSecret

func (client *NamedValueClient) BeginRefreshSecret(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientBeginRefreshSecretOptions) (*runtime.Poller[NamedValueClientRefreshSecretResponse], error)

BeginRefreshSecret - Refresh the secret of the named value specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • namedValueID - Identifier of the NamedValue.
  • options - NamedValueClientBeginRefreshSecretOptions contains the optional parameters for the NamedValueClient.BeginRefreshSecret method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRefreshNamedValue.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewNamedValueClient().BeginRefreshSecret(ctx, "rg1", "apimService1", "testprop2", 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.NamedValueContract = armapimanagement.NamedValueContract{
	// 	Name: to.Ptr("testprop6"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/namedValues"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6"),
	// 	Properties: &armapimanagement.NamedValueContractProperties{
	// 		Secret: to.Ptr(true),
	// 		Tags: []*string{
	// 			to.Ptr("foo"),
	// 			to.Ptr("bar")},
	// 			DisplayName: to.Ptr("prop6namekv"),
	// 			KeyVault: &armapimanagement.KeyVaultContractProperties{
	// 				IdentityClientID: to.Ptr("2d2df842-44d8-4885-8dec-77cc1a984a31"),
	// 				SecretIdentifier: to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
	// 				LastStatus: &armapimanagement.KeyVaultLastAccessStatusContractProperties{
	// 					Code: to.Ptr("Success"),
	// 					TimeStampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-11T00:54:31.8024882Z"); return t}()),
	// 				},
	// 			},
	// 		},
	// 	}
}
Output:

func (*NamedValueClient) BeginUpdate

func (client *NamedValueClient) BeginUpdate(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string, parameters NamedValueUpdateParameters, options *NamedValueClientBeginUpdateOptions) (*runtime.Poller[NamedValueClientUpdateResponse], error)

BeginUpdate - Updates the specific named value. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • namedValueID - Identifier of the NamedValue.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - NamedValueClientBeginUpdateOptions contains the optional parameters for the NamedValueClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateNamedValue.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewNamedValueClient().BeginUpdate(ctx, "rg1", "apimService1", "testprop2", "*", armapimanagement.NamedValueUpdateParameters{
		Properties: &armapimanagement.NamedValueUpdateParameterProperties{
			Secret: to.Ptr(false),
			Tags: []*string{
				to.Ptr("foo"),
				to.Ptr("bar2")},
			DisplayName: to.Ptr("prop3name"),
			Value:       to.Ptr("propValue"),
		},
	}, 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.NamedValueContract = armapimanagement.NamedValueContract{
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/namedValues"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop2"),
	// 	Properties: &armapimanagement.NamedValueContractProperties{
	// 		Secret: to.Ptr(false),
	// 		Tags: []*string{
	// 			to.Ptr("foo"),
	// 			to.Ptr("bar2")},
	// 			DisplayName: to.Ptr("prop3name"),
	// 			Value: to.Ptr("propValue"),
	// 		},
	// 	}
}
Output:

func (*NamedValueClient) Delete

func (client *NamedValueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string, options *NamedValueClientDeleteOptions) (NamedValueClientDeleteResponse, error)

Delete - Deletes specific named value from the API Management service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • namedValueID - Identifier of the NamedValue.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - NamedValueClientDeleteOptions contains the optional parameters for the NamedValueClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNamedValue.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*NamedValueClient) Get

func (client *NamedValueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientGetOptions) (NamedValueClientGetResponse, error)

Get - Gets the details of the named value specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • namedValueID - Identifier of the NamedValue.
  • options - NamedValueClientGetOptions contains the optional parameters for the NamedValueClient.Get method.
Example (ApiManagementGetNamedValue)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNamedValue.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNamedValueClient().Get(ctx, "rg1", "apimService1", "testarmTemplateproperties2", 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.NamedValueContract = armapimanagement.NamedValueContract{
	// 	Name: to.Ptr("testarmTemplateproperties2"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/namedValues"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testarmTemplateproperties2"),
	// 	Properties: &armapimanagement.NamedValueContractProperties{
	// 		Secret: to.Ptr(false),
	// 		Tags: []*string{
	// 			to.Ptr("foo"),
	// 			to.Ptr("bar")},
	// 			DisplayName: to.Ptr("propName"),
	// 			Value: to.Ptr("propValue"),
	// 		},
	// 	}
}
Output:

Example (ApiManagementGetNamedValueWithKeyVault)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNamedValueWithKeyVault.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNamedValueClient().Get(ctx, "rg1", "apimService1", "testprop6", 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.NamedValueContract = armapimanagement.NamedValueContract{
	// 	Name: to.Ptr("testprop6"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/namedValues"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6"),
	// 	Properties: &armapimanagement.NamedValueContractProperties{
	// 		Secret: to.Ptr(true),
	// 		Tags: []*string{
	// 			to.Ptr("foo"),
	// 			to.Ptr("bar")},
	// 			DisplayName: to.Ptr("prop6namekv"),
	// 			KeyVault: &armapimanagement.KeyVaultContractProperties{
	// 				IdentityClientID: to.Ptr("2d2df842-44d8-4885-8dec-77cc1a984a31"),
	// 				SecretIdentifier: to.Ptr("https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert"),
	// 				LastStatus: &armapimanagement.KeyVaultLastAccessStatusContractProperties{
	// 					Code: to.Ptr("Success"),
	// 					TimeStampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-11T00:54:31.8024882Z"); return t}()),
	// 				},
	// 			},
	// 		},
	// 	}
}
Output:

func (*NamedValueClient) GetEntityTag

func (client *NamedValueClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientGetEntityTagOptions) (NamedValueClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the named value specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • namedValueID - Identifier of the NamedValue.
  • options - NamedValueClientGetEntityTagOptions contains the optional parameters for the NamedValueClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNamedValue.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewNamedValueClient().GetEntityTag(ctx, "rg1", "apimService1", "testarmTemplateproperties2", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*NamedValueClient) ListValue

func (client *NamedValueClient) ListValue(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientListValueOptions) (NamedValueClientListValueResponse, error)

ListValue - Gets the secret of the named value specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • namedValueID - Identifier of the NamedValue.
  • options - NamedValueClientListValueOptions contains the optional parameters for the NamedValueClient.ListValue method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementNamedValueListValue.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNamedValueClient().ListValue(ctx, "rg1", "apimService1", "testarmTemplateproperties2", 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.NamedValueSecretContract = armapimanagement.NamedValueSecretContract{
	// 	Value: to.Ptr("propValue"),
	// }
}
Output:

func (*NamedValueClient) NewListByServicePager added in v0.5.0

func (client *NamedValueClient) NewListByServicePager(resourceGroupName string, serviceName string, options *NamedValueClientListByServiceOptions) *runtime.Pager[NamedValueClientListByServiceResponse]

NewListByServicePager - Lists a collection of named values defined within a service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - NamedValueClientListByServiceOptions contains the optional parameters for the NamedValueClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNamedValues.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewNamedValueClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.NamedValueClientListByServiceOptions{Filter: nil,
		Top:                     nil,
		Skip:                    nil,
		IsKeyVaultRefreshFailed: 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.NamedValueCollection = armapimanagement.NamedValueCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.NamedValueContract{
		// 		{
		// 			Name: to.Ptr("592f1174cc83890dc4f32686"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/namedValues"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/592f1174cc83890dc4f32686"),
		// 			Properties: &armapimanagement.NamedValueContractProperties{
		// 				Secret: to.Ptr(false),
		// 				DisplayName: to.Ptr("Logger-Credentials-592f1174cc83890dc4f32687"),
		// 				Value: to.Ptr("propValue"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("testprop6"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/namedValues"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6"),
		// 			Properties: &armapimanagement.NamedValueContractProperties{
		// 				Secret: to.Ptr(true),
		// 				Tags: []*string{
		// 					to.Ptr("foo"),
		// 					to.Ptr("bar")},
		// 					DisplayName: to.Ptr("prop6namekv"),
		// 					KeyVault: &armapimanagement.KeyVaultContractProperties{
		// 						IdentityClientID: to.Ptr("2d2df842-44d8-4885-8dec-77cc1a984a31"),
		// 						SecretIdentifier: to.Ptr("https://contoso.vault.azure.net/secrets/aadSecret"),
		// 						LastStatus: &armapimanagement.KeyVaultLastAccessStatusContractProperties{
		// 							Code: to.Ptr("Success"),
		// 							TimeStampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-11T00:54:31.8024882Z"); return t}()),
		// 						},
		// 					},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

type NamedValueClientBeginCreateOrUpdateOptions added in v0.3.0

type NamedValueClientBeginCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
	// Resumes the LRO from the provided token.
	ResumeToken string
}

NamedValueClientBeginCreateOrUpdateOptions contains the optional parameters for the NamedValueClient.BeginCreateOrUpdate method.

type NamedValueClientBeginRefreshSecretOptions added in v0.3.0

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

NamedValueClientBeginRefreshSecretOptions contains the optional parameters for the NamedValueClient.BeginRefreshSecret method.

type NamedValueClientBeginUpdateOptions added in v0.3.0

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

NamedValueClientBeginUpdateOptions contains the optional parameters for the NamedValueClient.BeginUpdate method.

type NamedValueClientCreateOrUpdateResponse added in v0.3.0

type NamedValueClientCreateOrUpdateResponse struct {
	NamedValueContract
}

NamedValueClientCreateOrUpdateResponse contains the response from method NamedValueClient.BeginCreateOrUpdate.

type NamedValueClientDeleteOptions added in v0.3.0

type NamedValueClientDeleteOptions struct {
}

NamedValueClientDeleteOptions contains the optional parameters for the NamedValueClient.Delete method.

type NamedValueClientDeleteResponse added in v0.3.0

type NamedValueClientDeleteResponse struct {
}

NamedValueClientDeleteResponse contains the response from method NamedValueClient.Delete.

type NamedValueClientGetEntityTagOptions added in v0.3.0

type NamedValueClientGetEntityTagOptions struct {
}

NamedValueClientGetEntityTagOptions contains the optional parameters for the NamedValueClient.GetEntityTag method.

type NamedValueClientGetEntityTagResponse added in v0.3.0

type NamedValueClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

NamedValueClientGetEntityTagResponse contains the response from method NamedValueClient.GetEntityTag.

type NamedValueClientGetOptions added in v0.3.0

type NamedValueClientGetOptions struct {
}

NamedValueClientGetOptions contains the optional parameters for the NamedValueClient.Get method.

type NamedValueClientGetResponse added in v0.3.0

type NamedValueClientGetResponse struct {
	NamedValueContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

NamedValueClientGetResponse contains the response from method NamedValueClient.Get.

type NamedValueClientListByServiceOptions added in v0.3.0

type NamedValueClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// When set to true, the response contains only named value entities which failed refresh.
	IsKeyVaultRefreshFailed *bool
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

NamedValueClientListByServiceOptions contains the optional parameters for the NamedValueClient.NewListByServicePager method.

type NamedValueClientListByServiceResponse added in v0.3.0

type NamedValueClientListByServiceResponse struct {
	NamedValueCollection
}

NamedValueClientListByServiceResponse contains the response from method NamedValueClient.NewListByServicePager.

type NamedValueClientListValueOptions added in v0.3.0

type NamedValueClientListValueOptions struct {
}

NamedValueClientListValueOptions contains the optional parameters for the NamedValueClient.ListValue method.

type NamedValueClientListValueResponse added in v0.3.0

type NamedValueClientListValueResponse struct {
	NamedValueSecretContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

NamedValueClientListValueResponse contains the response from method NamedValueClient.ListValue.

type NamedValueClientRefreshSecretResponse added in v0.3.0

type NamedValueClientRefreshSecretResponse struct {
	NamedValueContract
}

NamedValueClientRefreshSecretResponse contains the response from method NamedValueClient.BeginRefreshSecret.

type NamedValueClientUpdateResponse added in v0.3.0

type NamedValueClientUpdateResponse struct {
	NamedValueContract
}

NamedValueClientUpdateResponse contains the response from method NamedValueClient.BeginUpdate.

type NamedValueCollection

type NamedValueCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*NamedValueContract
}

NamedValueCollection - Paged NamedValue list representation.

func (NamedValueCollection) MarshalJSON

func (n NamedValueCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NamedValueCollection.

func (*NamedValueCollection) UnmarshalJSON added in v1.1.0

func (n *NamedValueCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCollection.

type NamedValueContract

type NamedValueContract struct {
	// NamedValue entity contract properties.
	Properties *NamedValueContractProperties

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

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

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

NamedValueContract - NamedValue details.

func (NamedValueContract) MarshalJSON

func (n NamedValueContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NamedValueContract.

func (*NamedValueContract) UnmarshalJSON added in v1.1.0

func (n *NamedValueContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueContract.

type NamedValueContractProperties

type NamedValueContractProperties struct {
	// REQUIRED; Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.
	DisplayName *string

	// KeyVault location details of the namedValue.
	KeyVault *KeyVaultContractProperties

	// Determines whether the value is a secret and should be encrypted or not. Default value is false.
	Secret *bool

	// Optional tags that when provided can be used to filter the NamedValue list.
	Tags []*string

	// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property
	// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get
	// the value.
	Value *string
}

NamedValueContractProperties - NamedValue Contract properties.

func (NamedValueContractProperties) MarshalJSON

func (n NamedValueContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NamedValueContractProperties.

func (*NamedValueContractProperties) UnmarshalJSON added in v1.1.0

func (n *NamedValueContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueContractProperties.

type NamedValueCreateContract

type NamedValueCreateContract struct {
	// NamedValue entity contract properties for PUT operation.
	Properties *NamedValueCreateContractProperties

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

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

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

NamedValueCreateContract - NamedValue details.

func (NamedValueCreateContract) MarshalJSON

func (n NamedValueCreateContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NamedValueCreateContract.

func (*NamedValueCreateContract) UnmarshalJSON added in v1.1.0

func (n *NamedValueCreateContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCreateContract.

type NamedValueCreateContractProperties

type NamedValueCreateContractProperties struct {
	// REQUIRED; Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.
	DisplayName *string

	// KeyVault location details of the namedValue.
	KeyVault *KeyVaultContractCreateProperties

	// Determines whether the value is a secret and should be encrypted or not. Default value is false.
	Secret *bool

	// Optional tags that when provided can be used to filter the NamedValue list.
	Tags []*string

	// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property
	// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get
	// the value.
	Value *string
}

NamedValueCreateContractProperties - NamedValue Contract properties.

func (NamedValueCreateContractProperties) MarshalJSON

func (n NamedValueCreateContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NamedValueCreateContractProperties.

func (*NamedValueCreateContractProperties) UnmarshalJSON added in v1.1.0

func (n *NamedValueCreateContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCreateContractProperties.

type NamedValueEntityBaseParameters

type NamedValueEntityBaseParameters struct {
	// Determines whether the value is a secret and should be encrypted or not. Default value is false.
	Secret *bool

	// Optional tags that when provided can be used to filter the NamedValue list.
	Tags []*string
}

NamedValueEntityBaseParameters - NamedValue Entity Base Parameters set.

func (NamedValueEntityBaseParameters) MarshalJSON

func (n NamedValueEntityBaseParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NamedValueEntityBaseParameters.

func (*NamedValueEntityBaseParameters) UnmarshalJSON added in v1.1.0

func (n *NamedValueEntityBaseParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueEntityBaseParameters.

type NamedValueSecretContract

type NamedValueSecretContract struct {
	// This is secret value of the NamedValue entity.
	Value *string
}

NamedValueSecretContract - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth.

func (NamedValueSecretContract) MarshalJSON added in v1.1.0

func (n NamedValueSecretContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NamedValueSecretContract.

func (*NamedValueSecretContract) UnmarshalJSON added in v1.1.0

func (n *NamedValueSecretContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueSecretContract.

type NamedValueUpdateParameterProperties

type NamedValueUpdateParameterProperties struct {
	// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.
	DisplayName *string

	// KeyVault location details of the namedValue.
	KeyVault *KeyVaultContractCreateProperties

	// Determines whether the value is a secret and should be encrypted or not. Default value is false.
	Secret *bool

	// Optional tags that when provided can be used to filter the NamedValue list.
	Tags []*string

	// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace.
	Value *string
}

NamedValueUpdateParameterProperties - NamedValue Contract properties.

func (NamedValueUpdateParameterProperties) MarshalJSON

func (n NamedValueUpdateParameterProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NamedValueUpdateParameterProperties.

func (*NamedValueUpdateParameterProperties) UnmarshalJSON added in v1.1.0

func (n *NamedValueUpdateParameterProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueUpdateParameterProperties.

type NamedValueUpdateParameters

type NamedValueUpdateParameters struct {
	// NamedValue entity Update contract properties.
	Properties *NamedValueUpdateParameterProperties
}

NamedValueUpdateParameters - NamedValue update Parameters.

func (NamedValueUpdateParameters) MarshalJSON

func (n NamedValueUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NamedValueUpdateParameters.

func (*NamedValueUpdateParameters) UnmarshalJSON added in v1.1.0

func (n *NamedValueUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueUpdateParameters.

type NetworkStatusClient

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

NetworkStatusClient contains the methods for the NetworkStatus group. Don't use this type directly, use NewNetworkStatusClient() instead.

func NewNetworkStatusClient

func NewNetworkStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkStatusClient, error)

NewNetworkStatusClient creates a new instance of NetworkStatusClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*NetworkStatusClient) ListByLocation

func (client *NetworkStatusClient) ListByLocation(ctx context.Context, resourceGroupName string, serviceName string, locationName string, options *NetworkStatusClientListByLocationOptions) (NetworkStatusClientListByLocationResponse, error)

ListByLocation - Gets the Connectivity Status to the external resources on which the Api Management service depends from inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • locationName - Location in which the API Management service is deployed. This is one of the Azure Regions like West US, East US, South Central US.
  • options - NetworkStatusClientListByLocationOptions contains the optional parameters for the NetworkStatusClient.ListByLocation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetNetworkStatusByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNetworkStatusClient().ListByLocation(ctx, "rg1", "apimService1", "North Central US", 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.NetworkStatusContract = armapimanagement.NetworkStatusContract{
	// 	ConnectivityStatus: []*armapimanagement.ConnectivityStatusContract{
	// 		{
	// 			Name: to.Ptr("apimgmtst6tnxxxxxxxxxxx.blob.core.windows.net"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(false),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.9365931Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:14.7035899Z"); return t}()),
	// 			ResourceType: to.Ptr("BlobStorage"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("apimgmtst6tnxxxxxxxxxxx.file.core.windows.net"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(true),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.9265938Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:41.5322463Z"); return t}()),
	// 			ResourceType: to.Ptr("FileStorage"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("apimgmtst6tnxxxxxxxxxxx.queue.core.windows.net"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(true),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.8410477Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:30.645994Z"); return t}()),
	// 			ResourceType: to.Ptr("Queue"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("apimgmtst6tnxxxxxxxxxxx.table.core.windows.net"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(false),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.9365931Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:23.8789171Z"); return t}()),
	// 			ResourceType: to.Ptr("TableStorage"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("gcs.prod.monitoring.core.windows.net"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(true),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T08:07:37.5486932Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:57:34.8666833Z"); return t}()),
	// 			ResourceType: to.Ptr("Monitoring"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("https://gcs.ppe.warm.ingestion.monitoring.azure.com"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(true),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.1060523Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:56:26.1870188Z"); return t}()),
	// 			ResourceType: to.Ptr("Monitoring"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("https://global.metrics.nsatc.net/"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(true),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.0510519Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:56:35.9620612Z"); return t}()),
	// 			ResourceType: to.Ptr("Monitoring"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("https://login.windows.net"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(true),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.1060523Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:56:30.8047708Z"); return t}()),
	// 			ResourceType: to.Ptr("AzureActiveDirectory"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("https://prod2.metrics.nsatc.net:1886/RecoveryService"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(true),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.2796235Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:56:45.2095302Z"); return t}()),
	// 			ResourceType: to.Ptr("Metrics"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("LocalGatewayRedis"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(true),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.9365931Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:15.1345836Z"); return t}()),
	// 			ResourceType: to.Ptr("InternalCache"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("prod.warmpath.msftcloudes.com"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(false),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.8410477Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:57.8992141Z"); return t}()),
	// 			ResourceType: to.Ptr("Monitoring"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("Scm"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(true),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:57.325384Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T23:03:57.6187917Z"); return t}()),
	// 			ResourceType: to.Ptr("SourceControl"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("smtpi-xxx.msn.com:25028"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(true),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.3510577Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:58:22.2430074Z"); return t}()),
	// 			ResourceType: to.Ptr("Email"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 		},
	// 		{
	// 			Name: to.Ptr("zwcvuxxxx.database.windows.net"),
	// 			Error: to.Ptr(""),
	// 			IsOptional: to.Ptr(false),
	// 			LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.0410467Z"); return t}()),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:44.3582171Z"); return t}()),
	// 			ResourceType: to.Ptr("SQLDatabase"),
	// 			Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 	}},
	// 	DNSServers: []*string{
	// 		to.Ptr("10.82.98.10")},
	// 	}
}
Output:

func (*NetworkStatusClient) ListByService

func (client *NetworkStatusClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *NetworkStatusClientListByServiceOptions) (NetworkStatusClientListByServiceResponse, error)

ListByService - Gets the Connectivity Status to the external resources on which the Api Management service depends from inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - NetworkStatusClientListByServiceOptions contains the optional parameters for the NetworkStatusClient.ListByService method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetNetworkStatus.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNetworkStatusClient().ListByService(ctx, "rg1", "apimService1", 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.NetworkStatusContractByLocationArray = []*armapimanagement.NetworkStatusContractByLocation{
	// 	{
	// 		Location: to.Ptr("West US"),
	// 		NetworkStatus: &armapimanagement.NetworkStatusContract{
	// 			ConnectivityStatus: []*armapimanagement.ConnectivityStatusContract{
	// 				{
	// 					Name: to.Ptr("apimgmtst6xxxxxxxxxxx.blob.core.windows.net"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(false),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.9365931Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:14.7035899Z"); return t}()),
	// 					ResourceType: to.Ptr("BlobStorage"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("apimgmtst6xxxxxxxxxxx.file.core.windows.net"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(true),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.9265938Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:41.5322463Z"); return t}()),
	// 					ResourceType: to.Ptr("FileStorage"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("apimgmtst6xxxxxxxxxxx.queue.core.windows.net"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(true),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.8410477Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:30.645994Z"); return t}()),
	// 					ResourceType: to.Ptr("Queue"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("apimgmtst6xxxxxxxxxxx.table.core.windows.net"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(false),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.9365931Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:23.8789171Z"); return t}()),
	// 					ResourceType: to.Ptr("TableStorage"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("gcs.prod.monitoring.core.windows.net"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(true),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T08:07:37.5486932Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:57:34.8666833Z"); return t}()),
	// 					ResourceType: to.Ptr("Monitoring"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("https://gcs.ppe.warm.ingestion.monitoring.azure.com"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(true),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.1060523Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:56:26.1870188Z"); return t}()),
	// 					ResourceType: to.Ptr("Monitoring"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("https://global.metrics.nsatc.net/"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(true),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.0510519Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:56:35.9620612Z"); return t}()),
	// 					ResourceType: to.Ptr("Monitoring"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("https://login.windows.net"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(true),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.1060523Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:56:30.8047708Z"); return t}()),
	// 					ResourceType: to.Ptr("AzureActiveDirectory"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("https://prod2.metrics.nsatc.net:1886/RecoveryService"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(true),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.2796235Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:56:45.2095302Z"); return t}()),
	// 					ResourceType: to.Ptr("Metrics"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("LocalGatewayRedis"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(true),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.9365931Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:15.1345836Z"); return t}()),
	// 					ResourceType: to.Ptr("InternalCache"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("prod.warmpath.msftcloudes.com"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(false),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:55.8410477Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:57.8992141Z"); return t}()),
	// 					ResourceType: to.Ptr("Monitoring"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("Scm"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(true),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-20T02:25:48.7066996Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T23:01:24.0553684Z"); return t}()),
	// 					ResourceType: to.Ptr("SourceControl"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("smtpi-ch1.msn.com:25028"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(true),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.3510577Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:58:22.2430074Z"); return t}()),
	// 					ResourceType: to.Ptr("Email"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 				},
	// 				{
	// 					Name: to.Ptr("zwcvuxxxx.database.windows.net"),
	// 					Error: to.Ptr(""),
	// 					IsOptional: to.Ptr(false),
	// 					LastStatusChange: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-20T07:54:56.0410467Z"); return t}()),
	// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-24T22:55:44.3582171Z"); return t}()),
	// 					ResourceType: to.Ptr("SQLDatabase"),
	// 					Status: to.Ptr(armapimanagement.ConnectivityStatusTypeSuccess),
	// 			}},
	// 			DNSServers: []*string{
	// 				to.Ptr("10.82.98.10")},
	// 			},
	// 	}}
}
Output:

type NetworkStatusClientListByLocationOptions added in v0.3.0

type NetworkStatusClientListByLocationOptions struct {
}

NetworkStatusClientListByLocationOptions contains the optional parameters for the NetworkStatusClient.ListByLocation method.

type NetworkStatusClientListByLocationResponse added in v0.3.0

type NetworkStatusClientListByLocationResponse struct {
	NetworkStatusContract
}

NetworkStatusClientListByLocationResponse contains the response from method NetworkStatusClient.ListByLocation.

type NetworkStatusClientListByServiceOptions added in v0.3.0

type NetworkStatusClientListByServiceOptions struct {
}

NetworkStatusClientListByServiceOptions contains the optional parameters for the NetworkStatusClient.ListByService method.

type NetworkStatusClientListByServiceResponse added in v0.3.0

type NetworkStatusClientListByServiceResponse struct {
	// List of Network Status values.
	NetworkStatusContractByLocationArray []*NetworkStatusContractByLocation
}

NetworkStatusClientListByServiceResponse contains the response from method NetworkStatusClient.ListByService.

type NetworkStatusContract

type NetworkStatusContract struct {
	// REQUIRED; Gets the list of Connectivity Status to the Resources on which the service depends upon.
	ConnectivityStatus []*ConnectivityStatusContract

	// REQUIRED; Gets the list of DNS servers IPV4 addresses.
	DNSServers []*string
}

NetworkStatusContract - Network Status details.

func (NetworkStatusContract) MarshalJSON

func (n NetworkStatusContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkStatusContract.

func (*NetworkStatusContract) UnmarshalJSON added in v1.1.0

func (n *NetworkStatusContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkStatusContract.

type NetworkStatusContractByLocation

type NetworkStatusContractByLocation struct {
	// Location of service
	Location *string

	// Network status in Location
	NetworkStatus *NetworkStatusContract
}

NetworkStatusContractByLocation - Network Status in the Location

func (NetworkStatusContractByLocation) MarshalJSON added in v1.1.0

func (n NetworkStatusContractByLocation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkStatusContractByLocation.

func (*NetworkStatusContractByLocation) UnmarshalJSON added in v1.1.0

func (n *NetworkStatusContractByLocation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkStatusContractByLocation.

type NotificationClient

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

NotificationClient contains the methods for the Notification group. Don't use this type directly, use NewNotificationClient() instead.

func NewNotificationClient

func NewNotificationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotificationClient, error)

NewNotificationClient creates a new instance of NotificationClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*NotificationClient) CreateOrUpdate

func (client *NotificationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, options *NotificationClientCreateOrUpdateOptions) (NotificationClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or Update API Management publisher notification. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • notificationName - Notification Name Identifier.
  • options - NotificationClientCreateOrUpdateOptions contains the optional parameters for the NotificationClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotification.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNotificationClient().CreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.NotificationNameRequestPublisherNotificationMessage, &armapimanagement.NotificationClientCreateOrUpdateOptions{IfMatch: 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.NotificationContract = armapimanagement.NotificationContract{
	// 	Name: to.Ptr("RequestPublisherNotificationMessage"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/notifications"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage"),
	// 	Properties: &armapimanagement.NotificationContractProperties{
	// 		Description: to.Ptr("The following email recipients and users will receive email notifications about subscription requests for API products requiring approval."),
	// 		Recipients: &armapimanagement.RecipientsContractProperties{
	// 			Emails: []*string{
	// 				to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/recipientEmails/contoso@live.com"),
	// 				to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/recipientEmails/foobar!live"),
	// 				to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/recipientEmails/foobar@live.com")},
	// 				Users: []*string{
	// 					to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/576823d0a40f7e74ec07d642")},
	// 				},
	// 				Title: to.Ptr("Subscription requests (requiring approval)"),
	// 			},
	// 		}
}
Output:

func (*NotificationClient) Get

func (client *NotificationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, options *NotificationClientGetOptions) (NotificationClientGetResponse, error)

Get - Gets the details of the Notification specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • notificationName - Notification Name Identifier.
  • options - NotificationClientGetOptions contains the optional parameters for the NotificationClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNotification.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNotificationClient().Get(ctx, "rg1", "apimService1", armapimanagement.NotificationNameRequestPublisherNotificationMessage, 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.NotificationContract = armapimanagement.NotificationContract{
	// 	Name: to.Ptr("RequestPublisherNotificationMessage"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/notifications"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage"),
	// 	Properties: &armapimanagement.NotificationContractProperties{
	// 		Description: to.Ptr("The following email recipients and users will receive email notifications about subscription requests for API products requiring approval."),
	// 		Recipients: &armapimanagement.RecipientsContractProperties{
	// 			Emails: []*string{
	// 				to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/recipientEmails/contoso@live.com"),
	// 				to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/recipientEmails/foobar!live"),
	// 				to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/recipientEmails/foobar@live.com")},
	// 				Users: []*string{
	// 					to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/576823d0a40f7e74ec07d642")},
	// 				},
	// 				Title: to.Ptr("Subscription requests (requiring approval)"),
	// 			},
	// 		}
}
Output:

func (*NotificationClient) NewListByServicePager added in v0.5.0

func (client *NotificationClient) NewListByServicePager(resourceGroupName string, serviceName string, options *NotificationClientListByServiceOptions) *runtime.Pager[NotificationClientListByServiceResponse]

NewListByServicePager - Lists a collection of properties defined within a service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - NotificationClientListByServiceOptions contains the optional parameters for the NotificationClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotifications.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewNotificationClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.NotificationClientListByServiceOptions{Top: nil,
		Skip: 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.NotificationCollection = armapimanagement.NotificationCollection{
		// 	Count: to.Ptr[int64](7),
		// 	Value: []*armapimanagement.NotificationContract{
		// 		{
		// 			Name: to.Ptr("RequestPublisherNotificationMessage"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/notifications"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage"),
		// 			Properties: &armapimanagement.NotificationContractProperties{
		// 				Description: to.Ptr("The following email recipients and users will receive email notifications about subscription requests for API products requiring approval."),
		// 				Recipients: &armapimanagement.RecipientsContractProperties{
		// 					Emails: []*string{
		// 						to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientEmails/contoso@live.com"),
		// 						to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientEmails/foobar!live"),
		// 						to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientEmails/foobar@live.com")},
		// 						Users: []*string{
		// 							to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/576823d0a40f7e74ec07d642")},
		// 						},
		// 						Title: to.Ptr("Subscription requests (requiring approval)"),
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("PurchasePublisherNotificationMessage"),
		// 					Type: to.Ptr("Microsoft.ApiManagement/service/notifications"),
		// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/PurchasePublisherNotificationMessage"),
		// 					Properties: &armapimanagement.NotificationContractProperties{
		// 						Description: to.Ptr("The following email recipients and users will receive email notifications about new API product subscriptions."),
		// 						Recipients: &armapimanagement.RecipientsContractProperties{
		// 							Emails: []*string{
		// 								to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientEmails/contoso@live.com")},
		// 								Users: []*string{
		// 									to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1")},
		// 								},
		// 								Title: to.Ptr("New subscriptions"),
		// 							},
		// 						},
		// 						{
		// 							Name: to.Ptr("NewApplicationNotificationMessage"),
		// 							Type: to.Ptr("Microsoft.ApiManagement/service/notifications"),
		// 							ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/NewApplicationNotificationMessage"),
		// 							Properties: &armapimanagement.NotificationContractProperties{
		// 								Description: to.Ptr("The following email recipients and users will receive email notifications when new applications are submitted to the application gallery."),
		// 								Recipients: &armapimanagement.RecipientsContractProperties{
		// 									Emails: []*string{
		// 										to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientEmails/contoso@live.com")},
		// 										Users: []*string{
		// 										},
		// 									},
		// 									Title: to.Ptr("Application gallery requests"),
		// 								},
		// 							},
		// 							{
		// 								Name: to.Ptr("BCC"),
		// 								Type: to.Ptr("Microsoft.ApiManagement/service/notifications"),
		// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/BCC"),
		// 								Properties: &armapimanagement.NotificationContractProperties{
		// 									Description: to.Ptr("The following recipients will receive blind carbon copies of all emails sent to developers."),
		// 									Recipients: &armapimanagement.RecipientsContractProperties{
		// 										Emails: []*string{
		// 										},
		// 										Users: []*string{
		// 										},
		// 									},
		// 									Title: to.Ptr("BCC"),
		// 								},
		// 							},
		// 							{
		// 								Name: to.Ptr("NewIssuePublisherNotificationMessage"),
		// 								Type: to.Ptr("Microsoft.ApiManagement/service/notifications"),
		// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/NewIssuePublisherNotificationMessage"),
		// 								Properties: &armapimanagement.NotificationContractProperties{
		// 									Description: to.Ptr("The following email recipients and users will receive email notifications when a new issue or comment is submitted on the developer portal."),
		// 									Recipients: &armapimanagement.RecipientsContractProperties{
		// 										Emails: []*string{
		// 										},
		// 										Users: []*string{
		// 											to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1")},
		// 										},
		// 										Title: to.Ptr("New issue or comment"),
		// 									},
		// 								},
		// 								{
		// 									Name: to.Ptr("AccountClosedPublisher"),
		// 									Type: to.Ptr("Microsoft.ApiManagement/service/notifications"),
		// 									ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/AccountClosedPublisher"),
		// 									Properties: &armapimanagement.NotificationContractProperties{
		// 										Description: to.Ptr("The following email recipients and users will receive email notifications when developer closes his account"),
		// 										Recipients: &armapimanagement.RecipientsContractProperties{
		// 											Emails: []*string{
		// 												to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientEmails/contoso@live.com")},
		// 												Users: []*string{
		// 												},
		// 											},
		// 											Title: to.Ptr("Close account message"),
		// 										},
		// 									},
		// 									{
		// 										Name: to.Ptr("QuotaLimitApproachingPublisherNotificationMessage"),
		// 										Type: to.Ptr("Microsoft.ApiManagement/service/notifications"),
		// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/QuotaLimitApproachingPublisherNotificationMessage"),
		// 										Properties: &armapimanagement.NotificationContractProperties{
		// 											Description: to.Ptr("The following email recipients and users will receive email notifications when subscription usage gets close to usage quota."),
		// 											Recipients: &armapimanagement.RecipientsContractProperties{
		// 												Emails: []*string{
		// 												},
		// 												Users: []*string{
		// 													to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1")},
		// 												},
		// 												Title: to.Ptr("Approaching subscription quota limit"),
		// 											},
		// 									}},
		// 								}
	}
}
Output:

type NotificationClientCreateOrUpdateOptions added in v0.3.0

type NotificationClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

NotificationClientCreateOrUpdateOptions contains the optional parameters for the NotificationClient.CreateOrUpdate method.

type NotificationClientCreateOrUpdateResponse added in v0.3.0

type NotificationClientCreateOrUpdateResponse struct {
	NotificationContract
}

NotificationClientCreateOrUpdateResponse contains the response from method NotificationClient.CreateOrUpdate.

type NotificationClientGetOptions added in v0.3.0

type NotificationClientGetOptions struct {
}

NotificationClientGetOptions contains the optional parameters for the NotificationClient.Get method.

type NotificationClientGetResponse added in v0.3.0

type NotificationClientGetResponse struct {
	NotificationContract
}

NotificationClientGetResponse contains the response from method NotificationClient.Get.

type NotificationClientListByServiceOptions added in v0.3.0

type NotificationClientListByServiceOptions struct {
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

NotificationClientListByServiceOptions contains the optional parameters for the NotificationClient.NewListByServicePager method.

type NotificationClientListByServiceResponse added in v0.3.0

type NotificationClientListByServiceResponse struct {
	NotificationCollection
}

NotificationClientListByServiceResponse contains the response from method NotificationClient.NewListByServicePager.

type NotificationCollection

type NotificationCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*NotificationContract
}

NotificationCollection - Paged Notification list representation.

func (NotificationCollection) MarshalJSON

func (n NotificationCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotificationCollection.

func (*NotificationCollection) UnmarshalJSON added in v1.1.0

func (n *NotificationCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotificationCollection.

type NotificationContract

type NotificationContract struct {
	// Notification entity contract properties.
	Properties *NotificationContractProperties

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

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

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

NotificationContract - Notification details.

func (NotificationContract) MarshalJSON

func (n NotificationContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotificationContract.

func (*NotificationContract) UnmarshalJSON added in v1.1.0

func (n *NotificationContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotificationContract.

type NotificationContractProperties

type NotificationContractProperties struct {
	// REQUIRED; Title of the Notification.
	Title *string

	// Description of the Notification.
	Description *string

	// Recipient Parameter values.
	Recipients *RecipientsContractProperties
}

NotificationContractProperties - Notification Contract properties.

func (NotificationContractProperties) MarshalJSON added in v1.1.0

func (n NotificationContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotificationContractProperties.

func (*NotificationContractProperties) UnmarshalJSON added in v1.1.0

func (n *NotificationContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotificationContractProperties.

type NotificationName

type NotificationName string
const (
	// NotificationNameAccountClosedPublisher - The following email recipients and users will receive email notifications when
	// developer closes his account.
	NotificationNameAccountClosedPublisher NotificationName = "AccountClosedPublisher"
	// NotificationNameBCC - The following recipients will receive blind carbon copies of all emails sent to developers.
	NotificationNameBCC NotificationName = "BCC"
	// NotificationNameNewApplicationNotificationMessage - The following email recipients and users will receive email notifications
	// when new applications are submitted to the application gallery.
	NotificationNameNewApplicationNotificationMessage NotificationName = "NewApplicationNotificationMessage"
	// NotificationNameNewIssuePublisherNotificationMessage - The following email recipients and users will receive email notifications
	// when a new issue or comment is submitted on the developer portal.
	NotificationNameNewIssuePublisherNotificationMessage NotificationName = "NewIssuePublisherNotificationMessage"
	// NotificationNamePurchasePublisherNotificationMessage - The following email recipients and users will receive email notifications
	// about new API product subscriptions.
	NotificationNamePurchasePublisherNotificationMessage NotificationName = "PurchasePublisherNotificationMessage"
	// NotificationNameQuotaLimitApproachingPublisherNotificationMessage - The following email recipients and users will receive
	// email notifications when subscription usage gets close to usage quota.
	NotificationNameQuotaLimitApproachingPublisherNotificationMessage NotificationName = "QuotaLimitApproachingPublisherNotificationMessage"
	// NotificationNameRequestPublisherNotificationMessage - The following email recipients and users will receive email notifications
	// about subscription requests for API products requiring approval.
	NotificationNameRequestPublisherNotificationMessage NotificationName = "RequestPublisherNotificationMessage"
)

func PossibleNotificationNameValues

func PossibleNotificationNameValues() []NotificationName

PossibleNotificationNameValues returns the possible values for the NotificationName const type.

type NotificationRecipientEmailClient

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

NotificationRecipientEmailClient contains the methods for the NotificationRecipientEmail group. Don't use this type directly, use NewNotificationRecipientEmailClient() instead.

func NewNotificationRecipientEmailClient

func NewNotificationRecipientEmailClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotificationRecipientEmailClient, error)

NewNotificationRecipientEmailClient creates a new instance of NotificationRecipientEmailClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*NotificationRecipientEmailClient) CheckEntityExists

CheckEntityExists - Determine if Notification Recipient Email subscribed to the notification.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • notificationName - Notification Name Identifier.
  • email - Email identifier.
  • options - NotificationRecipientEmailClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientEmailClient.CheckEntityExists method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNotificationRecipientEmail.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewNotificationRecipientEmailClient().CheckEntityExists(ctx, "rg1", "apimService1", armapimanagement.NotificationNameRequestPublisherNotificationMessage, "contoso@live.com", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*NotificationRecipientEmailClient) CreateOrUpdate

CreateOrUpdate - Adds the Email address to the list of Recipients for the Notification. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • notificationName - Notification Name Identifier.
  • email - Email identifier.
  • options - NotificationRecipientEmailClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientEmailClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotificationRecipientEmail.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNotificationRecipientEmailClient().CreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.NotificationNameRequestPublisherNotificationMessage, "foobar@live.com", 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.RecipientEmailContract = armapimanagement.RecipientEmailContract{
	// 	Name: to.Ptr("foobar@live.com"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/notifications/recipientEmails"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientEmails/foobar@live.com"),
	// 	Properties: &armapimanagement.RecipientEmailContractProperties{
	// 		Email: to.Ptr("foobar@live.com"),
	// 	},
	// }
}
Output:

func (*NotificationRecipientEmailClient) Delete

Delete - Removes the email from the list of Notification. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • notificationName - Notification Name Identifier.
  • email - Email identifier.
  • options - NotificationRecipientEmailClientDeleteOptions contains the optional parameters for the NotificationRecipientEmailClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNotificationRecipientEmail.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewNotificationRecipientEmailClient().Delete(ctx, "rg1", "apimService1", armapimanagement.NotificationNameRequestPublisherNotificationMessage, "contoso@live.com", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*NotificationRecipientEmailClient) ListByNotification

ListByNotification - Gets the list of the Notification Recipient Emails subscribed to a notification. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • notificationName - Notification Name Identifier.
  • options - NotificationRecipientEmailClientListByNotificationOptions contains the optional parameters for the NotificationRecipientEmailClient.ListByNotification method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotificationRecipientEmails.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNotificationRecipientEmailClient().ListByNotification(ctx, "rg1", "apimService1", armapimanagement.NotificationNameRequestPublisherNotificationMessage, 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.RecipientEmailCollection = armapimanagement.RecipientEmailCollection{
	// 	Count: to.Ptr[int64](3),
	// 	Value: []*armapimanagement.RecipientEmailContract{
	// 		{
	// 			Name: to.Ptr("contoso@live.com"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/notifications/recipientEmails"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientEmails/contoso@live.com"),
	// 			Properties: &armapimanagement.RecipientEmailContractProperties{
	// 				Email: to.Ptr("contoso@live.com"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("foobar!live"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/notifications/recipientEmails"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientEmails/foobar!live"),
	// 			Properties: &armapimanagement.RecipientEmailContractProperties{
	// 				Email: to.Ptr("foobar!live"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("foobar@live.com"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/notifications/recipientEmails"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientEmails/foobar@live.com"),
	// 			Properties: &armapimanagement.RecipientEmailContractProperties{
	// 				Email: to.Ptr("foobar@live.com"),
	// 			},
	// 	}},
	// }
}
Output:

type NotificationRecipientEmailClientCheckEntityExistsOptions added in v0.3.0

type NotificationRecipientEmailClientCheckEntityExistsOptions struct {
}

NotificationRecipientEmailClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientEmailClient.CheckEntityExists method.

type NotificationRecipientEmailClientCheckEntityExistsResponse added in v0.3.0

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

NotificationRecipientEmailClientCheckEntityExistsResponse contains the response from method NotificationRecipientEmailClient.CheckEntityExists.

type NotificationRecipientEmailClientCreateOrUpdateOptions added in v0.3.0

type NotificationRecipientEmailClientCreateOrUpdateOptions struct {
}

NotificationRecipientEmailClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientEmailClient.CreateOrUpdate method.

type NotificationRecipientEmailClientCreateOrUpdateResponse added in v0.3.0

type NotificationRecipientEmailClientCreateOrUpdateResponse struct {
	RecipientEmailContract
}

NotificationRecipientEmailClientCreateOrUpdateResponse contains the response from method NotificationRecipientEmailClient.CreateOrUpdate.

type NotificationRecipientEmailClientDeleteOptions added in v0.3.0

type NotificationRecipientEmailClientDeleteOptions struct {
}

NotificationRecipientEmailClientDeleteOptions contains the optional parameters for the NotificationRecipientEmailClient.Delete method.

type NotificationRecipientEmailClientDeleteResponse added in v0.3.0

type NotificationRecipientEmailClientDeleteResponse struct {
}

NotificationRecipientEmailClientDeleteResponse contains the response from method NotificationRecipientEmailClient.Delete.

type NotificationRecipientEmailClientListByNotificationOptions added in v0.3.0

type NotificationRecipientEmailClientListByNotificationOptions struct {
}

NotificationRecipientEmailClientListByNotificationOptions contains the optional parameters for the NotificationRecipientEmailClient.ListByNotification method.

type NotificationRecipientEmailClientListByNotificationResponse added in v0.3.0

type NotificationRecipientEmailClientListByNotificationResponse struct {
	RecipientEmailCollection
}

NotificationRecipientEmailClientListByNotificationResponse contains the response from method NotificationRecipientEmailClient.ListByNotification.

type NotificationRecipientUserClient

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

NotificationRecipientUserClient contains the methods for the NotificationRecipientUser group. Don't use this type directly, use NewNotificationRecipientUserClient() instead.

func NewNotificationRecipientUserClient

func NewNotificationRecipientUserClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotificationRecipientUserClient, error)

NewNotificationRecipientUserClient creates a new instance of NotificationRecipientUserClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*NotificationRecipientUserClient) CheckEntityExists

CheckEntityExists - Determine if the Notification Recipient User is subscribed to the notification.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • notificationName - Notification Name Identifier.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - NotificationRecipientUserClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientUserClient.CheckEntityExists method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNotificationRecipientUser.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewNotificationRecipientUserClient().CheckEntityExists(ctx, "rg1", "apimService1", armapimanagement.NotificationNameRequestPublisherNotificationMessage, "576823d0a40f7e74ec07d642", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*NotificationRecipientUserClient) CreateOrUpdate

CreateOrUpdate - Adds the API Management User to the list of Recipients for the Notification. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • notificationName - Notification Name Identifier.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - NotificationRecipientUserClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientUserClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotificationRecipientUser.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNotificationRecipientUserClient().CreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.NotificationNameRequestPublisherNotificationMessage, "576823d0a40f7e74ec07d642", 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.RecipientUserContract = armapimanagement.RecipientUserContract{
	// 	Name: to.Ptr("576823d0a40f7e74ec07d642"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/notifications/recipientUsers"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientUsers/576823d0a40f7e74ec07d642"),
	// 	Properties: &armapimanagement.RecipientUsersContractProperties{
	// 		UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/576823d0a40f7e74ec07d642"),
	// 	},
	// }
}
Output:

func (*NotificationRecipientUserClient) Delete

Delete - Removes the API Management user from the list of Notification. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • notificationName - Notification Name Identifier.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - NotificationRecipientUserClientDeleteOptions contains the optional parameters for the NotificationRecipientUserClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNotificationRecipientUser.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewNotificationRecipientUserClient().Delete(ctx, "rg1", "apimService1", armapimanagement.NotificationNameRequestPublisherNotificationMessage, "576823d0a40f7e74ec07d642", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*NotificationRecipientUserClient) ListByNotification

ListByNotification - Gets the list of the Notification Recipient User subscribed to the notification. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • notificationName - Notification Name Identifier.
  • options - NotificationRecipientUserClientListByNotificationOptions contains the optional parameters for the NotificationRecipientUserClient.ListByNotification method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotificationRecipientUsers.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNotificationRecipientUserClient().ListByNotification(ctx, "rg1", "apimService1", armapimanagement.NotificationNameRequestPublisherNotificationMessage, 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.RecipientUserCollection = armapimanagement.RecipientUserCollection{
	// 	Count: to.Ptr[int64](1),
	// 	Value: []*armapimanagement.RecipientUserContract{
	// 		{
	// 			Name: to.Ptr("576823d0a40f7e74ec07d642"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/notifications/recipientUsers"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/notifications/RequestPublisherNotificationMessage/recipientUsers/576823d0a40f7e74ec07d642"),
	// 			Properties: &armapimanagement.RecipientUsersContractProperties{
	// 				UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/576823d0a40f7e74ec07d642"),
	// 			},
	// 	}},
	// }
}
Output:

type NotificationRecipientUserClientCheckEntityExistsOptions added in v0.3.0

type NotificationRecipientUserClientCheckEntityExistsOptions struct {
}

NotificationRecipientUserClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientUserClient.CheckEntityExists method.

type NotificationRecipientUserClientCheckEntityExistsResponse added in v0.3.0

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

NotificationRecipientUserClientCheckEntityExistsResponse contains the response from method NotificationRecipientUserClient.CheckEntityExists.

type NotificationRecipientUserClientCreateOrUpdateOptions added in v0.3.0

type NotificationRecipientUserClientCreateOrUpdateOptions struct {
}

NotificationRecipientUserClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientUserClient.CreateOrUpdate method.

type NotificationRecipientUserClientCreateOrUpdateResponse added in v0.3.0

type NotificationRecipientUserClientCreateOrUpdateResponse struct {
	RecipientUserContract
}

NotificationRecipientUserClientCreateOrUpdateResponse contains the response from method NotificationRecipientUserClient.CreateOrUpdate.

type NotificationRecipientUserClientDeleteOptions added in v0.3.0

type NotificationRecipientUserClientDeleteOptions struct {
}

NotificationRecipientUserClientDeleteOptions contains the optional parameters for the NotificationRecipientUserClient.Delete method.

type NotificationRecipientUserClientDeleteResponse added in v0.3.0

type NotificationRecipientUserClientDeleteResponse struct {
}

NotificationRecipientUserClientDeleteResponse contains the response from method NotificationRecipientUserClient.Delete.

type NotificationRecipientUserClientListByNotificationOptions added in v0.3.0

type NotificationRecipientUserClientListByNotificationOptions struct {
}

NotificationRecipientUserClientListByNotificationOptions contains the optional parameters for the NotificationRecipientUserClient.ListByNotification method.

type NotificationRecipientUserClientListByNotificationResponse added in v0.3.0

type NotificationRecipientUserClientListByNotificationResponse struct {
	RecipientUserCollection
}

NotificationRecipientUserClientListByNotificationResponse contains the response from method NotificationRecipientUserClient.ListByNotification.

type OAuth2AuthenticationSettingsContract

type OAuth2AuthenticationSettingsContract struct {
	// OAuth authorization server identifier.
	AuthorizationServerID *string

	// operations scope.
	Scope *string
}

OAuth2AuthenticationSettingsContract - API OAuth2 Authentication settings details.

func (OAuth2AuthenticationSettingsContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OAuth2AuthenticationSettingsContract.

func (*OAuth2AuthenticationSettingsContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OAuth2AuthenticationSettingsContract.

type OpenIDAuthenticationSettingsContract

type OpenIDAuthenticationSettingsContract struct {
	// How to send token to the server.
	BearerTokenSendingMethods []*BearerTokenSendingMethods

	// OAuth authorization server identifier.
	OpenidProviderID *string
}

OpenIDAuthenticationSettingsContract - API OAuth2 Authentication settings details.

func (OpenIDAuthenticationSettingsContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OpenIDAuthenticationSettingsContract.

func (*OpenIDAuthenticationSettingsContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDAuthenticationSettingsContract.

type OpenIDConnectProviderClient

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

OpenIDConnectProviderClient contains the methods for the OpenIDConnectProvider group. Don't use this type directly, use NewOpenIDConnectProviderClient() instead.

func NewOpenIDConnectProviderClient

func NewOpenIDConnectProviderClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OpenIDConnectProviderClient, error)

NewOpenIDConnectProviderClient creates a new instance of OpenIDConnectProviderClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OpenIDConnectProviderClient) CreateOrUpdate

CreateOrUpdate - Creates or updates the OpenID Connect Provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • opid - Identifier of the OpenID Connect Provider.
  • parameters - Create parameters.
  • options - OpenIDConnectProviderClientCreateOrUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateOpenIdConnectProvider.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOpenIDConnectProviderClient().CreateOrUpdate(ctx, "rg1", "apimService1", "templateOpenIdConnect3", armapimanagement.OpenidConnectProviderContract{
		Properties: &armapimanagement.OpenidConnectProviderContractProperties{
			ClientID:         to.Ptr("oidprovidertemplate3"),
			ClientSecret:     to.Ptr("x"),
			DisplayName:      to.Ptr("templateoidprovider3"),
			MetadataEndpoint: to.Ptr("https://oidprovider-template3.net"),
		},
	}, &armapimanagement.OpenIDConnectProviderClientCreateOrUpdateOptions{IfMatch: 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.OpenidConnectProviderContract = armapimanagement.OpenidConnectProviderContract{
	// 	Name: to.Ptr("templateOpenIdConnect3"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/openidconnectproviders"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/openidConnectProviders/templateOpenIdConnect3"),
	// 	Properties: &armapimanagement.OpenidConnectProviderContractProperties{
	// 		ClientID: to.Ptr("oidprovidertemplate3"),
	// 		DisplayName: to.Ptr("templateoidprovider3"),
	// 		MetadataEndpoint: to.Ptr("https://oidprovider-template3.net"),
	// 	},
	// }
}
Output:

func (*OpenIDConnectProviderClient) Delete

Delete - Deletes specific OpenID Connect Provider of the API Management service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • opid - Identifier of the OpenID Connect Provider.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - OpenIDConnectProviderClientDeleteOptions contains the optional parameters for the OpenIDConnectProviderClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteOpenIdConnectProvider.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*OpenIDConnectProviderClient) Get

Get - Gets specific OpenID Connect Provider without secrets. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • opid - Identifier of the OpenID Connect Provider.
  • options - OpenIDConnectProviderClientGetOptions contains the optional parameters for the OpenIDConnectProviderClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetOpenIdConnectProvider.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOpenIDConnectProviderClient().Get(ctx, "rg1", "apimService1", "templateOpenIdConnect2", 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.OpenidConnectProviderContract = armapimanagement.OpenidConnectProviderContract{
	// 	Name: to.Ptr("templateOpenIdConnect2"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/openidconnectproviders"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/openidConnectProviders/templateOpenIdConnect2"),
	// 	Properties: &armapimanagement.OpenidConnectProviderContractProperties{
	// 		Description: to.Ptr("open id provider template2"),
	// 		ClientID: to.Ptr("oidprovidertemplate2"),
	// 		DisplayName: to.Ptr("templateoidprovider2"),
	// 		MetadataEndpoint: to.Ptr("https://oidprovider-template2.net"),
	// 	},
	// }
}
Output:

func (*OpenIDConnectProviderClient) GetEntityTag

GetEntityTag - Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • opid - Identifier of the OpenID Connect Provider.
  • options - OpenIDConnectProviderClientGetEntityTagOptions contains the optional parameters for the OpenIDConnectProviderClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadOpenIdConnectProvider.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewOpenIDConnectProviderClient().GetEntityTag(ctx, "rg1", "apimService1", "templateOpenIdConnect2", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*OpenIDConnectProviderClient) ListSecrets

ListSecrets - Gets the client secret details of the OpenID Connect Provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • opid - Identifier of the OpenID Connect Provider.
  • options - OpenIDConnectProviderClientListSecretsOptions contains the optional parameters for the OpenIDConnectProviderClient.ListSecrets method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementOpenidConnectProviderListSecrets.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOpenIDConnectProviderClient().ListSecrets(ctx, "rg1", "apimService1", "templateOpenIdConnect2", 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.ClientSecretContract = armapimanagement.ClientSecretContract{
	// 	ClientSecret: to.Ptr("oidsecretproviderTemplate2"),
	// }
}
Output:

func (*OpenIDConnectProviderClient) NewListByServicePager added in v0.5.0

NewListByServicePager - Lists of all the OpenId Connect Providers.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - OpenIDConnectProviderClientListByServiceOptions contains the optional parameters for the OpenIDConnectProviderClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListOpenIdConnectProviders.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOpenIDConnectProviderClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.OpenIDConnectProviderClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.OpenIDConnectProviderCollection = armapimanagement.OpenIDConnectProviderCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.OpenidConnectProviderContract{
		// 		{
		// 			Name: to.Ptr("templateOpenIdConnect2"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/openidconnectproviders"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/openidConnectProviders/templateOpenIdConnect2"),
		// 			Properties: &armapimanagement.OpenidConnectProviderContractProperties{
		// 				Description: to.Ptr("open id provider template2"),
		// 				ClientID: to.Ptr("oidprovidertemplate2"),
		// 				DisplayName: to.Ptr("templateoidprovider2"),
		// 				MetadataEndpoint: to.Ptr("https://oidprovider-template2.net"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*OpenIDConnectProviderClient) Update

Update - Updates the specific OpenID Connect Provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • opid - Identifier of the OpenID Connect Provider.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - OpenIDConnectProviderClientUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateOpenIdConnectProvider.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOpenIDConnectProviderClient().Update(ctx, "rg1", "apimService1", "templateOpenIdConnect2", "*", armapimanagement.OpenidConnectProviderUpdateContract{
		Properties: &armapimanagement.OpenidConnectProviderUpdateContractProperties{
			ClientSecret: to.Ptr("updatedsecret"),
		},
	}, 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.OpenidConnectProviderContract = armapimanagement.OpenidConnectProviderContract{
	// 	Name: to.Ptr("templateOpenIdConnect2"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/openidconnectproviders"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/openidConnectProviders/templateOpenIdConnect2"),
	// 	Properties: &armapimanagement.OpenidConnectProviderContractProperties{
	// 		Description: to.Ptr("open id provider template2"),
	// 		ClientID: to.Ptr("oidprovidertemplate2"),
	// 		DisplayName: to.Ptr("templateoidprovider2"),
	// 		MetadataEndpoint: to.Ptr("https://oidprovider-template2.net"),
	// 	},
	// }
}
Output:

type OpenIDConnectProviderClientCreateOrUpdateOptions added in v0.3.0

type OpenIDConnectProviderClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

OpenIDConnectProviderClientCreateOrUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.CreateOrUpdate method.

type OpenIDConnectProviderClientCreateOrUpdateResponse added in v0.3.0

type OpenIDConnectProviderClientCreateOrUpdateResponse struct {
	OpenidConnectProviderContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

OpenIDConnectProviderClientCreateOrUpdateResponse contains the response from method OpenIDConnectProviderClient.CreateOrUpdate.

type OpenIDConnectProviderClientDeleteOptions added in v0.3.0

type OpenIDConnectProviderClientDeleteOptions struct {
}

OpenIDConnectProviderClientDeleteOptions contains the optional parameters for the OpenIDConnectProviderClient.Delete method.

type OpenIDConnectProviderClientDeleteResponse added in v0.3.0

type OpenIDConnectProviderClientDeleteResponse struct {
}

OpenIDConnectProviderClientDeleteResponse contains the response from method OpenIDConnectProviderClient.Delete.

type OpenIDConnectProviderClientGetEntityTagOptions added in v0.3.0

type OpenIDConnectProviderClientGetEntityTagOptions struct {
}

OpenIDConnectProviderClientGetEntityTagOptions contains the optional parameters for the OpenIDConnectProviderClient.GetEntityTag method.

type OpenIDConnectProviderClientGetEntityTagResponse added in v0.3.0

type OpenIDConnectProviderClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

OpenIDConnectProviderClientGetEntityTagResponse contains the response from method OpenIDConnectProviderClient.GetEntityTag.

type OpenIDConnectProviderClientGetOptions added in v0.3.0

type OpenIDConnectProviderClientGetOptions struct {
}

OpenIDConnectProviderClientGetOptions contains the optional parameters for the OpenIDConnectProviderClient.Get method.

type OpenIDConnectProviderClientGetResponse added in v0.3.0

type OpenIDConnectProviderClientGetResponse struct {
	OpenidConnectProviderContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

OpenIDConnectProviderClientGetResponse contains the response from method OpenIDConnectProviderClient.Get.

type OpenIDConnectProviderClientListByServiceOptions added in v0.3.0

type OpenIDConnectProviderClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

OpenIDConnectProviderClientListByServiceOptions contains the optional parameters for the OpenIDConnectProviderClient.NewListByServicePager method.

type OpenIDConnectProviderClientListByServiceResponse added in v0.3.0

type OpenIDConnectProviderClientListByServiceResponse struct {
	OpenIDConnectProviderCollection
}

OpenIDConnectProviderClientListByServiceResponse contains the response from method OpenIDConnectProviderClient.NewListByServicePager.

type OpenIDConnectProviderClientListSecretsOptions added in v0.3.0

type OpenIDConnectProviderClientListSecretsOptions struct {
}

OpenIDConnectProviderClientListSecretsOptions contains the optional parameters for the OpenIDConnectProviderClient.ListSecrets method.

type OpenIDConnectProviderClientListSecretsResponse added in v0.3.0

type OpenIDConnectProviderClientListSecretsResponse struct {
	ClientSecretContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

OpenIDConnectProviderClientListSecretsResponse contains the response from method OpenIDConnectProviderClient.ListSecrets.

type OpenIDConnectProviderClientUpdateOptions added in v0.3.0

type OpenIDConnectProviderClientUpdateOptions struct {
}

OpenIDConnectProviderClientUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.Update method.

type OpenIDConnectProviderClientUpdateResponse added in v0.3.0

type OpenIDConnectProviderClientUpdateResponse struct {
	OpenidConnectProviderContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

OpenIDConnectProviderClientUpdateResponse contains the response from method OpenIDConnectProviderClient.Update.

type OpenIDConnectProviderCollection

type OpenIDConnectProviderCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*OpenidConnectProviderContract
}

OpenIDConnectProviderCollection - Paged OpenIdProviders list representation.

func (OpenIDConnectProviderCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OpenIDConnectProviderCollection.

func (*OpenIDConnectProviderCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectProviderCollection.

type OpenidConnectProviderContract

type OpenidConnectProviderContract struct {
	// OpenId Connect Provider contract properties.
	Properties *OpenidConnectProviderContractProperties

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

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

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

OpenidConnectProviderContract - OpenId Connect Provider details.

func (OpenidConnectProviderContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderContract.

func (*OpenidConnectProviderContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderContract.

type OpenidConnectProviderContractProperties

type OpenidConnectProviderContractProperties struct {
	// REQUIRED; Client ID of developer console which is the client application.
	ClientID *string

	// REQUIRED; User-friendly OpenID Connect Provider name.
	DisplayName *string

	// REQUIRED; Metadata endpoint URI.
	MetadataEndpoint *string

	// Client Secret of developer console which is the client application.
	ClientSecret *string

	// User-friendly description of OpenID Connect Provider.
	Description *string
}

OpenidConnectProviderContractProperties - OpenID Connect Providers Contract.

func (OpenidConnectProviderContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderContractProperties.

func (*OpenidConnectProviderContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderContractProperties.

type OpenidConnectProviderUpdateContract

type OpenidConnectProviderUpdateContract struct {
	// OpenId Connect Provider Update contract properties.
	Properties *OpenidConnectProviderUpdateContractProperties
}

OpenidConnectProviderUpdateContract - Parameters supplied to the Update OpenID Connect Provider operation.

func (OpenidConnectProviderUpdateContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderUpdateContract.

func (*OpenidConnectProviderUpdateContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderUpdateContract.

type OpenidConnectProviderUpdateContractProperties

type OpenidConnectProviderUpdateContractProperties struct {
	// Client ID of developer console which is the client application.
	ClientID *string

	// Client Secret of developer console which is the client application.
	ClientSecret *string

	// User-friendly description of OpenID Connect Provider.
	Description *string

	// User-friendly OpenID Connect Provider name.
	DisplayName *string

	// Metadata endpoint URI.
	MetadataEndpoint *string
}

OpenidConnectProviderUpdateContractProperties - Parameters supplied to the Update OpenID Connect Provider operation.

func (OpenidConnectProviderUpdateContractProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderUpdateContractProperties.

func (*OpenidConnectProviderUpdateContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderUpdateContractProperties.

type Operation

type Operation struct {
	// The object that describes the operation.
	Display *OperationDisplay

	// Operation name: {provider}/{resource}/{operation}
	Name *string

	// The operation origin.
	Origin *string

	// The operation properties.
	Properties any
}

Operation - REST API operation

func (Operation) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationClient

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

OperationClient contains the methods for the Operation group. Don't use this type directly, use NewOperationClient() instead.

func NewOperationClient

func NewOperationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationClient, error)

NewOperationClient creates a new instance of OperationClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationClient) NewListByTagsPager added in v0.5.0

func (client *OperationClient) NewListByTagsPager(resourceGroupName string, serviceName string, apiID string, options *OperationClientListByTagsOptions) *runtime.Pager[OperationClientListByTagsResponse]

NewListByTagsPager - Lists a collection of operations associated with tags.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - OperationClientListByTagsOptions contains the optional parameters for the OperationClient.NewListByTagsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationsByTags.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationClient().NewListByTagsPager("rg1", "apimService1", "a1", &armapimanagement.OperationClientListByTagsOptions{Filter: nil,
		Top:                        nil,
		Skip:                       nil,
		IncludeNotTaggedOperations: 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.TagResourceCollection = armapimanagement.TagResourceCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.TagResourceContract{
		// 		{
		// 			Operation: &armapimanagement.OperationTagResourceContractProperties{
		// 				Name: to.Ptr("Create resource"),
		// 				Method: to.Ptr("POST"),
		// 				Description: to.Ptr("A demonstration of a POST call based on the echo backend above. The request body is expected to contain JSON-formatted data (see example below). A policy is used to automatically transform any request sent in JSON directly to XML. In a real-world scenario this could be used to enable modern clients to speak to a legacy backend."),
		// 				APIName: to.Ptr("Echo API"),
		// 				APIRevision: to.Ptr("1"),
		// 				ID: to.Ptr("/apis/echo-api/operations/create-resource"),
		// 				URLTemplate: to.Ptr("/resource"),
		// 			},
		// 			Tag: &armapimanagement.TagResourceContractProperties{
		// 				Name: to.Ptr("awesomeTag"),
		// 				ID: to.Ptr("/tags/apitag123"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationClientListByTagsOptions added in v0.3.0

type OperationClientListByTagsOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Include not tagged Operations.
	IncludeNotTaggedOperations *bool
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

OperationClientListByTagsOptions contains the optional parameters for the OperationClient.NewListByTagsPager method.

type OperationClientListByTagsResponse added in v0.3.0

type OperationClientListByTagsResponse struct {
	TagResourceCollection
}

OperationClientListByTagsResponse contains the response from method OperationClient.NewListByTagsPager.

type OperationCollection

type OperationCollection struct {
	// Total record count number across all pages.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Page values.
	Value []*OperationContract
}

OperationCollection - Paged Operation list representation.

func (OperationCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationCollection.

func (*OperationCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationCollection.

type OperationContract

type OperationContract struct {
	// Properties of the Operation Contract.
	Properties *OperationContractProperties

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

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

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

OperationContract - API Operation details.

func (OperationContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationContract.

func (*OperationContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationContract.

type OperationContractProperties

type OperationContractProperties struct {
	// REQUIRED; Operation Name.
	DisplayName *string

	// REQUIRED; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
	Method *string

	// REQUIRED; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
	URLTemplate *string

	// Description of the operation. May include HTML formatting tags.
	Description *string

	// Operation Policies
	Policies *string

	// An entity containing request details.
	Request *RequestContract

	// Array of Operation responses.
	Responses []*ResponseContract

	// Collection of URL template parameters.
	TemplateParameters []*ParameterContract
}

OperationContractProperties - Operation Contract Properties

func (OperationContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationContractProperties.

func (*OperationContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationContractProperties.

type OperationDisplay

type OperationDisplay struct {
	// Friendly name of the operation
	Description *string

	// Operation type: read, write, delete, listKeys/action, etc.
	Operation *string

	// Friendly name of the resource provider
	Provider *string

	// Resource type on which the operation is performed.
	Resource *string
}

OperationDisplay - The object that describes the operation.

func (OperationDisplay) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationEntityBaseContract

type OperationEntityBaseContract struct {
	// Description of the operation. May include HTML formatting tags.
	Description *string

	// Operation Policies
	Policies *string

	// An entity containing request details.
	Request *RequestContract

	// Array of Operation responses.
	Responses []*ResponseContract

	// Collection of URL template parameters.
	TemplateParameters []*ParameterContract
}

OperationEntityBaseContract - API Operation Entity Base Contract details.

func (OperationEntityBaseContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationEntityBaseContract.

func (*OperationEntityBaseContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationEntityBaseContract.

type OperationListResult

type OperationListResult struct {
	// URL to get the next set of operation list results if there are any.
	NextLink *string

	// List of operations supported by the resource provider.
	Value []*Operation
}

OperationListResult - Result of the request to list REST API operations. It contains a list of operations and a URL nextLink 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 added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationNameFormat

type OperationNameFormat string

OperationNameFormat - The format of the Operation Name for Application Insights telemetries. Default is Name.

const (
	// OperationNameFormatName - API_NAME;rev=API_REVISION - OPERATION_NAME
	OperationNameFormatName OperationNameFormat = "Name"
	// OperationNameFormatURL - HTTP_VERB URL
	OperationNameFormatURL OperationNameFormat = "Url"
)

func PossibleOperationNameFormatValues

func PossibleOperationNameFormatValues() []OperationNameFormat

PossibleOperationNameFormatValues returns the possible values for the OperationNameFormat const type.

type OperationResultContract

type OperationResultContract struct {
	// Properties of the Operation Contract.
	Properties *OperationResultContractProperties

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

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

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

OperationResultContract - Long Running Git Operation Results.

func (OperationResultContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationResultContract.

func (*OperationResultContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultContract.

type OperationResultContractProperties

type OperationResultContractProperties struct {
	// Error Body Contract
	Error *ErrorResponseBody

	// Operation result identifier.
	ID *string

	// Optional result info.
	ResultInfo *string

	// Start time of an async operation. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO
	// 8601 standard.
	Started *time.Time

	// Status of an async operation.
	Status *AsyncOperationStatus

	// Last update time of an async operation. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by
	// the ISO 8601 standard.
	Updated *time.Time

	// READ-ONLY; This property if only provided as part of the TenantConfigurationValidate operation. It contains the log the
	// entities which will be updated/created/deleted as part of the TenantConfigurationDeploy
	// operation.
	ActionLog []*OperationResultLogItemContract
}

OperationResultContractProperties - Operation Result.

func (OperationResultContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationResultContractProperties.

func (*OperationResultContractProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultContractProperties.

type OperationResultLogItemContract

type OperationResultLogItemContract struct {
	// Action like create/update/delete.
	Action *string

	// Identifier of the entity being created/updated/deleted.
	ObjectKey *string

	// The type of entity contract.
	ObjectType *string
}

OperationResultLogItemContract - Log of the entity being created, updated or deleted.

func (OperationResultLogItemContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationResultLogItemContract.

func (*OperationResultLogItemContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultLogItemContract.

type OperationTagResourceContractProperties

type OperationTagResourceContractProperties struct {
	// Identifier of the operation in form /operations/{operationId}.
	ID *string

	// READ-ONLY; API Name.
	APIName *string

	// READ-ONLY; API Revision.
	APIRevision *string

	// READ-ONLY; API Version.
	APIVersion *string

	// READ-ONLY; Operation Description.
	Description *string

	// READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
	Method *string

	// READ-ONLY; Operation name.
	Name *string

	// READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
	URLTemplate *string
}

OperationTagResourceContractProperties - Operation Entity contract Properties.

func (OperationTagResourceContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationTagResourceContractProperties.

func (*OperationTagResourceContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationTagResourceContractProperties.

type OperationUpdateContract

type OperationUpdateContract struct {
	// Properties of the API Operation entity that can be updated.
	Properties *OperationUpdateContractProperties
}

OperationUpdateContract - API Operation Update Contract details.

func (OperationUpdateContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationUpdateContract.

func (*OperationUpdateContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationUpdateContract.

type OperationUpdateContractProperties

type OperationUpdateContractProperties struct {
	// Description of the operation. May include HTML formatting tags.
	Description *string

	// Operation Name.
	DisplayName *string

	// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
	Method *string

	// Operation Policies
	Policies *string

	// An entity containing request details.
	Request *RequestContract

	// Array of Operation responses.
	Responses []*ResponseContract

	// Collection of URL template parameters.
	TemplateParameters []*ParameterContract

	// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
	URLTemplate *string
}

OperationUpdateContractProperties - Operation Update Contract Properties.

func (OperationUpdateContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationUpdateContractProperties.

func (*OperationUpdateContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationUpdateContractProperties.

type OperationsClient added in v0.3.0

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

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

func NewOperationsClient added in v0.3.0

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 added in v0.5.0

NewListPager - Lists all of the available REST API operations of the Microsoft.ApiManagement provider.

Generated from API version 2021-08-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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.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 = armapimanagement.OperationListResult{
		// 	Value: []*armapimanagement.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.ApiManagement/service/write"),
		// 			Display: &armapimanagement.OperationDisplay{
		// 				Description: to.Ptr("Create a new instance of API Management Service"),
		// 				Operation: to.Ptr("Create a new instance of API Management Service"),
		// 				Provider: to.Ptr("Microsoft API Management"),
		// 				Resource: to.Ptr("Service"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ApiManagement/service/read"),
		// 			Display: &armapimanagement.OperationDisplay{
		// 				Description: to.Ptr("Read metadata for an API Management Service instance"),
		// 				Operation: to.Ptr("Read metadata for an API Management Service instance"),
		// 				Provider: to.Ptr("Microsoft API Management"),
		// 				Resource: to.Ptr("Service"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ApiManagement/service/delete"),
		// 			Display: &armapimanagement.OperationDisplay{
		// 				Description: to.Ptr("Delete API Management Service instance"),
		// 				Operation: to.Ptr("Delete API Management Service instance"),
		// 				Provider: to.Ptr("Microsoft API Management"),
		// 				Resource: to.Ptr("Service"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ApiManagement/service/providers/Microsoft.Insights/diagnosticSettings/write"),
		// 			Display: &armapimanagement.OperationDisplay{
		// 				Description: to.Ptr("Creates or updates the diagnostic setting for API Management service"),
		// 				Operation: to.Ptr("Write diagnostic setting"),
		// 				Provider: to.Ptr("Microsoft API Management"),
		// 				Resource: to.Ptr("Service"),
		// 			},
		// 			Origin: to.Ptr("system"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ApiManagement/service/tenant/operationResults/read"),
		// 			Display: &armapimanagement.OperationDisplay{
		// 				Description: to.Ptr("Get list of operation results or Get result of a specific operation"),
		// 				Operation: to.Ptr("Get operation results or Get operation result"),
		// 				Provider: to.Ptr("Microsoft API Management"),
		// 				Resource: to.Ptr("Results of async operations"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Origin

type Origin string

Origin - The origin of the issue.

const (
	OriginInbound  Origin = "Inbound"
	OriginLocal    Origin = "Local"
	OriginOutbound Origin = "Outbound"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type OutboundEnvironmentEndpoint

type OutboundEnvironmentEndpoint struct {
	// The type of service accessed by the Api Management Service, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory.
	Category *string

	// The endpoints that the Api Management Service reaches the service at.
	Endpoints []*EndpointDependency
}

OutboundEnvironmentEndpoint - Endpoints accessed for a common purpose that the Api Management Service requires outbound network access to.

func (OutboundEnvironmentEndpoint) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint.

func (*OutboundEnvironmentEndpoint) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint.

type OutboundEnvironmentEndpointList

type OutboundEnvironmentEndpointList struct {
	// REQUIRED; Collection of resources.
	Value []*OutboundEnvironmentEndpoint

	// READ-ONLY; Link to next page of resources.
	NextLink *string
}

OutboundEnvironmentEndpointList - Collection of Outbound Environment Endpoints

func (OutboundEnvironmentEndpointList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointList.

func (*OutboundEnvironmentEndpointList) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpointList.

type OutboundNetworkDependenciesEndpointsClient

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

OutboundNetworkDependenciesEndpointsClient contains the methods for the OutboundNetworkDependenciesEndpoints group. Don't use this type directly, use NewOutboundNetworkDependenciesEndpointsClient() instead.

func NewOutboundNetworkDependenciesEndpointsClient

func NewOutboundNetworkDependenciesEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OutboundNetworkDependenciesEndpointsClient, error)

NewOutboundNetworkDependenciesEndpointsClient creates a new instance of OutboundNetworkDependenciesEndpointsClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OutboundNetworkDependenciesEndpointsClient) ListByService

ListByService - Gets the network endpoints of all outbound dependencies of a ApiManagement service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - OutboundNetworkDependenciesEndpointsClientListByServiceOptions contains the optional parameters for the OutboundNetworkDependenciesEndpointsClient.ListByService method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetOutboundNetworkDependenciesEndpoints.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOutboundNetworkDependenciesEndpointsClient().ListByService(ctx, "rg1", "apimService1", 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.OutboundEnvironmentEndpointList = armapimanagement.OutboundEnvironmentEndpointList{
	// 	Value: []*armapimanagement.OutboundEnvironmentEndpoint{
	// 		{
	// 			Category: to.Ptr("Azure SMTP"),
	// 			Endpoints: []*armapimanagement.EndpointDependency{
	// 				{
	// 					DomainName: to.Ptr("smtpi-ch1.msn.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](25028),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 			}},
	// 		},
	// 		{
	// 			Category: to.Ptr("Azure SQL"),
	// 			Endpoints: []*armapimanagement.EndpointDependency{
	// 				{
	// 					DomainName: to.Ptr("xxxx1345234.database.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](1433),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 			}},
	// 		},
	// 		{
	// 			Category: to.Ptr("Azure Storage"),
	// 			Endpoints: []*armapimanagement.EndpointDependency{
	// 				{
	// 					DomainName: to.Ptr("xxxx32storagedgfbay.blob.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx1362629927xt.blob.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx1362629927xt.table.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx141483183xt.blob.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx141483183xt.table.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx1949864718xt.blob.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx1949864718xt.table.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx3292114122xt.blob.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx3292114122xt.table.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx32tst4oto8t0mlesawmm.blob.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx32tst4oto8t0mlesawmm.file.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](445),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx32tst4oto8t0mlesawmm.queue.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx32tst4oto8t0mlesawmm.table.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 			}},
	// 		},
	// 		{
	// 			Category: to.Ptr("Azure Event Hub"),
	// 			Endpoints: []*armapimanagement.EndpointDependency{
	// 				{
	// 					DomainName: to.Ptr("xxxx1362629927eh.servicebus.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](5671),
	// 							Region: to.Ptr("West US"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](5672),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx1949864718eh.servicebus.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](5671),
	// 							Region: to.Ptr("West US"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](5672),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx3292114122eh.servicebus.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](5671),
	// 							Region: to.Ptr("West US"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](5672),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxxx141483183eh.servicebus.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("West US"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](5671),
	// 							Region: to.Ptr("West US"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](5672),
	// 							Region: to.Ptr("West US"),
	// 					}},
	// 			}},
	// 		},
	// 		{
	// 			Category: to.Ptr("SSL Certificate Verification"),
	// 			Endpoints: []*armapimanagement.EndpointDependency{
	// 				{
	// 					DomainName: to.Ptr("ocsp.msocsp.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](80),
	// 							Region: to.Ptr("Global"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("mscrl.microsoft.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](80),
	// 							Region: to.Ptr("Global"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("crl.microsoft.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](80),
	// 							Region: to.Ptr("Global"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("crl3.digicert.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](80),
	// 							Region: to.Ptr("Global"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("ocsp.digicert.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](80),
	// 							Region: to.Ptr("Global"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("cacerts.digicert.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](80),
	// 							Region: to.Ptr("Global"),
	// 						},
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 			}},
	// 		},
	// 		{
	// 			Category: to.Ptr("Azure Monitor"),
	// 			Endpoints: []*armapimanagement.EndpointDependency{
	// 				{
	// 					DomainName: to.Ptr("gcs.ppe.monitoring.core.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("global.prod.microsoftmetrics.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxx3.prod.microsoftmetrics.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](1886),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxx3-red.prod.microsoftmetrics.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](1886),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("xxx3-black.prod.microsoftmetrics.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](1886),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("gcs.ppe.warm.ingestion.monitoring.azure.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("metrichost23.prod.microsoftmetrics.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("metrichost23-red.prod.microsoftmetrics.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("metrichost23-black.prod.microsoftmetrics.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 			}},
	// 		},
	// 		{
	// 			Category: to.Ptr("Portal Captcha"),
	// 			Endpoints: []*armapimanagement.EndpointDependency{
	// 				{
	// 					DomainName: to.Ptr("client.xxx.live.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("partner.xxx.live.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 			}},
	// 		},
	// 		{
	// 			Category: to.Ptr("Azure Active Directory"),
	// 			Endpoints: []*armapimanagement.EndpointDependency{
	// 				{
	// 					DomainName: to.Ptr("login.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("graph.windows.net"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 				},
	// 				{
	// 					DomainName: to.Ptr("login.microsoftonline.com"),
	// 					EndpointDetails: []*armapimanagement.EndpointDetail{
	// 						{
	// 							Port: to.Ptr[int32](443),
	// 							Region: to.Ptr("Global"),
	// 					}},
	// 			}},
	// 	}},
	// }
}
Output:

type OutboundNetworkDependenciesEndpointsClientListByServiceOptions added in v0.3.0

type OutboundNetworkDependenciesEndpointsClientListByServiceOptions struct {
}

OutboundNetworkDependenciesEndpointsClientListByServiceOptions contains the optional parameters for the OutboundNetworkDependenciesEndpointsClient.ListByService method.

type OutboundNetworkDependenciesEndpointsClientListByServiceResponse added in v0.3.0

type OutboundNetworkDependenciesEndpointsClientListByServiceResponse struct {
	OutboundEnvironmentEndpointList
}

OutboundNetworkDependenciesEndpointsClientListByServiceResponse contains the response from method OutboundNetworkDependenciesEndpointsClient.ListByService.

type ParameterContract

type ParameterContract struct {
	// REQUIRED; Parameter name.
	Name *string

	// REQUIRED; Parameter type.
	Type *string

	// Default parameter value.
	DefaultValue *string

	// Parameter description.
	Description *string

	// Exampled defined for the parameter.
	Examples map[string]*ParameterExampleContract

	// Specifies whether parameter is required or not.
	Required *bool

	// Schema identifier.
	SchemaID *string

	// Type name defined by the schema.
	TypeName *string

	// Parameter values.
	Values []*string
}

ParameterContract - Operation parameters details.

func (ParameterContract) MarshalJSON

func (p ParameterContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ParameterContract.

func (*ParameterContract) UnmarshalJSON added in v1.1.0

func (p *ParameterContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ParameterContract.

type ParameterExampleContract

type ParameterExampleContract struct {
	// Long description for the example
	Description *string

	// A URL that points to the literal example
	ExternalValue *string

	// Short description for the example
	Summary *string

	// Example value. May be a primitive value, or an object.
	Value any
}

ParameterExampleContract - Parameter example.

func (ParameterExampleContract) MarshalJSON added in v1.1.0

func (p ParameterExampleContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ParameterExampleContract.

func (*ParameterExampleContract) UnmarshalJSON added in v1.1.0

func (p *ParameterExampleContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ParameterExampleContract.

type PipelineDiagnosticSettings

type PipelineDiagnosticSettings struct {
	// Diagnostic settings for request.
	Request *HTTPMessageDiagnostic

	// Diagnostic settings for response.
	Response *HTTPMessageDiagnostic
}

PipelineDiagnosticSettings - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.

func (PipelineDiagnosticSettings) MarshalJSON added in v1.1.0

func (p PipelineDiagnosticSettings) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PipelineDiagnosticSettings.

func (*PipelineDiagnosticSettings) UnmarshalJSON added in v1.1.0

func (p *PipelineDiagnosticSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PipelineDiagnosticSettings.

type PlatformVersion

type PlatformVersion string

PlatformVersion - Compute Platform Version running the service.

const (
	// PlatformVersionMtv1 - Platform running the service on Multi Tenant V1 platform.
	PlatformVersionMtv1 PlatformVersion = "mtv1"
	// PlatformVersionStv1 - Platform running the service on Single Tenant V1 platform.
	PlatformVersionStv1 PlatformVersion = "stv1"
	// PlatformVersionStv2 - Platform running the service on Single Tenant V2 platform.
	PlatformVersionStv2 PlatformVersion = "stv2"
	// PlatformVersionUndetermined - Platform version cannot be determined, as compute platform is not deployed.
	PlatformVersionUndetermined PlatformVersion = "undetermined"
)

func PossiblePlatformVersionValues

func PossiblePlatformVersionValues() []PlatformVersion

PossiblePlatformVersionValues returns the possible values for the PlatformVersion const type.

type PolicyClient

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

PolicyClient contains the methods for the Policy group. Don't use this type directly, use NewPolicyClient() instead.

func NewPolicyClient

func NewPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PolicyClient, error)

NewPolicyClient creates a new instance of PolicyClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PolicyClient) CreateOrUpdate

func (client *PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, parameters PolicyContract, options *PolicyClientCreateOrUpdateOptions) (PolicyClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates the global policy configuration of the Api Management service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • policyID - The identifier of the Policy.
  • parameters - The policy contents to apply.
  • options - PolicyClientCreateOrUpdateOptions contains the optional parameters for the PolicyClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreatePolicy.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPolicyClient().CreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.PolicyIDNamePolicy, armapimanagement.PolicyContract{
		Properties: &armapimanagement.PolicyContractProperties{
			Format: to.Ptr(armapimanagement.PolicyContentFormatXML),
			Value:  to.Ptr("<policies>\r\n  <inbound />\r\n  <backend>\r\n    <forward-request />\r\n  </backend>\r\n  <outbound />\r\n</policies>"),
		},
	}, &armapimanagement.PolicyClientCreateOrUpdateOptions{IfMatch: 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.PolicyContract = armapimanagement.PolicyContract{
	// 	Name: to.Ptr("policy"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/policies"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy"),
	// 	Properties: &armapimanagement.PolicyContractProperties{
	// 		Value: to.Ptr("<policies>\r\n  <inbound />\r\n  <backend>\r\n    <forward-request />\r\n  </backend>\r\n  <outbound />\r\n</policies>"),
	// 	},
	// }
}
Output:

func (*PolicyClient) Delete

func (client *PolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, ifMatch string, options *PolicyClientDeleteOptions) (PolicyClientDeleteResponse, error)

Delete - Deletes the global policy configuration of the Api Management Service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • policyID - The identifier of the Policy.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - PolicyClientDeleteOptions contains the optional parameters for the PolicyClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletePolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*PolicyClient) Get

func (client *PolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, options *PolicyClientGetOptions) (PolicyClientGetResponse, error)

Get - Get the Global policy definition of the Api Management service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • policyID - The identifier of the Policy.
  • options - PolicyClientGetOptions contains the optional parameters for the PolicyClient.Get method.
Example (ApiManagementGetPolicy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPolicyClient().Get(ctx, "rg1", "apimService1", armapimanagement.PolicyIDNamePolicy, &armapimanagement.PolicyClientGetOptions{Format: 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.PolicyContract = armapimanagement.PolicyContract{
	// 	Name: to.Ptr("policy"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/policies"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy"),
	// 	Properties: &armapimanagement.PolicyContractProperties{
	// 		Value: to.Ptr("<!--\r\n    IMPORTANT:\r\n    - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\r\n    - Only the <forward-request> policy element can appear within the <backend> section element.\r\n    - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\r\n    - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\r\n    - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\r\n    - To remove a policy, delete the corresponding policy statement from the policy document.\r\n    - Policies are applied in the order of their appearance, from the top down.\r\n-->\r\n<policies>\r\n  <inbound />\r\n  <backend>\r\n    <forward-request />\r\n  </backend>\r\n  <outbound />\r\n</policies>"),
	// 	},
	// }
}
Output:

Example (ApiManagementGetPolicyFormat)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPolicyFormat.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPolicyClient().Get(ctx, "rg1", "apimService1", armapimanagement.PolicyIDNamePolicy, &armapimanagement.PolicyClientGetOptions{Format: to.Ptr(armapimanagement.PolicyExportFormatRawxml)})
	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.PolicyContract = armapimanagement.PolicyContract{
	// 	Name: to.Ptr("policy"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/policies"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy"),
	// 	Properties: &armapimanagement.PolicyContractProperties{
	// 		Format: to.Ptr(armapimanagement.PolicyContentFormatRawxml),
	// 		Value: to.Ptr("<!--\n    IMPORTANT:\n    - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\n    - Only the <forward-request> policy element can appear within the <backend> section element.\n    - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\n    - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\n    - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\n    - To remove a policy, delete the corresponding policy statement from the policy document.\n    - Policies are applied in the order of their appearance, from the top down.\n-->\r\n<policies>\r\n	<inbound>\r\n		<set-header name=\"correlationid\" exists-action=\"skip\">\r\n			<value>@{\n                var guidBinary = new byte[16];\n                Array.Copy(Guid.NewGuid().ToByteArray(), 0, guidBinary, 0, 10);\n                long time = DateTime.Now.Ticks;\n                byte[] bytes = new byte[6];\n                unchecked\n                {\n                       bytes[5] = (byte)(time >> 40);\n                       bytes[4] = (byte)(time >> 32);\n                       bytes[3] = (byte)(time >> 24);\n                       bytes[2] = (byte)(time >> 16);\n                       bytes[1] = (byte)(time >> 8);\n                       bytes[0] = (byte)(time);\n                }\n                Array.Copy(bytes, 0, guidBinary, 10, 6);\n                return new Guid(guidBinary).ToString();\n            }\n            </value>\r\n		</set-header>\r\n	</inbound>\r\n	<backend>\r\n		<forward-request />\r\n	</backend>\r\n	<outbound />\r\n	<on-error />\r\n</policies>"),
	// 	},
	// }
}
Output:

func (*PolicyClient) GetEntityTag

func (client *PolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, options *PolicyClientGetEntityTagOptions) (PolicyClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the Global policy definition in the Api Management service.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • policyID - The identifier of the Policy.
  • options - PolicyClientGetEntityTagOptions contains the optional parameters for the PolicyClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewPolicyClient().GetEntityTag(ctx, "rg1", "apimService1", armapimanagement.PolicyIDNamePolicy, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*PolicyClient) ListByService

func (client *PolicyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PolicyClientListByServiceOptions) (PolicyClientListByServiceResponse, error)

ListByService - Lists all the Global Policy definitions of the Api Management service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - PolicyClientListByServiceOptions contains the optional parameters for the PolicyClient.ListByService method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPolicies.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPolicyClient().ListByService(ctx, "rg1", "apimService1", 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.PolicyCollection = armapimanagement.PolicyCollection{
	// 	Count: to.Ptr[int64](1),
	// 	Value: []*armapimanagement.PolicyContract{
	// 		{
	// 			Name: to.Ptr("policy"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/policies"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy"),
	// 			Properties: &armapimanagement.PolicyContractProperties{
	// 				Value: to.Ptr("<!--\r\n    IMPORTANT:\r\n    - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.\r\n    - Only the <forward-request> policy element can appear within the <backend> section element.\r\n    - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.\r\n    - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.\r\n    - To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.\r\n    - To remove a policy, delete the corresponding policy statement from the policy document.\r\n    - Policies are applied in the order of their appearance, from the top down.\r\n-->\r\n<policies>\r\n  <inbound />\r\n  <backend>\r\n    <forward-request />\r\n  </backend>\r\n  <outbound />\r\n</policies>"),
	// 			},
	// 	}},
	// }
}
Output:

type PolicyClientCreateOrUpdateOptions added in v0.3.0

type PolicyClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

PolicyClientCreateOrUpdateOptions contains the optional parameters for the PolicyClient.CreateOrUpdate method.

type PolicyClientCreateOrUpdateResponse added in v0.3.0

type PolicyClientCreateOrUpdateResponse struct {
	PolicyContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

PolicyClientCreateOrUpdateResponse contains the response from method PolicyClient.CreateOrUpdate.

type PolicyClientDeleteOptions added in v0.3.0

type PolicyClientDeleteOptions struct {
}

PolicyClientDeleteOptions contains the optional parameters for the PolicyClient.Delete method.

type PolicyClientDeleteResponse added in v0.3.0

type PolicyClientDeleteResponse struct {
}

PolicyClientDeleteResponse contains the response from method PolicyClient.Delete.

type PolicyClientGetEntityTagOptions added in v0.3.0

type PolicyClientGetEntityTagOptions struct {
}

PolicyClientGetEntityTagOptions contains the optional parameters for the PolicyClient.GetEntityTag method.

type PolicyClientGetEntityTagResponse added in v0.3.0

type PolicyClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

PolicyClientGetEntityTagResponse contains the response from method PolicyClient.GetEntityTag.

type PolicyClientGetOptions added in v0.3.0

type PolicyClientGetOptions struct {
	// Policy Export Format.
	Format *PolicyExportFormat
}

PolicyClientGetOptions contains the optional parameters for the PolicyClient.Get method.

type PolicyClientGetResponse added in v0.3.0

type PolicyClientGetResponse struct {
	PolicyContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

PolicyClientGetResponse contains the response from method PolicyClient.Get.

type PolicyClientListByServiceOptions added in v0.3.0

type PolicyClientListByServiceOptions struct {
}

PolicyClientListByServiceOptions contains the optional parameters for the PolicyClient.ListByService method.

type PolicyClientListByServiceResponse added in v0.3.0

type PolicyClientListByServiceResponse struct {
	PolicyCollection
}

PolicyClientListByServiceResponse contains the response from method PolicyClient.ListByService.

type PolicyCollection

type PolicyCollection struct {
	// Total record count number.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Policy Contract value.
	Value []*PolicyContract
}

PolicyCollection - The response of the list policy operation.

func (PolicyCollection) MarshalJSON

func (p PolicyCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicyCollection.

func (*PolicyCollection) UnmarshalJSON added in v1.1.0

func (p *PolicyCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicyCollection.

type PolicyContentFormat

type PolicyContentFormat string

PolicyContentFormat - Format of the policyContent.

const (
	// PolicyContentFormatRawxml - The contents are inline and Content type is a non XML encoded policy document.
	PolicyContentFormatRawxml PolicyContentFormat = "rawxml"
	// PolicyContentFormatRawxmlLink - The policy document is not Xml encoded and is hosted on a http endpoint accessible from
	// the API Management service.
	PolicyContentFormatRawxmlLink PolicyContentFormat = "rawxml-link"
	// PolicyContentFormatXML - The contents are inline and Content type is an XML document.
	PolicyContentFormatXML PolicyContentFormat = "xml"
	// PolicyContentFormatXMLLink - The policy XML document is hosted on a http endpoint accessible from the API Management service.
	PolicyContentFormatXMLLink PolicyContentFormat = "xml-link"
)

func PossiblePolicyContentFormatValues

func PossiblePolicyContentFormatValues() []PolicyContentFormat

PossiblePolicyContentFormatValues returns the possible values for the PolicyContentFormat const type.

type PolicyContract

type PolicyContract struct {
	// Properties of the Policy.
	Properties *PolicyContractProperties

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

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

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

PolicyContract - Policy Contract details.

func (PolicyContract) MarshalJSON

func (p PolicyContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicyContract.

func (*PolicyContract) UnmarshalJSON added in v1.1.0

func (p *PolicyContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicyContract.

type PolicyContractProperties

type PolicyContractProperties struct {
	// REQUIRED; Contents of the Policy as defined by the format.
	Value *string

	// Format of the policyContent.
	Format *PolicyContentFormat
}

PolicyContractProperties - Policy contract Properties.

func (PolicyContractProperties) MarshalJSON added in v1.1.0

func (p PolicyContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicyContractProperties.

func (*PolicyContractProperties) UnmarshalJSON added in v1.1.0

func (p *PolicyContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicyContractProperties.

type PolicyDescriptionClient

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

PolicyDescriptionClient contains the methods for the PolicyDescription group. Don't use this type directly, use NewPolicyDescriptionClient() instead.

func NewPolicyDescriptionClient

func NewPolicyDescriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PolicyDescriptionClient, error)

NewPolicyDescriptionClient creates a new instance of PolicyDescriptionClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PolicyDescriptionClient) ListByService

ListByService - Lists all policy descriptions. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - PolicyDescriptionClientListByServiceOptions contains the optional parameters for the PolicyDescriptionClient.ListByService method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPolicyDescriptions.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPolicyDescriptionClient().ListByService(ctx, "rg1", "apimService1", &armapimanagement.PolicyDescriptionClientListByServiceOptions{Scope: to.Ptr(armapimanagement.PolicyScopeContractAPI)})
	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.PolicyDescriptionCollection = armapimanagement.PolicyDescriptionCollection{
	// 	Count: to.Ptr[int64](2),
	// 	Value: []*armapimanagement.PolicyDescriptionContract{
	// 		{
	// 			Name: to.Ptr("authentication-basic"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/policyDescriptions"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyDescriptions/authentication-basic"),
	// 			Properties: &armapimanagement.PolicyDescriptionContractProperties{
	// 				Description: to.Ptr("Authenticate with the backend service using Basic authentication. Use in the inbound section at API scope."),
	// 				Scope: to.Ptr[int64](268435471),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("authentication-certificate"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/policyDescriptions"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyDescriptions/authentication-certificate"),
	// 			Properties: &armapimanagement.PolicyDescriptionContractProperties{
	// 				Description: to.Ptr("Authenticate with the backend service using a client certificate. Use in the inbound section at API scope."),
	// 				Scope: to.Ptr[int64](268435471),
	// 			},
	// 	}},
	// }
}
Output:

type PolicyDescriptionClientListByServiceOptions added in v0.3.0

type PolicyDescriptionClientListByServiceOptions struct {
	// Policy scope.
	Scope *PolicyScopeContract
}

PolicyDescriptionClientListByServiceOptions contains the optional parameters for the PolicyDescriptionClient.ListByService method.

type PolicyDescriptionClientListByServiceResponse added in v0.3.0

type PolicyDescriptionClientListByServiceResponse struct {
	PolicyDescriptionCollection
}

PolicyDescriptionClientListByServiceResponse contains the response from method PolicyDescriptionClient.ListByService.

type PolicyDescriptionCollection

type PolicyDescriptionCollection struct {
	// Total record count number.
	Count *int64

	// Descriptions of APIM policies.
	Value []*PolicyDescriptionContract
}

PolicyDescriptionCollection - Descriptions of APIM policies.

func (PolicyDescriptionCollection) MarshalJSON

func (p PolicyDescriptionCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicyDescriptionCollection.

func (*PolicyDescriptionCollection) UnmarshalJSON added in v1.1.0

func (p *PolicyDescriptionCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionCollection.

type PolicyDescriptionContract

type PolicyDescriptionContract struct {
	// Policy description contract properties.
	Properties *PolicyDescriptionContractProperties

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

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

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

PolicyDescriptionContract - Policy description details.

func (PolicyDescriptionContract) MarshalJSON

func (p PolicyDescriptionContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicyDescriptionContract.

func (*PolicyDescriptionContract) UnmarshalJSON added in v1.1.0

func (p *PolicyDescriptionContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionContract.

type PolicyDescriptionContractProperties

type PolicyDescriptionContractProperties struct {
	// READ-ONLY; Policy description.
	Description *string

	// READ-ONLY; Binary OR value of the Snippet scope.
	Scope *int64
}

PolicyDescriptionContractProperties - Policy description properties.

func (PolicyDescriptionContractProperties) MarshalJSON added in v1.1.0

func (p PolicyDescriptionContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicyDescriptionContractProperties.

func (*PolicyDescriptionContractProperties) UnmarshalJSON added in v1.1.0

func (p *PolicyDescriptionContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionContractProperties.

type PolicyExportFormat

type PolicyExportFormat string
const (
	// PolicyExportFormatRawxml - The contents are inline and Content type is a non XML encoded policy document.
	PolicyExportFormatRawxml PolicyExportFormat = "rawxml"
	// PolicyExportFormatXML - The contents are inline and Content type is an XML document.
	PolicyExportFormatXML PolicyExportFormat = "xml"
)

func PossiblePolicyExportFormatValues

func PossiblePolicyExportFormatValues() []PolicyExportFormat

PossiblePolicyExportFormatValues returns the possible values for the PolicyExportFormat const type.

type PolicyIDName

type PolicyIDName string
const (
	PolicyIDNamePolicy PolicyIDName = "policy"
)

func PossiblePolicyIDNameValues

func PossiblePolicyIDNameValues() []PolicyIDName

PossiblePolicyIDNameValues returns the possible values for the PolicyIDName const type.

type PolicyScopeContract

type PolicyScopeContract string
const (
	PolicyScopeContractTenant    PolicyScopeContract = "Tenant"
	PolicyScopeContractProduct   PolicyScopeContract = "Product"
	PolicyScopeContractAPI       PolicyScopeContract = "Api"
	PolicyScopeContractOperation PolicyScopeContract = "Operation"
	PolicyScopeContractAll       PolicyScopeContract = "All"
)

func PossiblePolicyScopeContractValues

func PossiblePolicyScopeContractValues() []PolicyScopeContract

PossiblePolicyScopeContractValues returns the possible values for the PolicyScopeContract const type.

type PortalDelegationSettings

type PortalDelegationSettings struct {
	// Delegation settings contract properties.
	Properties *PortalDelegationSettingsProperties

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

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

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

PortalDelegationSettings - Delegation settings for a developer portal.

func (PortalDelegationSettings) MarshalJSON

func (p PortalDelegationSettings) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalDelegationSettings.

func (*PortalDelegationSettings) UnmarshalJSON added in v1.1.0

func (p *PortalDelegationSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalDelegationSettings.

type PortalDelegationSettingsProperties

type PortalDelegationSettingsProperties struct {
	// Subscriptions delegation settings.
	Subscriptions *SubscriptionsDelegationSettingsProperties

	// A delegation Url.
	URL *string

	// User registration delegation settings.
	UserRegistration *RegistrationDelegationSettingsProperties

	// A base64-encoded validation key to validate, that a request is coming from Azure API Management.
	ValidationKey *string
}

PortalDelegationSettingsProperties - Delegation settings contract properties.

func (PortalDelegationSettingsProperties) MarshalJSON added in v1.1.0

func (p PortalDelegationSettingsProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalDelegationSettingsProperties.

func (*PortalDelegationSettingsProperties) UnmarshalJSON added in v1.1.0

func (p *PortalDelegationSettingsProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalDelegationSettingsProperties.

type PortalRevisionClient

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

PortalRevisionClient contains the methods for the PortalRevision group. Don't use this type directly, use NewPortalRevisionClient() instead.

func NewPortalRevisionClient

func NewPortalRevisionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PortalRevisionClient, error)

NewPortalRevisionClient creates a new instance of PortalRevisionClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PortalRevisionClient) BeginCreateOrUpdate

func (client *PortalRevisionClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, parameters PortalRevisionContract, options *PortalRevisionClientBeginCreateOrUpdateOptions) (*runtime.Poller[PortalRevisionClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates a new developer portal's revision by running the portal's publishing. The isCurrent property indicates if the revision is publicly accessible. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance.
  • options - PortalRevisionClientBeginCreateOrUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreatePortalRevision.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPortalRevisionClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "20201112101010", armapimanagement.PortalRevisionContract{
		Properties: &armapimanagement.PortalRevisionContractProperties{
			Description: to.Ptr("portal revision 1"),
			IsCurrent:   to.Ptr(true),
		},
	}, 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)
	}
}
Output:

func (*PortalRevisionClient) BeginUpdate

func (client *PortalRevisionClient) BeginUpdate(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, ifMatch string, parameters PortalRevisionContract, options *PortalRevisionClientBeginUpdateOptions) (*runtime.Poller[PortalRevisionClientUpdateResponse], error)

BeginUpdate - Updates the description of specified portal revision or makes it current. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - PortalRevisionClientBeginUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdatePortalRevision.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPortalRevisionClient().BeginUpdate(ctx, "rg1", "apimService1", "20201112101010", "*", armapimanagement.PortalRevisionContract{
		Properties: &armapimanagement.PortalRevisionContractProperties{
			Description: to.Ptr("portal revision update"),
			IsCurrent:   to.Ptr(true),
		},
	}, 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.PortalRevisionContract = armapimanagement.PortalRevisionContract{
	// 	Name: to.Ptr("20201112101010"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/portalRevisions"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop2"),
	// 	Properties: &armapimanagement.PortalRevisionContractProperties{
	// 		Description: to.Ptr("portal revision update"),
	// 		CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-13T22:47:13.397Z"); return t}()),
	// 		IsCurrent: to.Ptr(true),
	// 		Status: to.Ptr(armapimanagement.PortalRevisionStatusCompleted),
	// 		UpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-13T23:29:25.34Z"); return t}()),
	// 	},
	// }
}
Output:

func (*PortalRevisionClient) Get

func (client *PortalRevisionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, options *PortalRevisionClientGetOptions) (PortalRevisionClientGetResponse, error)

Get - Gets the developer portal's revision specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance.
  • options - PortalRevisionClientGetOptions contains the optional parameters for the PortalRevisionClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPortalRevision.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPortalRevisionClient().Get(ctx, "rg1", "apimService1", "20201112101010", 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.PortalRevisionContract = armapimanagement.PortalRevisionContract{
	// 	Name: to.Ptr("20201112101010"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/portalRevisions"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalRevisions/20201112101010"),
	// 	Properties: &armapimanagement.PortalRevisionContractProperties{
	// 		Description: to.Ptr("portal revision 1"),
	// 		CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-12T22:51:36.47Z"); return t}()),
	// 		IsCurrent: to.Ptr(true),
	// 		Status: to.Ptr(armapimanagement.PortalRevisionStatusCompleted),
	// 		UpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-12T22:52:00.097Z"); return t}()),
	// 	},
	// }
}
Output:

func (*PortalRevisionClient) GetEntityTag

func (client *PortalRevisionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, options *PortalRevisionClientGetEntityTagOptions) (PortalRevisionClientGetEntityTagResponse, error)

GetEntityTag - Gets the developer portal revision specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance.
  • options - PortalRevisionClientGetEntityTagOptions contains the optional parameters for the PortalRevisionClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadPortalRevision.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewPortalRevisionClient().GetEntityTag(ctx, "rg1", "apimService1", "20201112101010", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*PortalRevisionClient) NewListByServicePager added in v0.5.0

func (client *PortalRevisionClient) NewListByServicePager(resourceGroupName string, serviceName string, options *PortalRevisionClientListByServiceOptions) *runtime.Pager[PortalRevisionClientListByServiceResponse]

NewListByServicePager - Lists developer portal's revisions.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - PortalRevisionClientListByServiceOptions contains the optional parameters for the PortalRevisionClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPortalRevisions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPortalRevisionClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.PortalRevisionClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.PortalRevisionCollection = armapimanagement.PortalRevisionCollection{
		// 	Value: []*armapimanagement.PortalRevisionContract{
		// 		{
		// 			Name: to.Ptr("20201112000000"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/portalRevisions"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalRevisions/20201112000000"),
		// 			Properties: &armapimanagement.PortalRevisionContractProperties{
		// 				Description: to.Ptr("portal revision"),
		// 				CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-12T22:10:09.673Z"); return t}()),
		// 				IsCurrent: to.Ptr(false),
		// 				Status: to.Ptr(armapimanagement.PortalRevisionStatusCompleted),
		// 				UpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-12T22:12:41.46Z"); return t}()),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("20201112101010"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/portalRevisions"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalRevisions/20201112101010"),
		// 			Properties: &armapimanagement.PortalRevisionContractProperties{
		// 				Description: to.Ptr("portal revision 1"),
		// 				CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-12T22:51:36.47Z"); return t}()),
		// 				IsCurrent: to.Ptr(true),
		// 				Status: to.Ptr(armapimanagement.PortalRevisionStatusCompleted),
		// 				UpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-12T22:52:00.097Z"); return t}()),
		// 			},
		// 	}},
		// }
	}
}
Output:

type PortalRevisionClientBeginCreateOrUpdateOptions added in v0.3.0

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

PortalRevisionClientBeginCreateOrUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginCreateOrUpdate method.

type PortalRevisionClientBeginUpdateOptions added in v0.3.0

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

PortalRevisionClientBeginUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginUpdate method.

type PortalRevisionClientCreateOrUpdateResponse added in v0.3.0

type PortalRevisionClientCreateOrUpdateResponse struct {
	PortalRevisionContract
}

PortalRevisionClientCreateOrUpdateResponse contains the response from method PortalRevisionClient.BeginCreateOrUpdate.

type PortalRevisionClientGetEntityTagOptions added in v0.3.0

type PortalRevisionClientGetEntityTagOptions struct {
}

PortalRevisionClientGetEntityTagOptions contains the optional parameters for the PortalRevisionClient.GetEntityTag method.

type PortalRevisionClientGetEntityTagResponse added in v0.3.0

type PortalRevisionClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

PortalRevisionClientGetEntityTagResponse contains the response from method PortalRevisionClient.GetEntityTag.

type PortalRevisionClientGetOptions added in v0.3.0

type PortalRevisionClientGetOptions struct {
}

PortalRevisionClientGetOptions contains the optional parameters for the PortalRevisionClient.Get method.

type PortalRevisionClientGetResponse added in v0.3.0

type PortalRevisionClientGetResponse struct {
	PortalRevisionContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

PortalRevisionClientGetResponse contains the response from method PortalRevisionClient.Get.

type PortalRevisionClientListByServiceOptions added in v0.3.0

type PortalRevisionClientListByServiceOptions struct {
	// FIELD SUPPORTED OPERATORS SUPPORTED FUNCTIONS
	// |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, ne, gt, lt | substringof,
	// contains, startswith, endswith| |isCurrent | eq, ne | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

PortalRevisionClientListByServiceOptions contains the optional parameters for the PortalRevisionClient.NewListByServicePager method.

type PortalRevisionClientListByServiceResponse added in v0.3.0

type PortalRevisionClientListByServiceResponse struct {
	PortalRevisionCollection
}

PortalRevisionClientListByServiceResponse contains the response from method PortalRevisionClient.NewListByServicePager.

type PortalRevisionClientUpdateResponse added in v0.3.0

type PortalRevisionClientUpdateResponse struct {
	PortalRevisionContract
}

PortalRevisionClientUpdateResponse contains the response from method PortalRevisionClient.BeginUpdate.

type PortalRevisionCollection

type PortalRevisionCollection struct {
	// READ-ONLY; Next page link, if any.
	NextLink *string

	// READ-ONLY; Collection of portal revisions.
	Value []*PortalRevisionContract
}

PortalRevisionCollection - Paged list of portal revisions.

func (PortalRevisionCollection) MarshalJSON

func (p PortalRevisionCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalRevisionCollection.

func (*PortalRevisionCollection) UnmarshalJSON added in v1.1.0

func (p *PortalRevisionCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionCollection.

type PortalRevisionContract

type PortalRevisionContract struct {
	// Properties of the portal revisions.
	Properties *PortalRevisionContractProperties

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

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

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

PortalRevisionContract - Portal Revision's contract details.

func (PortalRevisionContract) MarshalJSON

func (p PortalRevisionContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalRevisionContract.

func (*PortalRevisionContract) UnmarshalJSON added in v1.1.0

func (p *PortalRevisionContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionContract.

type PortalRevisionContractProperties

type PortalRevisionContractProperties struct {
	// Portal revision description.
	Description *string

	// Indicates if the portal's revision is public.
	IsCurrent *bool

	// READ-ONLY; Portal's revision creation date and time.
	CreatedDateTime *time.Time

	// READ-ONLY; Status of the portal's revision.
	Status *PortalRevisionStatus

	// READ-ONLY; Portal revision publishing status details.
	StatusDetails *string

	// READ-ONLY; Last updated date and time.
	UpdatedDateTime *time.Time
}

func (PortalRevisionContractProperties) MarshalJSON

func (p PortalRevisionContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalRevisionContractProperties.

func (*PortalRevisionContractProperties) UnmarshalJSON

func (p *PortalRevisionContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionContractProperties.

type PortalRevisionStatus

type PortalRevisionStatus string

PortalRevisionStatus - Status of the portal's revision.

const (
	// PortalRevisionStatusCompleted - Portal's revision publishing completed.
	PortalRevisionStatusCompleted PortalRevisionStatus = "completed"
	// PortalRevisionStatusFailed - Portal's revision publishing failed.
	PortalRevisionStatusFailed PortalRevisionStatus = "failed"
	// PortalRevisionStatusPending - Portal's revision has been queued.
	PortalRevisionStatusPending PortalRevisionStatus = "pending"
	// PortalRevisionStatusPublishing - Portal's revision is being published.
	PortalRevisionStatusPublishing PortalRevisionStatus = "publishing"
)

func PossiblePortalRevisionStatusValues

func PossiblePortalRevisionStatusValues() []PortalRevisionStatus

PossiblePortalRevisionStatusValues returns the possible values for the PortalRevisionStatus const type.

type PortalSettingValidationKeyContract

type PortalSettingValidationKeyContract struct {
	// This is secret value of the validation key in portal settings.
	ValidationKey *string
}

PortalSettingValidationKeyContract - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth.

func (PortalSettingValidationKeyContract) MarshalJSON added in v1.1.0

func (p PortalSettingValidationKeyContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalSettingValidationKeyContract.

func (*PortalSettingValidationKeyContract) UnmarshalJSON added in v1.1.0

func (p *PortalSettingValidationKeyContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingValidationKeyContract.

type PortalSettingsClient

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

PortalSettingsClient contains the methods for the PortalSettings group. Don't use this type directly, use NewPortalSettingsClient() instead.

func NewPortalSettingsClient

func NewPortalSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PortalSettingsClient, error)

NewPortalSettingsClient creates a new instance of PortalSettingsClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PortalSettingsClient) ListByService

func (client *PortalSettingsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PortalSettingsClientListByServiceOptions) (PortalSettingsClientListByServiceResponse, error)

ListByService - Lists a collection of portalsettings defined within a service instance.. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - PortalSettingsClientListByServiceOptions contains the optional parameters for the PortalSettingsClient.ListByService method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPortalSettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPortalSettingsClient().ListByService(ctx, "rg1", "apimService1", 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.PortalSettingsCollection = armapimanagement.PortalSettingsCollection{
	// 	Count: to.Ptr[int64](3),
	// 	Value: []*armapimanagement.PortalSettingsContract{
	// 		{
	// 			Name: to.Ptr("delegation"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/portalsettings"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/delegation"),
	// 			Properties: &armapimanagement.PortalSettingsContractProperties{
	// 				Enabled: to.Ptr(false),
	// 				Subscriptions: &armapimanagement.SubscriptionsDelegationSettingsProperties{
	// 					Enabled: to.Ptr(false),
	// 				},
	// 				UserRegistration: &armapimanagement.RegistrationDelegationSettingsProperties{
	// 					Enabled: to.Ptr(false),
	// 				},
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("signin"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/portalsettings"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/signin"),
	// 			Properties: &armapimanagement.PortalSettingsContractProperties{
	// 				Enabled: to.Ptr(false),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("signup"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/portalsettings"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/signup"),
	// 			Properties: &armapimanagement.PortalSettingsContractProperties{
	// 				Enabled: to.Ptr(true),
	// 				TermsOfService: &armapimanagement.TermsOfServiceProperties{
	// 					ConsentRequired: to.Ptr(false),
	// 					Enabled: to.Ptr(false),
	// 					Text: to.Ptr("Terms of service"),
	// 				},
	// 			},
	// 	}},
	// }
}
Output:

type PortalSettingsClientListByServiceOptions added in v0.3.0

type PortalSettingsClientListByServiceOptions struct {
}

PortalSettingsClientListByServiceOptions contains the optional parameters for the PortalSettingsClient.ListByService method.

type PortalSettingsClientListByServiceResponse added in v0.3.0

type PortalSettingsClientListByServiceResponse struct {
	PortalSettingsCollection
}

PortalSettingsClientListByServiceResponse contains the response from method PortalSettingsClient.ListByService.

type PortalSettingsCollection

type PortalSettingsCollection struct {
	// Total record count number.
	Count *int64

	// Descriptions of APIM policies.
	Value []*PortalSettingsContract
}

PortalSettingsCollection - Descriptions of APIM policies.

func (PortalSettingsCollection) MarshalJSON

func (p PortalSettingsCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalSettingsCollection.

func (*PortalSettingsCollection) UnmarshalJSON added in v1.1.0

func (p *PortalSettingsCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsCollection.

type PortalSettingsContract

type PortalSettingsContract struct {
	// Portal Settings contract properties.
	Properties *PortalSettingsContractProperties

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

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

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

PortalSettingsContract - Portal Settings for the Developer Portal.

func (PortalSettingsContract) MarshalJSON

func (p PortalSettingsContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalSettingsContract.

func (*PortalSettingsContract) UnmarshalJSON added in v1.1.0

func (p *PortalSettingsContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsContract.

type PortalSettingsContractProperties

type PortalSettingsContractProperties struct {
	// Redirect Anonymous users to the Sign-In page.
	Enabled *bool

	// Subscriptions delegation settings.
	Subscriptions *SubscriptionsDelegationSettingsProperties

	// Terms of service contract properties.
	TermsOfService *TermsOfServiceProperties

	// A delegation Url.
	URL *string

	// User registration delegation settings.
	UserRegistration *RegistrationDelegationSettingsProperties

	// A base64-encoded validation key to validate, that a request is coming from Azure API Management.
	ValidationKey *string
}

PortalSettingsContractProperties - Sign-in settings contract properties.

func (PortalSettingsContractProperties) MarshalJSON added in v1.1.0

func (p PortalSettingsContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalSettingsContractProperties.

func (*PortalSettingsContractProperties) UnmarshalJSON added in v1.1.0

func (p *PortalSettingsContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsContractProperties.

type PortalSigninSettingProperties

type PortalSigninSettingProperties struct {
	// Redirect Anonymous users to the Sign-In page.
	Enabled *bool
}

PortalSigninSettingProperties - Sign-in settings contract properties.

func (PortalSigninSettingProperties) MarshalJSON added in v1.1.0

func (p PortalSigninSettingProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalSigninSettingProperties.

func (*PortalSigninSettingProperties) UnmarshalJSON added in v1.1.0

func (p *PortalSigninSettingProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalSigninSettingProperties.

type PortalSigninSettings

type PortalSigninSettings struct {
	// Sign-in settings contract properties.
	Properties *PortalSigninSettingProperties

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

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

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

PortalSigninSettings - Sign-In settings for the Developer Portal.

func (PortalSigninSettings) MarshalJSON

func (p PortalSigninSettings) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalSigninSettings.

func (*PortalSigninSettings) UnmarshalJSON added in v1.1.0

func (p *PortalSigninSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalSigninSettings.

type PortalSignupSettings

type PortalSignupSettings struct {
	// Sign-up settings contract properties.
	Properties *PortalSignupSettingsProperties

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

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

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

PortalSignupSettings - Sign-Up settings for a developer portal.

func (PortalSignupSettings) MarshalJSON

func (p PortalSignupSettings) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalSignupSettings.

func (*PortalSignupSettings) UnmarshalJSON added in v1.1.0

func (p *PortalSignupSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalSignupSettings.

type PortalSignupSettingsProperties

type PortalSignupSettingsProperties struct {
	// Allow users to sign up on a developer portal.
	Enabled *bool

	// Terms of service contract properties.
	TermsOfService *TermsOfServiceProperties
}

PortalSignupSettingsProperties - Sign-up settings contract properties.

func (PortalSignupSettingsProperties) MarshalJSON added in v1.1.0

func (p PortalSignupSettingsProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PortalSignupSettingsProperties.

func (*PortalSignupSettingsProperties) UnmarshalJSON added in v1.1.0

func (p *PortalSignupSettingsProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PortalSignupSettingsProperties.

type PreferredIPVersion

type PreferredIPVersion string

PreferredIPVersion - The IP version to be used. Only IPv4 is supported for now.

const (
	PreferredIPVersionIPv4 PreferredIPVersion = "IPv4"
)

func PossiblePreferredIPVersionValues

func PossiblePreferredIPVersionValues() []PreferredIPVersion

PossiblePreferredIPVersionValues returns the possible values for the PreferredIPVersion const type.

type PrivateEndpoint

type PrivateEndpoint struct {
	// READ-ONLY; The ARM identifier for Private Endpoint
	ID *string
}

PrivateEndpoint - The Private Endpoint resource.

func (PrivateEndpoint) MarshalJSON added in v1.1.0

func (p PrivateEndpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint.

func (*PrivateEndpoint) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	// Resource properties.
	Properties *PrivateEndpointConnectionProperties

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

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

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

PrivateEndpointConnection - The Private Endpoint Connection resource.

func (PrivateEndpointConnection) MarshalJSON

func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.

func (*PrivateEndpointConnection) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.

type PrivateEndpointConnectionClient

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

PrivateEndpointConnectionClient contains the methods for the PrivateEndpointConnection group. Don't use this type directly, use NewPrivateEndpointConnectionClient() instead.

func NewPrivateEndpointConnectionClient

func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionClient, error)

NewPrivateEndpointConnectionClient creates a new instance of PrivateEndpointConnectionClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PrivateEndpointConnectionClient) BeginCreateOrUpdate

func (client *PrivateEndpointConnectionClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, privateEndpointConnectionRequest PrivateEndpointConnectionRequest, options *PrivateEndpointConnectionClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates a new Private Endpoint Connection or updates an existing one. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • privateEndpointConnectionName - Name of the private endpoint connection.
  • options - PrivateEndpointConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementApproveOrRejectPrivateEndpointConnection.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "privateEndpointConnectionName", armapimanagement.PrivateEndpointConnectionRequest{
		ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/privateEndpointConnections/connectionName"),
		Properties: &armapimanagement.PrivateEndpointConnectionRequestProperties{
			PrivateLinkServiceConnectionState: &armapimanagement.PrivateLinkServiceConnectionState{
				Description: to.Ptr("The Private Endpoint Connection is approved."),
				Status:      to.Ptr(armapimanagement.PrivateEndpointServiceConnectionStatusApproved),
			},
		},
	}, 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.PrivateEndpointConnection = armapimanagement.PrivateEndpointConnection{
	// 	Name: to.Ptr("privateEndpointConnectionName"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/privateEndpointConnections/privateEndpointConnectionName"),
	// 	Properties: &armapimanagement.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armapimanagement.PrivateEndpoint{
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/privateEndpointName"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armapimanagement.PrivateLinkServiceConnectionState{
	// 			Description: to.Ptr("The request has been approved."),
	// 			Status: to.Ptr(armapimanagement.PrivateEndpointServiceConnectionStatus("Succeeded")),
	// 		},
	// 		ProvisioningState: to.Ptr(armapimanagement.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionClient) BeginDelete

func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionClientDeleteResponse], error)

BeginDelete - Deletes the specified Private Endpoint Connection. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • privateEndpointConnectionName - Name of the private endpoint connection.
  • options - PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletePrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginDelete(ctx, "rg1", "apimService1", "privateEndpointConnectionName", 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)
	}
}
Output:

func (*PrivateEndpointConnectionClient) GetByName

func (client *PrivateEndpointConnectionClient) GetByName(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientGetByNameOptions) (PrivateEndpointConnectionClientGetByNameResponse, error)

GetByName - Gets the details of the Private Endpoint Connection specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • privateEndpointConnectionName - Name of the private endpoint connection.
  • options - PrivateEndpointConnectionClientGetByNameOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetByName method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateEndpointConnectionClient().GetByName(ctx, "rg1", "apimService1", "privateEndpointConnectionName", 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.PrivateEndpointConnection = armapimanagement.PrivateEndpointConnection{
	// 	Name: to.Ptr("privateEndpointProxyName"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/privateEndpointConnections/privateEndpointConnectionName"),
	// 	Properties: &armapimanagement.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armapimanagement.PrivateEndpoint{
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/privateEndpointName"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armapimanagement.PrivateLinkServiceConnectionState{
	// 			Description: to.Ptr("Please approve my request, thanks"),
	// 			ActionsRequired: to.Ptr("None"),
	// 			Status: to.Ptr(armapimanagement.PrivateEndpointServiceConnectionStatusPending),
	// 		},
	// 		ProvisioningState: to.Ptr(armapimanagement.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionClient) GetPrivateLinkResource

func (client *PrivateEndpointConnectionClient) GetPrivateLinkResource(ctx context.Context, resourceGroupName string, serviceName string, privateLinkSubResourceName string, options *PrivateEndpointConnectionClientGetPrivateLinkResourceOptions) (PrivateEndpointConnectionClientGetPrivateLinkResourceResponse, error)

GetPrivateLinkResource - Gets the private link resources If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • privateLinkSubResourceName - Name of the private link resource.
  • options - PrivateEndpointConnectionClientGetPrivateLinkResourceOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetPrivateLinkResource method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPrivateLinkGroupResource.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateEndpointConnectionClient().GetPrivateLinkResource(ctx, "rg1", "apimService1", "privateLinkSubResourceName", 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.PrivateLinkResource = armapimanagement.PrivateLinkResource{
	// 	Name: to.Ptr("Gateway"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/privateLinkResources"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/privateLinkResources/Gateway"),
	// 	Properties: &armapimanagement.PrivateLinkResourceProperties{
	// 		GroupID: to.Ptr("Gateway"),
	// 		RequiredMembers: []*string{
	// 			to.Ptr("Gateway")},
	// 			RequiredZoneNames: []*string{
	// 				to.Ptr("privateLink.azure-api.net")},
	// 			},
	// 		}
}
Output:

func (*PrivateEndpointConnectionClient) ListPrivateLinkResources

ListPrivateLinkResources - Gets the private link resources If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - PrivateEndpointConnectionClientListPrivateLinkResourcesOptions contains the optional parameters for the PrivateEndpointConnectionClient.ListPrivateLinkResources method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPrivateLinkGroupResources.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateEndpointConnectionClient().ListPrivateLinkResources(ctx, "rg1", "apimService1", 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.PrivateLinkResourceListResult = armapimanagement.PrivateLinkResourceListResult{
	// 	Value: []*armapimanagement.PrivateLinkResource{
	// 		{
	// 			Name: to.Ptr("Gateway"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/privateLinkResources"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/privateLinkResources/Gateway"),
	// 			Properties: &armapimanagement.PrivateLinkResourceProperties{
	// 				GroupID: to.Ptr("Gateway"),
	// 				RequiredMembers: []*string{
	// 					to.Ptr("Gateway")},
	// 					RequiredZoneNames: []*string{
	// 						to.Ptr("privateLink.azure-api.net")},
	// 					},
	// 			}},
	// 		}
}
Output:

func (*PrivateEndpointConnectionClient) NewListByServicePager added in v0.5.0

NewListByServicePager - Lists all private endpoint connections of the API Management service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - PrivateEndpointConnectionClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPrivateEndpointConnections.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateEndpointConnectionClient().NewListByServicePager("rg1", "apimService1", 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.PrivateEndpointConnectionListResult = armapimanagement.PrivateEndpointConnectionListResult{
		// 	Value: []*armapimanagement.PrivateEndpointConnection{
		// 		{
		// 			Name: to.Ptr("privateEndpointProxyName"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/privateEndpointConnections/connectionName"),
		// 			Properties: &armapimanagement.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armapimanagement.PrivateEndpoint{
		// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/privateEndpointName"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armapimanagement.PrivateLinkServiceConnectionState{
		// 					Description: to.Ptr("Please approve my request, thanks"),
		// 					ActionsRequired: to.Ptr("None"),
		// 					Status: to.Ptr(armapimanagement.PrivateEndpointServiceConnectionStatusPending),
		// 				},
		// 				ProvisioningState: to.Ptr(armapimanagement.PrivateEndpointConnectionProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("privateEndpointProxyName2"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/privateEndpointConnections/privateEndpointProxyName2"),
		// 			Properties: &armapimanagement.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armapimanagement.PrivateEndpoint{
		// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/privateEndpointName2"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armapimanagement.PrivateLinkServiceConnectionState{
		// 					Description: to.Ptr("Please approve my request, thanks"),
		// 					ActionsRequired: to.Ptr("None"),
		// 					Status: to.Ptr(armapimanagement.PrivateEndpointServiceConnectionStatusPending),
		// 				},
		// 				ProvisioningState: to.Ptr(armapimanagement.PrivateEndpointConnectionProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

type PrivateEndpointConnectionClientBeginCreateOrUpdateOptions added in v0.3.0

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

PrivateEndpointConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginCreateOrUpdate method.

type PrivateEndpointConnectionClientBeginDeleteOptions added in v0.3.0

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

PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete method.

type PrivateEndpointConnectionClientCreateOrUpdateResponse added in v0.3.0

type PrivateEndpointConnectionClientCreateOrUpdateResponse struct {
	PrivateEndpointConnection
}

PrivateEndpointConnectionClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionClient.BeginCreateOrUpdate.

type PrivateEndpointConnectionClientDeleteResponse added in v0.3.0

type PrivateEndpointConnectionClientDeleteResponse struct {
}

PrivateEndpointConnectionClientDeleteResponse contains the response from method PrivateEndpointConnectionClient.BeginDelete.

type PrivateEndpointConnectionClientGetByNameOptions added in v0.3.0

type PrivateEndpointConnectionClientGetByNameOptions struct {
}

PrivateEndpointConnectionClientGetByNameOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetByName method.

type PrivateEndpointConnectionClientGetByNameResponse added in v0.3.0

type PrivateEndpointConnectionClientGetByNameResponse struct {
	PrivateEndpointConnection
}

PrivateEndpointConnectionClientGetByNameResponse contains the response from method PrivateEndpointConnectionClient.GetByName.

type PrivateEndpointConnectionClientGetPrivateLinkResourceOptions added in v0.3.0

type PrivateEndpointConnectionClientGetPrivateLinkResourceOptions struct {
}

PrivateEndpointConnectionClientGetPrivateLinkResourceOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetPrivateLinkResource method.

type PrivateEndpointConnectionClientGetPrivateLinkResourceResponse added in v0.3.0

type PrivateEndpointConnectionClientGetPrivateLinkResourceResponse struct {
	PrivateLinkResource
}

PrivateEndpointConnectionClientGetPrivateLinkResourceResponse contains the response from method PrivateEndpointConnectionClient.GetPrivateLinkResource.

type PrivateEndpointConnectionClientListByServiceOptions added in v0.3.0

type PrivateEndpointConnectionClientListByServiceOptions struct {
}

PrivateEndpointConnectionClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionClient.NewListByServicePager method.

type PrivateEndpointConnectionClientListByServiceResponse added in v0.3.0

type PrivateEndpointConnectionClientListByServiceResponse struct {
	PrivateEndpointConnectionListResult
}

PrivateEndpointConnectionClientListByServiceResponse contains the response from method PrivateEndpointConnectionClient.NewListByServicePager.

type PrivateEndpointConnectionClientListPrivateLinkResourcesOptions added in v0.3.0

type PrivateEndpointConnectionClientListPrivateLinkResourcesOptions struct {
}

PrivateEndpointConnectionClientListPrivateLinkResourcesOptions contains the optional parameters for the PrivateEndpointConnectionClient.ListPrivateLinkResources method.

type PrivateEndpointConnectionClientListPrivateLinkResourcesResponse added in v0.3.0

type PrivateEndpointConnectionClientListPrivateLinkResourcesResponse struct {
	PrivateLinkResourceListResult
}

PrivateEndpointConnectionClientListPrivateLinkResourcesResponse contains the response from method PrivateEndpointConnectionClient.ListPrivateLinkResources.

type PrivateEndpointConnectionListResult

type PrivateEndpointConnectionListResult struct {
	// Array of private endpoint connections
	Value []*PrivateEndpointConnection
}

PrivateEndpointConnectionListResult - List of private endpoint connection associated with the specified storage account

func (PrivateEndpointConnectionListResult) MarshalJSON

func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.

func (*PrivateEndpointConnectionListResult) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.

type PrivateEndpointConnectionProperties

type PrivateEndpointConnectionProperties struct {
	// REQUIRED; A collection of information about the state of the connection between service consumer and provider.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState

	// The resource of private end point.
	PrivateEndpoint *PrivateEndpoint

	// READ-ONLY; The provisioning state of the private endpoint connection resource.
	ProvisioningState *PrivateEndpointConnectionProvisioningState
}

PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties.

func (PrivateEndpointConnectionProperties) MarshalJSON added in v1.1.0

func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.

func (*PrivateEndpointConnectionProperties) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.

type PrivateEndpointConnectionProvisioningState

type PrivateEndpointConnectionProvisioningState string

PrivateEndpointConnectionProvisioningState - The current provisioning state.

const (
	PrivateEndpointConnectionProvisioningStateCreating  PrivateEndpointConnectionProvisioningState = "Creating"
	PrivateEndpointConnectionProvisioningStateDeleting  PrivateEndpointConnectionProvisioningState = "Deleting"
	PrivateEndpointConnectionProvisioningStateFailed    PrivateEndpointConnectionProvisioningState = "Failed"
	PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded"
)

func PossiblePrivateEndpointConnectionProvisioningStateValues

func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState

PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type.

type PrivateEndpointConnectionRequest

type PrivateEndpointConnectionRequest struct {
	// Private Endpoint Connection Resource Id.
	ID *string

	// The connection state of the private endpoint connection.
	Properties *PrivateEndpointConnectionRequestProperties
}

PrivateEndpointConnectionRequest - A request to approve or reject a private endpoint connection

func (PrivateEndpointConnectionRequest) MarshalJSON added in v1.1.0

func (p PrivateEndpointConnectionRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionRequest.

func (*PrivateEndpointConnectionRequest) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpointConnectionRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionRequest.

type PrivateEndpointConnectionRequestProperties

type PrivateEndpointConnectionRequestProperties struct {
	// A collection of information about the state of the connection between service consumer and provider.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState
}

PrivateEndpointConnectionRequestProperties - The connection state of the private endpoint connection.

func (PrivateEndpointConnectionRequestProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionRequestProperties.

func (*PrivateEndpointConnectionRequestProperties) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpointConnectionRequestProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionRequestProperties.

type PrivateEndpointConnectionWrapperProperties

type PrivateEndpointConnectionWrapperProperties struct {
	// REQUIRED; A collection of information about the state of the connection between service consumer and provider.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState

	// The resource of private end point.
	PrivateEndpoint *ArmIDWrapper

	// READ-ONLY; All the Group ids.
	GroupIDs []*string

	// READ-ONLY; The provisioning state of the private endpoint connection resource.
	ProvisioningState *string
}

PrivateEndpointConnectionWrapperProperties - Properties of the PrivateEndpointConnectProperties.

func (PrivateEndpointConnectionWrapperProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionWrapperProperties.

func (*PrivateEndpointConnectionWrapperProperties) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpointConnectionWrapperProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionWrapperProperties.

type PrivateEndpointServiceConnectionStatus

type PrivateEndpointServiceConnectionStatus string

PrivateEndpointServiceConnectionStatus - The private endpoint connection status.

const (
	PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved"
	PrivateEndpointServiceConnectionStatusPending  PrivateEndpointServiceConnectionStatus = "Pending"
	PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected"
)

func PossiblePrivateEndpointServiceConnectionStatusValues

func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus

PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type.

type PrivateLinkResource

type PrivateLinkResource struct {
	// Resource properties.
	Properties *PrivateLinkResourceProperties

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

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

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

PrivateLinkResource - A private link resource

func (PrivateLinkResource) MarshalJSON

func (p PrivateLinkResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.

func (*PrivateLinkResource) UnmarshalJSON added in v1.1.0

func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.

type PrivateLinkResourceListResult

type PrivateLinkResourceListResult struct {
	// Array of private link resources
	Value []*PrivateLinkResource
}

PrivateLinkResourceListResult - A list of private link resources

func (PrivateLinkResourceListResult) MarshalJSON

func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.

func (*PrivateLinkResourceListResult) UnmarshalJSON added in v1.1.0

func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.

type PrivateLinkResourceProperties

type PrivateLinkResourceProperties struct {
	// The private link resource Private link DNS zone name.
	RequiredZoneNames []*string

	// READ-ONLY; The private link resource group id.
	GroupID *string

	// READ-ONLY; The private link resource required member names.
	RequiredMembers []*string
}

PrivateLinkResourceProperties - Properties of a private link resource.

func (PrivateLinkResourceProperties) MarshalJSON

func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.

func (*PrivateLinkResourceProperties) UnmarshalJSON added in v1.1.0

func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.

type PrivateLinkServiceConnectionState

type PrivateLinkServiceConnectionState struct {
	// A message indicating if changes on the service provider require any updates on the consumer.
	ActionsRequired *string

	// The reason for approval/rejection of the connection.
	Description *string

	// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
	Status *PrivateEndpointServiceConnectionStatus
}

PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.

func (PrivateLinkServiceConnectionState) MarshalJSON added in v1.1.0

func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.

func (*PrivateLinkServiceConnectionState) UnmarshalJSON added in v1.1.0

func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.

type ProductAPIClient

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

ProductAPIClient contains the methods for the ProductAPI group. Don't use this type directly, use NewProductAPIClient() instead.

func NewProductAPIClient

func NewProductAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductAPIClient, error)

NewProductAPIClient creates a new instance of ProductAPIClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ProductAPIClient) CheckEntityExists

func (client *ProductAPIClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiID string, options *ProductAPIClientCheckEntityExistsOptions) (ProductAPIClientCheckEntityExistsResponse, error)

CheckEntityExists - Checks that API entity specified by identifier is associated with the Product entity.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - ProductAPIClientCheckEntityExistsOptions contains the optional parameters for the ProductAPIClient.CheckEntityExists method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductApi.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewProductAPIClient().CheckEntityExists(ctx, "rg1", "apimService1", "5931a75ae4bbd512a88c680b", "59306a29e4bbd510dc24e5f9", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ProductAPIClient) CreateOrUpdate

func (client *ProductAPIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiID string, options *ProductAPIClientCreateOrUpdateOptions) (ProductAPIClientCreateOrUpdateResponse, error)

CreateOrUpdate - Adds an API to the specified product. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - ProductAPIClientCreateOrUpdateOptions contains the optional parameters for the ProductAPIClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductApi.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProductAPIClient().CreateOrUpdate(ctx, "rg1", "apimService1", "testproduct", "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.APIContract = armapimanagement.APIContract{
	// 	Name: to.Ptr("5931a75ae4bbd512a88c680b"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/apis"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5931a75ae4bbd512a88c680b"),
	// 	Properties: &armapimanagement.APIContractProperties{
	// 		APIRevision: to.Ptr("1"),
	// 		IsCurrent: to.Ptr(true),
	// 		SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{
	// 			Header: to.Ptr("Ocp-Apim-Subscription-Key"),
	// 			Query: to.Ptr("subscription-key"),
	// 		},
	// 		Path: to.Ptr(""),
	// 		DisplayName: to.Ptr("EchoApi"),
	// 		Protocols: []*armapimanagement.Protocol{
	// 			to.Ptr(armapimanagement.ProtocolHTTP),
	// 			to.Ptr(armapimanagement.ProtocolHTTPS)},
	// 			ServiceURL: to.Ptr("https://contoso.com/apis/echo"),
	// 		},
	// 	}
}
Output:

func (*ProductAPIClient) Delete

func (client *ProductAPIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiID string, options *ProductAPIClientDeleteOptions) (ProductAPIClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - ProductAPIClientDeleteOptions contains the optional parameters for the ProductAPIClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductApi.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*ProductAPIClient) NewListByProductPager added in v0.5.0

func (client *ProductAPIClient) NewListByProductPager(resourceGroupName string, serviceName string, productID string, options *ProductAPIClientListByProductOptions) *runtime.Pager[ProductAPIClientListByProductResponse]

NewListByProductPager - Lists a collection of the APIs associated with a product.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • options - ProductAPIClientListByProductOptions contains the optional parameters for the ProductAPIClient.NewListByProductPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductApis.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewProductAPIClient().NewListByProductPager("rg1", "apimService1", "5768181ea40f7eb6c49f6ac7", &armapimanagement.ProductAPIClientListByProductOptions{Filter: nil,
		Top:  nil,
		Skip: 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.APICollection = armapimanagement.APICollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.APIContract{
		// 		{
		// 			Name: to.Ptr("57681820a40f7eb6c49f6aca"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/products/apis"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5768181ea40f7eb6c49f6ac7/apis/57681820a40f7eb6c49f6aca"),
		// 			Properties: &armapimanagement.APIContractProperties{
		// 				Description: to.Ptr("description_57681820a40f7eb6c49f6acc"),
		// 				APIRevision: to.Ptr("1"),
		// 				IsCurrent: to.Ptr(true),
		// 				Path: to.Ptr("suffix_57681820a40f7eb6c49f6ace"),
		// 				DisplayName: to.Ptr("api_57681820a40f7eb6c49f6acb"),
		// 				Protocols: []*armapimanagement.Protocol{
		// 					to.Ptr(armapimanagement.ProtocolHTTPS)},
		// 					ServiceURL: to.Ptr("http://contoso/57681820a40f7eb6c49f6acd"),
		// 				},
		// 		}},
		// 	}
	}
}
Output:

type ProductAPIClientCheckEntityExistsOptions added in v0.3.0

type ProductAPIClientCheckEntityExistsOptions struct {
}

ProductAPIClientCheckEntityExistsOptions contains the optional parameters for the ProductAPIClient.CheckEntityExists method.

type ProductAPIClientCheckEntityExistsResponse added in v0.3.0

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

ProductAPIClientCheckEntityExistsResponse contains the response from method ProductAPIClient.CheckEntityExists.

type ProductAPIClientCreateOrUpdateOptions added in v0.3.0

type ProductAPIClientCreateOrUpdateOptions struct {
}

ProductAPIClientCreateOrUpdateOptions contains the optional parameters for the ProductAPIClient.CreateOrUpdate method.

type ProductAPIClientCreateOrUpdateResponse added in v0.3.0

type ProductAPIClientCreateOrUpdateResponse struct {
	APIContract
}

ProductAPIClientCreateOrUpdateResponse contains the response from method ProductAPIClient.CreateOrUpdate.

type ProductAPIClientDeleteOptions added in v0.3.0

type ProductAPIClientDeleteOptions struct {
}

ProductAPIClientDeleteOptions contains the optional parameters for the ProductAPIClient.Delete method.

type ProductAPIClientDeleteResponse added in v0.3.0

type ProductAPIClientDeleteResponse struct {
}

ProductAPIClientDeleteResponse contains the response from method ProductAPIClient.Delete.

type ProductAPIClientListByProductOptions added in v0.3.0

type ProductAPIClientListByProductOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ProductAPIClientListByProductOptions contains the optional parameters for the ProductAPIClient.NewListByProductPager method.

type ProductAPIClientListByProductResponse added in v0.3.0

type ProductAPIClientListByProductResponse struct {
	APICollection
}

ProductAPIClientListByProductResponse contains the response from method ProductAPIClient.NewListByProductPager.

type ProductClient

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

ProductClient contains the methods for the Product group. Don't use this type directly, use NewProductClient() instead.

func NewProductClient

func NewProductClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductClient, error)

NewProductClient creates a new instance of ProductClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ProductClient) CreateOrUpdate

func (client *ProductClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters ProductContract, options *ProductClientCreateOrUpdateOptions) (ProductClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or Updates a product. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • parameters - Create or update parameters.
  • options - ProductClientCreateOrUpdateOptions contains the optional parameters for the ProductClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProduct.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProductClient().CreateOrUpdate(ctx, "rg1", "apimService1", "testproduct", armapimanagement.ProductContract{
		Properties: &armapimanagement.ProductContractProperties{
			DisplayName: to.Ptr("Test Template ProductName 4"),
		},
	}, &armapimanagement.ProductClientCreateOrUpdateOptions{IfMatch: 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.ProductContract = armapimanagement.ProductContract{
	// 	Name: to.Ptr("testproduct"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/products"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/testproduct"),
	// 	Properties: &armapimanagement.ProductContractProperties{
	// 		ApprovalRequired: to.Ptr(false),
	// 		State: to.Ptr(armapimanagement.ProductStateNotPublished),
	// 		SubscriptionRequired: to.Ptr(true),
	// 		DisplayName: to.Ptr("Test Template ProductName 4"),
	// 	},
	// }
}
Output:

func (*ProductClient) Delete

func (client *ProductClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, options *ProductClientDeleteOptions) (ProductClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - ProductClientDeleteOptions contains the optional parameters for the ProductClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProduct.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewProductClient().Delete(ctx, "rg1", "apimService1", "testproduct", "*", &armapimanagement.ProductClientDeleteOptions{DeleteSubscriptions: to.Ptr(true)})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ProductClient) Get

func (client *ProductClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductClientGetOptions) (ProductClientGetResponse, error)

Get - Gets the details of the product specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • options - ProductClientGetOptions contains the optional parameters for the ProductClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProduct.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProductClient().Get(ctx, "rg1", "apimService1", "unlimited", 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.ProductContract = armapimanagement.ProductContract{
	// 	Name: to.Ptr("unlimited"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/products"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/unlimited"),
	// 	Properties: &armapimanagement.ProductContractProperties{
	// 		Description: to.Ptr("Subscribers have completely unlimited access to the API. Administrator approval is required."),
	// 		ApprovalRequired: to.Ptr(true),
	// 		State: to.Ptr(armapimanagement.ProductStatePublished),
	// 		SubscriptionRequired: to.Ptr(true),
	// 		SubscriptionsLimit: to.Ptr[int32](1),
	// 		DisplayName: to.Ptr("Unlimited"),
	// 	},
	// }
}
Output:

func (*ProductClient) GetEntityTag

func (client *ProductClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductClientGetEntityTagOptions) (ProductClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the product specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • options - ProductClientGetEntityTagOptions contains the optional parameters for the ProductClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProduct.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewProductClient().GetEntityTag(ctx, "rg1", "apimService1", "unlimited", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ProductClient) NewListByServicePager added in v0.5.0

func (client *ProductClient) NewListByServicePager(resourceGroupName string, serviceName string, options *ProductClientListByServiceOptions) *runtime.Pager[ProductClientListByServiceResponse]

NewListByServicePager - Lists a collection of products in the specified service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - ProductClientListByServiceOptions contains the optional parameters for the ProductClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProducts.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewProductClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.ProductClientListByServiceOptions{Filter: nil,
		Top:          nil,
		Skip:         nil,
		ExpandGroups: nil,
		Tags:         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.ProductCollection = armapimanagement.ProductCollection{
		// 	Count: to.Ptr[int64](3),
		// 	Value: []*armapimanagement.ProductContract{
		// 		{
		// 			Name: to.Ptr("kjoshiarmtemplateCert1"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/products"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/kjoshiarmtemplateCert1"),
		// 			Properties: &armapimanagement.ProductContractProperties{
		// 				Description: to.Ptr("Development Product"),
		// 				State: to.Ptr(armapimanagement.ProductStatePublished),
		// 				SubscriptionRequired: to.Ptr(false),
		// 				DisplayName: to.Ptr("Dev"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("starter"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/products"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/starter"),
		// 			Properties: &armapimanagement.ProductContractProperties{
		// 				Description: to.Ptr("Subscribers will be able to run 5 calls/minute up to a maximum of 100 calls/week."),
		// 				ApprovalRequired: to.Ptr(false),
		// 				State: to.Ptr(armapimanagement.ProductStatePublished),
		// 				SubscriptionRequired: to.Ptr(true),
		// 				SubscriptionsLimit: to.Ptr[int32](1),
		// 				Terms: to.Ptr(""),
		// 				DisplayName: to.Ptr("Starter"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("unlimited"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/products"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/unlimited"),
		// 			Properties: &armapimanagement.ProductContractProperties{
		// 				Description: to.Ptr("Subscribers have completely unlimited access to the API. Administrator approval is required."),
		// 				ApprovalRequired: to.Ptr(true),
		// 				State: to.Ptr(armapimanagement.ProductStatePublished),
		// 				SubscriptionRequired: to.Ptr(true),
		// 				SubscriptionsLimit: to.Ptr[int32](1),
		// 				DisplayName: to.Ptr("Unlimited"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ProductClient) NewListByTagsPager added in v0.5.0

func (client *ProductClient) NewListByTagsPager(resourceGroupName string, serviceName string, options *ProductClientListByTagsOptions) *runtime.Pager[ProductClientListByTagsResponse]

NewListByTagsPager - Lists a collection of products associated with tags.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - ProductClientListByTagsOptions contains the optional parameters for the ProductClient.NewListByTagsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductsByTags.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewProductClient().NewListByTagsPager("rg1", "apimService1", &armapimanagement.ProductClientListByTagsOptions{Filter: nil,
		Top:                      nil,
		Skip:                     nil,
		IncludeNotTaggedProducts: 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.TagResourceCollection = armapimanagement.TagResourceCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.TagResourceContract{
		// 		{
		// 			Product: &armapimanagement.ProductTagResourceContractProperties{
		// 				Description: to.Ptr("Subscribers will be able to run 5 calls/minute up to a maximum of 100 calls/week."),
		// 				ApprovalRequired: to.Ptr(false),
		// 				State: to.Ptr(armapimanagement.ProductStatePublished),
		// 				SubscriptionRequired: to.Ptr(true),
		// 				SubscriptionsLimit: to.Ptr[int32](1),
		// 				Terms: to.Ptr(""),
		// 				Name: to.Ptr("Starter"),
		// 				ID: to.Ptr("/products/starter"),
		// 			},
		// 			Tag: &armapimanagement.TagResourceContractProperties{
		// 				Name: to.Ptr("awesomeTag"),
		// 				ID: to.Ptr("/tags/apitag123"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ProductClient) Update

func (client *ProductClient) Update(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, parameters ProductUpdateParameters, options *ProductClientUpdateOptions) (ProductClientUpdateResponse, error)

Update - Update existing product details. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - ProductClientUpdateOptions contains the optional parameters for the ProductClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateProduct.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProductClient().Update(ctx, "rg1", "apimService1", "testproduct", "*", armapimanagement.ProductUpdateParameters{
		Properties: &armapimanagement.ProductUpdateProperties{
			DisplayName: to.Ptr("Test Template ProductName 4"),
		},
	}, 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.ProductContract = armapimanagement.ProductContract{
	// 	Name: to.Ptr("testproduct"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/products"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/testproduct"),
	// 	Properties: &armapimanagement.ProductContractProperties{
	// 		Description: to.Ptr("Subscribers have completely unlimited access to the API. Administrator approval is required."),
	// 		ApprovalRequired: to.Ptr(true),
	// 		State: to.Ptr(armapimanagement.ProductStatePublished),
	// 		SubscriptionRequired: to.Ptr(true),
	// 		SubscriptionsLimit: to.Ptr[int32](1),
	// 		DisplayName: to.Ptr("Test Template ProductName 4"),
	// 	},
	// }
}
Output:

type ProductClientCreateOrUpdateOptions added in v0.3.0

type ProductClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

ProductClientCreateOrUpdateOptions contains the optional parameters for the ProductClient.CreateOrUpdate method.

type ProductClientCreateOrUpdateResponse added in v0.3.0

type ProductClientCreateOrUpdateResponse struct {
	ProductContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ProductClientCreateOrUpdateResponse contains the response from method ProductClient.CreateOrUpdate.

type ProductClientDeleteOptions added in v0.3.0

type ProductClientDeleteOptions struct {
	// Delete existing subscriptions associated with the product or not.
	DeleteSubscriptions *bool
}

ProductClientDeleteOptions contains the optional parameters for the ProductClient.Delete method.

type ProductClientDeleteResponse added in v0.3.0

type ProductClientDeleteResponse struct {
}

ProductClientDeleteResponse contains the response from method ProductClient.Delete.

type ProductClientGetEntityTagOptions added in v0.3.0

type ProductClientGetEntityTagOptions struct {
}

ProductClientGetEntityTagOptions contains the optional parameters for the ProductClient.GetEntityTag method.

type ProductClientGetEntityTagResponse added in v0.3.0

type ProductClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

ProductClientGetEntityTagResponse contains the response from method ProductClient.GetEntityTag.

type ProductClientGetOptions added in v0.3.0

type ProductClientGetOptions struct {
}

ProductClientGetOptions contains the optional parameters for the ProductClient.Get method.

type ProductClientGetResponse added in v0.3.0

type ProductClientGetResponse struct {
	ProductContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ProductClientGetResponse contains the response from method ProductClient.Get.

type ProductClientListByServiceOptions added in v0.3.0

type ProductClientListByServiceOptions struct {
	// When set to true, the response contains an array of groups that have visibility to the product. The default is false.
	ExpandGroups *bool
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | state | filter | eq | |
	// | groups | expand | | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Products which are part of a specific tag.
	Tags *string
	// Number of records to return.
	Top *int32
}

ProductClientListByServiceOptions contains the optional parameters for the ProductClient.NewListByServicePager method.

type ProductClientListByServiceResponse added in v0.3.0

type ProductClientListByServiceResponse struct {
	ProductCollection
}

ProductClientListByServiceResponse contains the response from method ProductClient.NewListByServicePager.

type ProductClientListByTagsOptions added in v0.3.0

type ProductClientListByTagsOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | state | filter | eq | substringof, contains, startswith, endswith |
	Filter *string
	// Include not tagged Products.
	IncludeNotTaggedProducts *bool
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ProductClientListByTagsOptions contains the optional parameters for the ProductClient.NewListByTagsPager method.

type ProductClientListByTagsResponse added in v0.3.0

type ProductClientListByTagsResponse struct {
	TagResourceCollection
}

ProductClientListByTagsResponse contains the response from method ProductClient.NewListByTagsPager.

type ProductClientUpdateOptions added in v0.3.0

type ProductClientUpdateOptions struct {
}

ProductClientUpdateOptions contains the optional parameters for the ProductClient.Update method.

type ProductClientUpdateResponse added in v0.3.0

type ProductClientUpdateResponse struct {
	ProductContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ProductClientUpdateResponse contains the response from method ProductClient.Update.

type ProductCollection

type ProductCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*ProductContract
}

ProductCollection - Paged Products list representation.

func (ProductCollection) MarshalJSON

func (p ProductCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProductCollection.

func (*ProductCollection) UnmarshalJSON added in v1.1.0

func (p *ProductCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProductCollection.

type ProductContract

type ProductContract struct {
	// Product entity contract properties.
	Properties *ProductContractProperties

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

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

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

ProductContract - Product details.

func (ProductContract) MarshalJSON

func (p ProductContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProductContract.

func (*ProductContract) UnmarshalJSON added in v1.1.0

func (p *ProductContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProductContract.

type ProductContractProperties

type ProductContractProperties struct {
	// REQUIRED; Product name.
	DisplayName *string

	// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers
	// to call the product’s APIs immediately after subscribing. If true,
	// administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present
	// only if subscriptionRequired property is present and has a value of false.
	ApprovalRequired *bool

	// Product description. May include HTML formatting tags.
	Description *string

	// whether product is published or not. Published products are discoverable by users of developer portal. Non published products
	// are visible only to administrators. Default state of Product is
	// notPublished.
	State *ProductState

	// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred
	// to as "protected" and a valid subscription key is required for a request to an
	// API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included
	// in the product can be made without a subscription key. If property is omitted
	// when creating a new product it's value is assumed to be true.
	SubscriptionRequired *bool

	// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited
	// per user subscriptions. Can be present only if subscriptionRequired
	// property is present and has a value of false.
	SubscriptionsLimit *int32

	// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms
	// before they can complete the subscription process.
	Terms *string
}

ProductContractProperties - Product profile.

func (ProductContractProperties) MarshalJSON added in v1.1.0

func (p ProductContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProductContractProperties.

func (*ProductContractProperties) UnmarshalJSON added in v1.1.0

func (p *ProductContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProductContractProperties.

type ProductEntityBaseParameters

type ProductEntityBaseParameters struct {
	// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers
	// to call the product’s APIs immediately after subscribing. If true,
	// administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present
	// only if subscriptionRequired property is present and has a value of false.
	ApprovalRequired *bool

	// Product description. May include HTML formatting tags.
	Description *string

	// whether product is published or not. Published products are discoverable by users of developer portal. Non published products
	// are visible only to administrators. Default state of Product is
	// notPublished.
	State *ProductState

	// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred
	// to as "protected" and a valid subscription key is required for a request to an
	// API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included
	// in the product can be made without a subscription key. If property is omitted
	// when creating a new product it's value is assumed to be true.
	SubscriptionRequired *bool

	// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited
	// per user subscriptions. Can be present only if subscriptionRequired
	// property is present and has a value of false.
	SubscriptionsLimit *int32

	// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms
	// before they can complete the subscription process.
	Terms *string
}

ProductEntityBaseParameters - Product Entity Base Parameters

func (ProductEntityBaseParameters) MarshalJSON added in v1.1.0

func (p ProductEntityBaseParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProductEntityBaseParameters.

func (*ProductEntityBaseParameters) UnmarshalJSON added in v1.1.0

func (p *ProductEntityBaseParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProductEntityBaseParameters.

type ProductGroupClient

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

ProductGroupClient contains the methods for the ProductGroup group. Don't use this type directly, use NewProductGroupClient() instead.

func NewProductGroupClient

func NewProductGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductGroupClient, error)

NewProductGroupClient creates a new instance of ProductGroupClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ProductGroupClient) CheckEntityExists

func (client *ProductGroupClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string, options *ProductGroupClientCheckEntityExistsOptions) (ProductGroupClientCheckEntityExistsResponse, error)

CheckEntityExists - Checks that Group entity specified by identifier is associated with the Product entity.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • options - ProductGroupClientCheckEntityExistsOptions contains the optional parameters for the ProductGroupClient.CheckEntityExists method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewProductGroupClient().CheckEntityExists(ctx, "rg1", "apimService1", "5931a75ae4bbd512a88c680b", "59306a29e4bbd510dc24e5f9", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ProductGroupClient) CreateOrUpdate

func (client *ProductGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string, options *ProductGroupClientCreateOrUpdateOptions) (ProductGroupClientCreateOrUpdateResponse, error)

CreateOrUpdate - Adds the association between the specified developer group with the specified product. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • options - ProductGroupClientCreateOrUpdateOptions contains the optional parameters for the ProductGroupClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProductGroupClient().CreateOrUpdate(ctx, "rg1", "apimService1", "testproduct", "templateGroup", 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.GroupContract = armapimanagement.GroupContract{
	// 	Name: to.Ptr("templateGroup"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/products/groups"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/groups/templateGroup"),
	// 	Properties: &armapimanagement.GroupContractProperties{
	// 		Type: to.Ptr(armapimanagement.GroupTypeCustom),
	// 		Description: to.Ptr("group created via Template"),
	// 		BuiltIn: to.Ptr(false),
	// 		DisplayName: to.Ptr("Template Group"),
	// 	},
	// }
}
Output:

func (*ProductGroupClient) Delete

func (client *ProductGroupClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string, options *ProductGroupClientDeleteOptions) (ProductGroupClientDeleteResponse, error)

Delete - Deletes the association between the specified group and product. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • groupID - Group identifier. Must be unique in the current API Management service instance.
  • options - ProductGroupClientDeleteOptions contains the optional parameters for the ProductGroupClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*ProductGroupClient) NewListByProductPager added in v0.5.0

func (client *ProductGroupClient) NewListByProductPager(resourceGroupName string, serviceName string, productID string, options *ProductGroupClientListByProductOptions) *runtime.Pager[ProductGroupClientListByProductResponse]

NewListByProductPager - Lists the collection of developer groups associated with the specified product.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • options - ProductGroupClientListByProductOptions contains the optional parameters for the ProductGroupClient.NewListByProductPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductGroups.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewProductGroupClient().NewListByProductPager("rg1", "apimService1", "5600b57e7e8880006a060002", &armapimanagement.ProductGroupClientListByProductOptions{Filter: nil,
		Top:  nil,
		Skip: 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.GroupCollection = armapimanagement.GroupCollection{
		// 	Count: to.Ptr[int64](3),
		// 	Value: []*armapimanagement.GroupContract{
		// 		{
		// 			Name: to.Ptr("5600b57e7e8880006a020001"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/products/groups"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b57e7e8880006a060002/groups/5600b57e7e8880006a020001"),
		// 			Properties: &armapimanagement.GroupContractProperties{
		// 				Type: to.Ptr(armapimanagement.GroupTypeSystem),
		// 				Description: to.Ptr("Administrators is a built-in group. Its membership is managed by the system. Microsoft Azure subscription administrators fall into this group."),
		// 				BuiltIn: to.Ptr(true),
		// 				DisplayName: to.Ptr("Administrators"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("5600b57e7e8880006a020002"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/products/groups"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b57e7e8880006a060002/groups/5600b57e7e8880006a020002"),
		// 			Properties: &armapimanagement.GroupContractProperties{
		// 				Type: to.Ptr(armapimanagement.GroupTypeSystem),
		// 				Description: to.Ptr("Developers is a built-in group. Its membership is managed by the system. Signed-in users fall into this group."),
		// 				BuiltIn: to.Ptr(true),
		// 				DisplayName: to.Ptr("Developers"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("5600b57e7e8880006a020003"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/products/groups"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b57e7e8880006a060002/groups/5600b57e7e8880006a020003"),
		// 			Properties: &armapimanagement.GroupContractProperties{
		// 				Type: to.Ptr(armapimanagement.GroupTypeSystem),
		// 				Description: to.Ptr("Guests is a built-in group. Its membership is managed by the system. Unauthenticated users visiting the developer portal fall into this group."),
		// 				BuiltIn: to.Ptr(true),
		// 				DisplayName: to.Ptr("Guests"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ProductGroupClientCheckEntityExistsOptions added in v0.3.0

type ProductGroupClientCheckEntityExistsOptions struct {
}

ProductGroupClientCheckEntityExistsOptions contains the optional parameters for the ProductGroupClient.CheckEntityExists method.

type ProductGroupClientCheckEntityExistsResponse added in v0.3.0

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

ProductGroupClientCheckEntityExistsResponse contains the response from method ProductGroupClient.CheckEntityExists.

type ProductGroupClientCreateOrUpdateOptions added in v0.3.0

type ProductGroupClientCreateOrUpdateOptions struct {
}

ProductGroupClientCreateOrUpdateOptions contains the optional parameters for the ProductGroupClient.CreateOrUpdate method.

type ProductGroupClientCreateOrUpdateResponse added in v0.3.0

type ProductGroupClientCreateOrUpdateResponse struct {
	GroupContract
}

ProductGroupClientCreateOrUpdateResponse contains the response from method ProductGroupClient.CreateOrUpdate.

type ProductGroupClientDeleteOptions added in v0.3.0

type ProductGroupClientDeleteOptions struct {
}

ProductGroupClientDeleteOptions contains the optional parameters for the ProductGroupClient.Delete method.

type ProductGroupClientDeleteResponse added in v0.3.0

type ProductGroupClientDeleteResponse struct {
}

ProductGroupClientDeleteResponse contains the response from method ProductGroupClient.Delete.

type ProductGroupClientListByProductOptions added in v0.3.0

type ProductGroupClientListByProductOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | |
	// | displayName | filter | eq, ne | |
	// | description | filter | eq, ne | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ProductGroupClientListByProductOptions contains the optional parameters for the ProductGroupClient.NewListByProductPager method.

type ProductGroupClientListByProductResponse added in v0.3.0

type ProductGroupClientListByProductResponse struct {
	GroupCollection
}

ProductGroupClientListByProductResponse contains the response from method ProductGroupClient.NewListByProductPager.

type ProductPolicyClient

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

ProductPolicyClient contains the methods for the ProductPolicy group. Don't use this type directly, use NewProductPolicyClient() instead.

func NewProductPolicyClient

func NewProductPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductPolicyClient, error)

NewProductPolicyClient creates a new instance of ProductPolicyClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ProductPolicyClient) CreateOrUpdate

func (client *ProductPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, parameters PolicyContract, options *ProductPolicyClientCreateOrUpdateOptions) (ProductPolicyClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates policy configuration for the Product. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • policyID - The identifier of the Policy.
  • parameters - The policy contents to apply.
  • options - ProductPolicyClientCreateOrUpdateOptions contains the optional parameters for the ProductPolicyClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductPolicy.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProductPolicyClient().CreateOrUpdate(ctx, "rg1", "apimService1", "5702e97e5157a50f48dce801", armapimanagement.PolicyIDNamePolicy, armapimanagement.PolicyContract{
		Properties: &armapimanagement.PolicyContractProperties{
			Format: to.Ptr(armapimanagement.PolicyContentFormatXML),
			Value:  to.Ptr("<policies>\r\n  <inbound>\r\n    <rate-limit calls=\"{{call-count}}\" renewal-period=\"15\"></rate-limit>\r\n    <log-to-eventhub logger-id=\"16\">\r\n                      @( string.Join(\",\", DateTime.UtcNow, context.Deployment.ServiceName, context.RequestId, context.Request.IpAddress, context.Operation.Name) ) \r\n                  </log-to-eventhub>\r\n    <quota-by-key calls=\"40\" counter-key=\"cc\" renewal-period=\"3600\" increment-count=\"@(context.Request.Method == &quot;POST&quot; ? 1:2)\" />\r\n    <base />\r\n  </inbound>\r\n  <backend>\r\n    <base />\r\n  </backend>\r\n  <outbound>\r\n    <base />\r\n  </outbound>\r\n</policies>"),
		},
	}, &armapimanagement.ProductPolicyClientCreateOrUpdateOptions{IfMatch: 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.PolicyContract = armapimanagement.PolicyContract{
	// 	Name: to.Ptr("policy"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/products/policies"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5702e97e5157a50f48dce801/policies/policy"),
	// 	Properties: &armapimanagement.PolicyContractProperties{
	// 		Value: to.Ptr("<policies>\r\n  <inbound>\r\n    <rate-limit calls=\"{{58c884fed8d14f127cec38f0}}\" renewal-period=\"15\" version=\"2\"></rate-limit>\r\n    <log-to-eventhub logger-id=\"16\">\r\n                      @( string.Join(\",\", DateTime.UtcNow, context.Deployment.ServiceName, context.RequestId, context.Request.IpAddress, context.Operation.Name) ) \r\n                  </log-to-eventhub>\r\n    <quota-by-key calls=\"40\" counter-key=\"cc\" renewal-period=\"3600\" increment-count=\"@(context.Request.Method == &quot;POST&quot; ? 1:2)\" />\r\n    <base />\r\n  </inbound>\r\n  <backend>\r\n    <base />\r\n  </backend>\r\n  <outbound>\r\n    <base />\r\n  </outbound>\r\n</policies>"),
	// 	},
	// }
}
Output:

func (*ProductPolicyClient) Delete

func (client *ProductPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, ifMatch string, options *ProductPolicyClientDeleteOptions) (ProductPolicyClientDeleteResponse, error)

Delete - Deletes the policy configuration at the Product. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • policyID - The identifier of the Policy.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - ProductPolicyClientDeleteOptions contains the optional parameters for the ProductPolicyClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewProductPolicyClient().Delete(ctx, "rg1", "apimService1", "testproduct", armapimanagement.PolicyIDNamePolicy, "*", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ProductPolicyClient) Get

func (client *ProductPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, options *ProductPolicyClientGetOptions) (ProductPolicyClientGetResponse, error)

Get - Get the policy configuration at the Product level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • policyID - The identifier of the Policy.
  • options - ProductPolicyClientGetOptions contains the optional parameters for the ProductPolicyClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProductPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProductPolicyClient().Get(ctx, "rg1", "apimService1", "kjoshiarmTemplateProduct4", armapimanagement.PolicyIDNamePolicy, &armapimanagement.ProductPolicyClientGetOptions{Format: 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.PolicyContract = armapimanagement.PolicyContract{
	// 	Name: to.Ptr("policy"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/products/policies"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/kjoshiarmTemplateProduct4/policies/policy"),
	// 	Properties: &armapimanagement.PolicyContractProperties{
	// 		Value: to.Ptr("<policies>\r\n  <inbound>\r\n    <base />\r\n  </inbound>\r\n  <backend>\r\n    <base />\r\n  </backend>\r\n  <outbound>\r\n    <base />\r\n  </outbound>\r\n  <on-error>\r\n    <base />\r\n  </on-error>\r\n</policies>"),
	// 	},
	// }
}
Output:

func (*ProductPolicyClient) GetEntityTag

func (client *ProductPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, options *ProductPolicyClientGetEntityTagOptions) (ProductPolicyClientGetEntityTagResponse, error)

GetEntityTag - Get the ETag of the policy configuration at the Product level.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • policyID - The identifier of the Policy.
  • options - ProductPolicyClientGetEntityTagOptions contains the optional parameters for the ProductPolicyClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewProductPolicyClient().GetEntityTag(ctx, "rg1", "apimService1", "unlimited", armapimanagement.PolicyIDNamePolicy, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ProductPolicyClient) ListByProduct

func (client *ProductPolicyClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductPolicyClientListByProductOptions) (ProductPolicyClientListByProductResponse, error)

ListByProduct - Get the policy configuration at the Product level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • options - ProductPolicyClientListByProductOptions contains the optional parameters for the ProductPolicyClient.ListByProduct method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductPolicies.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProductPolicyClient().ListByProduct(ctx, "rg1", "apimService1", "armTemplateProduct4", 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.PolicyCollection = armapimanagement.PolicyCollection{
	// 	Count: to.Ptr[int64](1),
	// 	Value: []*armapimanagement.PolicyContract{
	// 		{
	// 			Name: to.Ptr("policy"),
	// 			Type: to.Ptr("Microsoft.ApiManagement/service/products/policies"),
	// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/armTemplateProduct4/policies/policy"),
	// 			Properties: &armapimanagement.PolicyContractProperties{
	// 				Value: to.Ptr("<policies>\r\n  <inbound>\r\n    <base />\r\n  </inbound>\r\n  <backend>\r\n    <base />\r\n  </backend>\r\n  <outbound>\r\n    <base />\r\n  </outbound>\r\n  <on-error>\r\n    <base />\r\n  </on-error>\r\n</policies>"),
	// 			},
	// 	}},
	// }
}
Output:

type ProductPolicyClientCreateOrUpdateOptions added in v0.3.0

type ProductPolicyClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

ProductPolicyClientCreateOrUpdateOptions contains the optional parameters for the ProductPolicyClient.CreateOrUpdate method.

type ProductPolicyClientCreateOrUpdateResponse added in v0.3.0

type ProductPolicyClientCreateOrUpdateResponse struct {
	PolicyContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ProductPolicyClientCreateOrUpdateResponse contains the response from method ProductPolicyClient.CreateOrUpdate.

type ProductPolicyClientDeleteOptions added in v0.3.0

type ProductPolicyClientDeleteOptions struct {
}

ProductPolicyClientDeleteOptions contains the optional parameters for the ProductPolicyClient.Delete method.

type ProductPolicyClientDeleteResponse added in v0.3.0

type ProductPolicyClientDeleteResponse struct {
}

ProductPolicyClientDeleteResponse contains the response from method ProductPolicyClient.Delete.

type ProductPolicyClientGetEntityTagOptions added in v0.3.0

type ProductPolicyClientGetEntityTagOptions struct {
}

ProductPolicyClientGetEntityTagOptions contains the optional parameters for the ProductPolicyClient.GetEntityTag method.

type ProductPolicyClientGetEntityTagResponse added in v0.3.0

type ProductPolicyClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

ProductPolicyClientGetEntityTagResponse contains the response from method ProductPolicyClient.GetEntityTag.

type ProductPolicyClientGetOptions added in v0.3.0

type ProductPolicyClientGetOptions struct {
	// Policy Export Format.
	Format *PolicyExportFormat
}

ProductPolicyClientGetOptions contains the optional parameters for the ProductPolicyClient.Get method.

type ProductPolicyClientGetResponse added in v0.3.0

type ProductPolicyClientGetResponse struct {
	PolicyContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

ProductPolicyClientGetResponse contains the response from method ProductPolicyClient.Get.

type ProductPolicyClientListByProductOptions added in v0.3.0

type ProductPolicyClientListByProductOptions struct {
}

ProductPolicyClientListByProductOptions contains the optional parameters for the ProductPolicyClient.ListByProduct method.

type ProductPolicyClientListByProductResponse added in v0.3.0

type ProductPolicyClientListByProductResponse struct {
	PolicyCollection
}

ProductPolicyClientListByProductResponse contains the response from method ProductPolicyClient.ListByProduct.

type ProductState

type ProductState string

ProductState - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished.

const (
	ProductStateNotPublished ProductState = "notPublished"
	ProductStatePublished    ProductState = "published"
)

func PossibleProductStateValues

func PossibleProductStateValues() []ProductState

PossibleProductStateValues returns the possible values for the ProductState const type.

type ProductSubscriptionsClient

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

ProductSubscriptionsClient contains the methods for the ProductSubscriptions group. Don't use this type directly, use NewProductSubscriptionsClient() instead.

func NewProductSubscriptionsClient

func NewProductSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductSubscriptionsClient, error)

NewProductSubscriptionsClient creates a new instance of ProductSubscriptionsClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ProductSubscriptionsClient) NewListPager added in v0.5.0

func (client *ProductSubscriptionsClient) NewListPager(resourceGroupName string, serviceName string, productID string, options *ProductSubscriptionsClientListOptions) *runtime.Pager[ProductSubscriptionsClientListResponse]

NewListPager - Lists the collection of subscriptions to the specified product.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • options - ProductSubscriptionsClientListOptions contains the optional parameters for the ProductSubscriptionsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductSubscriptions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewProductSubscriptionsClient().NewListPager("rg1", "apimService1", "5600b57e7e8880006a060002", &armapimanagement.ProductSubscriptionsClientListOptions{Filter: nil,
		Top:  nil,
		Skip: 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.SubscriptionCollection = armapimanagement.SubscriptionCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.SubscriptionContract{
		// 		{
		// 			Name: to.Ptr("5600b57e7e8880006a070002"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/products/subscriptions"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b57e7e8880006a060002/subscriptions/5600b57e7e8880006a070002"),
		// 			Properties: &armapimanagement.SubscriptionContractProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-22T01:57:18.723Z"); return t}()),
		// 				OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
		// 				Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b57e7e8880006a060002"),
		// 				State: to.Ptr(armapimanagement.SubscriptionStateActive),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ProductSubscriptionsClientListOptions added in v0.3.0

type ProductSubscriptionsClientListOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | state | filter | eq | |
	// | user | expand | | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ProductSubscriptionsClientListOptions contains the optional parameters for the ProductSubscriptionsClient.NewListPager method.

type ProductSubscriptionsClientListResponse added in v0.3.0

type ProductSubscriptionsClientListResponse struct {
	SubscriptionCollection
}

ProductSubscriptionsClientListResponse contains the response from method ProductSubscriptionsClient.NewListPager.

type ProductTagResourceContractProperties

type ProductTagResourceContractProperties struct {
	// REQUIRED; Product name.
	Name *string

	// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers
	// to call the product’s APIs immediately after subscribing. If true,
	// administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present
	// only if subscriptionRequired property is present and has a value of false.
	ApprovalRequired *bool

	// Product description. May include HTML formatting tags.
	Description *string

	// Identifier of the product in the form of /products/{productId}
	ID *string

	// whether product is published or not. Published products are discoverable by users of developer portal. Non published products
	// are visible only to administrators. Default state of Product is
	// notPublished.
	State *ProductState

	// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred
	// to as "protected" and a valid subscription key is required for a request to an
	// API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included
	// in the product can be made without a subscription key. If property is omitted
	// when creating a new product it's value is assumed to be true.
	SubscriptionRequired *bool

	// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited
	// per user subscriptions. Can be present only if subscriptionRequired
	// property is present and has a value of false.
	SubscriptionsLimit *int32

	// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms
	// before they can complete the subscription process.
	Terms *string
}

ProductTagResourceContractProperties - Product profile.

func (ProductTagResourceContractProperties) MarshalJSON added in v1.1.0

func (p ProductTagResourceContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProductTagResourceContractProperties.

func (*ProductTagResourceContractProperties) UnmarshalJSON added in v1.1.0

func (p *ProductTagResourceContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProductTagResourceContractProperties.

type ProductUpdateParameters

type ProductUpdateParameters struct {
	// Product entity Update contract properties.
	Properties *ProductUpdateProperties
}

ProductUpdateParameters - Product Update parameters.

func (ProductUpdateParameters) MarshalJSON

func (p ProductUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProductUpdateParameters.

func (*ProductUpdateParameters) UnmarshalJSON added in v1.1.0

func (p *ProductUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProductUpdateParameters.

type ProductUpdateProperties

type ProductUpdateProperties struct {
	// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers
	// to call the product’s APIs immediately after subscribing. If true,
	// administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present
	// only if subscriptionRequired property is present and has a value of false.
	ApprovalRequired *bool

	// Product description. May include HTML formatting tags.
	Description *string

	// Product name.
	DisplayName *string

	// whether product is published or not. Published products are discoverable by users of developer portal. Non published products
	// are visible only to administrators. Default state of Product is
	// notPublished.
	State *ProductState

	// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred
	// to as "protected" and a valid subscription key is required for a request to an
	// API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included
	// in the product can be made without a subscription key. If property is omitted
	// when creating a new product it's value is assumed to be true.
	SubscriptionRequired *bool

	// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited
	// per user subscriptions. Can be present only if subscriptionRequired
	// property is present and has a value of false.
	SubscriptionsLimit *int32

	// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms
	// before they can complete the subscription process.
	Terms *string
}

ProductUpdateProperties - Parameters supplied to the Update Product operation.

func (ProductUpdateProperties) MarshalJSON added in v1.1.0

func (p ProductUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProductUpdateProperties.

func (*ProductUpdateProperties) UnmarshalJSON added in v1.1.0

func (p *ProductUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProductUpdateProperties.

type Protocol

type Protocol string
const (
	ProtocolHTTP  Protocol = "http"
	ProtocolHTTPS Protocol = "https"
	ProtocolWs    Protocol = "ws"
	ProtocolWss   Protocol = "wss"
)

func PossibleProtocolValues

func PossibleProtocolValues() []Protocol

PossibleProtocolValues returns the possible values for the Protocol const type.

type PublicNetworkAccess

type PublicNetworkAccess string

PublicNetworkAccess - Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'

const (
	PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled"
	PublicNetworkAccessEnabled  PublicNetworkAccess = "Enabled"
)

func PossiblePublicNetworkAccessValues

func PossiblePublicNetworkAccessValues() []PublicNetworkAccess

PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type.

type QuotaByCounterKeysClient

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

QuotaByCounterKeysClient contains the methods for the QuotaByCounterKeys group. Don't use this type directly, use NewQuotaByCounterKeysClient() instead.

func NewQuotaByCounterKeysClient

func NewQuotaByCounterKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaByCounterKeysClient, error)

NewQuotaByCounterKeysClient creates a new instance of QuotaByCounterKeysClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*QuotaByCounterKeysClient) ListByService

func (client *QuotaByCounterKeysClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, options *QuotaByCounterKeysClientListByServiceOptions) (QuotaByCounterKeysClientListByServiceResponse, error)

ListByService - Lists a collection of current quota counter periods associated with the counter-key configured in the policy on the specified service instance. The api does not support paging yet. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key
  • options - QuotaByCounterKeysClientListByServiceOptions contains the optional parameters for the QuotaByCounterKeysClient.ListByService method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetQuotaCounterKeys.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewQuotaByCounterKeysClient().ListByService(ctx, "rg1", "apimService1", "ba", 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.QuotaCounterCollection = armapimanagement.QuotaCounterCollection{
	// 	Value: []*armapimanagement.QuotaCounterContract{
	// 		{
	// 			CounterKey: to.Ptr("ba"),
	// 			PeriodEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T16:54:40Z"); return t}()),
	// 			PeriodKey: to.Ptr("0_P3Y6M4DT12H30M5S"),
	// 			PeriodStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2014-08-04T04:24:35Z"); return t}()),
	// 			Value: &armapimanagement.QuotaCounterValueContractProperties{
	// 				CallsCount: to.Ptr[int32](5),
	// 				KbTransferred: to.Ptr[float64](2.5830078125),
	// 			},
	// 	}},
	// }
}
Output:

func (*QuotaByCounterKeysClient) Update

func (client *QuotaByCounterKeysClient) Update(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, parameters QuotaCounterValueUpdateContract, options *QuotaByCounterKeysClientUpdateOptions) (QuotaByCounterKeysClientUpdateResponse, error)

Update - Updates all the quota counter values specified with the existing quota counter key to a value in the specified service instance. This should be used for reset of the quota counter values. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key
  • parameters - The value of the quota counter to be applied to all quota counter periods.
  • options - QuotaByCounterKeysClientUpdateOptions contains the optional parameters for the QuotaByCounterKeysClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateQuotaCounterKey.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewQuotaByCounterKeysClient().Update(ctx, "rg1", "apimService1", "ba", armapimanagement.QuotaCounterValueUpdateContract{
		Properties: &armapimanagement.QuotaCounterValueContractProperties{
			CallsCount:    to.Ptr[int32](0),
			KbTransferred: to.Ptr[float64](2.5630078125),
		},
	}, 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.QuotaCounterCollection = armapimanagement.QuotaCounterCollection{
	// 	Value: []*armapimanagement.QuotaCounterContract{
	// 		{
	// 			CounterKey: to.Ptr("ba"),
	// 			PeriodEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T16:54:40Z"); return t}()),
	// 			PeriodKey: to.Ptr("0_P3Y6M4DT12H30M5S"),
	// 			PeriodStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2014-08-04T04:24:35Z"); return t}()),
	// 			Value: &armapimanagement.QuotaCounterValueContractProperties{
	// 				CallsCount: to.Ptr[int32](5),
	// 				KbTransferred: to.Ptr[float64](2.5830078125),
	// 			},
	// 	}},
	// }
}
Output:

type QuotaByCounterKeysClientListByServiceOptions added in v0.3.0

type QuotaByCounterKeysClientListByServiceOptions struct {
}

QuotaByCounterKeysClientListByServiceOptions contains the optional parameters for the QuotaByCounterKeysClient.ListByService method.

type QuotaByCounterKeysClientListByServiceResponse added in v0.3.0

type QuotaByCounterKeysClientListByServiceResponse struct {
	QuotaCounterCollection
}

QuotaByCounterKeysClientListByServiceResponse contains the response from method QuotaByCounterKeysClient.ListByService.

type QuotaByCounterKeysClientUpdateOptions added in v0.3.0

type QuotaByCounterKeysClientUpdateOptions struct {
}

QuotaByCounterKeysClientUpdateOptions contains the optional parameters for the QuotaByCounterKeysClient.Update method.

type QuotaByCounterKeysClientUpdateResponse added in v0.3.0

type QuotaByCounterKeysClientUpdateResponse struct {
	QuotaCounterCollection
}

QuotaByCounterKeysClientUpdateResponse contains the response from method QuotaByCounterKeysClient.Update.

type QuotaByPeriodKeysClient

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

QuotaByPeriodKeysClient contains the methods for the QuotaByPeriodKeys group. Don't use this type directly, use NewQuotaByPeriodKeysClient() instead.

func NewQuotaByPeriodKeysClient

func NewQuotaByPeriodKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaByPeriodKeysClient, error)

NewQuotaByPeriodKeysClient creates a new instance of QuotaByPeriodKeysClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*QuotaByPeriodKeysClient) Get

func (client *QuotaByPeriodKeysClient) Get(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, quotaPeriodKey string, options *QuotaByPeriodKeysClientGetOptions) (QuotaByPeriodKeysClientGetResponse, error)

Get - Gets the value of the quota counter associated with the counter-key in the policy for the specific period in service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key
  • quotaPeriodKey - Quota period key identifier.
  • options - QuotaByPeriodKeysClientGetOptions contains the optional parameters for the QuotaByPeriodKeysClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetQuotaCounterKeysByQuotaPeriod.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewQuotaByPeriodKeysClient().Get(ctx, "rg1", "apimService1", "ba", "0_P3Y6M4DT12H30M5S", 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.QuotaCounterContract = armapimanagement.QuotaCounterContract{
	// 	CounterKey: to.Ptr("ba"),
	// 	PeriodEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T16:54:40Z"); return t}()),
	// 	PeriodKey: to.Ptr("0_P3Y6M4DT12H30M5S"),
	// 	PeriodStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2014-08-04T04:24:35Z"); return t}()),
	// 	Value: &armapimanagement.QuotaCounterValueContractProperties{
	// 		CallsCount: to.Ptr[int32](0),
	// 		KbTransferred: to.Ptr[float64](2.5625),
	// 	},
	// }
}
Output:

func (*QuotaByPeriodKeysClient) Update

func (client *QuotaByPeriodKeysClient) Update(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, quotaPeriodKey string, parameters QuotaCounterValueUpdateContract, options *QuotaByPeriodKeysClientUpdateOptions) (QuotaByPeriodKeysClientUpdateResponse, error)

Update - Updates an existing quota counter value in the specified service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key
  • quotaPeriodKey - Quota period key identifier.
  • parameters - The value of the Quota counter to be applied on the specified period.
  • options - QuotaByPeriodKeysClientUpdateOptions contains the optional parameters for the QuotaByPeriodKeysClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateQuotaCounterKeyByQuotaPeriod.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewQuotaByPeriodKeysClient().Update(ctx, "rg1", "apimService1", "ba", "0_P3Y6M4DT12H30M5S", armapimanagement.QuotaCounterValueUpdateContract{
		Properties: &armapimanagement.QuotaCounterValueContractProperties{
			CallsCount:    to.Ptr[int32](0),
			KbTransferred: to.Ptr[float64](0),
		},
	}, 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.QuotaCounterContract = armapimanagement.QuotaCounterContract{
	// 	CounterKey: to.Ptr("ba"),
	// 	PeriodEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-08T16:54:40Z"); return t}()),
	// 	PeriodKey: to.Ptr("0_P3Y6M4DT12H30M5S"),
	// 	PeriodStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2014-08-04T04:24:35Z"); return t}()),
	// 	Value: &armapimanagement.QuotaCounterValueContractProperties{
	// 		CallsCount: to.Ptr[int32](0),
	// 		KbTransferred: to.Ptr[float64](2.5625),
	// 	},
	// }
}
Output:

type QuotaByPeriodKeysClientGetOptions added in v0.3.0

type QuotaByPeriodKeysClientGetOptions struct {
}

QuotaByPeriodKeysClientGetOptions contains the optional parameters for the QuotaByPeriodKeysClient.Get method.

type QuotaByPeriodKeysClientGetResponse added in v0.3.0

type QuotaByPeriodKeysClientGetResponse struct {
	QuotaCounterContract
}

QuotaByPeriodKeysClientGetResponse contains the response from method QuotaByPeriodKeysClient.Get.

type QuotaByPeriodKeysClientUpdateOptions added in v0.3.0

type QuotaByPeriodKeysClientUpdateOptions struct {
}

QuotaByPeriodKeysClientUpdateOptions contains the optional parameters for the QuotaByPeriodKeysClient.Update method.

type QuotaByPeriodKeysClientUpdateResponse added in v0.3.0

type QuotaByPeriodKeysClientUpdateResponse struct {
	QuotaCounterContract
}

QuotaByPeriodKeysClientUpdateResponse contains the response from method QuotaByPeriodKeysClient.Update.

type QuotaCounterCollection

type QuotaCounterCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Quota counter values.
	Value []*QuotaCounterContract
}

QuotaCounterCollection - Paged Quota Counter list representation.

func (QuotaCounterCollection) MarshalJSON

func (q QuotaCounterCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaCounterCollection.

func (*QuotaCounterCollection) UnmarshalJSON added in v1.1.0

func (q *QuotaCounterCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterCollection.

type QuotaCounterContract

type QuotaCounterContract struct {
	// REQUIRED; The Key value of the Counter. Must not be empty.
	CounterKey *string

	// REQUIRED; The date of the end of Counter Period. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified
	// by the ISO 8601 standard.
	PeriodEndTime *time.Time

	// REQUIRED; Identifier of the Period for which the counter was collected. Must not be empty.
	PeriodKey *string

	// REQUIRED; The date of the start of Counter Period. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified
	// by the ISO 8601 standard.
	PeriodStartTime *time.Time

	// Quota Value Properties
	Value *QuotaCounterValueContractProperties
}

QuotaCounterContract - Quota counter details.

func (QuotaCounterContract) MarshalJSON

func (q QuotaCounterContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaCounterContract.

func (*QuotaCounterContract) UnmarshalJSON

func (q *QuotaCounterContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterContract.

type QuotaCounterValueContract

type QuotaCounterValueContract struct {
	// Quota counter Value Properties.
	Value *QuotaCounterValueContractProperties
}

QuotaCounterValueContract - Quota counter value details.

func (QuotaCounterValueContract) MarshalJSON added in v1.1.0

func (q QuotaCounterValueContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueContract.

func (*QuotaCounterValueContract) UnmarshalJSON added in v1.1.0

func (q *QuotaCounterValueContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueContract.

type QuotaCounterValueContractProperties

type QuotaCounterValueContractProperties struct {
	// Number of times Counter was called.
	CallsCount *int32

	// Data Transferred in KiloBytes.
	KbTransferred *float64
}

QuotaCounterValueContractProperties - Quota counter value details.

func (QuotaCounterValueContractProperties) MarshalJSON added in v1.1.0

func (q QuotaCounterValueContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueContractProperties.

func (*QuotaCounterValueContractProperties) UnmarshalJSON added in v1.1.0

func (q *QuotaCounterValueContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueContractProperties.

type QuotaCounterValueUpdateContract

type QuotaCounterValueUpdateContract struct {
	// Quota counter value details.
	Properties *QuotaCounterValueContractProperties
}

QuotaCounterValueUpdateContract - Quota counter value details.

func (QuotaCounterValueUpdateContract) MarshalJSON

func (q QuotaCounterValueUpdateContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueUpdateContract.

func (*QuotaCounterValueUpdateContract) UnmarshalJSON added in v1.1.0

func (q *QuotaCounterValueUpdateContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueUpdateContract.

type RecipientEmailCollection

type RecipientEmailCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*RecipientEmailContract
}

RecipientEmailCollection - Paged Recipient User list representation.

func (RecipientEmailCollection) MarshalJSON

func (r RecipientEmailCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RecipientEmailCollection.

func (*RecipientEmailCollection) UnmarshalJSON added in v1.1.0

func (r *RecipientEmailCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailCollection.

type RecipientEmailContract

type RecipientEmailContract struct {
	// Recipient Email contract properties.
	Properties *RecipientEmailContractProperties

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

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

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

RecipientEmailContract - Recipient Email details.

func (RecipientEmailContract) MarshalJSON

func (r RecipientEmailContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RecipientEmailContract.

func (*RecipientEmailContract) UnmarshalJSON added in v1.1.0

func (r *RecipientEmailContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailContract.

type RecipientEmailContractProperties

type RecipientEmailContractProperties struct {
	// User Email subscribed to notification.
	Email *string
}

RecipientEmailContractProperties - Recipient Email Contract Properties.

func (RecipientEmailContractProperties) MarshalJSON added in v1.1.0

func (r RecipientEmailContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RecipientEmailContractProperties.

func (*RecipientEmailContractProperties) UnmarshalJSON added in v1.1.0

func (r *RecipientEmailContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailContractProperties.

type RecipientUserCollection

type RecipientUserCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*RecipientUserContract
}

RecipientUserCollection - Paged Recipient User list representation.

func (RecipientUserCollection) MarshalJSON

func (r RecipientUserCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RecipientUserCollection.

func (*RecipientUserCollection) UnmarshalJSON added in v1.1.0

func (r *RecipientUserCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUserCollection.

type RecipientUserContract

type RecipientUserContract struct {
	// Recipient User entity contract properties.
	Properties *RecipientUsersContractProperties

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

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

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

RecipientUserContract - Recipient User details.

func (RecipientUserContract) MarshalJSON

func (r RecipientUserContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RecipientUserContract.

func (*RecipientUserContract) UnmarshalJSON added in v1.1.0

func (r *RecipientUserContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUserContract.

type RecipientUsersContractProperties

type RecipientUsersContractProperties struct {
	// API Management UserId subscribed to notification.
	UserID *string
}

RecipientUsersContractProperties - Recipient User Contract Properties.

func (RecipientUsersContractProperties) MarshalJSON added in v1.1.0

func (r RecipientUsersContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RecipientUsersContractProperties.

func (*RecipientUsersContractProperties) UnmarshalJSON added in v1.1.0

func (r *RecipientUsersContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUsersContractProperties.

type RecipientsContractProperties

type RecipientsContractProperties struct {
	// List of Emails subscribed for the notification.
	Emails []*string

	// List of Users subscribed for the notification.
	Users []*string
}

RecipientsContractProperties - Notification Parameter contract.

func (RecipientsContractProperties) MarshalJSON

func (r RecipientsContractProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RecipientsContractProperties.

func (*RecipientsContractProperties) UnmarshalJSON added in v1.1.0

func (r *RecipientsContractProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RecipientsContractProperties.

type RegionClient

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

RegionClient contains the methods for the Region group. Don't use this type directly, use NewRegionClient() instead.

func NewRegionClient

func NewRegionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegionClient, error)

NewRegionClient creates a new instance of RegionClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*RegionClient) NewListByServicePager added in v0.5.0

func (client *RegionClient) NewListByServicePager(resourceGroupName string, serviceName string, options *RegionClientListByServiceOptions) *runtime.Pager[RegionClientListByServiceResponse]

NewListByServicePager - Lists all azure regions in which the service exists.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - RegionClientListByServiceOptions contains the optional parameters for the RegionClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListRegions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRegionClient().NewListByServicePager("rg1", "apimService1", 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.RegionListResult = armapimanagement.RegionListResult{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.RegionContract{
		// 		{
		// 			Name: to.Ptr("West US"),
		// 			IsDeleted: to.Ptr(false),
		// 			IsMasterRegion: to.Ptr(true),
		// 	}},
		// }
	}
}
Output:

type RegionClientListByServiceOptions added in v0.3.0

type RegionClientListByServiceOptions struct {
}

RegionClientListByServiceOptions contains the optional parameters for the RegionClient.NewListByServicePager method.

type RegionClientListByServiceResponse added in v0.3.0

type RegionClientListByServiceResponse struct {
	RegionListResult
}

RegionClientListByServiceResponse contains the response from method RegionClient.NewListByServicePager.

type RegionContract

type RegionContract struct {
	// whether Region is deleted.
	IsDeleted *bool

	// whether Region is the master region.
	IsMasterRegion *bool

	// READ-ONLY; Region name.
	Name *string
}

RegionContract - Region profile.

func (RegionContract) MarshalJSON added in v1.1.0

func (r RegionContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegionContract.

func (*RegionContract) UnmarshalJSON added in v1.1.0

func (r *RegionContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegionContract.

type RegionListResult

type RegionListResult struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Lists of Regions.
	Value []*RegionContract
}

RegionListResult - Lists Regions operation response details.

func (RegionListResult) MarshalJSON

func (r RegionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegionListResult.

func (*RegionListResult) UnmarshalJSON added in v1.1.0

func (r *RegionListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegionListResult.

type RegistrationDelegationSettingsProperties

type RegistrationDelegationSettingsProperties struct {
	// Enable or disable delegation for user registration.
	Enabled *bool
}

RegistrationDelegationSettingsProperties - User registration delegation settings properties.

func (RegistrationDelegationSettingsProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type RegistrationDelegationSettingsProperties.

func (*RegistrationDelegationSettingsProperties) UnmarshalJSON added in v1.1.0

func (r *RegistrationDelegationSettingsProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationDelegationSettingsProperties.

type RemotePrivateEndpointConnectionWrapper

type RemotePrivateEndpointConnectionWrapper struct {
	// Private Endpoint connection resource id
	ID *string

	// Private Endpoint Connection Name
	Name *string

	// Resource properties.
	Properties *PrivateEndpointConnectionWrapperProperties

	// Private Endpoint Connection Resource Type
	Type *string
}

RemotePrivateEndpointConnectionWrapper - Remote Private Endpoint Connection resource.

func (RemotePrivateEndpointConnectionWrapper) MarshalJSON added in v1.1.0

func (r RemotePrivateEndpointConnectionWrapper) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpointConnectionWrapper.

func (*RemotePrivateEndpointConnectionWrapper) UnmarshalJSON added in v1.1.0

func (r *RemotePrivateEndpointConnectionWrapper) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RemotePrivateEndpointConnectionWrapper.

type ReportCollection

type ReportCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*ReportRecordContract
}

ReportCollection - Paged Report records list representation.

func (ReportCollection) MarshalJSON

func (r ReportCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportCollection.

func (*ReportCollection) UnmarshalJSON added in v1.1.0

func (r *ReportCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportCollection.

type ReportRecordContract

type ReportRecordContract struct {
	// API identifier path. /apis/{apiId}
	APIID *string

	// API region identifier.
	APIRegion *string

	// Average time it took to process request.
	APITimeAvg *float64

	// Maximum time it took to process request.
	APITimeMax *float64

	// Minimum time it took to process request.
	APITimeMin *float64

	// Bandwidth consumed.
	Bandwidth *int64

	// Number of times when content was served from cache policy.
	CacheHitCount *int32

	// Number of times content was fetched from backend.
	CacheMissCount *int32

	// Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden
	// and HttpStatusCode.TooManyRequests
	CallCountBlocked *int32

	// Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and
	// any Code between HttpStatusCode.InternalServerError (500) and 600
	CallCountFailed *int32

	// Number of other calls.
	CallCountOther *int32

	// Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect
	CallCountSuccess *int32

	// Total number of calls.
	CallCountTotal *int32

	// Country to which this record data is related.
	Country *string

	// Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601
	// format (http://en.wikipedia.org/wiki/ISO_8601#Durations).
	Interval *string

	// Name depending on report endpoint specifies product, API, operation or developer name.
	Name *string

	// Operation identifier path. /apis/{apiId}/operations/{operationId}
	OperationID *string

	// Country region to which this record data is related.
	Region *string

	// Average time it took to process request on backend.
	ServiceTimeAvg *float64

	// Maximum time it took to process request on backend.
	ServiceTimeMax *float64

	// Minimum time it took to process request on backend.
	ServiceTimeMin *float64

	// Subscription identifier path. /subscriptions/{subscriptionId}
	SubscriptionID *string

	// Start of aggregation period. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601
	// standard.
	Timestamp *time.Time

	// Zip code to which this record data is related.
	Zip *string

	// READ-ONLY; Product identifier path. /products/{productId}
	ProductID *string

	// READ-ONLY; User identifier path. /users/{userId}
	UserID *string
}

ReportRecordContract - Report data.

func (ReportRecordContract) MarshalJSON

func (r ReportRecordContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportRecordContract.

func (*ReportRecordContract) UnmarshalJSON

func (r *ReportRecordContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportRecordContract.

type ReportsClient

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

ReportsClient contains the methods for the Reports group. Don't use this type directly, use NewReportsClient() instead.

func NewReportsClient

func NewReportsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReportsClient, error)

NewReportsClient creates a new instance of ReportsClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ReportsClient) NewListByAPIPager added in v0.5.0

func (client *ReportsClient) NewListByAPIPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByAPIOptions) *runtime.Pager[ReportsClientListByAPIResponse]

NewListByAPIPager - Lists report records by API.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • filter - The filter to apply on the operation.
  • options - ReportsClientListByAPIOptions contains the optional parameters for the ReportsClient.NewListByAPIPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByApi.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReportsClient().NewListByAPIPager("rg1", "apimService1", "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByAPIOptions{Top: nil,
		Skip:    nil,
		Orderby: 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.ReportCollection = armapimanagement.ReportCollection{
		// 	Count: to.Ptr[int64](2),
		// 	Value: []*armapimanagement.ReportRecordContract{
		// 		{
		// 			Name: to.Ptr("Echo API"),
		// 			APIID: to.Ptr("/apis/5600b59475ff190048040001"),
		// 			APITimeAvg: to.Ptr[float64](0),
		// 			APITimeMax: to.Ptr[float64](0),
		// 			APITimeMin: to.Ptr[float64](0),
		// 			Bandwidth: to.Ptr[int64](0),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](0),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](0),
		// 			CallCountTotal: to.Ptr[int32](0),
		// 			ServiceTimeAvg: to.Ptr[float64](0),
		// 			ServiceTimeMax: to.Ptr[float64](0),
		// 			ServiceTimeMin: to.Ptr[float64](0),
		// 		},
		// 		{
		// 			Name: to.Ptr("httpbin"),
		// 			APIID: to.Ptr("/apis/57a03a13e4bbd5119c8b19e9"),
		// 			APITimeAvg: to.Ptr[float64](1015.7607923076923),
		// 			APITimeMax: to.Ptr[float64](1819.2173),
		// 			APITimeMin: to.Ptr[float64](330.3206),
		// 			Bandwidth: to.Ptr[int64](11019),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](1),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](13),
		// 			CallCountTotal: to.Ptr[int32](14),
		// 			ServiceTimeAvg: to.Ptr[float64](957.094776923077),
		// 			ServiceTimeMax: to.Ptr[float64](1697.3612),
		// 			ServiceTimeMin: to.Ptr[float64](215.24),
		// 	}},
		// }
	}
}
Output:

func (*ReportsClient) NewListByGeoPager added in v0.5.0

func (client *ReportsClient) NewListByGeoPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByGeoOptions) *runtime.Pager[ReportsClientListByGeoResponse]

NewListByGeoPager - Lists report records by geography.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • filter - | Field | Usage | Supported operators | Supported functions | |-------------|-------------|-------------|-------------| | timestamp | filter | ge, le | | | country | select | | | | region | select | | | | zip | select | | | | apiRegion | filter | eq | | | userId | filter | eq | | | productId | filter | eq | | | subscriptionId | filter | eq | | | apiId | filter | eq | | | operationId | filter | eq | | | callCountSuccess | select | | | | callCountBlocked | select | | | | callCountFailed | select | | | | callCountOther | select | | | | bandwidth | select, orderBy | | | | cacheHitsCount | select | | | | cacheMissCount | select | | | | apiTimeAvg | select | | | | apiTimeMin | select | | | | apiTimeMax | select | | | | serviceTimeAvg | select | | | | serviceTimeMin | select | | | | serviceTimeMax | select | | |
  • options - ReportsClientListByGeoOptions contains the optional parameters for the ReportsClient.NewListByGeoPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByGeo.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReportsClient().NewListByGeoPager("rg1", "apimService1", "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByGeoOptions{Top: nil,
		Skip: 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.ReportCollection = armapimanagement.ReportCollection{
		// 	Value: []*armapimanagement.ReportRecordContract{
		// 		{
		// 			APITimeAvg: to.Ptr[float64](1015.7607923076923),
		// 			APITimeMax: to.Ptr[float64](1819.2173),
		// 			APITimeMin: to.Ptr[float64](330.3206),
		// 			Bandwidth: to.Ptr[int64](11019),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](1),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](13),
		// 			CallCountTotal: to.Ptr[int32](14),
		// 			Country: to.Ptr("US"),
		// 			Region: to.Ptr("WA"),
		// 			ServiceTimeAvg: to.Ptr[float64](957.094776923077),
		// 			ServiceTimeMax: to.Ptr[float64](1697.3612),
		// 			ServiceTimeMin: to.Ptr[float64](215.24),
		// 			Zip: to.Ptr("98052"),
		// 	}},
		// }
	}
}
Output:

func (*ReportsClient) NewListByOperationPager added in v0.5.0

func (client *ReportsClient) NewListByOperationPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByOperationOptions) *runtime.Pager[ReportsClientListByOperationResponse]

NewListByOperationPager - Lists report records by API Operations.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • filter - | Field | Usage | Supported operators | Supported functions | |-------------|-------------|-------------|-------------| | timestamp | filter | ge, le | | | displayName | select, orderBy | | | | apiRegion | filter | eq | | | userId | filter | eq | | | productId | filter | eq | | | subscriptionId | filter | eq | | | apiId | filter | eq | | | operationId | select, filter | eq | | | callCountSuccess | select, orderBy | | | | callCountBlocked | select, orderBy | | | | callCountFailed | select, orderBy | | | | callCountOther | select, orderBy | | | | callCountTotal | select, orderBy | | | | bandwidth | select, orderBy | | | | cacheHitsCount | select | | | | cacheMissCount | select | | | | apiTimeAvg | select, orderBy | | | | apiTimeMin | select | | | | apiTimeMax | select | | | | serviceTimeAvg | select | | | | serviceTimeMin | select | | | | serviceTimeMax | select | | |
  • options - ReportsClientListByOperationOptions contains the optional parameters for the ReportsClient.NewListByOperationPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByOperation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReportsClient().NewListByOperationPager("rg1", "apimService1", "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByOperationOptions{Top: nil,
		Skip:    nil,
		Orderby: 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.ReportCollection = armapimanagement.ReportCollection{
		// 	Count: to.Ptr[int64](3),
		// 	Value: []*armapimanagement.ReportRecordContract{
		// 		{
		// 			Name: to.Ptr("get"),
		// 			OperationID: to.Ptr("/apis/57a03a13e4bbd5119c8b19e9/operations/57a03a1dd8d14f0a780d7d14"),
		// 			APIID: to.Ptr("/apis/57a03a13e4bbd5119c8b19e9"),
		// 			APITimeAvg: to.Ptr[float64](1015.7607923076923),
		// 			APITimeMax: to.Ptr[float64](1819.2173),
		// 			APITimeMin: to.Ptr[float64](330.3206),
		// 			Bandwidth: to.Ptr[int64](11019),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](1),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](13),
		// 			CallCountTotal: to.Ptr[int32](14),
		// 			ServiceTimeAvg: to.Ptr[float64](957.094776923077),
		// 			ServiceTimeMax: to.Ptr[float64](1697.3612),
		// 			ServiceTimeMin: to.Ptr[float64](215.24),
		// 		},
		// 		{
		// 			Name: to.Ptr("GetWeatherInformation"),
		// 			OperationID: to.Ptr("/apis/57c999d1e4bbd50c988cb2c3/operations/57c999d1e4bbd50df889c93e"),
		// 			APIID: to.Ptr("/apis/57c999d1e4bbd50c988cb2c3"),
		// 			APITimeAvg: to.Ptr[float64](0),
		// 			APITimeMax: to.Ptr[float64](0),
		// 			APITimeMin: to.Ptr[float64](0),
		// 			Bandwidth: to.Ptr[int64](0),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](0),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](0),
		// 			CallCountTotal: to.Ptr[int32](0),
		// 			ServiceTimeAvg: to.Ptr[float64](0),
		// 			ServiceTimeMax: to.Ptr[float64](0),
		// 			ServiceTimeMin: to.Ptr[float64](0),
		// 		},
		// 		{
		// 			Name: to.Ptr("GetCityForecastByZIP"),
		// 			OperationID: to.Ptr("/apis/57c999d1e4bbd50c988cb2c3/operations/57c999d1e4bbd50df889c93f"),
		// 			APIID: to.Ptr("/apis/57c999d1e4bbd50c988cb2c3"),
		// 			APITimeAvg: to.Ptr[float64](0),
		// 			APITimeMax: to.Ptr[float64](0),
		// 			APITimeMin: to.Ptr[float64](0),
		// 			Bandwidth: to.Ptr[int64](0),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](0),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](0),
		// 			CallCountTotal: to.Ptr[int32](0),
		// 			ServiceTimeAvg: to.Ptr[float64](0),
		// 			ServiceTimeMax: to.Ptr[float64](0),
		// 			ServiceTimeMin: to.Ptr[float64](0),
		// 	}},
		// }
	}
}
Output:

func (*ReportsClient) NewListByProductPager added in v0.5.0

func (client *ReportsClient) NewListByProductPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByProductOptions) *runtime.Pager[ReportsClientListByProductResponse]

NewListByProductPager - Lists report records by Product.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • filter - | Field | Usage | Supported operators | Supported functions | |-------------|-------------|-------------|-------------| | timestamp | filter | ge, le | | | displayName | select, orderBy | | | | apiRegion | filter | eq | | | userId | filter | eq | | | productId | select, filter | eq | | | subscriptionId | filter | eq | | | callCountSuccess | select, orderBy | | | | callCountBlocked | select, orderBy | | | | callCountFailed | select, orderBy | | | | callCountOther | select, orderBy | | | | callCountTotal | select, orderBy | | | | bandwidth | select, orderBy | | | | cacheHitsCount | select | | | | cacheMissCount | select | | | | apiTimeAvg | select, orderBy | | | | apiTimeMin | select | | | | apiTimeMax | select | | | | serviceTimeAvg | select | | | | serviceTimeMin | select | | | | serviceTimeMax | select | | |
  • options - ReportsClientListByProductOptions contains the optional parameters for the ReportsClient.NewListByProductPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByProduct.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReportsClient().NewListByProductPager("rg1", "apimService1", "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByProductOptions{Top: nil,
		Skip:    nil,
		Orderby: 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.ReportCollection = armapimanagement.ReportCollection{
		// 	Count: to.Ptr[int64](2),
		// 	Value: []*armapimanagement.ReportRecordContract{
		// 		{
		// 			Name: to.Ptr("Starter"),
		// 			APITimeAvg: to.Ptr[float64](0),
		// 			APITimeMax: to.Ptr[float64](0),
		// 			APITimeMin: to.Ptr[float64](0),
		// 			Bandwidth: to.Ptr[int64](0),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](0),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](0),
		// 			CallCountTotal: to.Ptr[int32](0),
		// 			ProductID: to.Ptr("/products/5600b59475ff190048060001"),
		// 			ServiceTimeAvg: to.Ptr[float64](0),
		// 			ServiceTimeMax: to.Ptr[float64](0),
		// 			ServiceTimeMin: to.Ptr[float64](0),
		// 		},
		// 		{
		// 			Name: to.Ptr("Unlimited"),
		// 			APITimeAvg: to.Ptr[float64](1015.7607923076923),
		// 			APITimeMax: to.Ptr[float64](1819.2173),
		// 			APITimeMin: to.Ptr[float64](330.3206),
		// 			Bandwidth: to.Ptr[int64](11019),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](1),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](13),
		// 			CallCountTotal: to.Ptr[int32](14),
		// 			ProductID: to.Ptr("/products/5600b59475ff190048060002"),
		// 			ServiceTimeAvg: to.Ptr[float64](957.094776923077),
		// 			ServiceTimeMax: to.Ptr[float64](1697.3612),
		// 			ServiceTimeMin: to.Ptr[float64](215.24),
		// 	}},
		// }
	}
}
Output:

func (*ReportsClient) NewListByRequestPager added in v0.5.0

func (client *ReportsClient) NewListByRequestPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByRequestOptions) *runtime.Pager[ReportsClientListByRequestResponse]

NewListByRequestPager - Lists report records by Request.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • filter - | Field | Usage | Supported operators | Supported functions | |-------------|-------------|-------------|-------------| | timestamp | filter | ge, le | | | apiId | filter | eq | | | operationId | filter | eq | | | productId | filter | eq | | | userId | filter | eq | | | apiRegion | filter | eq | | | subscriptionId | filter | eq | |
  • options - ReportsClientListByRequestOptions contains the optional parameters for the ReportsClient.NewListByRequestPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByRequest.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReportsClient().NewListByRequestPager("rg1", "apimService1", "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByRequestOptions{Top: nil,
		Skip: 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.RequestReportCollection = armapimanagement.RequestReportCollection{
		// 	Count: to.Ptr[int64](2),
		// 	Value: []*armapimanagement.RequestReportRecordContract{
		// 		{
		// 			OperationID: to.Ptr("/apis/5931a75ae4bbd512a88c680b/operations/-"),
		// 			Method: to.Ptr("GET"),
		// 			APIID: to.Ptr("/apis/5931a75ae4bbd512a88c680b"),
		// 			APIRegion: to.Ptr("East Asia"),
		// 			APITime: to.Ptr[float64](221.1544),
		// 			Cache: to.Ptr("none"),
		// 			IPAddress: to.Ptr("207.xx.155.xx"),
		// 			ProductID: to.Ptr("/products/-"),
		// 			RequestID: to.Ptr("63e7119c-26aa-433c-96d7-f6f3267ff52f"),
		// 			RequestSize: to.Ptr[int32](0),
		// 			ResponseCode: to.Ptr[int32](404),
		// 			ResponseSize: to.Ptr[int32](405),
		// 			ServiceTime: to.Ptr[float64](0),
		// 			SubscriptionID: to.Ptr("/subscriptions/5600b59475ff190048070002"),
		// 			Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-03T00:17:00.1649134Z"); return t}()),
		// 			URL: to.Ptr("https://apimService1.azure-api.net/echo/resource?param1=sample"),
		// 			UserID: to.Ptr("/users/1"),
		// 		},
		// 		{
		// 			OperationID: to.Ptr("/apis/5931a75ae4bbd512a88c680b/operations/-"),
		// 			Method: to.Ptr("POST"),
		// 			APIID: to.Ptr("/apis/5931a75ae4bbd512a88c680b"),
		// 			APIRegion: to.Ptr("East Asia"),
		// 			APITime: to.Ptr[float64](6.675400000000001),
		// 			Cache: to.Ptr("none"),
		// 			IPAddress: to.Ptr("207.xx.155.xx"),
		// 			ProductID: to.Ptr("/products/-"),
		// 			RequestID: to.Ptr("e581b7f7-c9ec-4fc6-8ab9-3855d9b00b04"),
		// 			RequestSize: to.Ptr[int32](0),
		// 			ResponseCode: to.Ptr[int32](404),
		// 			ResponseSize: to.Ptr[int32](403),
		// 			ServiceTime: to.Ptr[float64](0),
		// 			SubscriptionID: to.Ptr("/subscriptions/5600b59475ff190048070002"),
		// 			Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-03T00:17:20.5255131Z"); return t}()),
		// 			URL: to.Ptr("https://apimService1.azure-api.net/echo/resource"),
		// 			UserID: to.Ptr("/users/1"),
		// 	}},
		// }
	}
}
Output:

func (*ReportsClient) NewListBySubscriptionPager added in v0.5.0

func (client *ReportsClient) NewListBySubscriptionPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListBySubscriptionOptions) *runtime.Pager[ReportsClientListBySubscriptionResponse]

NewListBySubscriptionPager - Lists report records by subscription.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • filter - | Field | Usage | Supported operators | Supported functions | |-------------|-------------|-------------|-------------| | timestamp | filter | ge, le | | | displayName | select, orderBy | | | | apiRegion | filter | eq | | | userId | select, filter | eq | | | productId | select, filter | eq | | | subscriptionId | select, filter | eq | | | callCountSuccess | select, orderBy | | | | callCountBlocked | select, orderBy | | | | callCountFailed | select, orderBy | | | | callCountOther | select, orderBy | | | | callCountTotal | select, orderBy | | | | bandwidth | select, orderBy | | | | cacheHitsCount | select | | | | cacheMissCount | select | | | | apiTimeAvg | select, orderBy | | | | apiTimeMin | select | | | | apiTimeMax | select | | | | serviceTimeAvg | select | | | | serviceTimeMin | select | | | | serviceTimeMax | select | | |
  • options - ReportsClientListBySubscriptionOptions contains the optional parameters for the ReportsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReportsClient().NewListBySubscriptionPager("rg1", "apimService1", "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListBySubscriptionOptions{Top: nil,
		Skip:    nil,
		Orderby: 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.ReportCollection = armapimanagement.ReportCollection{
		// 	Count: to.Ptr[int64](3),
		// 	Value: []*armapimanagement.ReportRecordContract{
		// 		{
		// 			Name: to.Ptr(""),
		// 			APITimeAvg: to.Ptr[float64](0),
		// 			APITimeMax: to.Ptr[float64](0),
		// 			APITimeMin: to.Ptr[float64](0),
		// 			Bandwidth: to.Ptr[int64](0),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](0),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](0),
		// 			CallCountTotal: to.Ptr[int32](0),
		// 			ProductID: to.Ptr("/products/5600b59475ff190048060001"),
		// 			ServiceTimeAvg: to.Ptr[float64](0),
		// 			ServiceTimeMax: to.Ptr[float64](0),
		// 			ServiceTimeMin: to.Ptr[float64](0),
		// 			SubscriptionID: to.Ptr("/subscriptions/5600b59475ff190048070001"),
		// 			UserID: to.Ptr("/users/1"),
		// 		},
		// 		{
		// 			Name: to.Ptr(""),
		// 			APITimeAvg: to.Ptr[float64](1015.7607923076923),
		// 			APITimeMax: to.Ptr[float64](1819.2173),
		// 			APITimeMin: to.Ptr[float64](330.3206),
		// 			Bandwidth: to.Ptr[int64](11019),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](1),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](13),
		// 			CallCountTotal: to.Ptr[int32](14),
		// 			ProductID: to.Ptr("/products/5600b59475ff190048060002"),
		// 			ServiceTimeAvg: to.Ptr[float64](957.094776923077),
		// 			ServiceTimeMax: to.Ptr[float64](1697.3612),
		// 			ServiceTimeMin: to.Ptr[float64](215.24),
		// 			SubscriptionID: to.Ptr("/subscriptions/5600b59475ff190048070002"),
		// 			UserID: to.Ptr("/users/1"),
		// 		},
		// 		{
		// 			Name: to.Ptr(""),
		// 			APITimeAvg: to.Ptr[float64](0),
		// 			APITimeMax: to.Ptr[float64](0),
		// 			APITimeMin: to.Ptr[float64](0),
		// 			Bandwidth: to.Ptr[int64](0),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](0),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](0),
		// 			CallCountTotal: to.Ptr[int32](0),
		// 			ProductID: to.Ptr("/products/5702e97e5157a50f48dce801"),
		// 			ServiceTimeAvg: to.Ptr[float64](0),
		// 			ServiceTimeMax: to.Ptr[float64](0),
		// 			ServiceTimeMin: to.Ptr[float64](0),
		// 			SubscriptionID: to.Ptr("/subscriptions/5702e97e5157a50a9c733303"),
		// 			UserID: to.Ptr("/users/1"),
		// 	}},
		// }
	}
}
Output:

func (*ReportsClient) NewListByTimePager added in v0.5.0

func (client *ReportsClient) NewListByTimePager(resourceGroupName string, serviceName string, filter string, interval string, options *ReportsClientListByTimeOptions) *runtime.Pager[ReportsClientListByTimeResponse]

NewListByTimePager - Lists report records by Time.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • filter - | Field | Usage | Supported operators | Supported functions | |-------------|-------------|-------------|-------------| | timestamp | filter, select | ge, le | | | interval | select | | | | apiRegion | filter | eq | | | userId | filter | eq | | | productId | filter | eq | | | subscriptionId | filter | eq | | | apiId | filter | eq | | | operationId | filter | eq | | | callCountSuccess | select | | | | callCountBlocked | select | | | | callCountFailed | select | | | | callCountOther | select | | | | bandwidth | select, orderBy | | | | cacheHitsCount | select | | | | cacheMissCount | select | | | | apiTimeAvg | select | | | | apiTimeMin | select | | | | apiTimeMax | select | | | | serviceTimeAvg | select | | | | serviceTimeMin | select | | | | serviceTimeMax | select | | |
  • interval - By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)).
  • options - ReportsClientListByTimeOptions contains the optional parameters for the ReportsClient.NewListByTimePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByTime.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReportsClient().NewListByTimePager("rg1", "apimService1", "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", "PT15M", &armapimanagement.ReportsClientListByTimeOptions{Top: nil,
		Skip:    nil,
		Orderby: 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.ReportCollection = armapimanagement.ReportCollection{
		// 	Count: to.Ptr[int64](2),
		// 	Value: []*armapimanagement.ReportRecordContract{
		// 		{
		// 			APITimeAvg: to.Ptr[float64](1337.46335),
		// 			APITimeMax: to.Ptr[float64](1819.2173),
		// 			APITimeMin: to.Ptr[float64](885.0839000000001),
		// 			Bandwidth: to.Ptr[int64](3243),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](0),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](4),
		// 			CallCountTotal: to.Ptr[int32](4),
		// 			Interval: to.Ptr("PT15M"),
		// 			ServiceTimeAvg: to.Ptr[float64](1255.917425),
		// 			ServiceTimeMax: to.Ptr[float64](1697.3612),
		// 			ServiceTimeMin: to.Ptr[float64](882.8264),
		// 			Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-03T00:15:00Z"); return t}()),
		// 		},
		// 		{
		// 			APITimeAvg: to.Ptr[float64](872.7818777777778),
		// 			APITimeMax: to.Ptr[float64](1093.8407),
		// 			APITimeMin: to.Ptr[float64](330.3206),
		// 			Bandwidth: to.Ptr[int64](7776),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](1),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](9),
		// 			CallCountTotal: to.Ptr[int32](10),
		// 			Interval: to.Ptr("PT15M"),
		// 			ServiceTimeAvg: to.Ptr[float64](824.2847111111112),
		// 			ServiceTimeMax: to.Ptr[float64](973.2262000000001),
		// 			ServiceTimeMin: to.Ptr[float64](215.24),
		// 			Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-03T00:30:00Z"); return t}()),
		// 	}},
		// }
	}
}
Output:

func (*ReportsClient) NewListByUserPager added in v0.5.0

func (client *ReportsClient) NewListByUserPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByUserOptions) *runtime.Pager[ReportsClientListByUserResponse]

NewListByUserPager - Lists report records by User.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • filter - | Field | Usage | Supported operators | Supported functions | |-------------|-------------|-------------|-------------| | timestamp | filter | ge, le | | | displayName | select, orderBy | | | | userId | select, filter | eq | | | apiRegion | filter | eq | | | productId | filter | eq | | | subscriptionId | filter | eq | | | apiId | filter | eq | | | operationId | filter | eq | | | callCountSuccess | select, orderBy | | | | callCountBlocked | select, orderBy | | | | callCountFailed | select, orderBy | | | | callCountOther | select, orderBy | | | | callCountTotal | select, orderBy | | | | bandwidth | select, orderBy | | | | cacheHitsCount | select | | | | cacheMissCount | select | | | | apiTimeAvg | select, orderBy | | | | apiTimeMin | select | | | | apiTimeMax | select | | | | serviceTimeAvg | select | | | | serviceTimeMin | select | | | | serviceTimeMax | select | | |
  • options - ReportsClientListByUserOptions contains the optional parameters for the ReportsClient.NewListByUserPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByUser.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReportsClient().NewListByUserPager("rg1", "apimService1", "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByUserOptions{Top: nil,
		Skip:    nil,
		Orderby: 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.ReportCollection = armapimanagement.ReportCollection{
		// 	Count: to.Ptr[int64](3),
		// 	Value: []*armapimanagement.ReportRecordContract{
		// 		{
		// 			Name: to.Ptr("Administrator"),
		// 			APITimeAvg: to.Ptr[float64](1015.7607923076923),
		// 			APITimeMax: to.Ptr[float64](1819.2173),
		// 			APITimeMin: to.Ptr[float64](330.3206),
		// 			Bandwidth: to.Ptr[int64](11019),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](1),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](13),
		// 			CallCountTotal: to.Ptr[int32](14),
		// 			ServiceTimeAvg: to.Ptr[float64](957.094776923077),
		// 			ServiceTimeMax: to.Ptr[float64](1697.3612),
		// 			ServiceTimeMin: to.Ptr[float64](215.24),
		// 			UserID: to.Ptr("/users/1"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Samir Solanki"),
		// 			APITimeAvg: to.Ptr[float64](0),
		// 			APITimeMax: to.Ptr[float64](0),
		// 			APITimeMin: to.Ptr[float64](0),
		// 			Bandwidth: to.Ptr[int64](0),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](0),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](0),
		// 			CallCountTotal: to.Ptr[int32](0),
		// 			ServiceTimeAvg: to.Ptr[float64](0),
		// 			ServiceTimeMax: to.Ptr[float64](0),
		// 			ServiceTimeMin: to.Ptr[float64](0),
		// 			UserID: to.Ptr("/users/56eaec62baf08b06e46d27fd"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Anonymous"),
		// 			APITimeAvg: to.Ptr[float64](0),
		// 			APITimeMax: to.Ptr[float64](0),
		// 			APITimeMin: to.Ptr[float64](0),
		// 			Bandwidth: to.Ptr[int64](0),
		// 			CacheHitCount: to.Ptr[int32](0),
		// 			CacheMissCount: to.Ptr[int32](0),
		// 			CallCountBlocked: to.Ptr[int32](0),
		// 			CallCountFailed: to.Ptr[int32](0),
		// 			CallCountOther: to.Ptr[int32](0),
		// 			CallCountSuccess: to.Ptr[int32](0),
		// 			CallCountTotal: to.Ptr[int32](0),
		// 			ServiceTimeAvg: to.Ptr[float64](0),
		// 			ServiceTimeMax: to.Ptr[float64](0),
		// 			ServiceTimeMin: to.Ptr[float64](0),
		// 			UserID: to.Ptr("/users/54c800b332965a0035030000"),
		// 	}},
		// }
	}
}
Output:

type ReportsClientListByAPIOptions added in v0.3.0

type ReportsClientListByAPIOptions struct {
	// OData order by query option.
	Orderby *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ReportsClientListByAPIOptions contains the optional parameters for the ReportsClient.NewListByAPIPager method.

type ReportsClientListByAPIResponse added in v0.3.0

type ReportsClientListByAPIResponse struct {
	ReportCollection
}

ReportsClientListByAPIResponse contains the response from method ReportsClient.NewListByAPIPager.

type ReportsClientListByGeoOptions added in v0.3.0

type ReportsClientListByGeoOptions struct {
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ReportsClientListByGeoOptions contains the optional parameters for the ReportsClient.NewListByGeoPager method.

type ReportsClientListByGeoResponse added in v0.3.0

type ReportsClientListByGeoResponse struct {
	ReportCollection
}

ReportsClientListByGeoResponse contains the response from method ReportsClient.NewListByGeoPager.

type ReportsClientListByOperationOptions added in v0.3.0

type ReportsClientListByOperationOptions struct {
	// OData order by query option.
	Orderby *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ReportsClientListByOperationOptions contains the optional parameters for the ReportsClient.NewListByOperationPager method.

type ReportsClientListByOperationResponse added in v0.3.0

type ReportsClientListByOperationResponse struct {
	ReportCollection
}

ReportsClientListByOperationResponse contains the response from method ReportsClient.NewListByOperationPager.

type ReportsClientListByProductOptions added in v0.3.0

type ReportsClientListByProductOptions struct {
	// OData order by query option.
	Orderby *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ReportsClientListByProductOptions contains the optional parameters for the ReportsClient.NewListByProductPager method.

type ReportsClientListByProductResponse added in v0.3.0

type ReportsClientListByProductResponse struct {
	ReportCollection
}

ReportsClientListByProductResponse contains the response from method ReportsClient.NewListByProductPager.

type ReportsClientListByRequestOptions added in v0.3.0

type ReportsClientListByRequestOptions struct {
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ReportsClientListByRequestOptions contains the optional parameters for the ReportsClient.NewListByRequestPager method.

type ReportsClientListByRequestResponse added in v0.3.0

type ReportsClientListByRequestResponse struct {
	RequestReportCollection
}

ReportsClientListByRequestResponse contains the response from method ReportsClient.NewListByRequestPager.

type ReportsClientListBySubscriptionOptions added in v0.3.0

type ReportsClientListBySubscriptionOptions struct {
	// OData order by query option.
	Orderby *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ReportsClientListBySubscriptionOptions contains the optional parameters for the ReportsClient.NewListBySubscriptionPager method.

type ReportsClientListBySubscriptionResponse added in v0.3.0

type ReportsClientListBySubscriptionResponse struct {
	ReportCollection
}

ReportsClientListBySubscriptionResponse contains the response from method ReportsClient.NewListBySubscriptionPager.

type ReportsClientListByTimeOptions added in v0.3.0

type ReportsClientListByTimeOptions struct {
	// OData order by query option.
	Orderby *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ReportsClientListByTimeOptions contains the optional parameters for the ReportsClient.NewListByTimePager method.

type ReportsClientListByTimeResponse added in v0.3.0

type ReportsClientListByTimeResponse struct {
	ReportCollection
}

ReportsClientListByTimeResponse contains the response from method ReportsClient.NewListByTimePager.

type ReportsClientListByUserOptions added in v0.3.0

type ReportsClientListByUserOptions struct {
	// OData order by query option.
	Orderby *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

ReportsClientListByUserOptions contains the optional parameters for the ReportsClient.NewListByUserPager method.

type ReportsClientListByUserResponse added in v0.3.0

type ReportsClientListByUserResponse struct {
	ReportCollection
}

ReportsClientListByUserResponse contains the response from method ReportsClient.NewListByUserPager.

type RepresentationContract

type RepresentationContract struct {
	// REQUIRED; Specifies a registered or custom content type for this representation, e.g. application/xml.
	ContentType *string

	// Exampled defined for the representation.
	Examples map[string]*ParameterExampleContract

	// Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
	FormParameters []*ParameterContract

	// Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
	SchemaID *string

	// Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded'
	// nor 'multipart/form-data'.
	TypeName *string
}

RepresentationContract - Operation request/response representation details.

func (RepresentationContract) MarshalJSON

func (r RepresentationContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RepresentationContract.

func (*RepresentationContract) UnmarshalJSON added in v1.1.0

func (r *RepresentationContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RepresentationContract.

type RequestContract

type RequestContract struct {
	// Operation request description.
	Description *string

	// Collection of operation request headers.
	Headers []*ParameterContract

	// Collection of operation request query parameters.
	QueryParameters []*ParameterContract

	// Collection of operation request representations.
	Representations []*RepresentationContract
}

RequestContract - Operation request details.

func (RequestContract) MarshalJSON

func (r RequestContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RequestContract.

func (*RequestContract) UnmarshalJSON added in v1.1.0

func (r *RequestContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RequestContract.

type RequestReportCollection

type RequestReportCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Page values.
	Value []*RequestReportRecordContract
}

RequestReportCollection - Paged Report records list representation.

func (RequestReportCollection) MarshalJSON

func (r RequestReportCollection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RequestReportCollection.

func (*RequestReportCollection) UnmarshalJSON added in v1.1.0

func (r *RequestReportCollection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RequestReportCollection.

type RequestReportRecordContract

type RequestReportRecordContract struct {
	// API identifier path. /apis/{apiId}
	APIID *string

	// Azure region where the gateway that processed this request is located.
	APIRegion *string

	// The total time it took to process this request.
	APITime *float64

	// The HTTP status code received by the gateway as a result of forwarding this request to the backend.
	BackendResponseCode *string

	// Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the
	// value is hit, cached response was returned. If the value is miss, the cache
	// was used but lookup resulted in a miss and request was fulfilled by the backend.
	Cache *string

	// The client IP address associated with this request.
	IPAddress *string

	// The HTTP method associated with this request..
	Method *string

	// Operation identifier path. /apis/{apiId}/operations/{operationId}
	OperationID *string

	// Request Identifier.
	RequestID *string

	// The size of this request..
	RequestSize *int32

	// The HTTP status code returned by the gateway.
	ResponseCode *int32

	// The size of the response returned by the gateway.
	ResponseSize *int32

	// he time it took to forward this request to the backend and get the response back.
	ServiceTime *float64

	// Subscription identifier path. /subscriptions/{subscriptionId}
	SubscriptionID *string

	// The date and time when this request was received by the gateway in ISO 8601 format.
	Timestamp *time.Time

	// The full URL associated with this request.
	URL *string

	// READ-ONLY; Product identifier path. /products/{productId}
	ProductID *string

	// READ-ONLY; User identifier path. /users/{userId}
	UserID *string
}

RequestReportRecordContract - Request Report data.

func (RequestReportRecordContract) MarshalJSON

func (r RequestReportRecordContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RequestReportRecordContract.

func (*RequestReportRecordContract) UnmarshalJSON

func (r *RequestReportRecordContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RequestReportRecordContract.

type Resource

type Resource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

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

Resource - Common fields that are returned in the response for all Azure Resource Manager resources

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceLocationDataContract

type ResourceLocationDataContract struct {
	// REQUIRED; A canonical name for the geographic or physical location.
	Name *string

	// The city or locality where the resource is located.
	City *string

	// The country or region where the resource is located.
	CountryOrRegion *string

	// The district, state, or province where the resource is located.
	District *string
}

ResourceLocationDataContract - Resource location data properties.

func (ResourceLocationDataContract) MarshalJSON added in v1.1.0

func (r ResourceLocationDataContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceLocationDataContract.

func (*ResourceLocationDataContract) UnmarshalJSON added in v1.1.0

func (r *ResourceLocationDataContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceLocationDataContract.

type ResourceSKU

type ResourceSKU struct {
	// Name of the Sku.
	Name *SKUType
}

ResourceSKU - Describes an available API Management SKU.

func (ResourceSKU) MarshalJSON added in v1.1.0

func (r ResourceSKU) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceSKU.

func (*ResourceSKU) UnmarshalJSON added in v1.1.0

func (r *ResourceSKU) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU.

type ResourceSKUCapacity

type ResourceSKUCapacity struct {
	// READ-ONLY; The default capacity.
	Default *int32

	// READ-ONLY; The maximum capacity that can be set.
	Maximum *int32

	// READ-ONLY; The minimum capacity.
	Minimum *int32

	// READ-ONLY; The scale type applicable to the sku.
	ScaleType *ResourceSKUCapacityScaleType
}

ResourceSKUCapacity - Describes scaling information of a SKU.

func (ResourceSKUCapacity) MarshalJSON added in v1.1.0

func (r ResourceSKUCapacity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapacity.

func (*ResourceSKUCapacity) UnmarshalJSON added in v1.1.0

func (r *ResourceSKUCapacity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapacity.

type ResourceSKUCapacityScaleType

type ResourceSKUCapacityScaleType string

ResourceSKUCapacityScaleType - The scale type applicable to the sku.

const (
	// ResourceSKUCapacityScaleTypeAutomatic - Supported scale type automatic.
	ResourceSKUCapacityScaleTypeAutomatic ResourceSKUCapacityScaleType = "automatic"
	// ResourceSKUCapacityScaleTypeManual - Supported scale type manual.
	ResourceSKUCapacityScaleTypeManual ResourceSKUCapacityScaleType = "manual"
	// ResourceSKUCapacityScaleTypeNone - Scaling not supported.
	ResourceSKUCapacityScaleTypeNone ResourceSKUCapacityScaleType = "none"
)

func PossibleResourceSKUCapacityScaleTypeValues

func PossibleResourceSKUCapacityScaleTypeValues() []ResourceSKUCapacityScaleType

PossibleResourceSKUCapacityScaleTypeValues returns the possible values for the ResourceSKUCapacityScaleType const type.

type ResourceSKUResult

type ResourceSKUResult struct {
	// READ-ONLY; Specifies the number of API Management units.
	Capacity *ResourceSKUCapacity

	// READ-ONLY; The type of resource the SKU applies to.
	ResourceType *string

	// READ-ONLY; Specifies API Management SKU.
	SKU *ResourceSKU
}

ResourceSKUResult - Describes an available API Management service SKU.

func (ResourceSKUResult) MarshalJSON added in v1.1.0

func (r ResourceSKUResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceSKUResult.

func (*ResourceSKUResult) UnmarshalJSON added in v1.1.0

func (r *ResourceSKUResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUResult.

type ResourceSKUResults

type ResourceSKUResults struct {
	// REQUIRED; The list of skus available for the service.
	Value []*ResourceSKUResult

	// The uri to fetch the next page of API Management service Skus.
	NextLink *string
}

ResourceSKUResults - The API Management service SKUs operation response.

func (ResourceSKUResults) MarshalJSON

func (r ResourceSKUResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceSKUResults.

func (*ResourceSKUResults) UnmarshalJSON added in v1.1.0

func (r *ResourceSKUResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUResults.

type ResponseContract

type ResponseContract struct {
	// REQUIRED; Operation response HTTP status code.
	StatusCode *int32

	// Operation response description.
	Description *string

	// Collection of operation response headers.
	Headers []*ParameterContract

	// Collection of operation response representations.
	Representations []*RepresentationContract
}

ResponseContract - Operation response details.

func (ResponseContract) MarshalJSON

func (r ResponseContract) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResponseContract.

func (*ResponseContract) UnmarshalJSON added in v1.1.0

func (r *ResponseContract) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResponseContract.

type SKU added in v0.3.0

type SKU struct {
	// READ-ONLY; The api versions that support this SKU.
	APIVersions []*string

	// READ-ONLY; A name value pair to describe the capability.
	Capabilities []*SKUCapabilities

	// READ-ONLY; Specifies the number of virtual machines in the scale set.
	Capacity *SKUCapacity

	// READ-ONLY; Metadata for retrieving price info.
	Costs []*SKUCosts

	// READ-ONLY; The Family of this particular SKU.
	Family *string

	// READ-ONLY; The Kind of resources that are supported in this SKU.
	Kind *string

	// READ-ONLY; A list of locations and availability zones in those locations where the SKU is available.
	LocationInfo []*SKULocationInfo

	// READ-ONLY; The set of locations that the SKU is available.
	Locations []*string

	// READ-ONLY; The name of SKU.
	Name *string

	// READ-ONLY; The type of resource the SKU applies to.
	ResourceType *string

	// READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.
	Restrictions []*SKURestrictions

	// READ-ONLY; The Size of the SKU.
	Size *string

	// READ-ONLY; Specifies the tier of virtual machines in a scale set.
	// Possible Values:
	// Standard
	// Basic
	Tier *string
}

SKU - Describes an available ApiManagement SKU.

func (SKU) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type SKUCapabilities added in v0.3.0

type SKUCapabilities struct {
	// READ-ONLY; An invariant to describe the feature.
	Name *string

	// READ-ONLY; An invariant if the feature is measured by quantity.
	Value *string
}

SKUCapabilities - Describes The SKU capabilities object.

func (SKUCapabilities) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SKUCapabilities.

func (*SKUCapabilities) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapabilities.

type SKUCapacity added in v0.3.0

type SKUCapacity struct {
	// READ-ONLY; The default capacity.
	Default *int32

	// READ-ONLY; The maximum capacity that can be set.
	Maximum *int32

	// READ-ONLY; The minimum capacity.
	Minimum *int32

	// READ-ONLY; The scale type applicable to the sku.
	ScaleType *APIManagementSKUCapacityScaleType
}

SKUCapacity - Describes scaling information of a SKU.

func (SKUCapacity) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SKUCapacity.

func (*SKUCapacity) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapacity.

type SKUCosts added in v0.3.0

type SKUCosts struct {
	// READ-ONLY; An invariant to show the extended unit.
	ExtendedUnit *string

	// READ-ONLY; Used for querying price from commerce.
	MeterID *string

	// READ-ONLY; The multiplier is needed to extend the base metered cost.
	Quantity *int64
}

SKUCosts - Describes metadata for retrieving price info.

func (SKUCosts) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SKUCosts.

func (*SKUCosts) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKUCosts.

type SKULocationInfo added in v0.3.0

type SKULocationInfo struct {
	// READ-ONLY; Location of the SKU
	Location *string

	// READ-ONLY; Details of capabilities available to a SKU in specific zones.
	ZoneDetails []*SKUZoneDetails

	// READ-ONLY; List of availability zones where the SKU is supported.
	Zones []*string
}

func (SKULocationInfo) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type SKULocationInfo.

func (*SKULocationInfo) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKULocationInfo.

type SKURestrictionInfo added in v0.3.0

type SKURestrictionInfo struct {
	// READ-ONLY; Locations where the SKU is restricted
	Locations []*string

	// READ-ONLY; List of availability zones where the SKU is restricted.
	Zones []*string
}

func (SKURestrictionInfo) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type SKURestrictionInfo.

func (*SKURestrictionInfo) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKURestrictionInfo.

type SKURestrictions added in v0.3.0

type SKURestrictions struct {
	// READ-ONLY; The reason for restriction.
	ReasonCode *APIManagementSKURestrictionsReasonCode

	// READ-ONLY; The information about the restriction where the SKU cannot be used.
	RestrictionInfo *SKURestrictionInfo

	// READ-ONLY; The type of restrictions.
	Type *APIManagementSKURestrictionsType

	// READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where
	// the SKU is restricted.
	Values []*string
}

SKURestrictions - Describes scaling information of a SKU.

func (SKURestrictions) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type SKURestrictions.

func (*SKURestrictions) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKURestrictions.

type SKUType

type SKUType string

SKUType - Name of the Sku.

const (
	// SKUTypeBasic - Basic SKU of Api Management.
	SKUTypeBasic SKUType = "Basic"
	// SKUTypeConsumption - Consumption SKU of Api Management.
	SKUTypeConsumption SKUType = "Consumption"
	// SKUTypeDeveloper - Developer SKU of Api Management.
	SKUTypeDeveloper SKUType = "Developer"
	// SKUTypeIsolated - Isolated SKU of Api Management.
	SKUTypeIsolated SKUType = "Isolated"
	// SKUTypePremium - Premium SKU of Api Management.
	SKUTypePremium SKUType = "Premium"
	// SKUTypeStandard - Standard SKU of Api Management.
	SKUTypeStandard SKUType = "Standard"
)

func PossibleSKUTypeValues

func PossibleSKUTypeValues() []SKUType

PossibleSKUTypeValues returns the possible values for the SKUType const type.

type SKUZoneDetails added in v0.3.0

type SKUZoneDetails struct {
	// READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones.
	Capabilities []*SKUCapabilities

	// READ-ONLY; The set of zones that the SKU is available in with the specified capabilities.
	Name []*string
}

SKUZoneDetails - Describes The zonal capabilities of a SKU.

func (SKUZoneDetails) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type SKUZoneDetails.

func (*SKUZoneDetails) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKUZoneDetails.

type SKUsClient added in v0.3.0

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

SKUsClient contains the methods for the APIManagementSKUs group. Don't use this type directly, use NewSKUsClient() instead.

func NewSKUsClient added in v0.3.0

func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SKUsClient, error)

NewSKUsClient creates a new instance of SKUsClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SKUsClient) NewListPager added in v0.5.0

func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse]

NewListPager - Gets the list of Microsoft.ApiManagement SKUs available for your Subscription.

Generated from API version 2021-08-01

  • options - SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSku.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSKUsClient().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.SKUsResult = armapimanagement.SKUsResult{
		// 	Value: []*armapimanagement.SKU{
		// 		{
		// 			Name: to.Ptr("Developer"),
		// 			Capacity: &armapimanagement.SKUCapacity{
		// 				Default: to.Ptr[int32](1),
		// 				Maximum: to.Ptr[int32](1),
		// 				Minimum: to.Ptr[int32](1),
		// 				ScaleType: to.Ptr(armapimanagement.APIManagementSKUCapacityScaleTypeNone),
		// 			},
		// 			LocationInfo: []*armapimanagement.SKULocationInfo{
		// 				{
		// 					Location: to.Ptr("centralindia"),
		// 					ZoneDetails: []*armapimanagement.SKUZoneDetails{
		// 					},
		// 					Zones: []*string{
		// 					},
		// 			}},
		// 			Locations: []*string{
		// 				to.Ptr("centralindia")},
		// 				ResourceType: to.Ptr("service"),
		// 				Restrictions: []*armapimanagement.SKURestrictions{
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("Standard"),
		// 				Capacity: &armapimanagement.SKUCapacity{
		// 					Default: to.Ptr[int32](1),
		// 					Maximum: to.Ptr[int32](4),
		// 					Minimum: to.Ptr[int32](1),
		// 					ScaleType: to.Ptr(armapimanagement.APIManagementSKUCapacityScaleTypeAutomatic),
		// 				},
		// 				LocationInfo: []*armapimanagement.SKULocationInfo{
		// 					{
		// 						Location: to.Ptr("centralindia"),
		// 						ZoneDetails: []*armapimanagement.SKUZoneDetails{
		// 						},
		// 						Zones: []*string{
		// 						},
		// 				}},
		// 				Locations: []*string{
		// 					to.Ptr("centralindia")},
		// 					ResourceType: to.Ptr("service"),
		// 					Restrictions: []*armapimanagement.SKURestrictions{
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("Premium"),
		// 					Capacity: &armapimanagement.SKUCapacity{
		// 						Default: to.Ptr[int32](1),
		// 						Maximum: to.Ptr[int32](10),
		// 						Minimum: to.Ptr[int32](1),
		// 						ScaleType: to.Ptr(armapimanagement.APIManagementSKUCapacityScaleTypeAutomatic),
		// 					},
		// 					LocationInfo: []*armapimanagement.SKULocationInfo{
		// 						{
		// 							Location: to.Ptr("centralindia"),
		// 							ZoneDetails: []*armapimanagement.SKUZoneDetails{
		// 							},
		// 							Zones: []*string{
		// 							},
		// 					}},
		// 					Locations: []*string{
		// 						to.Ptr("centralindia")},
		// 						ResourceType: to.Ptr("service"),
		// 						Restrictions: []*armapimanagement.SKURestrictions{
		// 						},
		// 					},
		// 					{
		// 						Name: to.Ptr("Basic"),
		// 						Capacity: &armapimanagement.SKUCapacity{
		// 							Default: to.Ptr[int32](1),
		// 							Maximum: to.Ptr[int32](2),
		// 							Minimum: to.Ptr[int32](1),
		// 							ScaleType: to.Ptr(armapimanagement.APIManagementSKUCapacityScaleTypeManual),
		// 						},
		// 						LocationInfo: []*armapimanagement.SKULocationInfo{
		// 							{
		// 								Location: to.Ptr("centralindia"),
		// 								ZoneDetails: []*armapimanagement.SKUZoneDetails{
		// 								},
		// 								Zones: []*string{
		// 								},
		// 						}},
		// 						Locations: []*string{
		// 							to.Ptr("centralindia")},
		// 							ResourceType: to.Ptr("service"),
		// 							Restrictions: []*armapimanagement.SKURestrictions{
		// 							},
		// 						},
		// 						{
		// 							Name: to.Ptr("Consumption"),
		// 							Capacity: &armapimanagement.SKUCapacity{
		// 								Default: to.Ptr[int32](0),
		// 								Maximum: to.Ptr[int32](0),
		// 								Minimum: to.Ptr[int32](0),
		// 								ScaleType: to.Ptr(armapimanagement.APIManagementSKUCapacityScaleTypeNone),
		// 							},
		// 							LocationInfo: []*armapimanagement.SKULocationInfo{
		// 								{
		// 									Location: to.Ptr("centralindia"),
		// 									ZoneDetails: []*armapimanagement.SKUZoneDetails{
		// 									},
		// 									Zones: []*string{
		// 									},
		// 							}},
		// 							Locations: []*string{
		// 								to.Ptr("centralindia")},
		// 								ResourceType: to.Ptr("service"),
		// 								Restrictions: []*armapimanagement.SKURestrictions{
		// 								},
		// 							},
		// 							{
		// 								Name: to.Ptr("Developer"),
		// 								Capacity: &armapimanagement.SKUCapacity{
		// 									Default: to.Ptr[int32](1),
		// 									Maximum: to.Ptr[int32](1),
		// 									Minimum: to.Ptr[int32](1),
		// 									ScaleType: to.Ptr(armapimanagement.APIManagementSKUCapacityScaleTypeNone),
		// 								},
		// 								LocationInfo: []*armapimanagement.SKULocationInfo{
		// 									{
		// 										Location: to.Ptr("uaenorth"),
		// 										ZoneDetails: []*armapimanagement.SKUZoneDetails{
		// 										},
		// 										Zones: []*string{
		// 										},
		// 								}},
		// 								Locations: []*string{
		// 									to.Ptr("uaenorth")},
		// 									ResourceType: to.Ptr("service"),
		// 									Restrictions: []*armapimanagement.SKURestrictions{
		// 									},
		// 								},
		// 								{
		// 									Name: to.Ptr("Standard"),
		// 									Capacity: &armapimanagement.SKUCapacity{
		// 										Default: to.Ptr[int32](1),
		// 										Maximum: to.Ptr[int32](4),
		// 										Minimum: to.Ptr[int32](1),
		// 										ScaleType: to.Ptr(armapimanagement.APIManagementSKUCapacityScaleTypeAutomatic),
		// 									},
		// 									LocationInfo: []*armapimanagement.SKULocationInfo{
		// 										{
		// 											Location: to.Ptr("uaenorth"),
		// 											ZoneDetails: []*armapimanagement.SKUZoneDetails{
		// 											},
		// 											Zones: []*string{
		// 											},
		// 									}},
		// 									Locations: []*string{
		// 										to.Ptr("uaenorth")},
		// 										ResourceType: to.Ptr("service"),
		// 										Restrictions: []*armapimanagement.SKURestrictions{
		// 										},
		// 									},
		// 									{
		// 										Name: to.Ptr("Premium"),
		// 										Capacity: &armapimanagement.SKUCapacity{
		// 											Default: to.Ptr[int32](1),
		// 											Maximum: to.Ptr[int32](10),
		// 											Minimum: to.Ptr[int32](1),
		// 											ScaleType: to.Ptr(armapimanagement.APIManagementSKUCapacityScaleTypeAutomatic),
		// 										},
		// 										LocationInfo: []*armapimanagement.SKULocationInfo{
		// 											{
		// 												Location: to.Ptr("uaenorth"),
		// 												ZoneDetails: []*armapimanagement.SKUZoneDetails{
		// 												},
		// 												Zones: []*string{
		// 												},
		// 										}},
		// 										Locations: []*string{
		// 											to.Ptr("uaenorth")},
		// 											ResourceType: to.Ptr("service"),
		// 											Restrictions: []*armapimanagement.SKURestrictions{
		// 											},
		// 										},
		// 										{
		// 											Name: to.Ptr("Basic"),
		// 											Capacity: &armapimanagement.SKUCapacity{
		// 												Default: to.Ptr[int32](1),
		// 												Maximum: to.Ptr[int32](2),
		// 												Minimum: to.Ptr[int32](1),
		// 												ScaleType: to.Ptr(armapimanagement.APIManagementSKUCapacityScaleTypeManual),
		// 											},
		// 											LocationInfo: []*armapimanagement.SKULocationInfo{
		// 												{
		// 													Location: to.Ptr("uaenorth"),
		// 													ZoneDetails: []*armapimanagement.SKUZoneDetails{
		// 													},
		// 													Zones: []*string{
		// 													},
		// 											}},
		// 											Locations: []*string{
		// 												to.Ptr("uaenorth")},
		// 												ResourceType: to.Ptr("service"),
		// 												Restrictions: []*armapimanagement.SKURestrictions{
		// 												},
		// 											},
		// 											{
		// 												Name: to.Ptr("Developer"),
		// 												Capacity: &armapimanagement.SKUCapacity{
		// 													Default: to.Ptr[int32](1),
		// 													Maximum: to.Ptr[int32](1),
		// 													Minimum: to.Ptr[int32](1),
		// 													ScaleType: to.Ptr(armapimanagement.APIManagementSKUCapacityScaleTypeNone),
		// 												},
		// 												LocationInfo: []*armapimanagement.SKULocationInfo{
		// 													{
		// 														Location: to.Ptr("australiacentral"),
		// 														ZoneDetails: []*armapimanagement.SKUZoneDetails{
		// 														},
		// 														Zones: []*string{
		// 														},
		// 												}},
		// 												Locations: []*string{
		// 													to.Ptr("australiacentral")},
		// 													ResourceType: to.Ptr("service"),
		// 													Restrictions: []*armapimanagement.SKURestrictions{
		// 													},
		// 											}},
		// 										}
	}
}
Output:

type SKUsClientListOptions added in v0.3.0

type SKUsClientListOptions struct {
}

SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method.

type SKUsClientListResponse added in v0.3.0

type SKUsClientListResponse struct {
	SKUsResult
}

SKUsClientListResponse contains the response from method SKUsClient.NewListPager.

type SKUsResult added in v0.3.0

type SKUsResult struct {
	// REQUIRED; The list of skus available for the subscription.
	Value []*SKU

	// READ-ONLY; The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource
	// Skus
	NextLink *string
}

SKUsResult - The List Resource Skus operation response.

func (SKUsResult) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type SKUsResult.

func (*SKUsResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKUsResult.

type SamplingSettings

type SamplingSettings struct {
	// Rate of sampling for fixed-rate sampling.
	Percentage *float64

	// Sampling type.
	SamplingType *SamplingType
}

SamplingSettings - Sampling settings for Diagnostic.

func (SamplingSettings) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SamplingSettings.

func (*SamplingSettings) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SamplingSettings.

type SamplingType

type SamplingType string

SamplingType - Sampling type.

const (
	// SamplingTypeFixed - Fixed-rate sampling.
	SamplingTypeFixed SamplingType = "fixed"
)

func PossibleSamplingTypeValues

func PossibleSamplingTypeValues() []SamplingType

PossibleSamplingTypeValues returns the possible values for the SamplingType const type.

type SaveConfigurationParameter

type SaveConfigurationParameter struct {
	// Properties of the Save Configuration Parameters.
	Properties *SaveConfigurationParameterProperties
}

SaveConfigurationParameter - Save Tenant Configuration Contract details.

func (SaveConfigurationParameter) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SaveConfigurationParameter.

func (*SaveConfigurationParameter) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SaveConfigurationParameter.

type SaveConfigurationParameterProperties

type SaveConfigurationParameterProperties struct {
	// REQUIRED; The name of the Git branch in which to commit the current configuration snapshot.
	Branch *string

	// The value if true, the current configuration database is committed to the Git repository, even if the Git repository has
	// newer changes that would be overwritten.
	Force *bool
}

SaveConfigurationParameterProperties - Parameters supplied to the Save Tenant Configuration operation.

func (SaveConfigurationParameterProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SaveConfigurationParameterProperties.

func (*SaveConfigurationParameterProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SaveConfigurationParameterProperties.

type SchemaCollection

type SchemaCollection struct {
	// Total record count number.
	Count *int64

	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; API Schema Contract value.
	Value []*SchemaContract
}

SchemaCollection - The response of the list schema operation.

func (SchemaCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SchemaCollection.

func (*SchemaCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SchemaCollection.

type SchemaContract

type SchemaContract struct {
	// Properties of the API Schema.
	Properties *SchemaContractProperties

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

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

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

SchemaContract - API Schema Contract details.

func (SchemaContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SchemaContract.

func (*SchemaContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SchemaContract.

type SchemaContractProperties

type SchemaContractProperties struct {
	// REQUIRED; Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema
	// document (e.g. application/json, application/xml).
	// - Swagger Schema use application/vnd.ms-azure-apim.swagger.definitions+json
	// - WSDL Schema use application/vnd.ms-azure-apim.xsd+xml
	// - OpenApi Schema use application/vnd.oai.openapi.components+json
	// - WADL Schema use application/vnd.ms-azure-apim.wadl.grammars+xml.
	ContentType *string

	// Create or update Properties of the API Schema Document.
	Document *SchemaDocumentProperties
}

SchemaContractProperties - API Schema create or update contract Properties.

func (SchemaContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SchemaContractProperties.

func (*SchemaContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SchemaContractProperties.

type SchemaDocumentProperties

type SchemaDocumentProperties struct {
	// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise.
	Components any

	// Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise.
	Definitions any

	// Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI.
	Value *string
}

SchemaDocumentProperties - Api Schema Document Properties.

func (SchemaDocumentProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SchemaDocumentProperties.

func (*SchemaDocumentProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SchemaDocumentProperties.

type SchemaType added in v0.3.0

type SchemaType string

SchemaType - Schema Type. Immutable.

const (
	// SchemaTypeJSON - Json schema type.
	SchemaTypeJSON SchemaType = "json"
	// SchemaTypeXML - Xml schema type.
	SchemaTypeXML SchemaType = "xml"
)

func PossibleSchemaTypeValues added in v0.3.0

func PossibleSchemaTypeValues() []SchemaType

PossibleSchemaTypeValues returns the possible values for the SchemaType const type.

type ServiceApplyNetworkConfigurationParameters added in v0.3.0

type ServiceApplyNetworkConfigurationParameters struct {
	// Location of the Api Management service to update for a multi-region service. For a service deployed in a single region,
	// this parameter is not required.
	Location *string
}

ServiceApplyNetworkConfigurationParameters - Parameter supplied to the Apply Network configuration operation.

func (ServiceApplyNetworkConfigurationParameters) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type ServiceApplyNetworkConfigurationParameters.

func (*ServiceApplyNetworkConfigurationParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceApplyNetworkConfigurationParameters.

type ServiceBackupRestoreParameters added in v0.3.0

type ServiceBackupRestoreParameters struct {
	// REQUIRED; The name of the backup file to create/retrieve.
	BackupName *string

	// REQUIRED; The name of the blob container (used to place/retrieve the backup).
	ContainerName *string

	// REQUIRED; The name of the Azure storage account (used to place/retrieve the backup).
	StorageAccount *string

	// Storage account access key. Required only if accessType is set to AccessKey.
	AccessKey *string

	// The type of access to be used for the storage account.
	AccessType *AccessType

	// The Client ID of user assigned managed identity. Required only if accessType is set to UserAssignedManagedIdentity.
	ClientID *string
}

ServiceBackupRestoreParameters - Parameters supplied to the Backup/Restore of an API Management service operation.

func (ServiceBackupRestoreParameters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceBackupRestoreParameters.

func (*ServiceBackupRestoreParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBackupRestoreParameters.

type ServiceBaseProperties added in v0.3.0

type ServiceBaseProperties struct {
	// Control Plane Apis version constraint for the API Management service.
	APIVersionConstraint *APIVersionConstraint

	// Additional datacenter locations of the API Management service.
	AdditionalLocations []*AdditionalLocation

	// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed
	// is 10.
	Certificates []*CertificateConfiguration

	// Custom properties of the API Management service.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168 will disable the cipher TLSRSAWITH3DESEDECBCSHA
	// for all TLS(1.0, 1.1 and 1.2).
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11 can be used to disable just TLS 1.1.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10 can be used to disable TLS 1.0 on an API
	// Management service.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11 can be used to disable just TLS 1.1
	// for communications with backends.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10 can be used to disable TLS 1.0 for
	// communications with backends.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2 can be used to enable HTTP2 protocol on an
	// API Management service.
	// Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For
	// all the settings except Http2 the default value is True if the service was
	// created on or before April 1st 2018 and False otherwise. Http2 setting's default value is False.
	// You can disable any of next ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]:
	// TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA, TLS
	// ECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256,
	// TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For example,
	// Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default value
	// is true for them. Note: next ciphers can't be disabled since they are required by
	// Azure CloudService internal components: TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCMSHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBC
	// SHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256,TLSRSAWITHAES256GCMSHA384
	CustomProperties map[string]*string

	// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway
	// in master region.
	DisableGateway *bool

	// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each
	// request to the gateway. This also enables the ability to authenticate the
	// certificate in the policy on the gateway.
	EnableClientCertificate *bool

	// Custom hostname configuration of the API Management service.
	HostnameConfigurations []*HostnameConfiguration

	// Email address from which the notification will be sent.
	NotificationSenderEmail *string

	// List of Private Endpoint Connections of this service.
	PrivateEndpointConnections []*RemotePrivateEndpointConnectionWrapper

	// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported
	// only for Developer and Premium SKU being deployed in Virtual Network.
	PublicIPAddressID *string

	// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, must
	// be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the
	// exclusive access method. Default value is 'Enabled'
	PublicNetworkAccess *PublicNetworkAccess

	// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other
	// properties will be ignored.
	Restore *bool

	// Virtual network configuration of the API Management service.
	VirtualNetworkConfiguration *VirtualNetworkConfiguration

	// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management
	// service is not part of any Virtual Network, External means the API Management
	// deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management
	// deployment is setup inside a Virtual Network having an Intranet Facing Endpoint
	// only.
	VirtualNetworkType *VirtualNetworkType

	// READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ
	// as specified by the ISO 8601 standard.
	CreatedAtUTC *time.Time

	// READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
	DeveloperPortalURL *string

	// READ-ONLY; Gateway URL of the API Management service in the Default Region.
	GatewayRegionalURL *string

	// READ-ONLY; Gateway URL of the API Management service.
	GatewayURL *string

	// READ-ONLY; Management API endpoint URL of the API Management service.
	ManagementAPIURL *string

	// READ-ONLY; Compute Platform Version running the service in this location.
	PlatformVersion *PlatformVersion

	// READ-ONLY; Publisher portal endpoint Url of the API Management service.
	PortalURL *string

	// READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed
	// in an Internal Virtual Network. Available only for Basic, Standard, Premium and Isolated
	// SKU.
	PrivateIPAddresses []*string

	// READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
	ProvisioningState *string

	// READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for
	// Basic, Standard, Premium and Isolated SKU.
	PublicIPAddresses []*string

	// READ-ONLY; SCM endpoint URL of the API Management service.
	ScmURL *string

	// READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started
	// on the service.
	TargetProvisioningState *string
}

ServiceBaseProperties - Base Properties of an API Management service resource description.

func (ServiceBaseProperties) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceBaseProperties.

func (*ServiceBaseProperties) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBaseProperties.

type ServiceCheckNameAvailabilityParameters added in v0.3.0

type ServiceCheckNameAvailabilityParameters struct {
	// REQUIRED; The name to check for availability.
	Name *string
}

ServiceCheckNameAvailabilityParameters - Parameters supplied to the CheckNameAvailability operation.

func (ServiceCheckNameAvailabilityParameters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceCheckNameAvailabilityParameters.

func (*ServiceCheckNameAvailabilityParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCheckNameAvailabilityParameters.

type ServiceClient added in v0.3.0

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

ServiceClient contains the methods for the APIManagementService group. Don't use this type directly, use NewServiceClient() instead.

func NewServiceClient added in v0.3.0

func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceClient, error)

NewServiceClient creates a new instance of ServiceClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ServiceClient) BeginApplyNetworkConfigurationUpdates added in v0.3.0

func (client *ServiceClient) BeginApplyNetworkConfigurationUpdates(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginApplyNetworkConfigurationUpdatesOptions) (*runtime.Poller[ServiceClientApplyNetworkConfigurationUpdatesResponse], error)

BeginApplyNetworkConfigurationUpdates - Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - ServiceClientBeginApplyNetworkConfigurationUpdatesOptions contains the optional parameters for the ServiceClient.BeginApplyNetworkConfigurationUpdates method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementApplyNetworkConfigurationUpdates.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginApplyNetworkConfigurationUpdates(ctx, "rg1", "apimService1", &armapimanagement.ServiceClientBeginApplyNetworkConfigurationUpdatesOptions{Parameters: &armapimanagement.ServiceApplyNetworkConfigurationParameters{
		Location: to.Ptr("west us"),
	},
	})
	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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"UID": to.Ptr("52ed5986-717b-45b4-b17c-3df8db372cff"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAXX6Y="),
	// 	Location: to.Ptr("East Asia"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-22T01:50:34.7921566Z"); return t}()),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 		},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("207.46.155.24")},
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
	// 				SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/eastUsVirtualNetwork/subnets/apimSubnet"),
	// 			},
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeExternal),
	// 			PublisherEmail: to.Ptr("admin@live.com"),
	// 			PublisherName: to.Ptr("Contoso"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 			Capacity: to.Ptr[int32](1),
	// 		},
	// 	}
}
Output:

func (*ServiceClient) BeginBackup added in v0.3.0

func (client *ServiceClient) BeginBackup(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters, options *ServiceClientBeginBackupOptions) (*runtime.Poller[ServiceClientBackupResponse], error)

BeginBackup - Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation and could take several minutes to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • parameters - Parameters supplied to the ApiManagementService_Backup operation.
  • options - ServiceClientBeginBackupOptions contains the optional parameters for the ServiceClient.BeginBackup method.
Example (ApiManagementBackupWithAccessKey)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithAccessKey.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginBackup(ctx, "rg1", "apimService1", armapimanagement.ServiceBackupRestoreParameters{
		AccessKey:      to.Ptr("**************************************************"),
		AccessType:     to.Ptr(armapimanagement.AccessTypeAccessKey),
		BackupName:     to.Ptr("apimService1backup_2017_03_19"),
		ContainerName:  to.Ptr("backupContainer"),
		StorageAccount: to.Ptr("teststorageaccount"),
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 		"tag3": to.Ptr("value3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAACXok="),
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		AdditionalLocations: []*armapimanagement.AdditionalLocation{
	// 			{
	// 				DisableGateway: to.Ptr(true),
	// 				GatewayRegionalURL: to.Ptr("https://apimService1-eastus-01.regional.azure-api.net"),
	// 				Location: to.Ptr("East US"),
	// 				PublicIPAddresses: []*string{
	// 					to.Ptr("23.101.138.153")},
	// 					SKU: &armapimanagement.ServiceSKUProperties{
	// 						Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 						Capacity: to.Ptr[int32](1),
	// 					},
	// 			}},
	// 			APIVersionConstraint: &armapimanagement.APIVersionConstraint{
	// 				MinAPIVersion: to.Ptr("2019-01-01"),
	// 			},
	// 			CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-18T06:26:20.3348609Z"); return t}()),
	// 			CustomProperties: map[string]*string{
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 			},
	// 			DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 			DisableGateway: to.Ptr(false),
	// 			GatewayRegionalURL: to.Ptr("https://apimService1-westus-01.regional.azure-api.net"),
	// 			GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 			HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("apimService1.azure-api.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.msitesting.net"),
	// 						Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXB9C2C91F1D174FDB3A2"),
	// 					},
	// 					DefaultSSLBinding: to.Ptr(true),
	// 					HostName: to.Ptr("gateway1.msitesting.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeManagement),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.msitesting.net"),
	// 						Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXB9C2C91F1D174FDB3A2"),
	// 					},
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("mgmt.msitesting.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypePortal),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.msitesting.net"),
	// 						Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXB9C2C91F1D174FDB3A2"),
	// 					},
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("portal1.msitesting.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 			}},
	// 			ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 			NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 			PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 			PublicIPAddresses: []*string{
	// 				to.Ptr("13.91.32.113")},
	// 				ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 				TargetProvisioningState: to.Ptr(""),
	// 				VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 				PublisherEmail: to.Ptr("apim@autorestsdk.com"),
	// 				PublisherName: to.Ptr("autorestsdk"),
	// 			},
	// 			SKU: &armapimanagement.ServiceSKUProperties{
	// 				Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 				Capacity: to.Ptr[int32](1),
	// 			},
	// 		}
}
Output:

Example (ApiManagementBackupWithSystemManagedIdentity)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithSystemManagedIdentity.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginBackup(ctx, "rg1", "apimService1", armapimanagement.ServiceBackupRestoreParameters{
		AccessType:     to.Ptr(armapimanagement.AccessTypeSystemAssignedManagedIdentity),
		BackupName:     to.Ptr("backup5"),
		ContainerName:  to.Ptr("apim-backups"),
		StorageAccount: to.Ptr("contosorpstorage"),
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"Owner": to.Ptr("apimService1"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAQM8o="),
	// 	Identity: &armapimanagement.ServiceIdentity{
	// 		Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned),
	// 		PrincipalID: to.Ptr("XXXXX-5fb4-4916-95d4-64b306f9d924"),
	// 		TenantID: to.Ptr("XXXXX-86f1-XXXXX-91ab-2d7cd011db47"),
	// 		UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
	// 			"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/rg1UserIdentity": &armapimanagement.UserIdentityProperties{
	// 				ClientID: to.Ptr("XXXXX-a154-4830-XXXX-46a12da1a1e2"),
	// 				PrincipalID: to.Ptr("XXXXX-a100-4478-XXXX-d65d98118ba0"),
	// 			},
	// 			"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/vpnpremium": &armapimanagement.UserIdentityProperties{
	// 				ClientID: to.Ptr("XXXX-6328-4db2-XXXX-ab0e3e7806cf"),
	// 				PrincipalID: to.Ptr("XXXXX-9208-4128-af2d-a10d2af9b5a3"),
	// 			},
	// 		},
	// 	},
	// 	Location: to.Ptr("Central US EUAP"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-23T16:26:47.8637967Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 		},
	// 		DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 		DisableGateway: to.Ptr(false),
	// 		GatewayRegionalURL: to.Ptr("https://apimService1-centraluseuap-01.regional.azure-api.net"),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv1),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("52.XXXX.160.66")},
	// 			PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 			PublisherEmail: to.Ptr("apimService1@corp.microsoft.com"),
	// 			PublisherName: to.Ptr("MS"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 			Capacity: to.Ptr[int32](1),
	// 		},
	// 		SystemData: &armapimanagement.SystemData{
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-30T06:24:57.0008037Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("contoso@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
	// 		},
	// 	}
}
Output:

Example (ApiManagementBackupWithUserAssignedManagedIdentity)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithUserAssignedManagedIdentity.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginBackup(ctx, "rg1", "apimService1", armapimanagement.ServiceBackupRestoreParameters{
		AccessType:     to.Ptr(armapimanagement.AccessTypeUserAssignedManagedIdentity),
		BackupName:     to.Ptr("backup5"),
		ClientID:       to.Ptr("XXXXX-a154-4830-XXXX-46a12da1a1e2"),
		ContainerName:  to.Ptr("apim-backups"),
		StorageAccount: to.Ptr("contosorpstorage"),
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"Owner": to.Ptr("apimService1"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAQM8o="),
	// 	Identity: &armapimanagement.ServiceIdentity{
	// 		Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned),
	// 		PrincipalID: to.Ptr("XXXXX-5fb4-4916-95d4-64b306f9d924"),
	// 		TenantID: to.Ptr("XXXXX-86f1-XXXXX-91ab-2d7cd011db47"),
	// 		UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
	// 			"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/rg1UserIdentity": &armapimanagement.UserIdentityProperties{
	// 				ClientID: to.Ptr("XXXXX-a154-4830-XXXX-46a12da1a1e2"),
	// 				PrincipalID: to.Ptr("XXXXX-a100-4478-XXXX-d65d98118ba0"),
	// 			},
	// 			"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/vpnpremium": &armapimanagement.UserIdentityProperties{
	// 				ClientID: to.Ptr("XXXX-6328-4db2-XXXX-ab0e3e7806cf"),
	// 				PrincipalID: to.Ptr("XXXXX-9208-4128-af2d-a10d2af9b5a3"),
	// 			},
	// 		},
	// 	},
	// 	Location: to.Ptr("Central US EUAP"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-23T16:26:47.8637967Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 		},
	// 		DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 		DisableGateway: to.Ptr(false),
	// 		GatewayRegionalURL: to.Ptr("https://apimService1-centraluseuap-01.regional.azure-api.net"),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv1),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("52.XXXX.160.66")},
	// 			PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 			PublisherEmail: to.Ptr("apimService1@corp.microsoft.com"),
	// 			PublisherName: to.Ptr("MS"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 			Capacity: to.Ptr[int32](1),
	// 		},
	// 		SystemData: &armapimanagement.SystemData{
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-30T06:24:57.0008037Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("contoso@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
	// 		},
	// 	}
}
Output:

func (*ServiceClient) BeginCreateOrUpdate added in v0.3.0

func (client *ServiceClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceResource, options *ServiceClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServiceClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates an API Management service. This is long running operation and could take several minutes to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • parameters - Parameters supplied to the CreateOrUpdate API Management service operation.
  • options - ServiceClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceClient.BeginCreateOrUpdate method.
Example (ApiManagementCreateMultiRegionServiceWithCustomHostname)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
			"tag3": to.Ptr("value3"),
		},
		Location: to.Ptr("West US"),
		Properties: &armapimanagement.ServiceProperties{
			AdditionalLocations: []*armapimanagement.AdditionalLocation{
				{
					DisableGateway: to.Ptr(true),
					Location:       to.Ptr("East US"),
					SKU: &armapimanagement.ServiceSKUProperties{
						Name:     to.Ptr(armapimanagement.SKUTypePremium),
						Capacity: to.Ptr[int32](1),
					},
				}},
			APIVersionConstraint: &armapimanagement.APIVersionConstraint{
				MinAPIVersion: to.Ptr("2019-01-01"),
			},
			HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
				{
					Type:                to.Ptr(armapimanagement.HostnameTypeProxy),
					CertificatePassword: to.Ptr("Password"),
					DefaultSSLBinding:   to.Ptr(true),
					EncodedCertificate:  to.Ptr("****** Base 64 Encoded Certificate ************"),
					HostName:            to.Ptr("gateway1.msitesting.net"),
				},
				{
					Type:                to.Ptr(armapimanagement.HostnameTypeManagement),
					CertificatePassword: to.Ptr("Password"),
					EncodedCertificate:  to.Ptr("****** Base 64 Encoded Certificate ************"),
					HostName:            to.Ptr("mgmt.msitesting.net"),
				},
				{
					Type:                to.Ptr(armapimanagement.HostnameTypePortal),
					CertificatePassword: to.Ptr("Password"),
					EncodedCertificate:  to.Ptr("****** Base 64 Encoded Certificate ************"),
					HostName:            to.Ptr("portal1.msitesting.net"),
				}},
			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
			PublisherEmail:     to.Ptr("apim@autorestsdk.com"),
			PublisherName:      to.Ptr("autorestsdk"),
		},
		SKU: &armapimanagement.ServiceSKUProperties{
			Name:     to.Ptr(armapimanagement.SKUTypePremium),
			Capacity: to.Ptr[int32](1),
		},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 		"tag3": to.Ptr("value3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAACXok="),
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		AdditionalLocations: []*armapimanagement.AdditionalLocation{
	// 			{
	// 				DisableGateway: to.Ptr(true),
	// 				GatewayRegionalURL: to.Ptr("https://apimService1-eastus-01.regional.azure-api.net"),
	// 				Location: to.Ptr("East US"),
	// 				PublicIPAddresses: []*string{
	// 					to.Ptr("23.101.138.153")},
	// 					SKU: &armapimanagement.ServiceSKUProperties{
	// 						Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 						Capacity: to.Ptr[int32](1),
	// 					},
	// 			}},
	// 			APIVersionConstraint: &armapimanagement.APIVersionConstraint{
	// 				MinAPIVersion: to.Ptr("2019-01-01"),
	// 			},
	// 			CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-18T06:26:20.3348609Z"); return t}()),
	// 			CustomProperties: map[string]*string{
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 			},
	// 			DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 			DisableGateway: to.Ptr(false),
	// 			GatewayRegionalURL: to.Ptr("https://apimService1-westus-01.regional.azure-api.net"),
	// 			GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 			HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("apimService1.azure-api.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.msitesting.net"),
	// 						Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXF1D174FDB3A2"),
	// 					},
	// 					DefaultSSLBinding: to.Ptr(true),
	// 					HostName: to.Ptr("gateway1.msitesting.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeManagement),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.msitesting.net"),
	// 						Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXF1D174FDB3A2"),
	// 					},
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("mgmt.msitesting.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypePortal),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.msitesting.net"),
	// 						Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXF1D174FDB3A2"),
	// 					},
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("portal1.msitesting.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 			}},
	// 			ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 			NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 			PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 			PublicIPAddresses: []*string{
	// 				to.Ptr("13.91.32.113")},
	// 				ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 				TargetProvisioningState: to.Ptr(""),
	// 				VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 				PublisherEmail: to.Ptr("apim@autorestsdk.com"),
	// 				PublisherName: to.Ptr("autorestsdk"),
	// 			},
	// 			SKU: &armapimanagement.ServiceSKUProperties{
	// 				Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 				Capacity: to.Ptr[int32](1),
	// 			},
	// 		}
}
Output:

Example (ApiManagementCreateService)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateService.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
		Tags: map[string]*string{
			"Name": to.Ptr("Contoso"),
			"Test": to.Ptr("User"),
		},
		Location: to.Ptr("South Central US"),
		Properties: &armapimanagement.ServiceProperties{
			PublisherEmail: to.Ptr("foo@contoso.com"),
			PublisherName:  to.Ptr("foo"),
		},
		SKU: &armapimanagement.ServiceSKUProperties{
			Name:     to.Ptr(armapimanagement.SKUTypeDeveloper),
			Capacity: to.Ptr[int32](1),
		},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"Name": to.Ptr("Contoso"),
	// 		"Test": to.Ptr("User"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAp3T4="),
	// 	Location: to.Ptr("South Central US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		APIVersionConstraint: &armapimanagement.APIVersionConstraint{
	// 		},
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-18T06:10:56.0327105Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 		},
	// 		DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 		DisableGateway: to.Ptr(false),
	// 		GatewayRegionalURL: to.Ptr("https://apimService1-southcentralus-01.regional.azure-api.net"),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("23.102.171.124")},
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 			PublisherEmail: to.Ptr("foo@contoso.com"),
	// 			PublisherName: to.Ptr("foo"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypeDeveloper),
	// 			Capacity: to.Ptr[int32](1),
	// 		},
	// 		SystemData: &armapimanagement.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.1974346Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateServiceHavingMsi)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceHavingMsi.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
			"tag3": to.Ptr("value3"),
		},
		Identity: &armapimanagement.ServiceIdentity{
			Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssigned),
		},
		Location: to.Ptr("West US"),
		Properties: &armapimanagement.ServiceProperties{
			PublisherEmail: to.Ptr("apim@autorestsdk.com"),
			PublisherName:  to.Ptr("autorestsdk"),
		},
		SKU: &armapimanagement.ServiceSKUProperties{
			Name:     to.Ptr(armapimanagement.SKUTypeConsumption),
			Capacity: to.Ptr[int32](0),
		},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 		"tag3": to.Ptr("value3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAAWiU="),
	// 	Identity: &armapimanagement.ServiceIdentity{
	// 		Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("dfb9a757-df69-4966-a8d0-711a9cd8ffb4"),
	// 		TenantID: to.Ptr("XXXXXX-86f1-41af-91ab-2d7cd011db47"),
	// 	},
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-11T16:29:29.9711098Z"); return t}()),
	// 		EnableClientCertificate: to.Ptr(false),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PlatformVersion: to.Ptr(armapimanagement.PlatformVersionMtv1),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		TargetProvisioningState: to.Ptr(""),
	// 		VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 		PublisherEmail: to.Ptr("apim@autorestsdk.com"),
	// 		PublisherName: to.Ptr("autorestsdk"),
	// 	},
	// 	SKU: &armapimanagement.ServiceSKUProperties{
	// 		Name: to.Ptr(armapimanagement.SKUTypeConsumption),
	// 		Capacity: to.Ptr[int32](0),
	// 	},
	// 	SystemData: &armapimanagement.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.1974346Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

Example (ApiManagementCreateServiceInVnetWithPublicIp)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceInVnetWithPublicIP.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
			"tag3": to.Ptr("value3"),
		},
		Location: to.Ptr("East US 2 EUAP"),
		Properties: &armapimanagement.ServiceProperties{
			PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet"),
			VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
				SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"),
			},
			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeExternal),
			PublisherEmail:     to.Ptr("apim@autorestsdk.com"),
			PublisherName:      to.Ptr("autorestsdk"),
		},
		SKU: &armapimanagement.ServiceSKUProperties{
			Name:     to.Ptr(armapimanagement.SKUTypePremium),
			Capacity: to.Ptr[int32](2),
		},
		Zones: []*string{
			to.Ptr("1"),
			to.Ptr("2")},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 		"tag3": to.Ptr("value3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAGTAs="),
	// 	Location: to.Ptr("East US 2 EUAP"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-22T06:53:46.6409875Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 		},
	// 		DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 		DisableGateway: to.Ptr(false),
	// 		GatewayRegionalURL: to.Ptr("https://apimService1-eastus2euap-01.regional.azure-api.net"),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("20.47.137.XXX")},
	// 			PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet"),
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
	// 				SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"),
	// 			},
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeExternal),
	// 			PublisherEmail: to.Ptr("apim@autorestsdk.com"),
	// 			PublisherName: to.Ptr("autorestsdk"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 			Capacity: to.Ptr[int32](2),
	// 		},
	// 		SystemData: &armapimanagement.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.1974346Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 		},
	// 		Zones: []*string{
	// 			to.Ptr("1"),
	// 			to.Ptr("2")},
	// 		}
}
Output:

Example (ApiManagementCreateServiceInZones)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceInZones.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
			"tag3": to.Ptr("value3"),
		},
		Location: to.Ptr("North europe"),
		Properties: &armapimanagement.ServiceProperties{
			PublisherEmail: to.Ptr("apim@autorestsdk.com"),
			PublisherName:  to.Ptr("autorestsdk"),
		},
		SKU: &armapimanagement.ServiceSKUProperties{
			Name:     to.Ptr(armapimanagement.SKUTypePremium),
			Capacity: to.Ptr[int32](2),
		},
		Zones: []*string{
			to.Ptr("1"),
			to.Ptr("2")},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 		"tag3": to.Ptr("value3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAiXvE="),
	// 	Location: to.Ptr("North Europe"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-28T23:18:14.6562474Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 		},
	// 		DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 		DisableGateway: to.Ptr(false),
	// 		GatewayRegionalURL: to.Ptr("https://apimService1-northeurope-01.regional.azure-api.net"),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("20.54.34.66")},
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 			PublisherEmail: to.Ptr("apim@autorestsdk.com"),
	// 			PublisherName: to.Ptr("autorestsdk"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 			Capacity: to.Ptr[int32](2),
	// 		},
	// 		SystemData: &armapimanagement.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.1974346Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 		},
	// 		Zones: []*string{
	// 			to.Ptr("1"),
	// 			to.Ptr("2")},
	// 		}
}
Output:

Example (ApiManagementCreateServiceWithCustomHostnameKeyVault)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceWithCustomHostnameKeyVault.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
			"tag3": to.Ptr("value3"),
		},
		Identity: &armapimanagement.ServiceIdentity{
			Type: to.Ptr(armapimanagement.ApimIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
				"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
			},
		},
		Location: to.Ptr("North Europe"),
		Properties: &armapimanagement.ServiceProperties{
			APIVersionConstraint: &armapimanagement.APIVersionConstraint{
				MinAPIVersion: to.Ptr("2019-01-01"),
			},
			HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
				{
					Type:              to.Ptr(armapimanagement.HostnameTypeProxy),
					DefaultSSLBinding: to.Ptr(true),
					HostName:          to.Ptr("gateway1.msitesting.net"),
					IdentityClientID:  to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
					KeyVaultID:        to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
				},
				{
					Type:             to.Ptr(armapimanagement.HostnameTypeManagement),
					HostName:         to.Ptr("mgmt.msitesting.net"),
					IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
					KeyVaultID:       to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
				},
				{
					Type:             to.Ptr(armapimanagement.HostnameTypePortal),
					HostName:         to.Ptr("portal1.msitesting.net"),
					IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
					KeyVaultID:       to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
				}},
			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
			PublisherEmail:     to.Ptr("apim@autorestsdk.com"),
			PublisherName:      to.Ptr("autorestsdk"),
		},
		SKU: &armapimanagement.ServiceSKUProperties{
			Name:     to.Ptr(armapimanagement.SKUTypePremium),
			Capacity: to.Ptr[int32](1),
		},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 		"tag3": to.Ptr("value3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAigjU="),
	// 	Identity: &armapimanagement.ServiceIdentity{
	// 		Type: to.Ptr(armapimanagement.ApimIdentityTypeUserAssigned),
	// 		TenantID: to.Ptr("f686d426-8d16-xxxx-xxxx-ab578e110ccd"),
	// 		UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
	// 			"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armapimanagement.UserIdentityProperties{
	// 				ClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
	// 				PrincipalID: to.Ptr("15e769b2-xxxx-xxxx-xxxx-3fd9a923ac3a"),
	// 			},
	// 		},
	// 	},
	// 	Location: to.Ptr("North Europe"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		APIVersionConstraint: &armapimanagement.APIVersionConstraint{
	// 			MinAPIVersion: to.Ptr("2019-01-01"),
	// 		},
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-13T22:30:20.7759747Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 		},
	// 		DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 		DisableGateway: to.Ptr(false),
	// 		GatewayRegionalURL: to.Ptr("https://apimService1-northeurope-01.regional.azure-api.net"),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 				DefaultSSLBinding: to.Ptr(false),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 			},
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				Certificate: &armapimanagement.CertificateInformation{
	// 					Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2037-01-01T07:00:00+00:00"); return t}()),
	// 					Subject: to.Ptr("CN=*.msitesting.net"),
	// 					Thumbprint: to.Ptr("EA276907917CB5XXXXXXXXXXX690"),
	// 				},
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceKeyVault),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("gateway1.msitesting.net"),
	// 				IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
	// 				KeyVaultID: to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 			},
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeManagement),
	// 				Certificate: &armapimanagement.CertificateInformation{
	// 					Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2037-01-01T07:00:00+00:00"); return t}()),
	// 					Subject: to.Ptr("CN=*.msitesting.net"),
	// 					Thumbprint: to.Ptr("EA276907917CB5XXXXXXXXXXX690"),
	// 				},
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceKeyVault),
	// 				DefaultSSLBinding: to.Ptr(false),
	// 				HostName: to.Ptr("mgmt.msitesting.net"),
	// 				IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
	// 				KeyVaultID: to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 			},
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypePortal),
	// 				Certificate: &armapimanagement.CertificateInformation{
	// 					Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2037-01-01T07:00:00+00:00"); return t}()),
	// 					Subject: to.Ptr("CN=*.msitesting.net"),
	// 					Thumbprint: to.Ptr("EA276907917CB5XXXXXXXXXXX690"),
	// 				},
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceKeyVault),
	// 				DefaultSSLBinding: to.Ptr(false),
	// 				HostName: to.Ptr("portal1.msitesting.net"),
	// 				IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
	// 				KeyVaultID: to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("40.112.74.192")},
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 			PublisherEmail: to.Ptr("apim@autorestsdk.com"),
	// 			PublisherName: to.Ptr("autorestsdk"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 			Capacity: to.Ptr[int32](1),
	// 		},
	// 		SystemData: &armapimanagement.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.1974346Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateServiceWithSystemCertificates)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceWithSystemCertificates.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
			"tag3": to.Ptr("value3"),
		},
		Location: to.Ptr("Central US"),
		Properties: &armapimanagement.ServiceProperties{
			Certificates: []*armapimanagement.CertificateConfiguration{
				{
					CertificatePassword: to.Ptr("Password"),
					EncodedCertificate:  to.Ptr("*******Base64 encoded Certificate******************"),
					StoreName:           to.Ptr(armapimanagement.CertificateConfigurationStoreNameCertificateAuthority),
				}},
			PublisherEmail: to.Ptr("apim@autorestsdk.com"),
			PublisherName:  to.Ptr("autorestsdk"),
		},
		SKU: &armapimanagement.ServiceSKUProperties{
			Name:     to.Ptr(armapimanagement.SKUTypeBasic),
			Capacity: to.Ptr[int32](1),
		},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 		"tag3": to.Ptr("value3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAp3UM="),
	// 	Location: to.Ptr("Central US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		APIVersionConstraint: &armapimanagement.APIVersionConstraint{
	// 		},
	// 		Certificates: []*armapimanagement.CertificateConfiguration{
	// 			{
	// 				Certificate: &armapimanagement.CertificateInformation{
	// 					Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00+00:00"); return t}()),
	// 					Subject: to.Ptr("CN=*.msitesting.net"),
	// 					Thumbprint: to.Ptr("8E989652CABCF585ACBFCB9C2C91F1D174FDB3A2"),
	// 				},
	// 				StoreName: to.Ptr(armapimanagement.CertificateConfigurationStoreNameCertificateAuthority),
	// 		}},
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-18T06:33:28.0906918Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 		},
	// 		DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 		DisableGateway: to.Ptr(false),
	// 		GatewayRegionalURL: to.Ptr("https://apimService1-centralus-01.regional.azure-api.net"),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("40.113.223.117")},
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 			PublisherEmail: to.Ptr("apim@autorestsdk.com"),
	// 			PublisherName: to.Ptr("autorestsdk"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypeBasic),
	// 			Capacity: to.Ptr[int32](1),
	// 		},
	// 		SystemData: &armapimanagement.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.1974346Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 		},
	// 	}
}
Output:

Example (ApiManagementCreateServiceWithUserAssignedIdentity)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceWithUserAssignedIdentity.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
			"tag3": to.Ptr("value3"),
		},
		Identity: &armapimanagement.ServiceIdentity{
			Type: to.Ptr(armapimanagement.ApimIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
				"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": {},
			},
		},
		Location: to.Ptr("West US"),
		Properties: &armapimanagement.ServiceProperties{
			PublisherEmail: to.Ptr("apim@autorestsdk.com"),
			PublisherName:  to.Ptr("autorestsdk"),
		},
		SKU: &armapimanagement.ServiceSKUProperties{
			Name:     to.Ptr(armapimanagement.SKUTypeConsumption),
			Capacity: to.Ptr[int32](0),
		},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 		"tag3": to.Ptr("value3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAFzyk="),
	// 	Identity: &armapimanagement.ServiceIdentity{
	// 		Type: to.Ptr(armapimanagement.ApimIdentityTypeUserAssigned),
	// 		TenantID: to.Ptr("XXXXX-86f1-41af-XXXX-2d7cd011db47"),
	// 		UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
	// 			"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": &armapimanagement.UserIdentityProperties{
	// 				ClientID: to.Ptr("5a2c6b8e-0905-XXXX-a772-993c9418137f"),
	// 				PrincipalID: to.Ptr("XXXXX-6e62-4649-9f54-a119fc1ba85e"),
	// 			},
	// 		},
	// 	},
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T01:05:33.4573398Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 		},
	// 		DisableGateway: to.Ptr(false),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PlatformVersion: to.Ptr(armapimanagement.PlatformVersionMtv1),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		TargetProvisioningState: to.Ptr(""),
	// 		VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 		PublisherEmail: to.Ptr("apim@autorestsdk.com"),
	// 		PublisherName: to.Ptr("autorestsdk"),
	// 	},
	// 	SKU: &armapimanagement.ServiceSKUProperties{
	// 		Name: to.Ptr(armapimanagement.SKUTypeConsumption),
	// 		Capacity: to.Ptr[int32](0),
	// 	},
	// 	SystemData: &armapimanagement.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.1974346Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

Example (ApiManagementUndelete)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUndelete.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
		Location: to.Ptr("South Central US"),
		Properties: &armapimanagement.ServiceProperties{
			Restore:        to.Ptr(true),
			PublisherEmail: to.Ptr("foo@contoso.com"),
			PublisherName:  to.Ptr("foo"),
		},
		SKU: &armapimanagement.ServiceSKUProperties{
			Name:     to.Ptr(armapimanagement.SKUTypeDeveloper),
			Capacity: to.Ptr[int32](1),
		},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Etag: to.Ptr("AAAAAAAp3T4="),
	// 	Location: to.Ptr("South Central US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		APIVersionConstraint: &armapimanagement.APIVersionConstraint{
	// 		},
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-18T06:10:56.0327105Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 		},
	// 		DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 		DisableGateway: to.Ptr(false),
	// 		GatewayRegionalURL: to.Ptr("https://apimService1-southcentralus-01.regional.azure-api.net"),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("23.102.171.124")},
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 			PublisherEmail: to.Ptr("foo@contoso.com"),
	// 			PublisherName: to.Ptr("foo"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypeDeveloper),
	// 			Capacity: to.Ptr[int32](1),
	// 		},
	// 	}
}
Output:

func (*ServiceClient) BeginDelete added in v0.3.0

func (client *ServiceClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*runtime.Poller[ServiceClientDeleteResponse], error)

BeginDelete - Deletes an existing API Management service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceDeleteService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginDelete(ctx, "rg1", "apimService1", 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)
	}
}
Output:

func (*ServiceClient) BeginRestore added in v0.3.0

func (client *ServiceClient) BeginRestore(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters, options *ServiceClientBeginRestoreOptions) (*runtime.Poller[ServiceClientRestoreResponse], error)

BeginRestore - Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the current service. This is a long running operation and could take several minutes to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • parameters - Parameters supplied to the Restore API Management service from backup operation.
  • options - ServiceClientBeginRestoreOptions contains the optional parameters for the ServiceClient.BeginRestore method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRestoreWithAccessKey.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginRestore(ctx, "rg1", "apimService1", armapimanagement.ServiceBackupRestoreParameters{
		AccessKey:      to.Ptr("**************************************************"),
		AccessType:     to.Ptr(armapimanagement.AccessTypeAccessKey),
		BackupName:     to.Ptr("apimService1backup_2017_03_19"),
		ContainerName:  to.Ptr("backupContainer"),
		StorageAccount: to.Ptr("teststorageaccount"),
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 		"tag3": to.Ptr("value3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAACXok="),
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		AdditionalLocations: []*armapimanagement.AdditionalLocation{
	// 			{
	// 				DisableGateway: to.Ptr(true),
	// 				GatewayRegionalURL: to.Ptr("https://apimService1-eastus-01.regional.azure-api.net"),
	// 				Location: to.Ptr("East US"),
	// 				PublicIPAddresses: []*string{
	// 					to.Ptr("23.101.138.153")},
	// 					SKU: &armapimanagement.ServiceSKUProperties{
	// 						Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 						Capacity: to.Ptr[int32](1),
	// 					},
	// 			}},
	// 			APIVersionConstraint: &armapimanagement.APIVersionConstraint{
	// 				MinAPIVersion: to.Ptr("2019-01-01"),
	// 			},
	// 			CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-18T06:26:20.3348609Z"); return t}()),
	// 			CustomProperties: map[string]*string{
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
	// 			},
	// 			DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 			DisableGateway: to.Ptr(false),
	// 			GatewayRegionalURL: to.Ptr("https://apimService1-westus-01.regional.azure-api.net"),
	// 			GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 			HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("apimService1.azure-api.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.msitesting.net"),
	// 						Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXB9C2C91F1D174FDB3A2"),
	// 					},
	// 					DefaultSSLBinding: to.Ptr(true),
	// 					HostName: to.Ptr("gateway1.msitesting.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeManagement),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.msitesting.net"),
	// 						Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXB9C2C91F1D174FDB3A2"),
	// 					},
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("mgmt.msitesting.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypePortal),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.msitesting.net"),
	// 						Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXB9C2C91F1D174FDB3A2"),
	// 					},
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("portal1.msitesting.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 			}},
	// 			ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 			NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 			PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 			PublicIPAddresses: []*string{
	// 				to.Ptr("13.91.32.113")},
	// 				ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 				TargetProvisioningState: to.Ptr(""),
	// 				VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 				PublisherEmail: to.Ptr("apim@autorestsdk.com"),
	// 				PublisherName: to.Ptr("autorestsdk"),
	// 			},
	// 			SKU: &armapimanagement.ServiceSKUProperties{
	// 				Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 				Capacity: to.Ptr[int32](1),
	// 			},
	// 		}
}
Output:

func (*ServiceClient) BeginUpdate added in v0.3.0

func (client *ServiceClient) BeginUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateParameters, options *ServiceClientBeginUpdateOptions) (*runtime.Poller[ServiceClientUpdateResponse], error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • parameters - Parameters supplied to the CreateOrUpdate API Management service operation.
  • options - ServiceClientBeginUpdateOptions contains the optional parameters for the ServiceClient.BeginUpdate method.
Example (ApiManagementUpdateServiceDisableTls10)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServiceDisableTls10.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceUpdateParameters{
		Properties: &armapimanagement.ServiceUpdateProperties{
			CustomProperties: map[string]*string{
				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"),
			},
		},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"Owner": to.Ptr("sasolank"),
	// 		"Pool": to.Ptr("Manual"),
	// 		"Reserved": to.Ptr(""),
	// 		"TestExpiration": to.Ptr("Thu, 29 Jun 2017 18:50:40 GMT"),
	// 		"TestSuiteExpiration": to.Ptr("Thu, 29 Jun 2017 18:51:46 GMT"),
	// 		"UID": to.Ptr("4f5025fe-0669-4e2e-8320-5199466e5eb3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAYRPs="),
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-29T17:50:42.3191122Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 		},
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 		},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("40.86.176.232")},
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 			PublisherEmail: to.Ptr("admin@live.com"),
	// 			PublisherName: to.Ptr("Contoso"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypeStandard),
	// 			Capacity: to.Ptr[int32](1),
	// 		},
	// 	}
}
Output:

Example (ApiManagementUpdateServicePublisherDetails)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServicePublisherDetails.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceUpdateParameters{
		Properties: &armapimanagement.ServiceUpdateProperties{
			PublisherEmail: to.Ptr("foobar@live.com"),
			PublisherName:  to.Ptr("Contoso Vnext"),
		},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"Owner": to.Ptr("sasolank"),
	// 		"Pool": to.Ptr("Manual"),
	// 		"Reserved": to.Ptr(""),
	// 		"TestExpiration": to.Ptr("Thu, 29 Jun 2017 18:50:40 GMT"),
	// 		"TestSuiteExpiration": to.Ptr("Thu, 29 Jun 2017 18:51:46 GMT"),
	// 		"UID": to.Ptr("4f5025fe-0669-4e2e-8320-5199466e5eb3"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAYRPs="),
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-29T17:50:42.3191122Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
	// 		},
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 		},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("40.86.176.232")},
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 			PublisherEmail: to.Ptr("foobar@live.com"),
	// 			PublisherName: to.Ptr("Contoso Vnext"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypeStandard),
	// 			Capacity: to.Ptr[int32](1),
	// 		},
	// 	}
}
Output:

Example (ApiManagementUpdateServiceToNewVnetAndAvailabilityZones)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServiceToNewVnetAndAZs.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceClient().BeginUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceUpdateParameters{
		Properties: &armapimanagement.ServiceUpdateProperties{
			AdditionalLocations: []*armapimanagement.AdditionalLocation{
				{
					Location:          to.Ptr("Australia East"),
					PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/apim-australia-east-publicip"),
					SKU: &armapimanagement.ServiceSKUProperties{
						Name:     to.Ptr(armapimanagement.SKUTypePremium),
						Capacity: to.Ptr[int32](3),
					},
					VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
						SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/apimaeavnet/subnets/default"),
					},
					Zones: []*string{
						to.Ptr("1"),
						to.Ptr("2"),
						to.Ptr("3")},
				}},
			PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/publicip-apim-japan-east"),
			VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
				SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-apim-japaneast/subnets/apim2"),
			},
			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeExternal),
		},
		SKU: &armapimanagement.ServiceSKUProperties{
			Name:     to.Ptr(armapimanagement.SKUTypePremium),
			Capacity: to.Ptr[int32](3),
		},
		Zones: []*string{
			to.Ptr("1"),
			to.Ptr("2"),
			to.Ptr("3")},
	}, 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Etag: to.Ptr("AAAAAAAWBIU="),
	// 	Location: to.Ptr("Japan East"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		AdditionalLocations: []*armapimanagement.AdditionalLocation{
	// 			{
	// 				DisableGateway: to.Ptr(false),
	// 				GatewayRegionalURL: to.Ptr("https://apimService1-australiaeast-01.regional.azure-api.net"),
	// 				Location: to.Ptr("Australia East"),
	// 				PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
	// 				PublicIPAddresses: []*string{
	// 					to.Ptr("20.213.1.35")},
	// 					PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/apim-australia-east-publicip"),
	// 					SKU: &armapimanagement.ServiceSKUProperties{
	// 						Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 						Capacity: to.Ptr[int32](3),
	// 					},
	// 					VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
	// 						SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/apimaeavnet/subnets/default"),
	// 					},
	// 					Zones: []*string{
	// 						to.Ptr("1"),
	// 						to.Ptr("2"),
	// 						to.Ptr("3")},
	// 				}},
	// 				CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-08T23:41:35.6447381Z"); return t}()),
	// 				CustomProperties: map[string]*string{
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_GCM_SHA256": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_256_CBC_SHA": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_256_CBC_SHA256": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("false"),
	// 				},
	// 				DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 				DisableGateway: to.Ptr(false),
	// 				GatewayRegionalURL: to.Ptr("https://apimService1-japaneast-01.regional.azure-api.net"),
	// 				GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 				HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 					{
	// 						Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 						CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 						DefaultSSLBinding: to.Ptr(false),
	// 						HostName: to.Ptr("apimService1.azure-api.net"),
	// 						NegotiateClientCertificate: to.Ptr(false),
	// 					},
	// 					{
	// 						Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 						Certificate: &armapimanagement.CertificateInformation{
	// 							Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-09T23:59:59+00:00"); return t}()),
	// 							Subject: to.Ptr("CN=mycustomdomain.int-azure-api.net"),
	// 							Thumbprint: to.Ptr("2994B5FFB8F76B3C687D324A8DEE0432C1ED18CD"),
	// 						},
	// 						CertificateSource: to.Ptr(armapimanagement.CertificateSourceManaged),
	// 						DefaultSSLBinding: to.Ptr(true),
	// 						HostName: to.Ptr("mycustomdomain.int-azure-api.net"),
	// 						NegotiateClientCertificate: to.Ptr(false),
	// 				}},
	// 				ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 				NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 				PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
	// 				PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 				PublicIPAddresses: []*string{
	// 					to.Ptr("20.78.248.217")},
	// 					PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/publicip-apim-japan-east"),
	// 					PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
	// 					ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 					TargetProvisioningState: to.Ptr(""),
	// 					VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
	// 						SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-apim-japaneast/subnets/apim2"),
	// 					},
	// 					VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeInternal),
	// 					PublisherEmail: to.Ptr("contoso@microsoft.com"),
	// 					PublisherName: to.Ptr("apimPublisher"),
	// 				},
	// 				SKU: &armapimanagement.ServiceSKUProperties{
	// 					Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 					Capacity: to.Ptr[int32](3),
	// 				},
	// 				SystemData: &armapimanagement.SystemData{
	// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-21T20:04:21.6108974Z"); return t}()),
	// 					LastModifiedBy: to.Ptr("contoso@microsoft.com"),
	// 					LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
	// 				},
	// 				Zones: []*string{
	// 					to.Ptr("1"),
	// 					to.Ptr("2"),
	// 					to.Ptr("3")},
	// 				}
}
Output:

func (*ServiceClient) CheckNameAvailability added in v0.3.0

CheckNameAvailability - Checks availability and correctness of a name for an API Management service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • parameters - Parameters supplied to the CheckNameAvailability operation.
  • options - ServiceClientCheckNameAvailabilityOptions contains the optional parameters for the ServiceClient.CheckNameAvailability method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceCheckNameAvailability.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceClient().CheckNameAvailability(ctx, armapimanagement.ServiceCheckNameAvailabilityParameters{
		Name: to.Ptr("apimService1"),
	}, 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.ServiceNameAvailabilityResult = armapimanagement.ServiceNameAvailabilityResult{
	// 	Message: to.Ptr(""),
	// 	NameAvailable: to.Ptr(true),
	// 	Reason: to.Ptr(armapimanagement.NameAvailabilityReasonValid),
	// }
}
Output:

func (*ServiceClient) Get added in v0.3.0

func (client *ServiceClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientGetOptions) (ServiceClientGetResponse, error)

Get - Gets an API Management service resource description. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method.
Example (ApiManagementServiceGetMultiRegionInternalVnet)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetMultiRegionInternalVnet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceClient().Get(ctx, "rg1", "apimService1", 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimservice1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimservice1"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Etag: to.Ptr("AAAAAADqC0c="),
	// 	Location: to.Ptr("West US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		AdditionalLocations: []*armapimanagement.AdditionalLocation{
	// 			{
	// 				DisableGateway: to.Ptr(false),
	// 				GatewayRegionalURL: to.Ptr("https://apimservice1-westus2-01.regional.azure-api.net"),
	// 				Location: to.Ptr("West US 2"),
	// 				PrivateIPAddresses: []*string{
	// 					to.Ptr("10.0.X.6")},
	// 					PublicIPAddresses: []*string{
	// 						to.Ptr("40.XXX.79.187")},
	// 						SKU: &armapimanagement.ServiceSKUProperties{
	// 							Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 							Capacity: to.Ptr[int32](1),
	// 						},
	// 						VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
	// 							SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/APIMVNet/subnets/apim-internal-sub"),
	// 						},
	// 				}},
	// 				APIVersionConstraint: &armapimanagement.APIVersionConstraint{
	// 				},
	// 				CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-02T01:42:09.1268424Z"); return t}()),
	// 				CustomProperties: map[string]*string{
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("True"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("True"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("True"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("True"),
	// 					"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("True"),
	// 				},
	// 				DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 				DisableGateway: to.Ptr(false),
	// 				GatewayRegionalURL: to.Ptr("https://apimservice1-westus-01.regional.azure-api.net"),
	// 				GatewayURL: to.Ptr("https://apimservice1.azure-api.net"),
	// 				HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 					{
	// 						Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 						CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 						DefaultSSLBinding: to.Ptr(false),
	// 						HostName: to.Ptr("apimService1.azure-api.net"),
	// 						NegotiateClientCertificate: to.Ptr(false),
	// 					},
	// 					{
	// 						Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 						Certificate: &armapimanagement.CertificateInformation{
	// 							Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-16T16:51:34+00:00"); return t}()),
	// 							Subject: to.Ptr("CN=*.preview.net"),
	// 							Thumbprint: to.Ptr("B4330123DBAXXXXXXXXX1F35E84493476"),
	// 						},
	// 						CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom),
	// 						DefaultSSLBinding: to.Ptr(true),
	// 						HostName: to.Ptr("apimgatewaytest.preview.net"),
	// 						NegotiateClientCertificate: to.Ptr(false),
	// 				}},
	// 				ManagementAPIURL: to.Ptr("https://apimservice1.management.azure-api.net"),
	// 				NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 				PortalURL: to.Ptr("https://apimservice1.portal.azure-api.net"),
	// 				PrivateIPAddresses: []*string{
	// 					to.Ptr("172.XX.0.5")},
	// 					ProvisioningState: to.Ptr("Succeeded"),
	// 					PublicIPAddresses: []*string{
	// 						to.Ptr("137.XXX.11.74")},
	// 						ScmURL: to.Ptr("https://apimservice1.scm.azure-api.net"),
	// 						TargetProvisioningState: to.Ptr(""),
	// 						VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
	// 							SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/apim-appGateway-vnet/subnets/apim-subnet"),
	// 						},
	// 						VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeInternal),
	// 						PublisherEmail: to.Ptr("abcs@contoso.com"),
	// 						PublisherName: to.Ptr("contoso publisher"),
	// 					},
	// 					SKU: &armapimanagement.ServiceSKUProperties{
	// 						Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 						Capacity: to.Ptr[int32](1),
	// 					},
	// 				}
}
Output:

Example (ApiManagementServiceGetService)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceClient().Get(ctx, "rg1", "apimService1", 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("OGF-Z3-06162021-Premium"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/OGF-Z3-06162021-Premium"),
	// 	Tags: map[string]*string{
	// 		"ReleaseName": to.Ptr("Z3"),
	// 		"owner": to.Ptr("v-aswmoh"),
	// 	},
	// 	Etag: to.Ptr("AAAAAAAWN/4="),
	// 	Identity: &armapimanagement.ServiceIdentity{
	// 		Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned),
	// 		PrincipalID: to.Ptr("306205e7-b21a-41bf-92e2-3e28af30041e"),
	// 		TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
	// 		UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
	// 			"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ogf-identity": &armapimanagement.UserIdentityProperties{
	// 				ClientID: to.Ptr("8d9791f2-0cdf-41f4-9e66-cdc39b496789"),
	// 				PrincipalID: to.Ptr("713784d2-ee37-412a-95f0-3768f397f82d"),
	// 			},
	// 		},
	// 	},
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		AdditionalLocations: []*armapimanagement.AdditionalLocation{
	// 			{
	// 				DisableGateway: to.Ptr(false),
	// 				GatewayRegionalURL: to.Ptr("https://ogf-z3-06162021-premium-eastus2-01.regional.azure-api.net"),
	// 				Location: to.Ptr("East US 2"),
	// 				PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
	// 				PublicIPAddresses: []*string{
	// 					to.Ptr("40.70.24.106")},
	// 					SKU: &armapimanagement.ServiceSKUProperties{
	// 						Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 						Capacity: to.Ptr[int32](1),
	// 					},
	// 					Zones: []*string{
	// 					},
	// 			}},
	// 			APIVersionConstraint: &armapimanagement.APIVersionConstraint{
	// 				MinAPIVersion: to.Ptr("2019-12-01"),
	// 			},
	// 			Certificates: []*armapimanagement.CertificateConfiguration{
	// 			},
	// 			CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T09:40:00.9453556Z"); return t}()),
	// 			CustomProperties: map[string]*string{
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("false"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("false"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("false"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("false"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("false"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("false"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"),
	// 				"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("false"),
	// 			},
	// 			DeveloperPortalURL: to.Ptr("https://ogf-z3-06162021-premium.developer.azure-api.net"),
	// 			DisableGateway: to.Ptr(false),
	// 			GatewayRegionalURL: to.Ptr("https://ogf-z3-06162021-premium-eastus-01.regional.azure-api.net"),
	// 			GatewayURL: to.Ptr("https://ogf-z3-06162021-premium.azure-api.net"),
	// 			HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 					CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("ogf-z3-06162021-premium.azure-api.net"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T22:32:32+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.current.int-azure-api.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US"),
	// 						Thumbprint: to.Ptr("BA0C286XXXXXXXX58A4A507E3DBD51"),
	// 					},
	// 					CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom),
	// 					DefaultSSLBinding: to.Ptr(true),
	// 					HostName: to.Ptr("gateway.current.int-azure-api.net"),
	// 					KeyVaultID: to.Ptr("https://ogf-testing.vault.azure.net/secrets/current-ssl"),
	// 					NegotiateClientCertificate: to.Ptr(true),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeDeveloperPortal),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T22:32:32+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.current.int-azure-api.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US"),
	// 						Thumbprint: to.Ptr("BA0C286XXXXXXXX58A4A507E3DBD51"),
	// 					},
	// 					CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom),
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("developer.current.int-azure-api.net"),
	// 					KeyVaultID: to.Ptr("https://ogf-testing.vault.azure.net/secrets/current-ssl"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeManagement),
	// 					Certificate: &armapimanagement.CertificateInformation{
	// 						Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T22:32:32+00:00"); return t}()),
	// 						Subject: to.Ptr("CN=*.current.int-azure-api.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US"),
	// 						Thumbprint: to.Ptr("BA0C286XXXXXXXX58A4A507E3DBD51"),
	// 					},
	// 					CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom),
	// 					DefaultSSLBinding: to.Ptr(false),
	// 					HostName: to.Ptr("mgmt.current.int-azure-api.net"),
	// 					KeyVaultID: to.Ptr("https://ogf-testing.vault.azure.net/secrets/current-ssl"),
	// 					NegotiateClientCertificate: to.Ptr(false),
	// 			}},
	// 			ManagementAPIURL: to.Ptr("https://ogf-z3-06162021-premium.management.azure-api.net"),
	// 			NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 			PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
	// 			PortalURL: to.Ptr("https://ogf-z3-06162021-premium.portal.azure-api.net"),
	// 			PrivateEndpointConnections: []*armapimanagement.RemotePrivateEndpointConnectionWrapper{
	// 				{
	// 					Name: to.Ptr("privateEndpointProxyName"),
	// 					Type: to.Ptr("Microsoft.ApiManagement/service/privateEndpointConnections"),
	// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/privateEndpointConnections/privateEndpointProxyName"),
	// 					Properties: &armapimanagement.PrivateEndpointConnectionWrapperProperties{
	// 						GroupIDs: []*string{
	// 							to.Ptr("Gateway")},
	// 							PrivateEndpoint: &armapimanagement.ArmIDWrapper{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/privateEndpointName"),
	// 							},
	// 							PrivateLinkServiceConnectionState: &armapimanagement.PrivateLinkServiceConnectionState{
	// 								Description: to.Ptr("Please approve my request, thanks"),
	// 								ActionsRequired: to.Ptr("None"),
	// 								Status: to.Ptr(armapimanagement.PrivateEndpointServiceConnectionStatusPending),
	// 							},
	// 							ProvisioningState: to.Ptr("Succeeded"),
	// 						},
	// 				}},
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 				PublicIPAddresses: []*string{
	// 					to.Ptr("13.92.130.49")},
	// 					PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
	// 					ScmURL: to.Ptr("https://ogf-z3-06162021-premium.scm.azure-api.net"),
	// 					TargetProvisioningState: to.Ptr(""),
	// 					VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 					PublisherEmail: to.Ptr("string"),
	// 					PublisherName: to.Ptr("Test Premium"),
	// 				},
	// 				SKU: &armapimanagement.ServiceSKUProperties{
	// 					Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 					Capacity: to.Ptr[int32](1),
	// 				},
	// 				SystemData: &armapimanagement.SystemData{
	// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T09:40:00.7106733Z"); return t}()),
	// 					CreatedBy: to.Ptr("string"),
	// 					CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
	// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-20T06:33:09.6159006Z"); return t}()),
	// 					LastModifiedBy: to.Ptr("foo@contoso.com"),
	// 					LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
	// 				},
	// 			}
}
Output:

Example (ApiManagementServiceGetServiceHavingMsi)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetServiceHavingMsi.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceClient().Get(ctx, "rg1", "apimService1", 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.ServiceResource = armapimanagement.ServiceResource{
	// 	Name: to.Ptr("apimService1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Etag: to.Ptr("AAAAAAAENfI="),
	// 	Identity: &armapimanagement.ServiceIdentity{
	// 		Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned),
	// 		PrincipalID: to.Ptr("ca1d33f7-xxxx-42ec-xxxx-d526a1ee953a"),
	// 		TenantID: to.Ptr("72f988bf-xxxx-41af-xxxx-2d7cd011db47"),
	// 		UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
	// 			"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": &armapimanagement.UserIdentityProperties{
	// 				ClientID: to.Ptr("aaff9c7d-xxxx-4db2-xxxx-ab0e3e7806cf"),
	// 				PrincipalID: to.Ptr("95194df2-9208-xxxx-xxxx-a10d2af9b5a3"),
	// 			},
	// 		},
	// 	},
	// 	Location: to.Ptr("West Europe"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-04-12T00:20:15.6018952Z"); return t}()),
	// 		CustomProperties: map[string]*string{
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("True"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("True"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("True"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("True"),
	// 			"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("True"),
	// 		},
	// 		DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
	// 		DisableGateway: to.Ptr(false),
	// 		GatewayRegionalURL: to.Ptr("https://apimService1-westeurope-01.regional.azure-api.net"),
	// 		GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
	// 		HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
	// 				DefaultSSLBinding: to.Ptr(false),
	// 				HostName: to.Ptr("apimService1.azure-api.net"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 			},
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeProxy),
	// 				Certificate: &armapimanagement.CertificateInformation{
	// 					Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-18T11:11:47+00:00"); return t}()),
	// 					Subject: to.Ptr("CN=*.msitesting.net"),
	// 					Thumbprint: to.Ptr("9833D531D7A45XXXXXA85908BD3692E0BD3F"),
	// 				},
	// 				CertificateSource: to.Ptr(armapimanagement.CertificateSourceKeyVault),
	// 				DefaultSSLBinding: to.Ptr(true),
	// 				HostName: to.Ptr("proxy.msitesting.net"),
	// 				KeyVaultID: to.Ptr("https://samir-msi-keyvault.vault.azure.net/secrets/msicertificate"),
	// 				NegotiateClientCertificate: to.Ptr(false),
	// 		}},
	// 		ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicIPAddresses: []*string{
	// 			to.Ptr("13.94.xxx.188")},
	// 			ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
	// 			TargetProvisioningState: to.Ptr(""),
	// 			VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
	// 				SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/dfVirtualNetwork/subnets/backendSubnet"),
	// 			},
	// 			VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeExternal),
	// 			PublisherEmail: to.Ptr("foo@contoso.com"),
	// 			PublisherName: to.Ptr("Contoso"),
	// 		},
	// 		SKU: &armapimanagement.ServiceSKUProperties{
	// 			Name: to.Ptr(armapimanagement.SKUTypePremium),
	// 			Capacity: to.Ptr[int32](1),
	// 		},
	// 	}
}
Output:

func (*ServiceClient) GetDomainOwnershipIdentifier added in v0.3.0

GetDomainOwnershipIdentifier - Get the custom domain ownership identifier for an API Management service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • options - ServiceClientGetDomainOwnershipIdentifierOptions contains the optional parameters for the ServiceClient.GetDomainOwnershipIdentifier method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetDomainOwnershipIdentifier.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceClient().GetDomainOwnershipIdentifier(ctx, 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.ServiceGetDomainOwnershipIdentifierResult = armapimanagement.ServiceGetDomainOwnershipIdentifierResult{
	// 	DomainOwnershipIdentifier: to.Ptr("KLE1vdMblVeHECAi4nCe3oNaXXXXvNlLrXt2ev84KM="),
	// }
}
Output:

func (*ServiceClient) GetSsoToken added in v0.3.0

func (client *ServiceClient) GetSsoToken(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientGetSsoTokenOptions) (ServiceClientGetSsoTokenResponse, error)

GetSsoToken - Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - ServiceClientGetSsoTokenOptions contains the optional parameters for the ServiceClient.GetSsoToken method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetSsoToken.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceClient().GetSsoToken(ctx, "rg1", "apimService1", 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.ServiceGetSsoTokenResult = armapimanagement.ServiceGetSsoTokenResult{
	// 	RedirectURI: to.Ptr("https://apimService1.portal.azure-api.net:443/signin-sso?token=1%26201705301929%26eIkr3%2fnfaLs1GVJ0OVbzkJjAcwPFkEZAPM8VUXvXPf7cJ6lWsB9oUwsk2zln9x0KLkn21txCPJWWheSPq7SNeA%3d%3d"),
	// }
}
Output:

func (*ServiceClient) NewListByResourceGroupPager added in v0.5.0

func (client *ServiceClient) NewListByResourceGroupPager(resourceGroupName string, options *ServiceClientListByResourceGroupOptions) *runtime.Pager[ServiceClientListByResourceGroupResponse]

NewListByResourceGroupPager - List all API Management services within a resource group.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • options - ServiceClientListByResourceGroupOptions contains the optional parameters for the ServiceClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListServiceBySubscriptionAndResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServiceClient().NewListByResourceGroupPager("rg1", 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 = armapimanagement.ServiceListResult{
		// 	Value: []*armapimanagement.ServiceResource{
		// 		{
		// 			Name: to.Ptr("OGF-Z3-06162021-Premium"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/OGF-Z3-06162021-Premium"),
		// 			Tags: map[string]*string{
		// 				"ReleaseName": to.Ptr("Z3"),
		// 				"owner": to.Ptr("v-aswmoh"),
		// 			},
		// 			Etag: to.Ptr("AAAAAAAWN/4="),
		// 			Identity: &armapimanagement.ServiceIdentity{
		// 				Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned),
		// 				PrincipalID: to.Ptr("306205e7-b21a-41bf-92e2-3e28af30041e"),
		// 				TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
		// 				UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
		// 					"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ogf-identity": &armapimanagement.UserIdentityProperties{
		// 						ClientID: to.Ptr("8d9791f2-0cdf-41f4-9e66-cdc39b496789"),
		// 						PrincipalID: to.Ptr("713784d2-ee37-412a-95f0-3768f397f82d"),
		// 					},
		// 				},
		// 			},
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armapimanagement.ServiceProperties{
		// 				AdditionalLocations: []*armapimanagement.AdditionalLocation{
		// 					{
		// 						DisableGateway: to.Ptr(false),
		// 						GatewayRegionalURL: to.Ptr("https://ogf-z3-06162021-premium-eastus2-01.regional.azure-api.net"),
		// 						Location: to.Ptr("East US 2"),
		// 						PublicIPAddresses: []*string{
		// 							to.Ptr("40.70.24.106")},
		// 							SKU: &armapimanagement.ServiceSKUProperties{
		// 								Name: to.Ptr(armapimanagement.SKUTypePremium),
		// 								Capacity: to.Ptr[int32](1),
		// 							},
		// 							Zones: []*string{
		// 							},
		// 					}},
		// 					APIVersionConstraint: &armapimanagement.APIVersionConstraint{
		// 						MinAPIVersion: to.Ptr("2019-12-01"),
		// 					},
		// 					Certificates: []*armapimanagement.CertificateConfiguration{
		// 					},
		// 					CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T09:40:00.9453556Z"); return t}()),
		// 					CustomProperties: map[string]*string{
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("false"),
		// 					},
		// 					DeveloperPortalURL: to.Ptr("https://ogf-z3-06162021-premium.developer.azure-api.net"),
		// 					DisableGateway: to.Ptr(false),
		// 					GatewayRegionalURL: to.Ptr("https://ogf-z3-06162021-premium-eastus-01.regional.azure-api.net"),
		// 					GatewayURL: to.Ptr("https://ogf-z3-06162021-premium.azure-api.net"),
		// 					HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
		// 						{
		// 							Type: to.Ptr(armapimanagement.HostnameTypeProxy),
		// 							CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
		// 							DefaultSSLBinding: to.Ptr(false),
		// 							HostName: to.Ptr("ogf-z3-06162021-premium.azure-api.net"),
		// 							NegotiateClientCertificate: to.Ptr(false),
		// 						},
		// 						{
		// 							Type: to.Ptr(armapimanagement.HostnameTypeProxy),
		// 							Certificate: &armapimanagement.CertificateInformation{
		// 								Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T22:32:32+00:00"); return t}()),
		// 								Subject: to.Ptr("CN=*.current.int-azure-api.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US"),
		// 								Thumbprint: to.Ptr("BA0C286F71AF3B6A01BDB240C58A4A507E3DBD51"),
		// 							},
		// 							CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom),
		// 							DefaultSSLBinding: to.Ptr(true),
		// 							HostName: to.Ptr("gateway.current.int-azure-api.net"),
		// 							KeyVaultID: to.Ptr("https://ogf-testing.vault-int.azure-int.net/secrets/current-ssl"),
		// 							NegotiateClientCertificate: to.Ptr(true),
		// 						},
		// 						{
		// 							Type: to.Ptr(armapimanagement.HostnameTypeDeveloperPortal),
		// 							Certificate: &armapimanagement.CertificateInformation{
		// 								Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T22:32:32+00:00"); return t}()),
		// 								Subject: to.Ptr("CN=*.current.int-azure-api.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US"),
		// 								Thumbprint: to.Ptr("BA0C286F71AF3B6A01BDB240C58A4A507E3DBD51"),
		// 							},
		// 							CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom),
		// 							DefaultSSLBinding: to.Ptr(false),
		// 							HostName: to.Ptr("developer.current.int-azure-api.net"),
		// 							KeyVaultID: to.Ptr("https://ogf-testing.vault-int.azure-int.net/secrets/current-ssl"),
		// 							NegotiateClientCertificate: to.Ptr(false),
		// 						},
		// 						{
		// 							Type: to.Ptr(armapimanagement.HostnameTypeManagement),
		// 							Certificate: &armapimanagement.CertificateInformation{
		// 								Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T22:32:32+00:00"); return t}()),
		// 								Subject: to.Ptr("CN=*.current.int-azure-api.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US"),
		// 								Thumbprint: to.Ptr("BA0C286F71AF3B6A01BDB240C58A4A507E3DBD51"),
		// 							},
		// 							CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom),
		// 							DefaultSSLBinding: to.Ptr(false),
		// 							HostName: to.Ptr("mgmt.current.int-azure-api.net"),
		// 							KeyVaultID: to.Ptr("https://ogf-testing.vault-int.azure-int.net/secrets/current-ssl"),
		// 							NegotiateClientCertificate: to.Ptr(false),
		// 					}},
		// 					ManagementAPIURL: to.Ptr("https://ogf-z3-06162021-premium.management.azure-api.net"),
		// 					NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
		// 					PortalURL: to.Ptr("https://ogf-z3-06162021-premium.portal.azure-api.net"),
		// 					ProvisioningState: to.Ptr("Succeeded"),
		// 					PublicIPAddresses: []*string{
		// 						to.Ptr("13.92.130.49")},
		// 						PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
		// 						ScmURL: to.Ptr("https://ogf-z3-06162021-premium.scm.azure-api.net"),
		// 						TargetProvisioningState: to.Ptr(""),
		// 						VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
		// 						PublisherEmail: to.Ptr("bar@contoso.com"),
		// 						PublisherName: to.Ptr("Test Premium"),
		// 					},
		// 					SKU: &armapimanagement.ServiceSKUProperties{
		// 						Name: to.Ptr(armapimanagement.SKUTypePremium),
		// 						Capacity: to.Ptr[int32](1),
		// 					},
		// 					SystemData: &armapimanagement.SystemData{
		// 						CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T09:40:00.7106733Z"); return t}()),
		// 						CreatedBy: to.Ptr("bar@contoso.com"),
		// 						CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 						LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-20T06:33:09.6159006Z"); return t}()),
		// 						LastModifiedBy: to.Ptr("foo@contoso.com"),
		// 						LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("vvktestcons"),
		// 					Type: to.Ptr("Microsoft.ApiManagement/service"),
		// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/vvktestcons"),
		// 					Tags: map[string]*string{
		// 						"Owner": to.Ptr("vitaliik"),
		// 					},
		// 					Etag: to.Ptr("AAAAAAAWKwo="),
		// 					Location: to.Ptr("East US"),
		// 					Properties: &armapimanagement.ServiceProperties{
		// 						CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-10T18:07:23.4565211Z"); return t}()),
		// 						CustomProperties: map[string]*string{
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
		// 						},
		// 						DisableGateway: to.Ptr(false),
		// 						EnableClientCertificate: to.Ptr(false),
		// 						GatewayURL: to.Ptr("https://vvktestcons.azure-api.net"),
		// 						HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
		// 							{
		// 								Type: to.Ptr(armapimanagement.HostnameTypeProxy),
		// 								CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
		// 								DefaultSSLBinding: to.Ptr(true),
		// 								HostName: to.Ptr("vvktestcons.azure-api.net"),
		// 								NegotiateClientCertificate: to.Ptr(false),
		// 						}},
		// 						NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
		// 						ProvisioningState: to.Ptr("Succeeded"),
		// 						PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
		// 						TargetProvisioningState: to.Ptr(""),
		// 						VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
		// 						PublisherEmail: to.Ptr("bar@contoso.com"),
		// 						PublisherName: to.Ptr("vvktestcons"),
		// 					},
		// 					SKU: &armapimanagement.ServiceSKUProperties{
		// 						Name: to.Ptr(armapimanagement.SKUTypeConsumption),
		// 						Capacity: to.Ptr[int32](0),
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("OGF-Z3-06162021-Standard"),
		// 					Type: to.Ptr("Microsoft.ApiManagement/service"),
		// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/OGF-Z3-06162021-Standard"),
		// 					Tags: map[string]*string{
		// 					},
		// 					Etag: to.Ptr("AAAAAAAWF7M="),
		// 					Identity: &armapimanagement.ServiceIdentity{
		// 						Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned),
		// 						PrincipalID: to.Ptr("347a5800-ca99-475a-9202-fe38ca79ee41"),
		// 						TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
		// 						UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
		// 							"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ogf-identity": &armapimanagement.UserIdentityProperties{
		// 								ClientID: to.Ptr("8d9791f2-0cdf-41f4-9e66-cdc39b496789"),
		// 								PrincipalID: to.Ptr("713784d2-ee37-412a-95f0-3768f397f82d"),
		// 							},
		// 						},
		// 					},
		// 					Location: to.Ptr("East US"),
		// 					Properties: &armapimanagement.ServiceProperties{
		// 						APIVersionConstraint: &armapimanagement.APIVersionConstraint{
		// 							MinAPIVersion: to.Ptr("2019-12-01"),
		// 						},
		// 						CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T09:39:58.6555759Z"); return t}()),
		// 						CustomProperties: map[string]*string{
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("false"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA": to.Ptr("true"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
		// 						},
		// 						DeveloperPortalURL: to.Ptr("https://ogf-z3-06162021-standard.developer.azure-api.net"),
		// 						DisableGateway: to.Ptr(false),
		// 						GatewayRegionalURL: to.Ptr("https://ogf-z3-06162021-standard-eastus-01.regional.azure-api.net"),
		// 						GatewayURL: to.Ptr("https://ogf-z3-06162021-standard.azure-api.net"),
		// 						HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
		// 							{
		// 								Type: to.Ptr(armapimanagement.HostnameTypeProxy),
		// 								CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
		// 								DefaultSSLBinding: to.Ptr(true),
		// 								HostName: to.Ptr("ogf-z3-06162021-standard.azure-api.net"),
		// 								NegotiateClientCertificate: to.Ptr(false),
		// 						}},
		// 						ManagementAPIURL: to.Ptr("https://ogf-z3-06162021-standard.management.azure-api.net"),
		// 						NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
		// 						PortalURL: to.Ptr("https://ogf-z3-06162021-standard.portal.azure-api.net"),
		// 						ProvisioningState: to.Ptr("Succeeded"),
		// 						PublicIPAddresses: []*string{
		// 							to.Ptr("13.82.208.32")},
		// 							PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
		// 							ScmURL: to.Ptr("https://ogf-z3-06162021-standard.scm.azure-api.net"),
		// 							TargetProvisioningState: to.Ptr(""),
		// 							VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
		// 							PublisherEmail: to.Ptr("bar@contoso.com"),
		// 							PublisherName: to.Ptr("Test Standard"),
		// 						},
		// 						SKU: &armapimanagement.ServiceSKUProperties{
		// 							Name: to.Ptr(armapimanagement.SKUTypeStandard),
		// 							Capacity: to.Ptr[int32](2),
		// 						},
		// 						SystemData: &armapimanagement.SystemData{
		// 							CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T09:39:58.4591834Z"); return t}()),
		// 							CreatedBy: to.Ptr("bar@contoso.com"),
		// 							CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 							LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T15:05:13.5494721Z"); return t}()),
		// 							LastModifiedBy: to.Ptr("bar@contoso.com"),
		// 							LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 						},
		// 					},
		// 					{
		// 						Name: to.Ptr("ogf-dev-060921"),
		// 						Type: to.Ptr("Microsoft.ApiManagement/service"),
		// 						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/ogf-dev-060921"),
		// 						Tags: map[string]*string{
		// 						},
		// 						Etag: to.Ptr("AAAAAAAWEFg="),
		// 						Identity: &armapimanagement.ServiceIdentity{
		// 							Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssigned),
		// 							PrincipalID: to.Ptr("c9bd4c05-205e-4431-b232-112cf2e9e0aa"),
		// 							TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
		// 						},
		// 						Location: to.Ptr("East US"),
		// 						Properties: &armapimanagement.ServiceProperties{
		// 							AdditionalLocations: []*armapimanagement.AdditionalLocation{
		// 								{
		// 									DisableGateway: to.Ptr(false),
		// 									GatewayRegionalURL: to.Ptr("https://ogf-dev-060921-southcentralus-01.regional.azure-api.net"),
		// 									Location: to.Ptr("South Central US"),
		// 									PublicIPAddresses: []*string{
		// 										to.Ptr("13.84.208.29")},
		// 										SKU: &armapimanagement.ServiceSKUProperties{
		// 											Name: to.Ptr(armapimanagement.SKUTypePremium),
		// 											Capacity: to.Ptr[int32](9),
		// 										},
		// 										Zones: []*string{
		// 										},
		// 								}},
		// 								APIVersionConstraint: &armapimanagement.APIVersionConstraint{
		// 									MinAPIVersion: to.Ptr("2019-12-01"),
		// 								},
		// 								Certificates: []*armapimanagement.CertificateConfiguration{
		// 									{
		// 										Certificate: &armapimanagement.CertificateInformation{
		// 											Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T22:51:47+00:00"); return t}()),
		// 											Subject: to.Ptr("CN=*.apim.net"),
		// 											Thumbprint: to.Ptr("4E8234312EC69245D1AE296C4882D46FB84076A3"),
		// 										},
		// 										StoreName: to.Ptr(armapimanagement.CertificateConfigurationStoreNameRoot),
		// 								}},
		// 								CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T10:06:22.2133978Z"); return t}()),
		// 								CustomProperties: map[string]*string{
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("false"),
		// 								},
		// 								DeveloperPortalURL: to.Ptr("https://ogf-dev-060921.developer.azure-api.net"),
		// 								DisableGateway: to.Ptr(false),
		// 								GatewayRegionalURL: to.Ptr("https://ogf-dev-060921-eastus-01.regional.azure-api.net"),
		// 								GatewayURL: to.Ptr("https://ogf-dev-060921.azure-api.net"),
		// 								HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
		// 									{
		// 										Type: to.Ptr(armapimanagement.HostnameTypeProxy),
		// 										CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
		// 										DefaultSSLBinding: to.Ptr(true),
		// 										HostName: to.Ptr("ogf-dev-060921.azure-api.net"),
		// 										NegotiateClientCertificate: to.Ptr(false),
		// 								}},
		// 								ManagementAPIURL: to.Ptr("https://ogf-dev-060921.management.azure-api.net"),
		// 								NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
		// 								PortalURL: to.Ptr("https://ogf-dev-060921.portal.azure-api.net"),
		// 								ProvisioningState: to.Ptr("Succeeded"),
		// 								PublicIPAddresses: []*string{
		// 									to.Ptr("168.62.39.172")},
		// 									PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
		// 									ScmURL: to.Ptr("https://ogf-dev-060921.scm.azure-api.net"),
		// 									TargetProvisioningState: to.Ptr(""),
		// 									VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
		// 									PublisherEmail: to.Ptr("v-ssaiprasan@microsoft.com"),
		// 									PublisherName: to.Ptr("TechM"),
		// 								},
		// 								SKU: &armapimanagement.ServiceSKUProperties{
		// 									Name: to.Ptr(armapimanagement.SKUTypePremium),
		// 									Capacity: to.Ptr[int32](3),
		// 								},
		// 								SystemData: &armapimanagement.SystemData{
		// 									CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T10:06:21.7336597Z"); return t}()),
		// 									CreatedBy: to.Ptr("v-ssaiprasan@microsoft.com"),
		// 									CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 									LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T14:27:05.546816Z"); return t}()),
		// 									LastModifiedBy: to.Ptr("v-ssaiprasan@microsoft.com"),
		// 									LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 								},
		// 						}},
		// 					}
	}
}
Output:

func (*ServiceClient) NewListPager added in v0.5.0

NewListPager - Lists all API Management services within an Azure subscription.

Generated from API version 2021-08-01

  • options - ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListServiceBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServiceClient().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.ServiceListResult = armapimanagement.ServiceListResult{
		// 	Value: []*armapimanagement.ServiceResource{
		// 		{
		// 			Name: to.Ptr("OGF-Z3-06162021-Premium"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/OGF-Z3-06162021-Premium"),
		// 			Tags: map[string]*string{
		// 				"ReleaseName": to.Ptr("Z3"),
		// 				"owner": to.Ptr("v-aswmoh"),
		// 			},
		// 			Etag: to.Ptr("AAAAAAAWN/4="),
		// 			Identity: &armapimanagement.ServiceIdentity{
		// 				Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned),
		// 				PrincipalID: to.Ptr("306205e7-b21a-41bf-92e2-3e28af30041e"),
		// 				TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
		// 				UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
		// 					"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ogf-identity": &armapimanagement.UserIdentityProperties{
		// 						ClientID: to.Ptr("8d9791f2-0cdf-41f4-9e66-cdc39b496789"),
		// 						PrincipalID: to.Ptr("713784d2-ee37-412a-95f0-3768f397f82d"),
		// 					},
		// 				},
		// 			},
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armapimanagement.ServiceProperties{
		// 				AdditionalLocations: []*armapimanagement.AdditionalLocation{
		// 					{
		// 						DisableGateway: to.Ptr(false),
		// 						GatewayRegionalURL: to.Ptr("https://ogf-z3-06162021-premium-eastus2-01.regional.azure-api.net"),
		// 						Location: to.Ptr("East US 2"),
		// 						PublicIPAddresses: []*string{
		// 							to.Ptr("40.70.24.106")},
		// 							SKU: &armapimanagement.ServiceSKUProperties{
		// 								Name: to.Ptr(armapimanagement.SKUTypePremium),
		// 								Capacity: to.Ptr[int32](1),
		// 							},
		// 							Zones: []*string{
		// 							},
		// 					}},
		// 					APIVersionConstraint: &armapimanagement.APIVersionConstraint{
		// 						MinAPIVersion: to.Ptr("2019-12-01"),
		// 					},
		// 					Certificates: []*armapimanagement.CertificateConfiguration{
		// 					},
		// 					CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T09:40:00.9453556Z"); return t}()),
		// 					CustomProperties: map[string]*string{
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"),
		// 						"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("false"),
		// 					},
		// 					DeveloperPortalURL: to.Ptr("https://ogf-z3-06162021-premium.developer.azure-api.net"),
		// 					DisableGateway: to.Ptr(false),
		// 					GatewayRegionalURL: to.Ptr("https://ogf-z3-06162021-premium-eastus-01.regional.azure-api.net"),
		// 					GatewayURL: to.Ptr("https://ogf-z3-06162021-premium.azure-api.net"),
		// 					HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
		// 						{
		// 							Type: to.Ptr(armapimanagement.HostnameTypeProxy),
		// 							CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
		// 							DefaultSSLBinding: to.Ptr(false),
		// 							HostName: to.Ptr("ogf-z3-06162021-premium.azure-api.net"),
		// 							NegotiateClientCertificate: to.Ptr(false),
		// 						},
		// 						{
		// 							Type: to.Ptr(armapimanagement.HostnameTypeProxy),
		// 							Certificate: &armapimanagement.CertificateInformation{
		// 								Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T22:32:32+00:00"); return t}()),
		// 								Subject: to.Ptr("CN=*.current.int-azure-api.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US"),
		// 								Thumbprint: to.Ptr("BA0C286F71AF3B6A01BDB240C58A4A507E3DBD51"),
		// 							},
		// 							CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom),
		// 							DefaultSSLBinding: to.Ptr(true),
		// 							HostName: to.Ptr("gateway.current.int-azure-api.net"),
		// 							KeyVaultID: to.Ptr("https://ogf-testing.vault-int.azure-int.net/secrets/current-ssl"),
		// 							NegotiateClientCertificate: to.Ptr(true),
		// 						},
		// 						{
		// 							Type: to.Ptr(armapimanagement.HostnameTypeDeveloperPortal),
		// 							Certificate: &armapimanagement.CertificateInformation{
		// 								Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T22:32:32+00:00"); return t}()),
		// 								Subject: to.Ptr("CN=*.current.int-azure-api.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US"),
		// 								Thumbprint: to.Ptr("BA0C286F71AF3B6A01BDB240C58A4A507E3DBD51"),
		// 							},
		// 							CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom),
		// 							DefaultSSLBinding: to.Ptr(false),
		// 							HostName: to.Ptr("developer.current.int-azure-api.net"),
		// 							KeyVaultID: to.Ptr("https://ogf-testing.vault-int.azure-int.net/secrets/current-ssl"),
		// 							NegotiateClientCertificate: to.Ptr(false),
		// 						},
		// 						{
		// 							Type: to.Ptr(armapimanagement.HostnameTypeManagement),
		// 							Certificate: &armapimanagement.CertificateInformation{
		// 								Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T22:32:32+00:00"); return t}()),
		// 								Subject: to.Ptr("CN=*.current.int-azure-api.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US"),
		// 								Thumbprint: to.Ptr("BA0C286F71AF3B6A01BDB240C58A4A507E3DBD51"),
		// 							},
		// 							CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom),
		// 							DefaultSSLBinding: to.Ptr(false),
		// 							HostName: to.Ptr("mgmt.current.int-azure-api.net"),
		// 							KeyVaultID: to.Ptr("https://ogf-testing.vault-int.azure-int.net/secrets/current-ssl"),
		// 							NegotiateClientCertificate: to.Ptr(false),
		// 					}},
		// 					ManagementAPIURL: to.Ptr("https://ogf-z3-06162021-premium.management.azure-api.net"),
		// 					NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
		// 					PortalURL: to.Ptr("https://ogf-z3-06162021-premium.portal.azure-api.net"),
		// 					ProvisioningState: to.Ptr("Succeeded"),
		// 					PublicIPAddresses: []*string{
		// 						to.Ptr("13.92.130.49")},
		// 						PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
		// 						ScmURL: to.Ptr("https://ogf-z3-06162021-premium.scm.azure-api.net"),
		// 						TargetProvisioningState: to.Ptr(""),
		// 						VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
		// 						PublisherEmail: to.Ptr("bar@contoso.com"),
		// 						PublisherName: to.Ptr("Test Premium"),
		// 					},
		// 					SKU: &armapimanagement.ServiceSKUProperties{
		// 						Name: to.Ptr(armapimanagement.SKUTypePremium),
		// 						Capacity: to.Ptr[int32](1),
		// 					},
		// 					SystemData: &armapimanagement.SystemData{
		// 						CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T09:40:00.7106733Z"); return t}()),
		// 						CreatedBy: to.Ptr("bar@contoso.com"),
		// 						CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 						LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-20T06:33:09.6159006Z"); return t}()),
		// 						LastModifiedBy: to.Ptr("foo@contoso.com"),
		// 						LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("vvktestcons"),
		// 					Type: to.Ptr("Microsoft.ApiManagement/service"),
		// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/vvktestcons"),
		// 					Tags: map[string]*string{
		// 						"Owner": to.Ptr("vitaliik"),
		// 					},
		// 					Etag: to.Ptr("AAAAAAAWKwo="),
		// 					Location: to.Ptr("East US"),
		// 					Properties: &armapimanagement.ServiceProperties{
		// 						CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-10T18:07:23.4565211Z"); return t}()),
		// 						CustomProperties: map[string]*string{
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
		// 						},
		// 						DisableGateway: to.Ptr(false),
		// 						EnableClientCertificate: to.Ptr(false),
		// 						GatewayURL: to.Ptr("https://vvktestcons.azure-api.net"),
		// 						HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
		// 							{
		// 								Type: to.Ptr(armapimanagement.HostnameTypeProxy),
		// 								CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
		// 								DefaultSSLBinding: to.Ptr(true),
		// 								HostName: to.Ptr("vvktestcons.azure-api.net"),
		// 								NegotiateClientCertificate: to.Ptr(false),
		// 						}},
		// 						NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
		// 						ProvisioningState: to.Ptr("Succeeded"),
		// 						PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
		// 						TargetProvisioningState: to.Ptr(""),
		// 						VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
		// 						PublisherEmail: to.Ptr("bar@contoso.com"),
		// 						PublisherName: to.Ptr("vvktestcons"),
		// 					},
		// 					SKU: &armapimanagement.ServiceSKUProperties{
		// 						Name: to.Ptr(armapimanagement.SKUTypeConsumption),
		// 						Capacity: to.Ptr[int32](0),
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("OGF-Z3-06162021-Standard"),
		// 					Type: to.Ptr("Microsoft.ApiManagement/service"),
		// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/OGF-Z3-06162021-Standard"),
		// 					Tags: map[string]*string{
		// 					},
		// 					Etag: to.Ptr("AAAAAAAWF7M="),
		// 					Identity: &armapimanagement.ServiceIdentity{
		// 						Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned),
		// 						PrincipalID: to.Ptr("347a5800-ca99-475a-9202-fe38ca79ee41"),
		// 						TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
		// 						UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
		// 							"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ogf-identity": &armapimanagement.UserIdentityProperties{
		// 								ClientID: to.Ptr("8d9791f2-0cdf-41f4-9e66-cdc39b496789"),
		// 								PrincipalID: to.Ptr("713784d2-ee37-412a-95f0-3768f397f82d"),
		// 							},
		// 						},
		// 					},
		// 					Location: to.Ptr("East US"),
		// 					Properties: &armapimanagement.ServiceProperties{
		// 						APIVersionConstraint: &armapimanagement.APIVersionConstraint{
		// 							MinAPIVersion: to.Ptr("2019-12-01"),
		// 						},
		// 						CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T09:39:58.6555759Z"); return t}()),
		// 						CustomProperties: map[string]*string{
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("false"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA": to.Ptr("true"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
		// 							"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
		// 						},
		// 						DeveloperPortalURL: to.Ptr("https://ogf-z3-06162021-standard.developer.azure-api.net"),
		// 						DisableGateway: to.Ptr(false),
		// 						GatewayRegionalURL: to.Ptr("https://ogf-z3-06162021-standard-eastus-01.regional.azure-api.net"),
		// 						GatewayURL: to.Ptr("https://ogf-z3-06162021-standard.azure-api.net"),
		// 						HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
		// 							{
		// 								Type: to.Ptr(armapimanagement.HostnameTypeProxy),
		// 								CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
		// 								DefaultSSLBinding: to.Ptr(true),
		// 								HostName: to.Ptr("ogf-z3-06162021-standard.azure-api.net"),
		// 								NegotiateClientCertificate: to.Ptr(false),
		// 						}},
		// 						ManagementAPIURL: to.Ptr("https://ogf-z3-06162021-standard.management.azure-api.net"),
		// 						NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
		// 						PortalURL: to.Ptr("https://ogf-z3-06162021-standard.portal.azure-api.net"),
		// 						ProvisioningState: to.Ptr("Succeeded"),
		// 						PublicIPAddresses: []*string{
		// 							to.Ptr("13.82.208.32")},
		// 							PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
		// 							ScmURL: to.Ptr("https://ogf-z3-06162021-standard.scm.azure-api.net"),
		// 							TargetProvisioningState: to.Ptr(""),
		// 							VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
		// 							PublisherEmail: to.Ptr("bar@contoso.com"),
		// 							PublisherName: to.Ptr("Test Standard"),
		// 						},
		// 						SKU: &armapimanagement.ServiceSKUProperties{
		// 							Name: to.Ptr(armapimanagement.SKUTypeStandard),
		// 							Capacity: to.Ptr[int32](2),
		// 						},
		// 						SystemData: &armapimanagement.SystemData{
		// 							CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T09:39:58.4591834Z"); return t}()),
		// 							CreatedBy: to.Ptr("bar@contoso.com"),
		// 							CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 							LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-17T15:05:13.5494721Z"); return t}()),
		// 							LastModifiedBy: to.Ptr("bar@contoso.com"),
		// 							LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 						},
		// 					},
		// 					{
		// 						Name: to.Ptr("ogf-dev-060921"),
		// 						Type: to.Ptr("Microsoft.ApiManagement/service"),
		// 						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/ogf-dev-060921"),
		// 						Tags: map[string]*string{
		// 						},
		// 						Etag: to.Ptr("AAAAAAAWEFg="),
		// 						Identity: &armapimanagement.ServiceIdentity{
		// 							Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssigned),
		// 							PrincipalID: to.Ptr("c9bd4c05-205e-4431-b232-112cf2e9e0aa"),
		// 							TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
		// 						},
		// 						Location: to.Ptr("East US"),
		// 						Properties: &armapimanagement.ServiceProperties{
		// 							AdditionalLocations: []*armapimanagement.AdditionalLocation{
		// 								{
		// 									DisableGateway: to.Ptr(false),
		// 									GatewayRegionalURL: to.Ptr("https://ogf-dev-060921-southcentralus-01.regional.azure-api.net"),
		// 									Location: to.Ptr("South Central US"),
		// 									PublicIPAddresses: []*string{
		// 										to.Ptr("13.84.208.29")},
		// 										SKU: &armapimanagement.ServiceSKUProperties{
		// 											Name: to.Ptr(armapimanagement.SKUTypePremium),
		// 											Capacity: to.Ptr[int32](9),
		// 										},
		// 										Zones: []*string{
		// 										},
		// 								}},
		// 								APIVersionConstraint: &armapimanagement.APIVersionConstraint{
		// 									MinAPIVersion: to.Ptr("2019-12-01"),
		// 								},
		// 								Certificates: []*armapimanagement.CertificateConfiguration{
		// 									{
		// 										Certificate: &armapimanagement.CertificateInformation{
		// 											Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T22:51:47+00:00"); return t}()),
		// 											Subject: to.Ptr("CN=*.apim.net"),
		// 											Thumbprint: to.Ptr("4E8234312EC69245D1AE296C4882D46FB84076A3"),
		// 										},
		// 										StoreName: to.Ptr(armapimanagement.CertificateConfigurationStoreNameRoot),
		// 								}},
		// 								CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T10:06:22.2133978Z"); return t}()),
		// 								CustomProperties: map[string]*string{
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"),
		// 									"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("false"),
		// 								},
		// 								DeveloperPortalURL: to.Ptr("https://ogf-dev-060921.developer.azure-api.net"),
		// 								DisableGateway: to.Ptr(false),
		// 								GatewayRegionalURL: to.Ptr("https://ogf-dev-060921-eastus-01.regional.azure-api.net"),
		// 								GatewayURL: to.Ptr("https://ogf-dev-060921.azure-api.net"),
		// 								HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
		// 									{
		// 										Type: to.Ptr(armapimanagement.HostnameTypeProxy),
		// 										CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
		// 										DefaultSSLBinding: to.Ptr(true),
		// 										HostName: to.Ptr("ogf-dev-060921.azure-api.net"),
		// 										NegotiateClientCertificate: to.Ptr(false),
		// 								}},
		// 								ManagementAPIURL: to.Ptr("https://ogf-dev-060921.management.azure-api.net"),
		// 								NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
		// 								PortalURL: to.Ptr("https://ogf-dev-060921.portal.azure-api.net"),
		// 								ProvisioningState: to.Ptr("Succeeded"),
		// 								PublicIPAddresses: []*string{
		// 									to.Ptr("168.62.39.172")},
		// 									PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
		// 									ScmURL: to.Ptr("https://ogf-dev-060921.scm.azure-api.net"),
		// 									TargetProvisioningState: to.Ptr(""),
		// 									VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
		// 									PublisherEmail: to.Ptr("v-ssaiprasan@microsoft.com"),
		// 									PublisherName: to.Ptr("TechM"),
		// 								},
		// 								SKU: &armapimanagement.ServiceSKUProperties{
		// 									Name: to.Ptr(armapimanagement.SKUTypePremium),
		// 									Capacity: to.Ptr[int32](3),
		// 								},
		// 								SystemData: &armapimanagement.SystemData{
		// 									CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T10:06:21.7336597Z"); return t}()),
		// 									CreatedBy: to.Ptr("v-ssaiprasan@microsoft.com"),
		// 									CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 									LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T14:27:05.546816Z"); return t}()),
		// 									LastModifiedBy: to.Ptr("v-ssaiprasan@microsoft.com"),
		// 									LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
		// 								},
		// 						}},
		// 					}
	}
}
Output:

type ServiceClientApplyNetworkConfigurationUpdatesResponse added in v0.3.0

type ServiceClientApplyNetworkConfigurationUpdatesResponse struct {
	ServiceResource
}

ServiceClientApplyNetworkConfigurationUpdatesResponse contains the response from method ServiceClient.BeginApplyNetworkConfigurationUpdates.

type ServiceClientBackupResponse added in v0.3.0

type ServiceClientBackupResponse struct {
	ServiceResource
}

ServiceClientBackupResponse contains the response from method ServiceClient.BeginBackup.

type ServiceClientBeginApplyNetworkConfigurationUpdatesOptions added in v0.3.0

type ServiceClientBeginApplyNetworkConfigurationUpdatesOptions struct {
	// Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all the regions in which
	// the Api Management service is deployed will be updated sequentially without
	// incurring downtime in the region.
	Parameters *ServiceApplyNetworkConfigurationParameters
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ServiceClientBeginApplyNetworkConfigurationUpdatesOptions contains the optional parameters for the ServiceClient.BeginApplyNetworkConfigurationUpdates method.

type ServiceClientBeginBackupOptions added in v0.3.0

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

ServiceClientBeginBackupOptions contains the optional parameters for the ServiceClient.BeginBackup method.

type ServiceClientBeginCreateOrUpdateOptions added in v0.3.0

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

ServiceClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceClient.BeginCreateOrUpdate method.

type ServiceClientBeginDeleteOptions added in v0.3.0

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

ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method.

type ServiceClientBeginRestoreOptions added in v0.3.0

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

ServiceClientBeginRestoreOptions contains the optional parameters for the ServiceClient.BeginRestore method.

type ServiceClientBeginUpdateOptions added in v0.3.0

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

ServiceClientBeginUpdateOptions contains the optional parameters for the ServiceClient.BeginUpdate method.

type ServiceClientCheckNameAvailabilityOptions added in v0.3.0

type ServiceClientCheckNameAvailabilityOptions struct {
}

ServiceClientCheckNameAvailabilityOptions contains the optional parameters for the ServiceClient.CheckNameAvailability method.

type ServiceClientCheckNameAvailabilityResponse added in v0.3.0

type ServiceClientCheckNameAvailabilityResponse struct {
	ServiceNameAvailabilityResult
}

ServiceClientCheckNameAvailabilityResponse contains the response from method ServiceClient.CheckNameAvailability.

type ServiceClientCreateOrUpdateResponse added in v0.3.0

type ServiceClientCreateOrUpdateResponse struct {
	ServiceResource
}

ServiceClientCreateOrUpdateResponse contains the response from method ServiceClient.BeginCreateOrUpdate.

type ServiceClientDeleteResponse added in v0.3.0

type ServiceClientDeleteResponse struct {
	ServiceResource
}

ServiceClientDeleteResponse contains the response from method ServiceClient.BeginDelete.

type ServiceClientGetDomainOwnershipIdentifierOptions added in v0.3.0

type ServiceClientGetDomainOwnershipIdentifierOptions struct {
}

ServiceClientGetDomainOwnershipIdentifierOptions contains the optional parameters for the ServiceClient.GetDomainOwnershipIdentifier method.

type ServiceClientGetDomainOwnershipIdentifierResponse added in v0.3.0

type ServiceClientGetDomainOwnershipIdentifierResponse struct {
	ServiceGetDomainOwnershipIdentifierResult
}

ServiceClientGetDomainOwnershipIdentifierResponse contains the response from method ServiceClient.GetDomainOwnershipIdentifier.

type ServiceClientGetOptions added in v0.3.0

type ServiceClientGetOptions struct {
}

ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method.

type ServiceClientGetResponse added in v0.3.0

type ServiceClientGetResponse struct {
	ServiceResource
}

ServiceClientGetResponse contains the response from method ServiceClient.Get.

type ServiceClientGetSsoTokenOptions added in v0.3.0

type ServiceClientGetSsoTokenOptions struct {
}

ServiceClientGetSsoTokenOptions contains the optional parameters for the ServiceClient.GetSsoToken method.

type ServiceClientGetSsoTokenResponse added in v0.3.0

type ServiceClientGetSsoTokenResponse struct {
	ServiceGetSsoTokenResult
}

ServiceClientGetSsoTokenResponse contains the response from method ServiceClient.GetSsoToken.

type ServiceClientListByResourceGroupOptions added in v0.3.0

type ServiceClientListByResourceGroupOptions struct {
}

ServiceClientListByResourceGroupOptions contains the optional parameters for the ServiceClient.NewListByResourceGroupPager method.

type ServiceClientListByResourceGroupResponse added in v0.3.0

type ServiceClientListByResourceGroupResponse struct {
	ServiceListResult
}

ServiceClientListByResourceGroupResponse contains the response from method ServiceClient.NewListByResourceGroupPager.

type ServiceClientListOptions added in v0.3.0

type ServiceClientListOptions struct {
}

ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method.

type ServiceClientListResponse added in v0.3.0

type ServiceClientListResponse struct {
	ServiceListResult
}

ServiceClientListResponse contains the response from method ServiceClient.NewListPager.

type ServiceClientRestoreResponse added in v0.3.0

type ServiceClientRestoreResponse struct {
	ServiceResource
}

ServiceClientRestoreResponse contains the response from method ServiceClient.BeginRestore.

type ServiceClientUpdateResponse added in v0.3.0

type ServiceClientUpdateResponse struct {
	ServiceResource
}

ServiceClientUpdateResponse contains the response from method ServiceClient.BeginUpdate.

type ServiceGetDomainOwnershipIdentifierResult added in v0.3.0

type ServiceGetDomainOwnershipIdentifierResult struct {
	// READ-ONLY; The domain ownership identifier value.
	DomainOwnershipIdentifier *string
}

ServiceGetDomainOwnershipIdentifierResult - Response of the GetDomainOwnershipIdentifier operation.

func (ServiceGetDomainOwnershipIdentifierResult) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type ServiceGetDomainOwnershipIdentifierResult.

func (*ServiceGetDomainOwnershipIdentifierResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceGetDomainOwnershipIdentifierResult.

type ServiceGetSsoTokenResult added in v0.3.0

type ServiceGetSsoTokenResult struct {
	// Redirect URL to the Publisher Portal containing the SSO token.
	RedirectURI *string
}

ServiceGetSsoTokenResult - The response of the GetSsoToken operation.

func (ServiceGetSsoTokenResult) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceGetSsoTokenResult.

func (*ServiceGetSsoTokenResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceGetSsoTokenResult.

type ServiceIdentity added in v0.3.0

type ServiceIdentity struct {
	// REQUIRED; The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly
	// created identity and a set of user assigned identities. The type 'None' will remove any
	// identities from the service.
	Type *ApimIdentityType

	// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource
	// ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
	UserAssignedIdentities map[string]*UserIdentityProperties

	// READ-ONLY; The principal id of the identity.
	PrincipalID *string

	// READ-ONLY; The client tenant id of the identity.
	TenantID *string
}

ServiceIdentity - Identity properties of the Api Management service resource.

func (ServiceIdentity) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceIdentity.

func (*ServiceIdentity) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceIdentity.

type ServiceListResult added in v0.3.0

type ServiceListResult struct {
	// REQUIRED; Result of the List API Management services operation.
	Value []*ServiceResource

	// Link to the next set of results. Not empty if Value contains incomplete list of API Management services.
	NextLink *string
}

ServiceListResult - The response of the List API Management services operation.

func (ServiceListResult) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceListResult.

func (*ServiceListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceListResult.

type ServiceNameAvailabilityResult added in v0.3.0

type ServiceNameAvailabilityResult struct {
	// Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported
	// characters, etc.) AlreadyExists indicates that the name is already in use
	// and is therefore unavailable.
	Reason *NameAvailabilityReason

	// READ-ONLY; If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource
	// naming requirements so that the user can select a valid name. If reason == AlreadyExists,
	// explain that is already in use, and direct them to select a different name.
	Message *string

	// READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false.
	NameAvailable *bool
}

ServiceNameAvailabilityResult - Response of the CheckNameAvailability operation.

func (ServiceNameAvailabilityResult) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceNameAvailabilityResult.

func (*ServiceNameAvailabilityResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceNameAvailabilityResult.

type ServiceProperties added in v0.3.0

type ServiceProperties struct {
	// REQUIRED; Publisher email.
	PublisherEmail *string

	// REQUIRED; Publisher name.
	PublisherName *string

	// Control Plane Apis version constraint for the API Management service.
	APIVersionConstraint *APIVersionConstraint

	// Additional datacenter locations of the API Management service.
	AdditionalLocations []*AdditionalLocation

	// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed
	// is 10.
	Certificates []*CertificateConfiguration

	// Custom properties of the API Management service.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168 will disable the cipher TLSRSAWITH3DESEDECBCSHA
	// for all TLS(1.0, 1.1 and 1.2).
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11 can be used to disable just TLS 1.1.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10 can be used to disable TLS 1.0 on an API
	// Management service.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11 can be used to disable just TLS 1.1
	// for communications with backends.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10 can be used to disable TLS 1.0 for
	// communications with backends.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2 can be used to enable HTTP2 protocol on an
	// API Management service.
	// Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For
	// all the settings except Http2 the default value is True if the service was
	// created on or before April 1st 2018 and False otherwise. Http2 setting's default value is False.
	// You can disable any of next ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]:
	// TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA, TLS
	// ECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256,
	// TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For example,
	// Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default value
	// is true for them. Note: next ciphers can't be disabled since they are required by
	// Azure CloudService internal components: TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCMSHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBC
	// SHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256,TLSRSAWITHAES256GCMSHA384
	CustomProperties map[string]*string

	// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway
	// in master region.
	DisableGateway *bool

	// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each
	// request to the gateway. This also enables the ability to authenticate the
	// certificate in the policy on the gateway.
	EnableClientCertificate *bool

	// Custom hostname configuration of the API Management service.
	HostnameConfigurations []*HostnameConfiguration

	// Email address from which the notification will be sent.
	NotificationSenderEmail *string

	// List of Private Endpoint Connections of this service.
	PrivateEndpointConnections []*RemotePrivateEndpointConnectionWrapper

	// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported
	// only for Developer and Premium SKU being deployed in Virtual Network.
	PublicIPAddressID *string

	// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, must
	// be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the
	// exclusive access method. Default value is 'Enabled'
	PublicNetworkAccess *PublicNetworkAccess

	// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other
	// properties will be ignored.
	Restore *bool

	// Virtual network configuration of the API Management service.
	VirtualNetworkConfiguration *VirtualNetworkConfiguration

	// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management
	// service is not part of any Virtual Network, External means the API Management
	// deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management
	// deployment is setup inside a Virtual Network having an Intranet Facing Endpoint
	// only.
	VirtualNetworkType *VirtualNetworkType

	// READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ
	// as specified by the ISO 8601 standard.
	CreatedAtUTC *time.Time

	// READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
	DeveloperPortalURL *string

	// READ-ONLY; Gateway URL of the API Management service in the Default Region.
	GatewayRegionalURL *string

	// READ-ONLY; Gateway URL of the API Management service.
	GatewayURL *string

	// READ-ONLY; Management API endpoint URL of the API Management service.
	ManagementAPIURL *string

	// READ-ONLY; Compute Platform Version running the service in this location.
	PlatformVersion *PlatformVersion

	// READ-ONLY; Publisher portal endpoint Url of the API Management service.
	PortalURL *string

	// READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed
	// in an Internal Virtual Network. Available only for Basic, Standard, Premium and Isolated
	// SKU.
	PrivateIPAddresses []*string

	// READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
	ProvisioningState *string

	// READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for
	// Basic, Standard, Premium and Isolated SKU.
	PublicIPAddresses []*string

	// READ-ONLY; SCM endpoint URL of the API Management service.
	ScmURL *string

	// READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started
	// on the service.
	TargetProvisioningState *string
}

ServiceProperties - Properties of an API Management service resource description.

func (ServiceProperties) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceProperties.

func (*ServiceProperties) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties.

type ServiceResource added in v0.3.0

type ServiceResource struct {
	// REQUIRED; Resource location.
	Location *string

	// REQUIRED; Properties of the API Management service.
	Properties *ServiceProperties

	// REQUIRED; SKU properties of the API Management service.
	SKU *ServiceSKUProperties

	// Managed service identity of the Api Management service.
	Identity *ServiceIdentity

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

	// A list of availability zones denoting where the resource needs to come from.
	Zones []*string

	// READ-ONLY; ETag of the resource.
	Etag *string

	// READ-ONLY; Resource ID.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
	Type *string
}

ServiceResource - A single API Management service resource in List or Get response.

func (ServiceResource) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceResource.

func (*ServiceResource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResource.

type ServiceSKUProperties added in v0.3.0

type ServiceSKUProperties struct {
	// REQUIRED; Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as
	// 0.
	Capacity *int32

	// REQUIRED; Name of the Sku.
	Name *SKUType
}

ServiceSKUProperties - API Management service resource SKU properties.

func (ServiceSKUProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceSKUProperties.

func (*ServiceSKUProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSKUProperties.

type ServiceSKUsClient added in v0.3.0

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

ServiceSKUsClient contains the methods for the APIManagementServiceSKUs group. Don't use this type directly, use NewServiceSKUsClient() instead.

func NewServiceSKUsClient added in v0.3.0

func NewServiceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceSKUsClient, error)

NewServiceSKUsClient creates a new instance of ServiceSKUsClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ServiceSKUsClient) NewListAvailableServiceSKUsPager added in v0.5.0

func (client *ServiceSKUsClient) NewListAvailableServiceSKUsPager(resourceGroupName string, serviceName string, options *ServiceSKUsClientListAvailableServiceSKUsOptions) *runtime.Pager[ServiceSKUsClientListAvailableServiceSKUsResponse]

NewListAvailableServiceSKUsPager - Gets all available SKU for a given API Management service

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - ServiceSKUsClientListAvailableServiceSKUsOptions contains the optional parameters for the ServiceSKUsClient.NewListAvailableServiceSKUsPager method.
Example (ApiManagementListSkUsConsumption)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Consumption.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServiceSKUsClient().NewListAvailableServiceSKUsPager("rg1", "apimService1", 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.ResourceSKUResults = armapimanagement.ResourceSKUResults{
		// 	Value: []*armapimanagement.ResourceSKUResult{
		// 		{
		// 			ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
		// 			SKU: &armapimanagement.ResourceSKU{
		// 				Name: to.Ptr(armapimanagement.SKUTypeConsumption),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (ApiManagementListSkUsDedicated)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Dedicated.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServiceSKUsClient().NewListAvailableServiceSKUsPager("rg1", "apimService1", 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.ResourceSKUResults = armapimanagement.ResourceSKUResults{
		// 	Value: []*armapimanagement.ResourceSKUResult{
		// 		{
		// 			Capacity: &armapimanagement.ResourceSKUCapacity{
		// 				Default: to.Ptr[int32](1),
		// 				Maximum: to.Ptr[int32](1),
		// 				Minimum: to.Ptr[int32](1),
		// 				ScaleType: to.Ptr(armapimanagement.ResourceSKUCapacityScaleTypeNone),
		// 			},
		// 			ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
		// 			SKU: &armapimanagement.ResourceSKU{
		// 				Name: to.Ptr(armapimanagement.SKUTypeDeveloper),
		// 			},
		// 		},
		// 		{
		// 			Capacity: &armapimanagement.ResourceSKUCapacity{
		// 				Default: to.Ptr[int32](1),
		// 				Maximum: to.Ptr[int32](2),
		// 				Minimum: to.Ptr[int32](1),
		// 				ScaleType: to.Ptr(armapimanagement.ResourceSKUCapacityScaleTypeManual),
		// 			},
		// 			ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
		// 			SKU: &armapimanagement.ResourceSKU{
		// 				Name: to.Ptr(armapimanagement.SKUTypeBasic),
		// 			},
		// 		},
		// 		{
		// 			Capacity: &armapimanagement.ResourceSKUCapacity{
		// 				Default: to.Ptr[int32](1),
		// 				Maximum: to.Ptr[int32](4),
		// 				Minimum: to.Ptr[int32](1),
		// 				ScaleType: to.Ptr(armapimanagement.ResourceSKUCapacityScaleTypeAutomatic),
		// 			},
		// 			ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
		// 			SKU: &armapimanagement.ResourceSKU{
		// 				Name: to.Ptr(armapimanagement.SKUTypeStandard),
		// 			},
		// 		},
		// 		{
		// 			Capacity: &armapimanagement.ResourceSKUCapacity{
		// 				Default: to.Ptr[int32](1),
		// 				Maximum: to.Ptr[int32](10),
		// 				Minimum: to.Ptr[int32](1),
		// 				ScaleType: to.Ptr(armapimanagement.ResourceSKUCapacityScaleTypeAutomatic),
		// 			},
		// 			ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
		// 			SKU: &armapimanagement.ResourceSKU{
		// 				Name: to.Ptr(armapimanagement.SKUTypePremium),
		// 			},
		// 		},
		// 		{
		// 			Capacity: &armapimanagement.ResourceSKUCapacity{
		// 				Default: to.Ptr[int32](1),
		// 				Maximum: to.Ptr[int32](1),
		// 				Minimum: to.Ptr[int32](1),
		// 				ScaleType: to.Ptr(armapimanagement.ResourceSKUCapacityScaleTypeAutomatic),
		// 			},
		// 			ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
		// 			SKU: &armapimanagement.ResourceSKU{
		// 				Name: to.Ptr(armapimanagement.SKUTypeIsolated),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ServiceSKUsClientListAvailableServiceSKUsOptions added in v0.3.0

type ServiceSKUsClientListAvailableServiceSKUsOptions struct {
}

ServiceSKUsClientListAvailableServiceSKUsOptions contains the optional parameters for the ServiceSKUsClient.NewListAvailableServiceSKUsPager method.

type ServiceSKUsClientListAvailableServiceSKUsResponse added in v0.3.0

type ServiceSKUsClientListAvailableServiceSKUsResponse struct {
	ResourceSKUResults
}

ServiceSKUsClientListAvailableServiceSKUsResponse contains the response from method ServiceSKUsClient.NewListAvailableServiceSKUsPager.

type ServiceUpdateParameters added in v0.3.0

type ServiceUpdateParameters struct {
	// Managed service identity of the Api Management service.
	Identity *ServiceIdentity

	// Properties of the API Management service.
	Properties *ServiceUpdateProperties

	// SKU properties of the API Management service.
	SKU *ServiceSKUProperties

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

	// A list of availability zones denoting where the resource needs to come from.
	Zones []*string

	// READ-ONLY; ETag of the resource.
	Etag *string

	// READ-ONLY; Resource ID.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
	Type *string
}

ServiceUpdateParameters - Parameter supplied to Update Api Management Service.

func (ServiceUpdateParameters) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceUpdateParameters.

func (*ServiceUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdateParameters.

type ServiceUpdateProperties added in v0.3.0

type ServiceUpdateProperties struct {
	// Control Plane Apis version constraint for the API Management service.
	APIVersionConstraint *APIVersionConstraint

	// Additional datacenter locations of the API Management service.
	AdditionalLocations []*AdditionalLocation

	// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed
	// is 10.
	Certificates []*CertificateConfiguration

	// Custom properties of the API Management service.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168 will disable the cipher TLSRSAWITH3DESEDECBCSHA
	// for all TLS(1.0, 1.1 and 1.2).
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11 can be used to disable just TLS 1.1.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10 can be used to disable TLS 1.0 on an API
	// Management service.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11 can be used to disable just TLS 1.1
	// for communications with backends.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10 can be used to disable TLS 1.0 for
	// communications with backends.
	// Setting Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2 can be used to enable HTTP2 protocol on an
	// API Management service.
	// Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For
	// all the settings except Http2 the default value is True if the service was
	// created on or before April 1st 2018 and False otherwise. Http2 setting's default value is False.
	// You can disable any of next ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]:
	// TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA, TLS
	// ECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256,
	// TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For example,
	// Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default value
	// is true for them. Note: next ciphers can't be disabled since they are required by
	// Azure CloudService internal components: TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCMSHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBC
	// SHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256,TLSRSAWITHAES256GCMSHA384
	CustomProperties map[string]*string

	// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway
	// in master region.
	DisableGateway *bool

	// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each
	// request to the gateway. This also enables the ability to authenticate the
	// certificate in the policy on the gateway.
	EnableClientCertificate *bool

	// Custom hostname configuration of the API Management service.
	HostnameConfigurations []*HostnameConfiguration

	// Email address from which the notification will be sent.
	NotificationSenderEmail *string

	// List of Private Endpoint Connections of this service.
	PrivateEndpointConnections []*RemotePrivateEndpointConnectionWrapper

	// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported
	// only for Developer and Premium SKU being deployed in Virtual Network.
	PublicIPAddressID *string

	// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, must
	// be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the
	// exclusive access method. Default value is 'Enabled'
	PublicNetworkAccess *PublicNetworkAccess

	// Publisher email.
	PublisherEmail *string

	// Publisher name.
	PublisherName *string

	// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other
	// properties will be ignored.
	Restore *bool

	// Virtual network configuration of the API Management service.
	VirtualNetworkConfiguration *VirtualNetworkConfiguration

	// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management
	// service is not part of any Virtual Network, External means the API Management
	// deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management
	// deployment is setup inside a Virtual Network having an Intranet Facing Endpoint
	// only.
	VirtualNetworkType *VirtualNetworkType

	// READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ
	// as specified by the ISO 8601 standard.
	CreatedAtUTC *time.Time

	// READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
	DeveloperPortalURL *string

	// READ-ONLY; Gateway URL of the API Management service in the Default Region.
	GatewayRegionalURL *string

	// READ-ONLY; Gateway URL of the API Management service.
	GatewayURL *string

	// READ-ONLY; Management API endpoint URL of the API Management service.
	ManagementAPIURL *string

	// READ-ONLY; Compute Platform Version running the service in this location.
	PlatformVersion *PlatformVersion

	// READ-ONLY; Publisher portal endpoint Url of the API Management service.
	PortalURL *string

	// READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed
	// in an Internal Virtual Network. Available only for Basic, Standard, Premium and Isolated
	// SKU.
	PrivateIPAddresses []*string

	// READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
	ProvisioningState *string

	// READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for
	// Basic, Standard, Premium and Isolated SKU.
	PublicIPAddresses []*string

	// READ-ONLY; SCM endpoint URL of the API Management service.
	ScmURL *string

	// READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started
	// on the service.
	TargetProvisioningState *string
}

ServiceUpdateProperties - Properties of an API Management service resource description.

func (ServiceUpdateProperties) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceUpdateProperties.

func (*ServiceUpdateProperties) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdateProperties.

type SettingsTypeName

type SettingsTypeName string
const (
	SettingsTypeNamePublic SettingsTypeName = "public"
)

func PossibleSettingsTypeNameValues

func PossibleSettingsTypeNameValues() []SettingsTypeName

PossibleSettingsTypeNameValues returns the possible values for the SettingsTypeName const type.

type Severity

type Severity string

Severity - The severity of the issue.

const (
	SeverityError   Severity = "Error"
	SeverityWarning Severity = "Warning"
)

func PossibleSeverityValues

func PossibleSeverityValues() []Severity

PossibleSeverityValues returns the possible values for the Severity const type.

type SignInSettingsClient

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

SignInSettingsClient contains the methods for the SignInSettings group. Don't use this type directly, use NewSignInSettingsClient() instead.

func NewSignInSettingsClient

func NewSignInSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SignInSettingsClient, error)

NewSignInSettingsClient creates a new instance of SignInSettingsClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SignInSettingsClient) CreateOrUpdate

CreateOrUpdate - Create or Update Sign-In settings. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • parameters - Create or update parameters.
  • options - SignInSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignInSettingsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignIn.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSignInSettingsClient().CreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.PortalSigninSettings{
		Properties: &armapimanagement.PortalSigninSettingProperties{
			Enabled: to.Ptr(true),
		},
	}, &armapimanagement.SignInSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")})
	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.PortalSigninSettings = armapimanagement.PortalSigninSettings{
	// 	Name: to.Ptr("signin"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/portalsettings"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/signin"),
	// 	Properties: &armapimanagement.PortalSigninSettingProperties{
	// 		Enabled: to.Ptr(true),
	// 	},
	// }
}
Output:

func (*SignInSettingsClient) Get

func (client *SignInSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *SignInSettingsClientGetOptions) (SignInSettingsClientGetResponse, error)

Get - Get Sign In Settings for the Portal If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - SignInSettingsClientGetOptions contains the optional parameters for the SignInSettingsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetSignIn.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSignInSettingsClient().Get(ctx, "rg1", "apimService1", 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.PortalSigninSettings = armapimanagement.PortalSigninSettings{
	// 	Name: to.Ptr("signin"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/portalsettings"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/signin"),
	// 	Properties: &armapimanagement.PortalSigninSettingProperties{
	// 		Enabled: to.Ptr(true),
	// 	},
	// }
}
Output:

func (*SignInSettingsClient) GetEntityTag

func (client *SignInSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, options *SignInSettingsClientGetEntityTagOptions) (SignInSettingsClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the SignInSettings.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - SignInSettingsClientGetEntityTagOptions contains the optional parameters for the SignInSettingsClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSignInSettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSignInSettingsClient().GetEntityTag(ctx, "rg1", "apimService1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SignInSettingsClient) Update

func (client *SignInSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, ifMatch string, parameters PortalSigninSettings, options *SignInSettingsClientUpdateOptions) (SignInSettingsClientUpdateResponse, error)

Update - Update Sign-In settings. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update Sign-In settings.
  • options - SignInSettingsClientUpdateOptions contains the optional parameters for the SignInSettingsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateSignIn.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSignInSettingsClient().Update(ctx, "rg1", "apimService1", "*", armapimanagement.PortalSigninSettings{
		Properties: &armapimanagement.PortalSigninSettingProperties{
			Enabled: to.Ptr(true),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

type SignInSettingsClientCreateOrUpdateOptions added in v0.3.0

type SignInSettingsClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

SignInSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignInSettingsClient.CreateOrUpdate method.

type SignInSettingsClientCreateOrUpdateResponse added in v0.3.0

type SignInSettingsClientCreateOrUpdateResponse struct {
	PortalSigninSettings
}

SignInSettingsClientCreateOrUpdateResponse contains the response from method SignInSettingsClient.CreateOrUpdate.

type SignInSettingsClientGetEntityTagOptions added in v0.3.0

type SignInSettingsClientGetEntityTagOptions struct {
}

SignInSettingsClientGetEntityTagOptions contains the optional parameters for the SignInSettingsClient.GetEntityTag method.

type SignInSettingsClientGetEntityTagResponse added in v0.3.0

type SignInSettingsClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

SignInSettingsClientGetEntityTagResponse contains the response from method SignInSettingsClient.GetEntityTag.

type SignInSettingsClientGetOptions added in v0.3.0

type SignInSettingsClientGetOptions struct {
}

SignInSettingsClientGetOptions contains the optional parameters for the SignInSettingsClient.Get method.

type SignInSettingsClientGetResponse added in v0.3.0

type SignInSettingsClientGetResponse struct {
	PortalSigninSettings
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

SignInSettingsClientGetResponse contains the response from method SignInSettingsClient.Get.

type SignInSettingsClientUpdateOptions added in v0.3.0

type SignInSettingsClientUpdateOptions struct {
}

SignInSettingsClientUpdateOptions contains the optional parameters for the SignInSettingsClient.Update method.

type SignInSettingsClientUpdateResponse added in v0.3.0

type SignInSettingsClientUpdateResponse struct {
}

SignInSettingsClientUpdateResponse contains the response from method SignInSettingsClient.Update.

type SignUpSettingsClient

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

SignUpSettingsClient contains the methods for the SignUpSettings group. Don't use this type directly, use NewSignUpSettingsClient() instead.

func NewSignUpSettingsClient

func NewSignUpSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SignUpSettingsClient, error)

NewSignUpSettingsClient creates a new instance of SignUpSettingsClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SignUpSettingsClient) CreateOrUpdate

CreateOrUpdate - Create or Update Sign-Up settings. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • parameters - Create or update parameters.
  • options - SignUpSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignUpSettingsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignUp.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSignUpSettingsClient().CreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.PortalSignupSettings{
		Properties: &armapimanagement.PortalSignupSettingsProperties{
			Enabled: to.Ptr(true),
			TermsOfService: &armapimanagement.TermsOfServiceProperties{
				ConsentRequired: to.Ptr(true),
				Enabled:         to.Ptr(true),
				Text:            to.Ptr("Terms of service text."),
			},
		},
	}, &armapimanagement.SignUpSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")})
	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.PortalSignupSettings = armapimanagement.PortalSignupSettings{
	// 	Name: to.Ptr("signup"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/portalsettings"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/signup"),
	// 	Properties: &armapimanagement.PortalSignupSettingsProperties{
	// 		Enabled: to.Ptr(true),
	// 		TermsOfService: &armapimanagement.TermsOfServiceProperties{
	// 			ConsentRequired: to.Ptr(true),
	// 			Enabled: to.Ptr(true),
	// 			Text: to.Ptr("Terms of service text."),
	// 		},
	// 	},
	// }
}
Output:

func (*SignUpSettingsClient) Get

func (client *SignUpSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *SignUpSettingsClientGetOptions) (SignUpSettingsClientGetResponse, error)

Get - Get Sign Up Settings for the Portal If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - SignUpSettingsClientGetOptions contains the optional parameters for the SignUpSettingsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetSignUp.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSignUpSettingsClient().Get(ctx, "rg1", "apimService1", 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.PortalSignupSettings = armapimanagement.PortalSignupSettings{
	// 	Name: to.Ptr("signup"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/portalsettings"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/signup"),
	// 	Properties: &armapimanagement.PortalSignupSettingsProperties{
	// 		Enabled: to.Ptr(true),
	// 		TermsOfService: &armapimanagement.TermsOfServiceProperties{
	// 			ConsentRequired: to.Ptr(true),
	// 			Enabled: to.Ptr(true),
	// 			Text: to.Ptr("Terms of service text."),
	// 		},
	// 	},
	// }
}
Output:

func (*SignUpSettingsClient) GetEntityTag

func (client *SignUpSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, options *SignUpSettingsClientGetEntityTagOptions) (SignUpSettingsClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the SignUpSettings.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - SignUpSettingsClientGetEntityTagOptions contains the optional parameters for the SignUpSettingsClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSignUpSettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSignUpSettingsClient().GetEntityTag(ctx, "rg1", "apimService1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SignUpSettingsClient) Update

func (client *SignUpSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, ifMatch string, parameters PortalSignupSettings, options *SignUpSettingsClientUpdateOptions) (SignUpSettingsClientUpdateResponse, error)

Update - Update Sign-Up settings. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update Sign-Up settings.
  • options - SignUpSettingsClientUpdateOptions contains the optional parameters for the SignUpSettingsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateSignUp.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSignUpSettingsClient().Update(ctx, "rg1", "apimService1", "*", armapimanagement.PortalSignupSettings{
		Properties: &armapimanagement.PortalSignupSettingsProperties{
			Enabled: to.Ptr(true),
			TermsOfService: &armapimanagement.TermsOfServiceProperties{
				ConsentRequired: to.Ptr(true),
				Enabled:         to.Ptr(true),
				Text:            to.Ptr("Terms of service text."),
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

type SignUpSettingsClientCreateOrUpdateOptions added in v0.3.0

type SignUpSettingsClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

SignUpSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignUpSettingsClient.CreateOrUpdate method.

type SignUpSettingsClientCreateOrUpdateResponse added in v0.3.0

type SignUpSettingsClientCreateOrUpdateResponse struct {
	PortalSignupSettings
}

SignUpSettingsClientCreateOrUpdateResponse contains the response from method SignUpSettingsClient.CreateOrUpdate.

type SignUpSettingsClientGetEntityTagOptions added in v0.3.0

type SignUpSettingsClientGetEntityTagOptions struct {
}

SignUpSettingsClientGetEntityTagOptions contains the optional parameters for the SignUpSettingsClient.GetEntityTag method.

type SignUpSettingsClientGetEntityTagResponse added in v0.3.0

type SignUpSettingsClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

SignUpSettingsClientGetEntityTagResponse contains the response from method SignUpSettingsClient.GetEntityTag.

type SignUpSettingsClientGetOptions added in v0.3.0

type SignUpSettingsClientGetOptions struct {
}

SignUpSettingsClientGetOptions contains the optional parameters for the SignUpSettingsClient.Get method.

type SignUpSettingsClientGetResponse added in v0.3.0

type SignUpSettingsClientGetResponse struct {
	PortalSignupSettings
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

SignUpSettingsClientGetResponse contains the response from method SignUpSettingsClient.Get.

type SignUpSettingsClientUpdateOptions added in v0.3.0

type SignUpSettingsClientUpdateOptions struct {
}

SignUpSettingsClientUpdateOptions contains the optional parameters for the SignUpSettingsClient.Update method.

type SignUpSettingsClientUpdateResponse added in v0.3.0

type SignUpSettingsClientUpdateResponse struct {
}

SignUpSettingsClientUpdateResponse contains the response from method SignUpSettingsClient.Update.

type SoapAPIType

type SoapAPIType string

SoapAPIType - Type of API to create. * http creates a REST API * soap creates a SOAP pass-through API * websocket creates websocket API * graphql creates GraphQL API.

const (
	// SoapAPITypeGraphQL - Imports the API having a GraphQL front end.
	SoapAPITypeGraphQL SoapAPIType = "graphql"
	// SoapAPITypeSoapPassThrough - Imports the SOAP API having a SOAP front end.
	SoapAPITypeSoapPassThrough SoapAPIType = "soap"
	// SoapAPITypeSoapToRest - Imports a SOAP API having a RESTful front end.
	SoapAPITypeSoapToRest SoapAPIType = "http"
	// SoapAPITypeWebSocket - Imports the API having a Websocket front end.
	SoapAPITypeWebSocket SoapAPIType = "websocket"
)

func PossibleSoapAPITypeValues

func PossibleSoapAPITypeValues() []SoapAPIType

PossibleSoapAPITypeValues returns the possible values for the SoapAPIType const type.

type State

type State string

State - Status of the issue.

const (
	// StateClosed - The issue was closed.
	StateClosed State = "closed"
	// StateOpen - The issue is opened.
	StateOpen State = "open"
	// StateProposed - The issue is proposed.
	StateProposed State = "proposed"
	// StateRemoved - The issue was removed.
	StateRemoved State = "removed"
	// StateResolved - The issue is now resolved.
	StateResolved State = "resolved"
)

func PossibleStateValues

func PossibleStateValues() []State

PossibleStateValues returns the possible values for the State const type.

type SubscriptionClient

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

SubscriptionClient contains the methods for the Subscription group. Don't use this type directly, use NewSubscriptionClient() instead.

func NewSubscriptionClient

func NewSubscriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionClient, error)

NewSubscriptionClient creates a new instance of SubscriptionClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SubscriptionClient) CreateOrUpdate

func (client *SubscriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, sid string, parameters SubscriptionCreateParameters, options *SubscriptionClientCreateOrUpdateOptions) (SubscriptionClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates the subscription of specified user to the specified product. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
  • parameters - Create parameters.
  • options - SubscriptionClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSubscription.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSubscriptionClient().CreateOrUpdate(ctx, "rg1", "apimService1", "testsub", armapimanagement.SubscriptionCreateParameters{
		Properties: &armapimanagement.SubscriptionCreateParameterProperties{
			DisplayName: to.Ptr("testsub"),
			OwnerID:     to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7"),
			Scope:       to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002"),
		},
	}, &armapimanagement.SubscriptionClientCreateOrUpdateOptions{Notify: nil,
		IfMatch: nil,
		AppType: 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.SubscriptionContract = armapimanagement.SubscriptionContract{
	// 	Name: to.Ptr("testsub"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/subscriptions"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/testsub"),
	// 	Properties: &armapimanagement.SubscriptionContractProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T23:34:03.1055076Z"); return t}()),
	// 		DisplayName: to.Ptr("testsub"),
	// 		OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7"),
	// 		Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002"),
	// 		State: to.Ptr(armapimanagement.SubscriptionStateSubmitted),
	// 	},
	// }
}
Output:

func (*SubscriptionClient) Delete

func (client *SubscriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, sid string, ifMatch string, options *SubscriptionClientDeleteOptions) (SubscriptionClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - SubscriptionClientDeleteOptions contains the optional parameters for the SubscriptionClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*SubscriptionClient) Get

func (client *SubscriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientGetOptions) (SubscriptionClientGetResponse, error)

Get - Gets the specified Subscription entity. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
  • options - SubscriptionClientGetOptions contains the optional parameters for the SubscriptionClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSubscriptionClient().Get(ctx, "rg1", "apimService1", "5931a769d8d14f0ad8ce13b8", 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.SubscriptionContract = armapimanagement.SubscriptionContract{
	// 	Name: to.Ptr("5931a769d8d14f0ad8ce13b8"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/subscriptions"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/5931a769d8d14f0ad8ce13b8"),
	// 	Properties: &armapimanagement.SubscriptionContractProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T17:59:06.223Z"); return t}()),
	// 		DisplayName: to.Ptr("Unlimited"),
	// 		OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512a88c680b"),
	// 		Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002"),
	// 		State: to.Ptr(armapimanagement.SubscriptionStateSubmitted),
	// 	},
	// }
}
Output:

func (*SubscriptionClient) GetEntityTag

func (client *SubscriptionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientGetEntityTagOptions) (SubscriptionClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
  • options - SubscriptionClientGetEntityTagOptions contains the optional parameters for the SubscriptionClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSubscriptionClient().GetEntityTag(ctx, "rg1", "apimService1", "5931a769d8d14f0ad8ce13b8", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SubscriptionClient) ListSecrets

func (client *SubscriptionClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientListSecretsOptions) (SubscriptionClientListSecretsResponse, error)

ListSecrets - Gets the specified Subscription keys. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
  • options - SubscriptionClientListSecretsOptions contains the optional parameters for the SubscriptionClient.ListSecrets method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionListSecrets.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSubscriptionClient().ListSecrets(ctx, "rg1", "apimService1", "5931a769d8d14f0ad8ce13b8", 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.SubscriptionKeysContract = armapimanagement.SubscriptionKeysContract{
	// 	PrimaryKey: to.Ptr("<primaryKey>"),
	// 	SecondaryKey: to.Ptr("<secondaryKey>"),
	// }
}
Output:

func (*SubscriptionClient) NewListPager added in v0.5.0

func (client *SubscriptionClient) NewListPager(resourceGroupName string, serviceName string, options *SubscriptionClientListOptions) *runtime.Pager[SubscriptionClientListResponse]

NewListPager - Lists all subscriptions of the API Management service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - SubscriptionClientListOptions contains the optional parameters for the SubscriptionClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSubscriptions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSubscriptionClient().NewListPager("rg1", "apimService1", &armapimanagement.SubscriptionClientListOptions{Filter: nil,
		Top:  nil,
		Skip: 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.SubscriptionCollection = armapimanagement.SubscriptionCollection{
		// 	Count: to.Ptr[int64](3),
		// 	Value: []*armapimanagement.SubscriptionContract{
		// 		{
		// 			Name: to.Ptr("5600b59475ff190048070001"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/subscriptions"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/5600b59475ff190048070001"),
		// 			Properties: &armapimanagement.SubscriptionContractProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-22T01:57:40.3Z"); return t}()),
		// 				OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
		// 				Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060001"),
		// 				State: to.Ptr(armapimanagement.SubscriptionStateActive),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("56eaed3dbaf08b06e46d27fe"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/subscriptions"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/56eaed3dbaf08b06e46d27fe"),
		// 			Properties: &armapimanagement.SubscriptionContractProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-17T17:45:33.837Z"); return t}()),
		// 				DisplayName: to.Ptr("Starter"),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-04-01T00:00:00Z"); return t}()),
		// 				NotificationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-20T00:00:00Z"); return t}()),
		// 				OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/56eaec62baf08b06e46d27fd"),
		// 				Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060001"),
		// 				StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-17T00:00:00Z"); return t}()),
		// 				State: to.Ptr(armapimanagement.SubscriptionStateActive),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("5931a769d8d14f0ad8ce13b8"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/subscriptions"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/5931a769d8d14f0ad8ce13b8"),
		// 			Properties: &armapimanagement.SubscriptionContractProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T17:59:06.223Z"); return t}()),
		// 				DisplayName: to.Ptr("Unlimited"),
		// 				OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512a88c680b"),
		// 				Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002"),
		// 				State: to.Ptr(armapimanagement.SubscriptionStateSubmitted),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*SubscriptionClient) RegeneratePrimaryKey

func (client *SubscriptionClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientRegeneratePrimaryKeyOptions) (SubscriptionClientRegeneratePrimaryKeyResponse, error)

RegeneratePrimaryKey - Regenerates primary key of existing subscription of the API Management service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
  • options - SubscriptionClientRegeneratePrimaryKeyOptions contains the optional parameters for the SubscriptionClient.RegeneratePrimaryKey method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionRegeneratePrimaryKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSubscriptionClient().RegeneratePrimaryKey(ctx, "rg1", "apimService1", "testsub", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SubscriptionClient) RegenerateSecondaryKey

func (client *SubscriptionClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientRegenerateSecondaryKeyOptions) (SubscriptionClientRegenerateSecondaryKeyResponse, error)

RegenerateSecondaryKey - Regenerates secondary key of existing subscription of the API Management service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
  • options - SubscriptionClientRegenerateSecondaryKeyOptions contains the optional parameters for the SubscriptionClient.RegenerateSecondaryKey method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionRegenerateSecondaryKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSubscriptionClient().RegenerateSecondaryKey(ctx, "rg1", "apimService1", "testsub", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SubscriptionClient) Update

func (client *SubscriptionClient) Update(ctx context.Context, resourceGroupName string, serviceName string, sid string, ifMatch string, parameters SubscriptionUpdateParameters, options *SubscriptionClientUpdateOptions) (SubscriptionClientUpdateResponse, error)

Update - Updates the details of a subscription specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - SubscriptionClientUpdateOptions contains the optional parameters for the SubscriptionClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateSubscription.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSubscriptionClient().Update(ctx, "rg1", "apimService1", "testsub", "*", armapimanagement.SubscriptionUpdateParameters{
		Properties: &armapimanagement.SubscriptionUpdateParameterProperties{
			DisplayName: to.Ptr("testsub"),
		},
	}, &armapimanagement.SubscriptionClientUpdateOptions{Notify: nil,
		AppType: 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.SubscriptionContract = armapimanagement.SubscriptionContract{
	// 	Name: to.Ptr("testsub"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/subscriptions"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/testsub"),
	// 	Properties: &armapimanagement.SubscriptionContractProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T17:59:06.223Z"); return t}()),
	// 		DisplayName: to.Ptr("testsub"),
	// 		OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512a88c680b"),
	// 		Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002"),
	// 		State: to.Ptr(armapimanagement.SubscriptionStateSubmitted),
	// 	},
	// }
}
Output:

type SubscriptionClientCreateOrUpdateOptions added in v0.3.0

type SubscriptionClientCreateOrUpdateOptions struct {
	// Determines the type of application which send the create user request. Default is legacy publisher portal.
	AppType *AppType
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
	// Notify change in Subscription State.
	// * If false, do not send any email notification for change of state of subscription
	// * If true, send email notification of change of state of subscription
	Notify *bool
}

SubscriptionClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionClient.CreateOrUpdate method.

type SubscriptionClientCreateOrUpdateResponse added in v0.3.0

type SubscriptionClientCreateOrUpdateResponse struct {
	SubscriptionContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

SubscriptionClientCreateOrUpdateResponse contains the response from method SubscriptionClient.CreateOrUpdate.

type SubscriptionClientDeleteOptions added in v0.3.0

type SubscriptionClientDeleteOptions struct {
}

SubscriptionClientDeleteOptions contains the optional parameters for the SubscriptionClient.Delete method.

type SubscriptionClientDeleteResponse added in v0.3.0

type SubscriptionClientDeleteResponse struct {
}

SubscriptionClientDeleteResponse contains the response from method SubscriptionClient.Delete.

type SubscriptionClientGetEntityTagOptions added in v0.3.0

type SubscriptionClientGetEntityTagOptions struct {
}

SubscriptionClientGetEntityTagOptions contains the optional parameters for the SubscriptionClient.GetEntityTag method.

type SubscriptionClientGetEntityTagResponse added in v0.3.0

type SubscriptionClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

SubscriptionClientGetEntityTagResponse contains the response from method SubscriptionClient.GetEntityTag.

type SubscriptionClientGetOptions added in v0.3.0

type SubscriptionClientGetOptions struct {
}

SubscriptionClientGetOptions contains the optional parameters for the SubscriptionClient.Get method.

type SubscriptionClientGetResponse added in v0.3.0

type SubscriptionClientGetResponse struct {
	SubscriptionContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

SubscriptionClientGetResponse contains the response from method SubscriptionClient.Get.

type SubscriptionClientListOptions added in v0.3.0

type SubscriptionClientListOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | state | filter | eq | |
	// | user | expand | | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

SubscriptionClientListOptions contains the optional parameters for the SubscriptionClient.NewListPager method.

type SubscriptionClientListResponse added in v0.3.0

type SubscriptionClientListResponse struct {
	SubscriptionCollection
}

SubscriptionClientListResponse contains the response from method SubscriptionClient.NewListPager.

type SubscriptionClientListSecretsOptions added in v0.3.0

type SubscriptionClientListSecretsOptions struct {
}

SubscriptionClientListSecretsOptions contains the optional parameters for the SubscriptionClient.ListSecrets method.

type SubscriptionClientListSecretsResponse added in v0.3.0

type SubscriptionClientListSecretsResponse struct {
	SubscriptionKeysContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

SubscriptionClientListSecretsResponse contains the response from method SubscriptionClient.ListSecrets.

type SubscriptionClientRegeneratePrimaryKeyOptions added in v0.3.0

type SubscriptionClientRegeneratePrimaryKeyOptions struct {
}

SubscriptionClientRegeneratePrimaryKeyOptions contains the optional parameters for the SubscriptionClient.RegeneratePrimaryKey method.

type SubscriptionClientRegeneratePrimaryKeyResponse added in v0.3.0

type SubscriptionClientRegeneratePrimaryKeyResponse struct {
}

SubscriptionClientRegeneratePrimaryKeyResponse contains the response from method SubscriptionClient.RegeneratePrimaryKey.

type SubscriptionClientRegenerateSecondaryKeyOptions added in v0.3.0

type SubscriptionClientRegenerateSecondaryKeyOptions struct {
}

SubscriptionClientRegenerateSecondaryKeyOptions contains the optional parameters for the SubscriptionClient.RegenerateSecondaryKey method.

type SubscriptionClientRegenerateSecondaryKeyResponse added in v0.3.0

type SubscriptionClientRegenerateSecondaryKeyResponse struct {
}

SubscriptionClientRegenerateSecondaryKeyResponse contains the response from method SubscriptionClient.RegenerateSecondaryKey.

type SubscriptionClientUpdateOptions added in v0.3.0

type SubscriptionClientUpdateOptions struct {
	// Determines the type of application which send the create user request. Default is legacy publisher portal.
	AppType *AppType
	// Notify change in Subscription State.
	// * If false, do not send any email notification for change of state of subscription
	// * If true, send email notification of change of state of subscription
	Notify *bool
}

SubscriptionClientUpdateOptions contains the optional parameters for the SubscriptionClient.Update method.

type SubscriptionClientUpdateResponse added in v0.3.0

type SubscriptionClientUpdateResponse struct {
	SubscriptionContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

SubscriptionClientUpdateResponse contains the response from method SubscriptionClient.Update.

type SubscriptionCollection

type SubscriptionCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*SubscriptionContract
}

SubscriptionCollection - Paged Subscriptions list representation.

func (SubscriptionCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionCollection.

func (*SubscriptionCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionCollection.

type SubscriptionContract

type SubscriptionContract struct {
	// Subscription contract properties.
	Properties *SubscriptionContractProperties

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

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

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

SubscriptionContract - Subscription details.

func (SubscriptionContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionContract.

func (*SubscriptionContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionContract.

type SubscriptionContractProperties

type SubscriptionContractProperties struct {
	// REQUIRED; Scope like /products/{productId} or /apis or /apis/{apiId}.
	Scope *string

	// REQUIRED; Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription
	// is blocked, and the subscriber cannot call any APIs of the product, * submitted – the
	// subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription
	// request has been denied by an administrator, * cancelled – the
	// subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration
	// date and was deactivated.
	State *SubscriptionState

	// Determines whether tracing is enabled
	AllowTracing *bool

	// The name of the subscription, or null if the subscription has no name.
	DisplayName *string

	// Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically
	// cancelled. The subscription lifecycle can be managed by using the
	// state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
	EndDate *time.Time

	// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired.
	// The subscription lifecycle can be managed by using the state property. The date
	// conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
	ExpirationDate *time.Time

	// Upcoming subscription expiration notification date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as
	// specified by the ISO 8601 standard.
	NotificationDate *time.Time

	// The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId}
	// where {userId} is a user identifier.
	OwnerID *string

	// Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get
	// the value.
	PrimaryKey *string

	// Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get
	// the value.
	SecondaryKey *string

	// Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated.
	// The subscription lifecycle can be managed by using the state property. The
	// date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
	StartDate *time.Time

	// Optional subscription comment added by an administrator when the state is changed to the 'rejected'.
	StateComment *string

	// READ-ONLY; Subscription creation date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by
	// the ISO 8601 standard.
	CreatedDate *time.Time
}

SubscriptionContractProperties - Subscription details.

func (SubscriptionContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionContractProperties.

func (*SubscriptionContractProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionContractProperties.

type SubscriptionCreateParameterProperties

type SubscriptionCreateParameterProperties struct {
	// REQUIRED; Subscription name.
	DisplayName *string

	// REQUIRED; Scope like /products/{productId} or /apis or /apis/{apiId}.
	Scope *string

	// Determines whether tracing can be enabled
	AllowTracing *bool

	// User (user id path) for whom subscription is being created in form /users/{userId}
	OwnerID *string

	// Primary subscription key. If not specified during request key will be generated automatically.
	PrimaryKey *string

	// Secondary subscription key. If not specified during request key will be generated automatically.
	SecondaryKey *string

	// Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are
	// * active – the subscription is active, * suspended – the subscription is
	// blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by
	// the developer, but has not yet been approved or rejected, * rejected – the
	// subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer
	// or administrator, * expired – the subscription reached its expiration date
	// and was deactivated.
	State *SubscriptionState
}

SubscriptionCreateParameterProperties - Parameters supplied to the Create subscription operation.

func (SubscriptionCreateParameterProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionCreateParameterProperties.

func (*SubscriptionCreateParameterProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionCreateParameterProperties.

type SubscriptionCreateParameters

type SubscriptionCreateParameters struct {
	// Subscription contract properties.
	Properties *SubscriptionCreateParameterProperties
}

SubscriptionCreateParameters - Subscription create details.

func (SubscriptionCreateParameters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionCreateParameters.

func (*SubscriptionCreateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionCreateParameters.

type SubscriptionKeyParameterNamesContract

type SubscriptionKeyParameterNamesContract struct {
	// Subscription key header name.
	Header *string

	// Subscription key query string parameter name.
	Query *string
}

SubscriptionKeyParameterNamesContract - Subscription key parameter names details.

func (SubscriptionKeyParameterNamesContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionKeyParameterNamesContract.

func (*SubscriptionKeyParameterNamesContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionKeyParameterNamesContract.

type SubscriptionKeysContract

type SubscriptionKeysContract struct {
	// Subscription primary key.
	PrimaryKey *string

	// Subscription secondary key.
	SecondaryKey *string
}

SubscriptionKeysContract - Subscription keys.

func (SubscriptionKeysContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionKeysContract.

func (*SubscriptionKeysContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionKeysContract.

type SubscriptionState

type SubscriptionState string

SubscriptionState - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.

const (
	SubscriptionStateSuspended SubscriptionState = "suspended"
	SubscriptionStateActive    SubscriptionState = "active"
	SubscriptionStateExpired   SubscriptionState = "expired"
	SubscriptionStateSubmitted SubscriptionState = "submitted"
	SubscriptionStateRejected  SubscriptionState = "rejected"
	SubscriptionStateCancelled SubscriptionState = "cancelled"
)

func PossibleSubscriptionStateValues

func PossibleSubscriptionStateValues() []SubscriptionState

PossibleSubscriptionStateValues returns the possible values for the SubscriptionState const type.

type SubscriptionUpdateParameterProperties

type SubscriptionUpdateParameterProperties struct {
	// Determines whether tracing can be enabled
	AllowTracing *bool

	// Subscription name.
	DisplayName *string

	// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired.
	// The subscription lifecycle can be managed by using the state property. The date
	// conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
	ExpirationDate *time.Time

	// User identifier path: /users/{userId}
	OwnerID *string

	// Primary subscription key.
	PrimaryKey *string

	// Scope like /products/{productId} or /apis or /apis/{apiId}
	Scope *string

	// Secondary subscription key.
	SecondaryKey *string

	// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked,
	// and the subscriber cannot call any APIs of the product, * submitted – the
	// subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription
	// request has been denied by an administrator, * cancelled – the
	// subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration
	// date and was deactivated.
	State *SubscriptionState

	// Comments describing subscription state change by the administrator when the state is changed to the 'rejected'.
	StateComment *string
}

SubscriptionUpdateParameterProperties - Parameters supplied to the Update subscription operation.

func (SubscriptionUpdateParameterProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionUpdateParameterProperties.

func (*SubscriptionUpdateParameterProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUpdateParameterProperties.

type SubscriptionUpdateParameters

type SubscriptionUpdateParameters struct {
	// Subscription Update contract properties.
	Properties *SubscriptionUpdateParameterProperties
}

SubscriptionUpdateParameters - Subscription update details.

func (SubscriptionUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionUpdateParameters.

func (*SubscriptionUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUpdateParameters.

type SubscriptionsDelegationSettingsProperties

type SubscriptionsDelegationSettingsProperties struct {
	// Enable or disable delegation for subscriptions.
	Enabled *bool
}

SubscriptionsDelegationSettingsProperties - Subscriptions delegation settings properties.

func (SubscriptionsDelegationSettingsProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type SubscriptionsDelegationSettingsProperties.

func (*SubscriptionsDelegationSettingsProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionsDelegationSettingsProperties.

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 TagClient

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

TagClient contains the methods for the Tag group. Don't use this type directly, use NewTagClient() instead.

func NewTagClient

func NewTagClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TagClient, error)

NewTagClient creates a new instance of TagClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*TagClient) AssignToAPI

func (client *TagClient) AssignToAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientAssignToAPIOptions) (TagClientAssignToAPIResponse, error)

AssignToAPI - Assign tag to the Api. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientAssignToAPIOptions contains the optional parameters for the TagClient.AssignToAPI method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTagClient().AssignToAPI(ctx, "rg1", "apimService1", "5931a75ae4bbd512a88c680b", "tagId1", 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.TagContract = armapimanagement.TagContract{
	// 	Name: to.Ptr("tagId1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/tagId1"),
	// 	Properties: &armapimanagement.TagContractProperties{
	// 		DisplayName: to.Ptr("tag1"),
	// 	},
	// }
}
Output:

func (*TagClient) AssignToOperation

func (client *TagClient) AssignToOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientAssignToOperationOptions) (TagClientAssignToOperationResponse, error)

AssignToOperation - Assign tag to the Operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientAssignToOperationOptions contains the optional parameters for the TagClient.AssignToOperation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperationTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTagClient().AssignToOperation(ctx, "rg1", "apimService1", "5931a75ae4bbd512a88c680b", "5931a75ae4bbd512a88c680a", "tagId1", 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.TagContract = armapimanagement.TagContract{
	// 	Name: to.Ptr("tagId1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/tagId1"),
	// 	Properties: &armapimanagement.TagContractProperties{
	// 		DisplayName: to.Ptr("tag1"),
	// 	},
	// }
}
Output:

func (*TagClient) AssignToProduct

func (client *TagClient) AssignToProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientAssignToProductOptions) (TagClientAssignToProductResponse, error)

AssignToProduct - Assign tag to the Product. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientAssignToProductOptions contains the optional parameters for the TagClient.AssignToProduct method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTagClient().AssignToProduct(ctx, "rg1", "apimService1", "5931a75ae4bbd512a88c680b", "tagId1", 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.TagContract = armapimanagement.TagContract{
	// 	Name: to.Ptr("tagId1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/tagId1"),
	// 	Properties: &armapimanagement.TagContractProperties{
	// 		DisplayName: to.Ptr("tag1"),
	// 	},
	// }
}
Output:

func (*TagClient) CreateOrUpdate

func (client *TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters, options *TagClientCreateOrUpdateOptions) (TagClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates a tag. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • parameters - Create parameters.
  • options - TagClientCreateOrUpdateOptions contains the optional parameters for the TagClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTag.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTagClient().CreateOrUpdate(ctx, "rg1", "apimService1", "tagId1", armapimanagement.TagCreateUpdateParameters{
		Properties: &armapimanagement.TagContractProperties{
			DisplayName: to.Ptr("tag1"),
		},
	}, &armapimanagement.TagClientCreateOrUpdateOptions{IfMatch: 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.TagContract = armapimanagement.TagContract{
	// 	Name: to.Ptr("tagId1"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/tagId1"),
	// 	Properties: &armapimanagement.TagContractProperties{
	// 		DisplayName: to.Ptr("tag1"),
	// 	},
	// }
}
Output:

func (*TagClient) Delete

func (client *TagClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, tagID string, ifMatch string, options *TagClientDeleteOptions) (TagClientDeleteResponse, error)

Delete - Deletes specific tag of the API Management service instance. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - TagClientDeleteOptions contains the optional parameters for the TagClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

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

func (*TagClient) DetachFromAPI

func (client *TagClient) DetachFromAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientDetachFromAPIOptions) (TagClientDetachFromAPIResponse, error)

DetachFromAPI - Detach the tag from the Api. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientDetachFromAPIOptions contains the optional parameters for the TagClient.DetachFromAPI method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewTagClient().DetachFromAPI(ctx, "rg1", "apimService1", "59d5b28d1f7fab116c282650", "59d5b28e1f7fab116402044e", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*TagClient) DetachFromOperation

func (client *TagClient) DetachFromOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientDetachFromOperationOptions) (TagClientDetachFromOperationResponse, error)

DetachFromOperation - Detach the tag from the Operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientDetachFromOperationOptions contains the optional parameters for the TagClient.DetachFromOperation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperationTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewTagClient().DetachFromOperation(ctx, "rg1", "apimService1", "59d5b28d1f7fab116c282650", "59d5b28d1f7fab116c282651", "59d5b28e1f7fab116402044e", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*TagClient) DetachFromProduct

func (client *TagClient) DetachFromProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientDetachFromProductOptions) (TagClientDetachFromProductResponse, error)

DetachFromProduct - Detach the tag from the Product. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientDetachFromProductOptions contains the optional parameters for the TagClient.DetachFromProduct method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewTagClient().DetachFromProduct(ctx, "rg1", "apimService1", "59d5b28d1f7fab116c282650", "59d5b28e1f7fab116402044e", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*TagClient) Get

func (client *TagClient) Get(ctx context.Context, resourceGroupName string, serviceName string, tagID string, options *TagClientGetOptions) (TagClientGetResponse, error)

Get - Gets the details of the tag specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientGetOptions contains the optional parameters for the TagClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTagClient().Get(ctx, "rg1", "apimService1", "59306a29e4bbd510dc24e5f9", 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.TagContract = armapimanagement.TagContract{
	// 	Name: to.Ptr("59306a29e4bbd510dc24e5f9"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/59306a29e4bbd510dc24e5f9"),
	// 	Properties: &armapimanagement.TagContractProperties{
	// 		DisplayName: to.Ptr("tag1"),
	// 	},
	// }
}
Output:

func (*TagClient) GetByAPI

func (client *TagClient) GetByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientGetByAPIOptions) (TagClientGetByAPIResponse, error)

GetByAPI - Get tag associated with the API. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientGetByAPIOptions contains the optional parameters for the TagClient.GetByAPI method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTagClient().GetByAPI(ctx, "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59306a29e4bbd510dc24e5f9", 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.TagContract = armapimanagement.TagContract{
	// 	Name: to.Ptr("59306a29e4bbd510dc24e5f9"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/59306a29e4bbd510dc24e5f9"),
	// 	Properties: &armapimanagement.TagContractProperties{
	// 		DisplayName: to.Ptr("tag1"),
	// 	},
	// }
}
Output:

func (*TagClient) GetByOperation

func (client *TagClient) GetByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientGetByOperationOptions) (TagClientGetByOperationResponse, error)

GetByOperation - Get tag associated with the Operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientGetByOperationOptions contains the optional parameters for the TagClient.GetByOperation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTagClient().GetByOperation(ctx, "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59d6bb8f1f7fab13dc67ec9a", "59306a29e4bbd510dc24e5f9", 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.TagContract = armapimanagement.TagContract{
	// 	Name: to.Ptr("59306a29e4bbd510dc24e5f9"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/59306a29e4bbd510dc24e5f9"),
	// 	Properties: &armapimanagement.TagContractProperties{
	// 		DisplayName: to.Ptr("tag1"),
	// 	},
	// }
}
Output:

func (*TagClient) GetByProduct

func (client *TagClient) GetByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientGetByProductOptions) (TagClientGetByProductResponse, error)

GetByProduct - Get tag associated with the Product. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientGetByProductOptions contains the optional parameters for the TagClient.GetByProduct method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProductTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTagClient().GetByProduct(ctx, "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59306a29e4bbd510dc24e5f9", 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.TagContract = armapimanagement.TagContract{
	// 	Name: to.Ptr("59306a29e4bbd510dc24e5f9"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/59306a29e4bbd510dc24e5f9"),
	// 	Properties: &armapimanagement.TagContractProperties{
	// 		DisplayName: to.Ptr("tag1"),
	// 	},
	// }
}
Output:

func (*TagClient) GetEntityState

func (client *TagClient) GetEntityState(ctx context.Context, resourceGroupName string, serviceName string, tagID string, options *TagClientGetEntityStateOptions) (TagClientGetEntityStateResponse, error)

GetEntityState - Gets the entity state version of the tag specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientGetEntityStateOptions contains the optional parameters for the TagClient.GetEntityState method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewTagClient().GetEntityState(ctx, "rg1", "apimService1", "59306a29e4bbd510dc24e5f9", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*TagClient) GetEntityStateByAPI

func (client *TagClient) GetEntityStateByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientGetEntityStateByAPIOptions) (TagClientGetEntityStateByAPIResponse, error)

GetEntityStateByAPI - Gets the entity state version of the tag specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientGetEntityStateByAPIOptions contains the optional parameters for the TagClient.GetEntityStateByAPI method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewTagClient().GetEntityStateByAPI(ctx, "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59306a29e4bbd510dc24e5f9", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*TagClient) GetEntityStateByOperation

func (client *TagClient) GetEntityStateByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientGetEntityStateByOperationOptions) (TagClientGetEntityStateByOperationResponse, error)

GetEntityStateByOperation - Gets the entity state version of the tag specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientGetEntityStateByOperationOptions contains the optional parameters for the TagClient.GetEntityStateByOperation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperationTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewTagClient().GetEntityStateByOperation(ctx, "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59d6bb8f1f7fab13dc67ec9a", "59306a29e4bbd510dc24e5f9", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*TagClient) GetEntityStateByProduct

func (client *TagClient) GetEntityStateByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientGetEntityStateByProductOptions) (TagClientGetEntityStateByProductResponse, error)

GetEntityStateByProduct - Gets the entity state version of the tag specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • options - TagClientGetEntityStateByProductOptions contains the optional parameters for the TagClient.GetEntityStateByProduct method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewTagClient().GetEntityStateByProduct(ctx, "rg1", "apimService1", "59306a29e4bbd510dc24e5f8", "59306a29e4bbd510dc24e5f9", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*TagClient) NewListByAPIPager added in v0.5.0

func (client *TagClient) NewListByAPIPager(resourceGroupName string, serviceName string, apiID string, options *TagClientListByAPIOptions) *runtime.Pager[TagClientListByAPIResponse]

NewListByAPIPager - Lists all Tags associated with the API.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • options - TagClientListByAPIOptions contains the optional parameters for the TagClient.NewListByAPIPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiTags.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTagClient().NewListByAPIPager("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", &armapimanagement.TagClientListByAPIOptions{Filter: nil,
		Top:  nil,
		Skip: 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.TagCollection = armapimanagement.TagCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.TagContract{
		// 		{
		// 			Name: to.Ptr("5600b539c53f5b0062060002"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/5600b539c53f5b0062060002"),
		// 			Properties: &armapimanagement.TagContractProperties{
		// 				DisplayName: to.Ptr("tag1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*TagClient) NewListByOperationPager added in v0.5.0

func (client *TagClient) NewListByOperationPager(resourceGroupName string, serviceName string, apiID string, operationID string, options *TagClientListByOperationOptions) *runtime.Pager[TagClientListByOperationResponse]

NewListByOperationPager - Lists all Tags associated with the Operation.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
  • operationID - Operation identifier within an API. Must be unique in the current API Management service instance.
  • options - TagClientListByOperationOptions contains the optional parameters for the TagClient.NewListByOperationPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationTags.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTagClient().NewListByOperationPager("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0888cba3f6", &armapimanagement.TagClientListByOperationOptions{Filter: nil,
		Top:  nil,
		Skip: 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.TagCollection = armapimanagement.TagCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.TagContract{
		// 		{
		// 			Name: to.Ptr("5600b539c53f5b0062060002"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/5600b539c53f5b0062060002"),
		// 			Properties: &armapimanagement.TagContractProperties{
		// 				DisplayName: to.Ptr("tag1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*TagClient) NewListByProductPager added in v0.5.0

func (client *TagClient) NewListByProductPager(resourceGroupName string, serviceName string, productID string, options *TagClientListByProductOptions) *runtime.Pager[TagClientListByProductResponse]

NewListByProductPager - Lists all Tags associated with the Product.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • productID - Product identifier. Must be unique in the current API Management service instance.
  • options - TagClientListByProductOptions contains the optional parameters for the TagClient.NewListByProductPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductTags.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTagClient().NewListByProductPager("rg1", "apimService1", "57d2ef278aa04f0888cba3f1", &armapimanagement.TagClientListByProductOptions{Filter: nil,
		Top:  nil,
		Skip: 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.TagCollection = armapimanagement.TagCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.TagContract{
		// 		{
		// 			Name: to.Ptr("5600b539c53f5b0062060002"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/5600b539c53f5b0062060002"),
		// 			Properties: &armapimanagement.TagContractProperties{
		// 				DisplayName: to.Ptr("tag1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*TagClient) NewListByServicePager added in v0.5.0

func (client *TagClient) NewListByServicePager(resourceGroupName string, serviceName string, options *TagClientListByServiceOptions) *runtime.Pager[TagClientListByServiceResponse]

NewListByServicePager - Lists a collection of tags defined within a service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - TagClientListByServiceOptions contains the optional parameters for the TagClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTags.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTagClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.TagClientListByServiceOptions{Filter: nil,
		Top:   nil,
		Skip:  nil,
		Scope: 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.TagCollection = armapimanagement.TagCollection{
		// 	Count: to.Ptr[int64](2),
		// 	Value: []*armapimanagement.TagContract{
		// 		{
		// 			Name: to.Ptr("5600b59375ff190048020001"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/5600b59375ff190048020001"),
		// 			Properties: &armapimanagement.TagContractProperties{
		// 				DisplayName: to.Ptr("tag1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("5600b59375ff190048020002"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/5600b59375ff190048020002"),
		// 			Properties: &armapimanagement.TagContractProperties{
		// 				DisplayName: to.Ptr("tag2"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*TagClient) Update

func (client *TagClient) Update(ctx context.Context, resourceGroupName string, serviceName string, tagID string, ifMatch string, parameters TagCreateUpdateParameters, options *TagClientUpdateOptions) (TagClientUpdateResponse, error)

Update - Updates the details of the tag specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • tagID - Tag identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - TagClientUpdateOptions contains the optional parameters for the TagClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTag.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTagClient().Update(ctx, "rg1", "apimService1", "temptag", "*", armapimanagement.TagCreateUpdateParameters{
		Properties: &armapimanagement.TagContractProperties{
			DisplayName: to.Ptr("temp tag"),
		},
	}, 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.TagContract = armapimanagement.TagContract{
	// 	Name: to.Ptr("temptag"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tags"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tags/temptag"),
	// 	Properties: &armapimanagement.TagContractProperties{
	// 		DisplayName: to.Ptr("tag1"),
	// 	},
	// }
}
Output:

type TagClientAssignToAPIOptions added in v0.3.0

type TagClientAssignToAPIOptions struct {
}

TagClientAssignToAPIOptions contains the optional parameters for the TagClient.AssignToAPI method.

type TagClientAssignToAPIResponse added in v0.3.0

type TagClientAssignToAPIResponse struct {
	TagContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TagClientAssignToAPIResponse contains the response from method TagClient.AssignToAPI.

type TagClientAssignToOperationOptions added in v0.3.0

type TagClientAssignToOperationOptions struct {
}

TagClientAssignToOperationOptions contains the optional parameters for the TagClient.AssignToOperation method.

type TagClientAssignToOperationResponse added in v0.3.0

type TagClientAssignToOperationResponse struct {
	TagContract
}

TagClientAssignToOperationResponse contains the response from method TagClient.AssignToOperation.

type TagClientAssignToProductOptions added in v0.3.0

type TagClientAssignToProductOptions struct {
}

TagClientAssignToProductOptions contains the optional parameters for the TagClient.AssignToProduct method.

type TagClientAssignToProductResponse added in v0.3.0

type TagClientAssignToProductResponse struct {
	TagContract
}

TagClientAssignToProductResponse contains the response from method TagClient.AssignToProduct.

type TagClientCreateOrUpdateOptions added in v0.3.0

type TagClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
}

TagClientCreateOrUpdateOptions contains the optional parameters for the TagClient.CreateOrUpdate method.

type TagClientCreateOrUpdateResponse added in v0.3.0

type TagClientCreateOrUpdateResponse struct {
	TagContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TagClientCreateOrUpdateResponse contains the response from method TagClient.CreateOrUpdate.

type TagClientDeleteOptions added in v0.3.0

type TagClientDeleteOptions struct {
}

TagClientDeleteOptions contains the optional parameters for the TagClient.Delete method.

type TagClientDeleteResponse added in v0.3.0

type TagClientDeleteResponse struct {
}

TagClientDeleteResponse contains the response from method TagClient.Delete.

type TagClientDetachFromAPIOptions added in v0.3.0

type TagClientDetachFromAPIOptions struct {
}

TagClientDetachFromAPIOptions contains the optional parameters for the TagClient.DetachFromAPI method.

type TagClientDetachFromAPIResponse added in v0.3.0

type TagClientDetachFromAPIResponse struct {
}

TagClientDetachFromAPIResponse contains the response from method TagClient.DetachFromAPI.

type TagClientDetachFromOperationOptions added in v0.3.0

type TagClientDetachFromOperationOptions struct {
}

TagClientDetachFromOperationOptions contains the optional parameters for the TagClient.DetachFromOperation method.

type TagClientDetachFromOperationResponse added in v0.3.0

type TagClientDetachFromOperationResponse struct {
}

TagClientDetachFromOperationResponse contains the response from method TagClient.DetachFromOperation.

type TagClientDetachFromProductOptions added in v0.3.0

type TagClientDetachFromProductOptions struct {
}

TagClientDetachFromProductOptions contains the optional parameters for the TagClient.DetachFromProduct method.

type TagClientDetachFromProductResponse added in v0.3.0

type TagClientDetachFromProductResponse struct {
}

TagClientDetachFromProductResponse contains the response from method TagClient.DetachFromProduct.

type TagClientGetByAPIOptions added in v0.3.0

type TagClientGetByAPIOptions struct {
}

TagClientGetByAPIOptions contains the optional parameters for the TagClient.GetByAPI method.

type TagClientGetByAPIResponse added in v0.3.0

type TagClientGetByAPIResponse struct {
	TagContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TagClientGetByAPIResponse contains the response from method TagClient.GetByAPI.

type TagClientGetByOperationOptions added in v0.3.0

type TagClientGetByOperationOptions struct {
}

TagClientGetByOperationOptions contains the optional parameters for the TagClient.GetByOperation method.

type TagClientGetByOperationResponse added in v0.3.0

type TagClientGetByOperationResponse struct {
	TagContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TagClientGetByOperationResponse contains the response from method TagClient.GetByOperation.

type TagClientGetByProductOptions added in v0.3.0

type TagClientGetByProductOptions struct {
}

TagClientGetByProductOptions contains the optional parameters for the TagClient.GetByProduct method.

type TagClientGetByProductResponse added in v0.3.0

type TagClientGetByProductResponse struct {
	TagContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TagClientGetByProductResponse contains the response from method TagClient.GetByProduct.

type TagClientGetEntityStateByAPIOptions added in v0.3.0

type TagClientGetEntityStateByAPIOptions struct {
}

TagClientGetEntityStateByAPIOptions contains the optional parameters for the TagClient.GetEntityStateByAPI method.

type TagClientGetEntityStateByAPIResponse added in v0.3.0

type TagClientGetEntityStateByAPIResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

TagClientGetEntityStateByAPIResponse contains the response from method TagClient.GetEntityStateByAPI.

type TagClientGetEntityStateByOperationOptions added in v0.3.0

type TagClientGetEntityStateByOperationOptions struct {
}

TagClientGetEntityStateByOperationOptions contains the optional parameters for the TagClient.GetEntityStateByOperation method.

type TagClientGetEntityStateByOperationResponse added in v0.3.0

type TagClientGetEntityStateByOperationResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

TagClientGetEntityStateByOperationResponse contains the response from method TagClient.GetEntityStateByOperation.

type TagClientGetEntityStateByProductOptions added in v0.3.0

type TagClientGetEntityStateByProductOptions struct {
}

TagClientGetEntityStateByProductOptions contains the optional parameters for the TagClient.GetEntityStateByProduct method.

type TagClientGetEntityStateByProductResponse added in v0.3.0

type TagClientGetEntityStateByProductResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

TagClientGetEntityStateByProductResponse contains the response from method TagClient.GetEntityStateByProduct.

type TagClientGetEntityStateOptions added in v0.3.0

type TagClientGetEntityStateOptions struct {
}

TagClientGetEntityStateOptions contains the optional parameters for the TagClient.GetEntityState method.

type TagClientGetEntityStateResponse added in v0.3.0

type TagClientGetEntityStateResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

TagClientGetEntityStateResponse contains the response from method TagClient.GetEntityState.

type TagClientGetOptions added in v0.3.0

type TagClientGetOptions struct {
}

TagClientGetOptions contains the optional parameters for the TagClient.Get method.

type TagClientGetResponse added in v0.3.0

type TagClientGetResponse struct {
	TagContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TagClientGetResponse contains the response from method TagClient.Get.

type TagClientListByAPIOptions added in v0.3.0

type TagClientListByAPIOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

TagClientListByAPIOptions contains the optional parameters for the TagClient.NewListByAPIPager method.

type TagClientListByAPIResponse added in v0.3.0

type TagClientListByAPIResponse struct {
	TagCollection
}

TagClientListByAPIResponse contains the response from method TagClient.NewListByAPIPager.

type TagClientListByOperationOptions added in v0.3.0

type TagClientListByOperationOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

TagClientListByOperationOptions contains the optional parameters for the TagClient.NewListByOperationPager method.

type TagClientListByOperationResponse added in v0.3.0

type TagClientListByOperationResponse struct {
	TagCollection
}

TagClientListByOperationResponse contains the response from method TagClient.NewListByOperationPager.

type TagClientListByProductOptions added in v0.3.0

type TagClientListByProductOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

TagClientListByProductOptions contains the optional parameters for the TagClient.NewListByProductPager method.

type TagClientListByProductResponse added in v0.3.0

type TagClientListByProductResponse struct {
	TagCollection
}

TagClientListByProductResponse contains the response from method TagClient.NewListByProductPager.

type TagClientListByServiceOptions added in v0.3.0

type TagClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Scope like 'apis', 'products' or 'apis/{apiId}
	Scope *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

TagClientListByServiceOptions contains the optional parameters for the TagClient.NewListByServicePager method.

type TagClientListByServiceResponse added in v0.3.0

type TagClientListByServiceResponse struct {
	TagCollection
}

TagClientListByServiceResponse contains the response from method TagClient.NewListByServicePager.

type TagClientUpdateOptions added in v0.3.0

type TagClientUpdateOptions struct {
}

TagClientUpdateOptions contains the optional parameters for the TagClient.Update method.

type TagClientUpdateResponse added in v0.3.0

type TagClientUpdateResponse struct {
	TagContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TagClientUpdateResponse contains the response from method TagClient.Update.

type TagCollection

type TagCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*TagContract
}

TagCollection - Paged Tag list representation.

func (TagCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TagCollection.

func (*TagCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagCollection.

type TagContract

type TagContract struct {
	// Tag entity contract properties.
	Properties *TagContractProperties

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

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

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

TagContract - Tag Contract details.

func (TagContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TagContract.

func (*TagContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagContract.

type TagContractProperties

type TagContractProperties struct {
	// REQUIRED; Tag name.
	DisplayName *string
}

TagContractProperties - Tag contract Properties.

func (TagContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type TagContractProperties.

func (*TagContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagContractProperties.

type TagCreateUpdateParameters

type TagCreateUpdateParameters struct {
	// Properties supplied to Create Tag operation.
	Properties *TagContractProperties
}

TagCreateUpdateParameters - Parameters supplied to Create/Update Tag operations.

func (TagCreateUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TagCreateUpdateParameters.

func (*TagCreateUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagCreateUpdateParameters.

type TagDescriptionBaseProperties

type TagDescriptionBaseProperties struct {
	// Description of the Tag.
	Description *string

	// Description of the external resources describing the tag.
	ExternalDocsDescription *string

	// Absolute URL of external resources describing the tag.
	ExternalDocsURL *string
}

TagDescriptionBaseProperties - Parameters supplied to the Create TagDescription operation.

func (TagDescriptionBaseProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type TagDescriptionBaseProperties.

func (*TagDescriptionBaseProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagDescriptionBaseProperties.

type TagDescriptionCollection

type TagDescriptionCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*TagDescriptionContract
}

TagDescriptionCollection - Paged TagDescription list representation.

func (TagDescriptionCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TagDescriptionCollection.

func (*TagDescriptionCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagDescriptionCollection.

type TagDescriptionContract

type TagDescriptionContract struct {
	// TagDescription entity contract properties.
	Properties *TagDescriptionContractProperties

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

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

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

TagDescriptionContract - Contract details.

func (TagDescriptionContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TagDescriptionContract.

func (*TagDescriptionContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagDescriptionContract.

type TagDescriptionContractProperties

type TagDescriptionContractProperties struct {
	// Description of the Tag.
	Description *string

	// Tag name.
	DisplayName *string

	// Description of the external resources describing the tag.
	ExternalDocsDescription *string

	// Absolute URL of external resources describing the tag.
	ExternalDocsURL *string

	// Identifier of the tag in the form of /tags/{tagId}
	TagID *string
}

TagDescriptionContractProperties - TagDescription contract Properties.

func (TagDescriptionContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type TagDescriptionContractProperties.

func (*TagDescriptionContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagDescriptionContractProperties.

type TagDescriptionCreateParameters

type TagDescriptionCreateParameters struct {
	// Properties supplied to Create TagDescription operation.
	Properties *TagDescriptionBaseProperties
}

TagDescriptionCreateParameters - Parameters supplied to the Create TagDescription operation.

func (TagDescriptionCreateParameters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type TagDescriptionCreateParameters.

func (*TagDescriptionCreateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagDescriptionCreateParameters.

type TagResourceClient

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

TagResourceClient contains the methods for the TagResource group. Don't use this type directly, use NewTagResourceClient() instead.

func NewTagResourceClient

func NewTagResourceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TagResourceClient, error)

NewTagResourceClient creates a new instance of TagResourceClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*TagResourceClient) NewListByServicePager added in v0.5.0

func (client *TagResourceClient) NewListByServicePager(resourceGroupName string, serviceName string, options *TagResourceClientListByServiceOptions) *runtime.Pager[TagResourceClientListByServiceResponse]

NewListByServicePager - Lists a collection of resources associated with tags.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - TagResourceClientListByServiceOptions contains the optional parameters for the TagResourceClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTagResources.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTagResourceClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.TagResourceClientListByServiceOptions{Filter: nil,
		Top:  nil,
		Skip: 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.TagResourceCollection = armapimanagement.TagResourceCollection{
		// 	Value: []*armapimanagement.TagResourceContract{
		// 		{
		// 			Operation: &armapimanagement.OperationTagResourceContractProperties{
		// 				Name: to.Ptr("Create resource"),
		// 				Method: to.Ptr("POST"),
		// 				Description: to.Ptr("A demonstration of a POST call based on the echo backend above. The request body is expected to contain JSON-formatted data (see example below). A policy is used to automatically transform any request sent in JSON directly to XML. In a real-world scenario this could be used to enable modern clients to speak to a legacy backend."),
		// 				APIName: to.Ptr("Echo API"),
		// 				APIRevision: to.Ptr("1"),
		// 				ID: to.Ptr("/apis/echo-api/operations/create-resource"),
		// 				URLTemplate: to.Ptr("/resource"),
		// 			},
		// 			Tag: &armapimanagement.TagResourceContractProperties{
		// 				Name: to.Ptr("awesomeTag"),
		// 				ID: to.Ptr("/tags/apitag123"),
		// 			},
		// 		},
		// 		{
		// 			API: &armapimanagement.APITagResourceContractProperties{
		// 				APIRevision: to.Ptr("1"),
		// 				IsCurrent: to.Ptr(true),
		// 				Name: to.Ptr("Echo API"),
		// 				Path: to.Ptr("echo"),
		// 				ID: to.Ptr("/apis/echo-api"),
		// 				ServiceURL: to.Ptr("http://echoapi.cloudapp.net/api"),
		// 			},
		// 			Tag: &armapimanagement.TagResourceContractProperties{
		// 				Name: to.Ptr("awesomeTag"),
		// 				ID: to.Ptr("/tags/apitag123"),
		// 			},
		// 		},
		// 		{
		// 			Product: &armapimanagement.ProductTagResourceContractProperties{
		// 				Description: to.Ptr("Subscribers will be able to run 5 calls/minute up to a maximum of 100 calls/week."),
		// 				ApprovalRequired: to.Ptr(false),
		// 				State: to.Ptr(armapimanagement.ProductStatePublished),
		// 				SubscriptionRequired: to.Ptr(true),
		// 				SubscriptionsLimit: to.Ptr[int32](1),
		// 				Terms: to.Ptr(""),
		// 				Name: to.Ptr("Starter"),
		// 				ID: to.Ptr("/products/starter"),
		// 			},
		// 			Tag: &armapimanagement.TagResourceContractProperties{
		// 				Name: to.Ptr("awesomeTag"),
		// 				ID: to.Ptr("/tags/apitag123"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type TagResourceClientListByServiceOptions added in v0.3.0

type TagResourceClientListByServiceOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | aid | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | state | filter | eq | |
	// | isCurrent | filter | eq | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

TagResourceClientListByServiceOptions contains the optional parameters for the TagResourceClient.NewListByServicePager method.

type TagResourceClientListByServiceResponse added in v0.3.0

type TagResourceClientListByServiceResponse struct {
	TagResourceCollection
}

TagResourceClientListByServiceResponse contains the response from method TagResourceClient.NewListByServicePager.

type TagResourceCollection

type TagResourceCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*TagResourceContract
}

TagResourceCollection - Paged Tag list representation.

func (TagResourceCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TagResourceCollection.

func (*TagResourceCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagResourceCollection.

type TagResourceContract

type TagResourceContract struct {
	// REQUIRED; Tag associated with the resource.
	Tag *TagResourceContractProperties

	// API associated with the tag.
	API *APITagResourceContractProperties

	// Operation associated with the tag.
	Operation *OperationTagResourceContractProperties

	// Product associated with the tag.
	Product *ProductTagResourceContractProperties
}

TagResourceContract - TagResource contract properties.

func (TagResourceContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type TagResourceContract.

func (*TagResourceContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagResourceContract.

type TagResourceContractProperties

type TagResourceContractProperties struct {
	// Tag identifier
	ID *string

	// Tag Name
	Name *string
}

TagResourceContractProperties - Contract defining the Tag property in the Tag Resource Contract

func (TagResourceContractProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type TagResourceContractProperties.

func (*TagResourceContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TagResourceContractProperties.

type TemplateName

type TemplateName string
const (
	TemplateNameAccountClosedDeveloper                            TemplateName = "accountClosedDeveloper"
	TemplateNameApplicationApprovedNotificationMessage            TemplateName = "applicationApprovedNotificationMessage"
	TemplateNameConfirmSignUpIdentityDefault                      TemplateName = "confirmSignUpIdentityDefault"
	TemplateNameEmailChangeIdentityDefault                        TemplateName = "emailChangeIdentityDefault"
	TemplateNameInviteUserNotificationMessage                     TemplateName = "inviteUserNotificationMessage"
	TemplateNameNewCommentNotificationMessage                     TemplateName = "newCommentNotificationMessage"
	TemplateNameNewDeveloperNotificationMessage                   TemplateName = "newDeveloperNotificationMessage"
	TemplateNameNewIssueNotificationMessage                       TemplateName = "newIssueNotificationMessage"
	TemplateNamePasswordResetByAdminNotificationMessage           TemplateName = "passwordResetByAdminNotificationMessage"
	TemplateNamePasswordResetIdentityDefault                      TemplateName = "passwordResetIdentityDefault"
	TemplateNamePurchaseDeveloperNotificationMessage              TemplateName = "purchaseDeveloperNotificationMessage"
	TemplateNameQuotaLimitApproachingDeveloperNotificationMessage TemplateName = "quotaLimitApproachingDeveloperNotificationMessage"
	TemplateNameRejectDeveloperNotificationMessage                TemplateName = "rejectDeveloperNotificationMessage"
	TemplateNameRequestDeveloperNotificationMessage               TemplateName = "requestDeveloperNotificationMessage"
)

func PossibleTemplateNameValues

func PossibleTemplateNameValues() []TemplateName

PossibleTemplateNameValues returns the possible values for the TemplateName const type.

type TenantAccessClient

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

TenantAccessClient contains the methods for the TenantAccess group. Don't use this type directly, use NewTenantAccessClient() instead.

func NewTenantAccessClient

func NewTenantAccessClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantAccessClient, error)

NewTenantAccessClient creates a new instance of TenantAccessClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*TenantAccessClient) Create

func (client *TenantAccessClient) Create(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, ifMatch string, parameters AccessInformationCreateParameters, options *TenantAccessClientCreateOptions) (TenantAccessClientCreateResponse, error)

Create - Update tenant access information details. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • accessName - The identifier of the Access configuration.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Parameters supplied to retrieve the Tenant Access Information.
  • options - TenantAccessClientCreateOptions contains the optional parameters for the TenantAccessClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTenantAccess.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTenantAccessClient().Create(ctx, "rg1", "apimService1", armapimanagement.AccessIDNameAccess, "*", armapimanagement.AccessInformationCreateParameters{
		Properties: &armapimanagement.AccessInformationCreateParameterProperties{
			Enabled: to.Ptr(true),
		},
	}, 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.AccessInformationContract = armapimanagement.AccessInformationContract{
	// 	Name: to.Ptr("access"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tenant"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/access"),
	// 	Properties: &armapimanagement.AccessInformationContractProperties{
	// 		Enabled: to.Ptr(true),
	// 	},
	// }
}
Output:

func (*TenantAccessClient) Get

func (client *TenantAccessClient) Get(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientGetOptions) (TenantAccessClientGetResponse, error)

Get - Get tenant access information details without secrets. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • accessName - The identifier of the Access configuration.
  • options - TenantAccessClientGetOptions contains the optional parameters for the TenantAccessClient.Get method.
Example (ApiManagementGetTenantAccess)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantAccess.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTenantAccessClient().Get(ctx, "rg1", "apimService1", armapimanagement.AccessIDNameAccess, 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.AccessInformationContract = armapimanagement.AccessInformationContract{
	// 	Name: to.Ptr("access"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tenant"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/access"),
	// 	Properties: &armapimanagement.AccessInformationContractProperties{
	// 		Enabled: to.Ptr(true),
	// 	},
	// }
}
Output:

Example (ApiManagementGetTenantGitAccess)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantGitAccess.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTenantAccessClient().Get(ctx, "rg1", "apimService1", armapimanagement.AccessIDNameGitAccess, 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.AccessInformationContract = armapimanagement.AccessInformationContract{
	// 	Name: to.Ptr("gitAccess"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tenant"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/gitAccess"),
	// 	Properties: &armapimanagement.AccessInformationContractProperties{
	// 		Enabled: to.Ptr(true),
	// 		PrincipalID: to.Ptr("git"),
	// 	},
	// }
}
Output:

func (*TenantAccessClient) GetEntityTag

func (client *TenantAccessClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientGetEntityTagOptions) (TenantAccessClientGetEntityTagResponse, error)

GetEntityTag - Tenant access metadata

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • accessName - The identifier of the Access configuration.
  • options - TenantAccessClientGetEntityTagOptions contains the optional parameters for the TenantAccessClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadTenantAccess.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewTenantAccessClient().GetEntityTag(ctx, "rg1", "apimService1", armapimanagement.AccessIDNameAccess, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*TenantAccessClient) ListSecrets

func (client *TenantAccessClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientListSecretsOptions) (TenantAccessClientListSecretsResponse, error)

ListSecrets - Get tenant access information details. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • accessName - The identifier of the Access configuration.
  • options - TenantAccessClientListSecretsOptions contains the optional parameters for the TenantAccessClient.ListSecrets method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSecretsTenantAccess.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTenantAccessClient().ListSecrets(ctx, "rg1", "apimService1", armapimanagement.AccessIDNameAccess, 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.AccessInformationSecretsContract = armapimanagement.AccessInformationSecretsContract{
	// 	Enabled: to.Ptr(true),
	// 	ID: to.Ptr("5600b59375ff190048030003"),
	// 	PrimaryKey: to.Ptr("<primaryKey>"),
	// 	SecondaryKey: to.Ptr("<secondaryKey>"),
	// }
}
Output:

func (*TenantAccessClient) NewListByServicePager added in v0.5.0

func (client *TenantAccessClient) NewListByServicePager(resourceGroupName string, serviceName string, options *TenantAccessClientListByServiceOptions) *runtime.Pager[TenantAccessClientListByServiceResponse]

NewListByServicePager - Returns list of access infos - for Git and Management endpoints.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - TenantAccessClientListByServiceOptions contains the optional parameters for the TenantAccessClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTenantAccess.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTenantAccessClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.TenantAccessClientListByServiceOptions{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.AccessInformationCollection = armapimanagement.AccessInformationCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.AccessInformationContract{
		// 		{
		// 			Name: to.Ptr("access"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/tenant"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/access"),
		// 			Properties: &armapimanagement.AccessInformationContractProperties{
		// 				Enabled: to.Ptr(true),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*TenantAccessClient) RegeneratePrimaryKey

func (client *TenantAccessClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientRegeneratePrimaryKeyOptions) (TenantAccessClientRegeneratePrimaryKeyResponse, error)

RegeneratePrimaryKey - Regenerate primary access key If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • accessName - The identifier of the Access configuration.
  • options - TenantAccessClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessClient.RegeneratePrimaryKey method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewTenantAccessClient().RegeneratePrimaryKey(ctx, "rg1", "apimService1", armapimanagement.AccessIDNameAccess, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*TenantAccessClient) RegenerateSecondaryKey

func (client *TenantAccessClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientRegenerateSecondaryKeyOptions) (TenantAccessClientRegenerateSecondaryKeyResponse, error)

RegenerateSecondaryKey - Regenerate secondary access key If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • accessName - The identifier of the Access configuration.
  • options - TenantAccessClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessClient.RegenerateSecondaryKey method.

func (*TenantAccessClient) Update

func (client *TenantAccessClient) Update(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, ifMatch string, parameters AccessInformationUpdateParameters, options *TenantAccessClientUpdateOptions) (TenantAccessClientUpdateResponse, error)

Update - Update tenant access information details. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • accessName - The identifier of the Access configuration.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Parameters supplied to retrieve the Tenant Access Information.
  • options - TenantAccessClientUpdateOptions contains the optional parameters for the TenantAccessClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTenantAccess.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTenantAccessClient().Update(ctx, "rg1", "apimService1", armapimanagement.AccessIDNameAccess, "*", armapimanagement.AccessInformationUpdateParameters{
		Properties: &armapimanagement.AccessInformationUpdateParameterProperties{
			Enabled: to.Ptr(true),
		},
	}, 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.AccessInformationContract = armapimanagement.AccessInformationContract{
	// 	Name: to.Ptr("access"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tenant"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/access"),
	// 	Properties: &armapimanagement.AccessInformationContractProperties{
	// 		Enabled: to.Ptr(true),
	// 	},
	// }
}
Output:

type TenantAccessClientCreateOptions added in v0.3.0

type TenantAccessClientCreateOptions struct {
}

TenantAccessClientCreateOptions contains the optional parameters for the TenantAccessClient.Create method.

type TenantAccessClientCreateResponse added in v0.3.0

type TenantAccessClientCreateResponse struct {
	AccessInformationContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TenantAccessClientCreateResponse contains the response from method TenantAccessClient.Create.

type TenantAccessClientGetEntityTagOptions added in v0.3.0

type TenantAccessClientGetEntityTagOptions struct {
}

TenantAccessClientGetEntityTagOptions contains the optional parameters for the TenantAccessClient.GetEntityTag method.

type TenantAccessClientGetEntityTagResponse added in v0.3.0

type TenantAccessClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

TenantAccessClientGetEntityTagResponse contains the response from method TenantAccessClient.GetEntityTag.

type TenantAccessClientGetOptions added in v0.3.0

type TenantAccessClientGetOptions struct {
}

TenantAccessClientGetOptions contains the optional parameters for the TenantAccessClient.Get method.

type TenantAccessClientGetResponse added in v0.3.0

type TenantAccessClientGetResponse struct {
	AccessInformationContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TenantAccessClientGetResponse contains the response from method TenantAccessClient.Get.

type TenantAccessClientListByServiceOptions added in v0.3.0

type TenantAccessClientListByServiceOptions struct {
	// Not used
	Filter *string
}

TenantAccessClientListByServiceOptions contains the optional parameters for the TenantAccessClient.NewListByServicePager method.

type TenantAccessClientListByServiceResponse added in v0.3.0

type TenantAccessClientListByServiceResponse struct {
	AccessInformationCollection
}

TenantAccessClientListByServiceResponse contains the response from method TenantAccessClient.NewListByServicePager.

type TenantAccessClientListSecretsOptions added in v0.3.0

type TenantAccessClientListSecretsOptions struct {
}

TenantAccessClientListSecretsOptions contains the optional parameters for the TenantAccessClient.ListSecrets method.

type TenantAccessClientListSecretsResponse added in v0.3.0

type TenantAccessClientListSecretsResponse struct {
	AccessInformationSecretsContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TenantAccessClientListSecretsResponse contains the response from method TenantAccessClient.ListSecrets.

type TenantAccessClientRegeneratePrimaryKeyOptions added in v0.3.0

type TenantAccessClientRegeneratePrimaryKeyOptions struct {
}

TenantAccessClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessClient.RegeneratePrimaryKey method.

type TenantAccessClientRegeneratePrimaryKeyResponse added in v0.3.0

type TenantAccessClientRegeneratePrimaryKeyResponse struct {
}

TenantAccessClientRegeneratePrimaryKeyResponse contains the response from method TenantAccessClient.RegeneratePrimaryKey.

type TenantAccessClientRegenerateSecondaryKeyOptions added in v0.3.0

type TenantAccessClientRegenerateSecondaryKeyOptions struct {
}

TenantAccessClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessClient.RegenerateSecondaryKey method.

type TenantAccessClientRegenerateSecondaryKeyResponse added in v0.3.0

type TenantAccessClientRegenerateSecondaryKeyResponse struct {
}

TenantAccessClientRegenerateSecondaryKeyResponse contains the response from method TenantAccessClient.RegenerateSecondaryKey.

type TenantAccessClientUpdateOptions added in v0.3.0

type TenantAccessClientUpdateOptions struct {
}

TenantAccessClientUpdateOptions contains the optional parameters for the TenantAccessClient.Update method.

type TenantAccessClientUpdateResponse added in v0.3.0

type TenantAccessClientUpdateResponse struct {
	AccessInformationContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TenantAccessClientUpdateResponse contains the response from method TenantAccessClient.Update.

type TenantAccessGitClient

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

TenantAccessGitClient contains the methods for the TenantAccessGit group. Don't use this type directly, use NewTenantAccessGitClient() instead.

func NewTenantAccessGitClient

func NewTenantAccessGitClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantAccessGitClient, error)

NewTenantAccessGitClient creates a new instance of TenantAccessGitClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*TenantAccessGitClient) RegeneratePrimaryKey

func (client *TenantAccessGitClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessGitClientRegeneratePrimaryKeyOptions) (TenantAccessGitClientRegeneratePrimaryKeyResponse, error)

RegeneratePrimaryKey - Regenerate primary access key for GIT. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • accessName - The identifier of the Access configuration.
  • options - TenantAccessGitClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegeneratePrimaryKey method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewTenantAccessGitClient().RegeneratePrimaryKey(ctx, "rg1", "apimService1", armapimanagement.AccessIDNameAccess, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*TenantAccessGitClient) RegenerateSecondaryKey

func (client *TenantAccessGitClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessGitClientRegenerateSecondaryKeyOptions) (TenantAccessGitClientRegenerateSecondaryKeyResponse, error)

RegenerateSecondaryKey - Regenerate secondary access key for GIT. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • accessName - The identifier of the Access configuration.
  • options - TenantAccessGitClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegenerateSecondaryKey method.

type TenantAccessGitClientRegeneratePrimaryKeyOptions added in v0.3.0

type TenantAccessGitClientRegeneratePrimaryKeyOptions struct {
}

TenantAccessGitClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegeneratePrimaryKey method.

type TenantAccessGitClientRegeneratePrimaryKeyResponse added in v0.3.0

type TenantAccessGitClientRegeneratePrimaryKeyResponse struct {
}

TenantAccessGitClientRegeneratePrimaryKeyResponse contains the response from method TenantAccessGitClient.RegeneratePrimaryKey.

type TenantAccessGitClientRegenerateSecondaryKeyOptions added in v0.3.0

type TenantAccessGitClientRegenerateSecondaryKeyOptions struct {
}

TenantAccessGitClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegenerateSecondaryKey method.

type TenantAccessGitClientRegenerateSecondaryKeyResponse added in v0.3.0

type TenantAccessGitClientRegenerateSecondaryKeyResponse struct {
}

TenantAccessGitClientRegenerateSecondaryKeyResponse contains the response from method TenantAccessGitClient.RegenerateSecondaryKey.

type TenantConfigurationClient

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

TenantConfigurationClient contains the methods for the TenantConfiguration group. Don't use this type directly, use NewTenantConfigurationClient() instead.

func NewTenantConfigurationClient

func NewTenantConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantConfigurationClient, error)

NewTenantConfigurationClient creates a new instance of TenantConfigurationClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*TenantConfigurationClient) BeginDeploy

BeginDeploy - This operation applies changes from the specified Git branch to the configuration database. This is a long running operation and could take several minutes to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • configurationName - The identifier of the Git Configuration Operation.
  • parameters - Deploy Configuration parameters.
  • options - TenantConfigurationClientBeginDeployOptions contains the optional parameters for the TenantConfigurationClient.BeginDeploy method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationDeploy.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTenantConfigurationClient().BeginDeploy(ctx, "rg1", "apimService1", armapimanagement.ConfigurationIDNameConfiguration, armapimanagement.DeployConfigurationParameters{
		Properties: &armapimanagement.DeployConfigurationParameterProperties{
			Branch: to.Ptr("master"),
		},
	}, 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.OperationResultContract = armapimanagement.OperationResultContract{
	// 	Name: to.Ptr("6074e652093a9d0dac3d733c"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tenant/operationResults"),
	// 	ID: to.Ptr("6074e652093a9d0dac3d733c"),
	// 	Properties: &armapimanagement.OperationResultContractProperties{
	// 		Error: &armapimanagement.ErrorResponseBody{
	// 			Code: to.Ptr("ValidationError"),
	// 			Message: to.Ptr("File not found: 'api-management/configuration.json'"),
	// 		},
	// 		Started: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-26T17:06:54.303Z"); return t}()),
	// 		Status: to.Ptr(armapimanagement.AsyncOperationStatusFailed),
	// 		Updated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-26T17:07:21.777Z"); return t}()),
	// 	},
	// }
}
Output:

func (*TenantConfigurationClient) BeginSave

BeginSave - This operation creates a commit with the current configuration snapshot to the specified branch in the repository. This is a long running operation and could take several minutes to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • configurationName - The identifier of the Git Configuration Operation.
  • parameters - Save Configuration parameters.
  • options - TenantConfigurationClientBeginSaveOptions contains the optional parameters for the TenantConfigurationClient.BeginSave method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationSave.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTenantConfigurationClient().BeginSave(ctx, "rg1", "apimService1", armapimanagement.ConfigurationIDNameConfiguration, armapimanagement.SaveConfigurationParameter{
		Properties: &armapimanagement.SaveConfigurationParameterProperties{
			Branch: to.Ptr("master"),
		},
	}, 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.OperationResultContract = armapimanagement.OperationResultContract{
	// 	Name: to.Ptr("6074e652093a9d0dac3d733c"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tenant/operationResults"),
	// 	ID: to.Ptr("6074e652093a9d0dac3d733c"),
	// 	Properties: &armapimanagement.OperationResultContractProperties{
	// 		ActionLog: []*armapimanagement.OperationResultLogItemContract{
	// 		},
	// 		ResultInfo: to.Ptr("The configuration was successfully saved to master as commit c0ae274f6046912107bad734834cbf65918668b6."),
	// 		Started: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-13T00:31:14.94Z"); return t}()),
	// 		Status: to.Ptr(armapimanagement.AsyncOperationStatusSucceeded),
	// 		Updated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-13T00:31:27.59Z"); return t}()),
	// 	},
	// }
}
Output:

func (*TenantConfigurationClient) BeginValidate

BeginValidate - This operation validates the changes in the specified Git branch. This is a long running operation and could take several minutes to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • configurationName - The identifier of the Git Configuration Operation.
  • parameters - Validate Configuration parameters.
  • options - TenantConfigurationClientBeginValidateOptions contains the optional parameters for the TenantConfigurationClient.BeginValidate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationValidate.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTenantConfigurationClient().BeginValidate(ctx, "rg1", "apimService1", armapimanagement.ConfigurationIDNameConfiguration, armapimanagement.DeployConfigurationParameters{
		Properties: &armapimanagement.DeployConfigurationParameterProperties{
			Branch: to.Ptr("master"),
		},
	}, 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.OperationResultContract = armapimanagement.OperationResultContract{
	// 	Name: to.Ptr("6074ec02093a9d0dac3d7345"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tenant/operationResults"),
	// 	ID: to.Ptr("6074ec02093a9d0dac3d7345"),
	// 	Properties: &armapimanagement.OperationResultContractProperties{
	// 		ActionLog: []*armapimanagement.OperationResultLogItemContract{
	// 		},
	// 		ResultInfo: to.Ptr("Validation is successfull"),
	// 		Started: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-13T00:55:30.62Z"); return t}()),
	// 		Status: to.Ptr(armapimanagement.AsyncOperationStatusSucceeded),
	// 		Updated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-13T00:55:39.857Z"); return t}()),
	// 	},
	// }
}
Output:

func (*TenantConfigurationClient) GetSyncState

GetSyncState - Gets the status of the most recent synchronization between the configuration database and the Git repository. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • configurationName - The identifier of the Git Configuration Operation.
  • options - TenantConfigurationClientGetSyncStateOptions contains the optional parameters for the TenantConfigurationClient.GetSyncState method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessSyncState.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTenantConfigurationClient().GetSyncState(ctx, "rg1", "apimService1", armapimanagement.ConfigurationIDNameConfiguration, 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.TenantConfigurationSyncStateContract = armapimanagement.TenantConfigurationSyncStateContract{
	// 	Name: to.Ptr("syncState"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/tenant/syncState"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/configuration/syncState"),
	// 	Properties: &armapimanagement.TenantConfigurationSyncStateContractProperties{
	// 		Branch: to.Ptr("master"),
	// 		CommitID: to.Ptr("de891c2342c7058dde45e5e624eae7e558c94683"),
	// 		ConfigurationChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-13T00:11:43.862781Z"); return t}()),
	// 		IsExport: to.Ptr(true),
	// 		IsGitEnabled: to.Ptr(true),
	// 		IsSynced: to.Ptr(true),
	// 		LastOperationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/configuration/operationResults/6074f0bd093a9d0dac3d7347"),
	// 		SyncDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-13T01:15:53.9824995Z"); return t}()),
	// 	},
	// }
}
Output:

type TenantConfigurationClientBeginDeployOptions added in v0.3.0

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

TenantConfigurationClientBeginDeployOptions contains the optional parameters for the TenantConfigurationClient.BeginDeploy method.

type TenantConfigurationClientBeginSaveOptions added in v0.3.0

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

TenantConfigurationClientBeginSaveOptions contains the optional parameters for the TenantConfigurationClient.BeginSave method.

type TenantConfigurationClientBeginValidateOptions added in v0.3.0

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

TenantConfigurationClientBeginValidateOptions contains the optional parameters for the TenantConfigurationClient.BeginValidate method.

type TenantConfigurationClientDeployResponse added in v0.3.0

type TenantConfigurationClientDeployResponse struct {
	OperationResultContract
}

TenantConfigurationClientDeployResponse contains the response from method TenantConfigurationClient.BeginDeploy.

type TenantConfigurationClientGetSyncStateOptions added in v0.3.0

type TenantConfigurationClientGetSyncStateOptions struct {
}

TenantConfigurationClientGetSyncStateOptions contains the optional parameters for the TenantConfigurationClient.GetSyncState method.

type TenantConfigurationClientGetSyncStateResponse added in v0.3.0

type TenantConfigurationClientGetSyncStateResponse struct {
	TenantConfigurationSyncStateContract
}

TenantConfigurationClientGetSyncStateResponse contains the response from method TenantConfigurationClient.GetSyncState.

type TenantConfigurationClientSaveResponse added in v0.3.0

type TenantConfigurationClientSaveResponse struct {
	OperationResultContract
}

TenantConfigurationClientSaveResponse contains the response from method TenantConfigurationClient.BeginSave.

type TenantConfigurationClientValidateResponse added in v0.3.0

type TenantConfigurationClientValidateResponse struct {
	OperationResultContract
}

TenantConfigurationClientValidateResponse contains the response from method TenantConfigurationClient.BeginValidate.

type TenantConfigurationSyncStateContract

type TenantConfigurationSyncStateContract struct {
	// Properties returned Tenant Configuration Sync State check.
	Properties *TenantConfigurationSyncStateContractProperties

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

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

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

TenantConfigurationSyncStateContract - Result of Tenant Configuration Sync State.

func (TenantConfigurationSyncStateContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TenantConfigurationSyncStateContract.

func (*TenantConfigurationSyncStateContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TenantConfigurationSyncStateContract.

type TenantConfigurationSyncStateContractProperties

type TenantConfigurationSyncStateContractProperties struct {
	// The name of Git branch.
	Branch *string

	// The latest commit Id.
	CommitID *string

	// The date of the latest configuration change. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified
	// by the ISO 8601 standard.
	ConfigurationChangeDate *time.Time

	// value indicating if last sync was save (true) or deploy (false) operation.
	IsExport *bool

	// value indicating whether Git configuration access is enabled.
	IsGitEnabled *bool

	// value indicating if last synchronization was later than the configuration change.
	IsSynced *bool

	// Most recent tenant configuration operation identifier
	LastOperationID *string

	// The date of the latest synchronization. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by
	// the ISO 8601 standard.
	SyncDate *time.Time
}

TenantConfigurationSyncStateContractProperties - Tenant Configuration Synchronization State.

func (TenantConfigurationSyncStateContractProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type TenantConfigurationSyncStateContractProperties.

func (*TenantConfigurationSyncStateContractProperties) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type TenantConfigurationSyncStateContractProperties.

type TenantSettingsClient

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

TenantSettingsClient contains the methods for the TenantSettings group. Don't use this type directly, use NewTenantSettingsClient() instead.

func NewTenantSettingsClient

func NewTenantSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantSettingsClient, error)

NewTenantSettingsClient creates a new instance of TenantSettingsClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*TenantSettingsClient) Get

func (client *TenantSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, settingsType SettingsTypeName, options *TenantSettingsClientGetOptions) (TenantSettingsClientGetResponse, error)

Get - Get tenant settings. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • settingsType - The identifier of the settings.
  • options - TenantSettingsClientGetOptions contains the optional parameters for the TenantSettingsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantSettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTenantSettingsClient().Get(ctx, "rg1", "apimService1", armapimanagement.SettingsTypeNamePublic, 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.TenantSettingsContract = armapimanagement.TenantSettingsContract{
	// 	Name: to.Ptr("public"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/settings"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/settings/public"),
	// 	Properties: &armapimanagement.TenantSettingsContractProperties{
	// 		Settings: map[string]*string{
	// 			"CustomPortalSettings.DelegatedSubscriptionEnabled": to.Ptr("False"),
	// 			"CustomPortalSettings.DelegationEnabled": to.Ptr("False"),
	// 			"CustomPortalSettings.DelegationUrl": to.Ptr(""),
	// 			"CustomPortalSettings.UserRegistrationTerms": nil,
	// 			"CustomPortalSettings.UserRegistrationTermsConsentRequired": to.Ptr("False"),
	// 			"CustomPortalSettings.UserRegistrationTermsEnabled": to.Ptr("False"),
	// 		},
	// 	},
	// }
}
Output:

func (*TenantSettingsClient) NewListByServicePager added in v0.5.0

func (client *TenantSettingsClient) NewListByServicePager(resourceGroupName string, serviceName string, options *TenantSettingsClientListByServiceOptions) *runtime.Pager[TenantSettingsClientListByServiceResponse]

NewListByServicePager - Public settings.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - TenantSettingsClientListByServiceOptions contains the optional parameters for the TenantSettingsClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTenantSettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTenantSettingsClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.TenantSettingsClientListByServiceOptions{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.TenantSettingsCollection = armapimanagement.TenantSettingsCollection{
		// 	Value: []*armapimanagement.TenantSettingsContract{
		// 		{
		// 			Name: to.Ptr("public"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/settings"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/settings/public"),
		// 			Properties: &armapimanagement.TenantSettingsContractProperties{
		// 				Settings: map[string]*string{
		// 					"CustomPortalSettings.DelegatedSubscriptionEnabled": to.Ptr("False"),
		// 					"CustomPortalSettings.DelegationEnabled": to.Ptr("False"),
		// 					"CustomPortalSettings.DelegationUrl": to.Ptr(""),
		// 					"CustomPortalSettings.UserRegistrationTerms": nil,
		// 					"CustomPortalSettings.UserRegistrationTermsConsentRequired": to.Ptr("False"),
		// 					"CustomPortalSettings.UserRegistrationTermsEnabled": to.Ptr("False"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

type TenantSettingsClientGetOptions added in v0.3.0

type TenantSettingsClientGetOptions struct {
}

TenantSettingsClientGetOptions contains the optional parameters for the TenantSettingsClient.Get method.

type TenantSettingsClientGetResponse added in v0.3.0

type TenantSettingsClientGetResponse struct {
	TenantSettingsContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

TenantSettingsClientGetResponse contains the response from method TenantSettingsClient.Get.

type TenantSettingsClientListByServiceOptions added in v0.3.0

type TenantSettingsClientListByServiceOptions struct {
	// Not used
	Filter *string
}

TenantSettingsClientListByServiceOptions contains the optional parameters for the TenantSettingsClient.NewListByServicePager method.

type TenantSettingsClientListByServiceResponse added in v0.3.0

type TenantSettingsClientListByServiceResponse struct {
	TenantSettingsCollection
}

TenantSettingsClientListByServiceResponse contains the response from method TenantSettingsClient.NewListByServicePager.

type TenantSettingsCollection

type TenantSettingsCollection struct {
	// READ-ONLY; Next page link if any.
	NextLink *string

	// READ-ONLY; Page values.
	Value []*TenantSettingsContract
}

TenantSettingsCollection - Paged AccessInformation list representation.

func (TenantSettingsCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TenantSettingsCollection.

func (*TenantSettingsCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TenantSettingsCollection.

type TenantSettingsContract

type TenantSettingsContract struct {
	// TenantSettings entity contract properties.
	Properties *TenantSettingsContractProperties

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

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

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

TenantSettingsContract - Tenant Settings.

func (TenantSettingsContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TenantSettingsContract.

func (*TenantSettingsContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TenantSettingsContract.

type TenantSettingsContractProperties

type TenantSettingsContractProperties struct {
	// Tenant settings
	Settings map[string]*string
}

TenantSettingsContractProperties - Tenant access information contract of the API Management service.

func (TenantSettingsContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TenantSettingsContractProperties.

func (*TenantSettingsContractProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TenantSettingsContractProperties.

type TermsOfServiceProperties

type TermsOfServiceProperties struct {
	// Ask user for consent to the terms of service.
	ConsentRequired *bool

	// Display terms of service during a sign-up process.
	Enabled *bool

	// A terms of service text.
	Text *string
}

TermsOfServiceProperties - Terms of service contract properties.

func (TermsOfServiceProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type TermsOfServiceProperties.

func (*TermsOfServiceProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TermsOfServiceProperties.

type TokenBodyParameterContract

type TokenBodyParameterContract struct {
	// REQUIRED; body parameter name.
	Name *string

	// REQUIRED; body parameter value.
	Value *string
}

TokenBodyParameterContract - OAuth acquire token request body parameter (www-url-form-encoded).

func (TokenBodyParameterContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type TokenBodyParameterContract.

func (*TokenBodyParameterContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type TokenBodyParameterContract.

type UserClient

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

UserClient contains the methods for the User group. Don't use this type directly, use NewUserClient() instead.

func NewUserClient

func NewUserClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserClient, error)

NewUserClient creates a new instance of UserClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*UserClient) CreateOrUpdate

func (client *UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserCreateParameters, options *UserClientCreateOrUpdateOptions) (UserClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or Updates a user. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • parameters - Create or update parameters.
  • options - UserClientCreateOrUpdateOptions contains the optional parameters for the UserClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateUser.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewUserClient().CreateOrUpdate(ctx, "rg1", "apimService1", "5931a75ae4bbd512288c680b", armapimanagement.UserCreateParameters{
		Properties: &armapimanagement.UserCreateParameterProperties{
			Confirmation: to.Ptr(armapimanagement.ConfirmationSignup),
			Email:        to.Ptr("foobar@outlook.com"),
			FirstName:    to.Ptr("foo"),
			LastName:     to.Ptr("bar"),
		},
	}, &armapimanagement.UserClientCreateOrUpdateOptions{Notify: nil,
		IfMatch: 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.UserContract = armapimanagement.UserContract{
	// 	Name: to.Ptr("5931a75ae4bbd512288c680b"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/users"),
	// 	ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512288c680b"),
	// 	Properties: &armapimanagement.UserContractProperties{
	// 		Identities: []*armapimanagement.UserIdentityContract{
	// 			{
	// 				ID: to.Ptr("foobar@outlook.com"),
	// 				Provider: to.Ptr("Basic"),
	// 		}},
	// 		State: to.Ptr(armapimanagement.UserStateActive),
	// 		Email: to.Ptr("foobar@outlook.com"),
	// 		FirstName: to.Ptr("foo"),
	// 		Groups: []*armapimanagement.GroupContractProperties{
	// 		},
	// 		LastName: to.Ptr("bar"),
	// 		RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-07T21:21:29.16Z"); return t}()),
	// 	},
	// }
}
Output:

func (*UserClient) Delete

func (client *UserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, userID string, ifMatch string, options *UserClientDeleteOptions) (UserClientDeleteResponse, error)

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

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • options - UserClientDeleteOptions contains the optional parameters for the UserClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteUser.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewUserClient().Delete(ctx, "rg1", "apimService1", "5931a75ae4bbd512288c680b", "*", &armapimanagement.UserClientDeleteOptions{DeleteSubscriptions: nil,
		Notify:  nil,
		AppType: nil,
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*UserClient) GenerateSsoURL

func (client *UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserClientGenerateSsoURLOptions) (UserClientGenerateSsoURLResponse, error)

GenerateSsoURL - Retrieves a redirection URL containing an authentication token for signing a given user into the developer portal. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - UserClientGenerateSsoURLOptions contains the optional parameters for the UserClient.GenerateSsoURL method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserGenerateSsoUrl.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewUserClient().GenerateSsoURL(ctx, "rg1", "apimService1", "57127d485157a511ace86ae7", 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.GenerateSsoURLResult = armapimanagement.GenerateSsoURLResult{
	// 	Value: to.Ptr("https://apimService1.portal.azure-api.net/signin-sso?token=57127d485157a511ace86ae7%26201706051624%267VY18MlwAom***********2bYr2bDQHg21OzQsNakExQ%3d%3d"),
	// }
}
Output:

func (*UserClient) Get

func (client *UserClient) Get(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserClientGetOptions) (UserClientGetResponse, error)

Get - Gets the details of the user specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - UserClientGetOptions contains the optional parameters for the UserClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetUser.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewUserClient().Get(ctx, "rg1", "apimService1", "5931a75ae4bbd512a88c680b", 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.UserContract = armapimanagement.UserContract{
	// 	Name: to.Ptr("5931a75ae4bbd512a88c680b"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/users"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512a88c680b"),
	// 	Properties: &armapimanagement.UserContractProperties{
	// 		Identities: []*armapimanagement.UserIdentityContract{
	// 			{
	// 				ID: to.Ptr("*************"),
	// 				Provider: to.Ptr("Microsoft"),
	// 		}},
	// 		State: to.Ptr(armapimanagement.UserStateActive),
	// 		Email: to.Ptr("foobar@outlook.com"),
	// 		FirstName: to.Ptr("foo"),
	// 		LastName: to.Ptr("bar"),
	// 		RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T17:58:50.357Z"); return t}()),
	// 	},
	// }
}
Output:

func (*UserClient) GetEntityTag

func (client *UserClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserClientGetEntityTagOptions) (UserClientGetEntityTagResponse, error)

GetEntityTag - Gets the entity state (Etag) version of the user specified by its identifier.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - UserClientGetEntityTagOptions contains the optional parameters for the UserClient.GetEntityTag method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadUser.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewUserClient().GetEntityTag(ctx, "rg1", "apimService1", "5931a75ae4bbd512a88c680b", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*UserClient) GetSharedAccessToken

func (client *UserClient) GetSharedAccessToken(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserTokenParameters, options *UserClientGetSharedAccessTokenOptions) (UserClientGetSharedAccessTokenResponse, error)

GetSharedAccessToken - Gets the Shared Access Authorization Token for the User. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • parameters - Create Authorization Token parameters.
  • options - UserClientGetSharedAccessTokenOptions contains the optional parameters for the UserClient.GetSharedAccessToken method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserToken.json

package main

import (
	"context"
	"log"

	"time"

	"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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewUserClient().GetSharedAccessToken(ctx, "rg1", "apimService1", "userId1718", armapimanagement.UserTokenParameters{
		Properties: &armapimanagement.UserTokenParameterProperties{
			Expiry:  to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T00:44:24.2845269Z"); return t }()),
			KeyType: to.Ptr(armapimanagement.KeyTypePrimary),
		},
	}, 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.UserTokenResult = armapimanagement.UserTokenResult{
	// 	Value: to.Ptr("userId1718&201904210044&9A1GR1f5WIhFvFmzQG+xxxxxxxxxxx/kBeu87DWad3tkasUXuvPL+MgzlwUHyg=="),
	// }
}
Output:

func (*UserClient) NewListByServicePager added in v0.5.0

func (client *UserClient) NewListByServicePager(resourceGroupName string, serviceName string, options *UserClientListByServiceOptions) *runtime.Pager[UserClientListByServiceResponse]

NewListByServicePager - Lists a collection of registered users in the specified service instance.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • options - UserClientListByServiceOptions contains the optional parameters for the UserClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUsers.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewUserClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.UserClientListByServiceOptions{Filter: nil,
		Top:          nil,
		Skip:         nil,
		ExpandGroups: 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.UserCollection = armapimanagement.UserCollection{
		// 	Count: to.Ptr[int64](3),
		// 	Value: []*armapimanagement.UserContract{
		// 		{
		// 			Name: to.Ptr("1"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/users"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
		// 			Properties: &armapimanagement.UserContractProperties{
		// 				Identities: []*armapimanagement.UserIdentityContract{
		// 					{
		// 						ID: to.Ptr("admin@live.com"),
		// 						Provider: to.Ptr("Azure"),
		// 				}},
		// 				State: to.Ptr(armapimanagement.UserStateActive),
		// 				Email: to.Ptr("admin@live.com"),
		// 				FirstName: to.Ptr("Administrator"),
		// 				LastName: to.Ptr(""),
		// 				RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-22T01:57:39.677Z"); return t}()),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("56eaec62baf08b06e46d27fd"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/users"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/56eaec62baf08b06e46d27fd"),
		// 			Properties: &armapimanagement.UserContractProperties{
		// 				Identities: []*armapimanagement.UserIdentityContract{
		// 					{
		// 						ID: to.Ptr("foo.bar.83@gmail.com"),
		// 						Provider: to.Ptr("Basic"),
		// 				}},
		// 				State: to.Ptr(armapimanagement.UserStateActive),
		// 				Email: to.Ptr("foo.bar.83@gmail.com"),
		// 				FirstName: to.Ptr("foo"),
		// 				LastName: to.Ptr("bar"),
		// 				RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-17T17:41:56.327Z"); return t}()),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("5931a75ae4bbd512a88c680b"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/users"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512a88c680b"),
		// 			Properties: &armapimanagement.UserContractProperties{
		// 				Identities: []*armapimanagement.UserIdentityContract{
		// 					{
		// 						ID: to.Ptr("*************"),
		// 						Provider: to.Ptr("Microsoft"),
		// 				}},
		// 				State: to.Ptr(armapimanagement.UserStateActive),
		// 				Email: to.Ptr("foobar@outlook.com"),
		// 				FirstName: to.Ptr("foo"),
		// 				LastName: to.Ptr("bar"),
		// 				RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T17:58:50.357Z"); return t}()),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*UserClient) Update

func (client *UserClient) Update(ctx context.Context, resourceGroupName string, serviceName string, userID string, ifMatch string, parameters UserUpdateParameters, options *UserClientUpdateOptions) (UserClientUpdateResponse, error)

Update - Updates the details of the user specified by its identifier. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
  • parameters - Update parameters.
  • options - UserClientUpdateOptions contains the optional parameters for the UserClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateUser.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/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewUserClient().Update(ctx, "rg1", "apimService1", "5931a75ae4bbd512a88c680b", "*", armapimanagement.UserUpdateParameters{
		Properties: &armapimanagement.UserUpdateParametersProperties{
			Email:     to.Ptr("foobar@outlook.com"),
			FirstName: to.Ptr("foo"),
			LastName:  to.Ptr("bar"),
		},
	}, 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.UserContract = armapimanagement.UserContract{
	// 	Name: to.Ptr("5931a75ae4bbd512a88c680b"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/users"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512a88c680b"),
	// 	Properties: &armapimanagement.UserContractProperties{
	// 		Identities: []*armapimanagement.UserIdentityContract{
	// 			{
	// 				ID: to.Ptr("*************"),
	// 				Provider: to.Ptr("Microsoft"),
	// 		}},
	// 		State: to.Ptr(armapimanagement.UserStateActive),
	// 		Email: to.Ptr("foobar@outlook.com"),
	// 		FirstName: to.Ptr("foo"),
	// 		LastName: to.Ptr("bar"),
	// 		RegistrationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T17:58:50.357Z"); return t}()),
	// 	},
	// }
}
Output:

type UserClientCreateOrUpdateOptions added in v0.3.0

type UserClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity, but required when updating an entity.
	IfMatch *string
	// Send an Email notification to the User.
	Notify *bool
}

UserClientCreateOrUpdateOptions contains the optional parameters for the UserClient.CreateOrUpdate method.

type UserClientCreateOrUpdateResponse added in v0.3.0

type UserClientCreateOrUpdateResponse struct {
	UserContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

UserClientCreateOrUpdateResponse contains the response from method UserClient.CreateOrUpdate.

type UserClientDeleteOptions added in v0.3.0

type UserClientDeleteOptions struct {
	// Determines the type of application which send the create user request. Default is legacy publisher portal.
	AppType *AppType
	// Whether to delete user's subscription or not.
	DeleteSubscriptions *bool
	// Send an Account Closed Email notification to the User.
	Notify *bool
}

UserClientDeleteOptions contains the optional parameters for the UserClient.Delete method.

type UserClientDeleteResponse added in v0.3.0

type UserClientDeleteResponse struct {
}

UserClientDeleteResponse contains the response from method UserClient.Delete.

type UserClientGenerateSsoURLOptions added in v0.3.0

type UserClientGenerateSsoURLOptions struct {
}

UserClientGenerateSsoURLOptions contains the optional parameters for the UserClient.GenerateSsoURL method.

type UserClientGenerateSsoURLResponse added in v0.3.0

type UserClientGenerateSsoURLResponse struct {
	GenerateSsoURLResult
}

UserClientGenerateSsoURLResponse contains the response from method UserClient.GenerateSsoURL.

type UserClientGetEntityTagOptions added in v0.3.0

type UserClientGetEntityTagOptions struct {
}

UserClientGetEntityTagOptions contains the optional parameters for the UserClient.GetEntityTag method.

type UserClientGetEntityTagResponse added in v0.3.0

type UserClientGetEntityTagResponse struct {
	// ETag contains the information returned from the ETag header response.
	ETag *string

	// Success indicates if the operation succeeded or failed.
	Success bool
}

UserClientGetEntityTagResponse contains the response from method UserClient.GetEntityTag.

type UserClientGetOptions added in v0.3.0

type UserClientGetOptions struct {
}

UserClientGetOptions contains the optional parameters for the UserClient.Get method.

type UserClientGetResponse added in v0.3.0

type UserClientGetResponse struct {
	UserContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

UserClientGetResponse contains the response from method UserClient.Get.

type UserClientGetSharedAccessTokenOptions added in v0.3.0

type UserClientGetSharedAccessTokenOptions struct {
}

UserClientGetSharedAccessTokenOptions contains the optional parameters for the UserClient.GetSharedAccessToken method.

type UserClientGetSharedAccessTokenResponse added in v0.3.0

type UserClientGetSharedAccessTokenResponse struct {
	UserTokenResult
}

UserClientGetSharedAccessTokenResponse contains the response from method UserClient.GetSharedAccessToken.

type UserClientListByServiceOptions added in v0.3.0

type UserClientListByServiceOptions struct {
	// Detailed Group in response.
	ExpandGroups *bool
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|-------------|-------------|-------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | state | filter | eq | |
	// | registrationDate | filter | ge, le, eq, ne, gt, lt | |
	// | note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | groups | expand | | |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

UserClientListByServiceOptions contains the optional parameters for the UserClient.NewListByServicePager method.

type UserClientListByServiceResponse added in v0.3.0

type UserClientListByServiceResponse struct {
	UserCollection
}

UserClientListByServiceResponse contains the response from method UserClient.NewListByServicePager.

type UserClientUpdateOptions added in v0.3.0

type UserClientUpdateOptions struct {
}

UserClientUpdateOptions contains the optional parameters for the UserClient.Update method.

type UserClientUpdateResponse added in v0.3.0

type UserClientUpdateResponse struct {
	UserContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

UserClientUpdateResponse contains the response from method UserClient.Update.

type UserCollection

type UserCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// Page values.
	Value []*UserContract
}

UserCollection - Paged Users list representation.

func (UserCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UserCollection.

func (*UserCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserCollection.

type UserConfirmationPasswordClient

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

UserConfirmationPasswordClient contains the methods for the UserConfirmationPassword group. Don't use this type directly, use NewUserConfirmationPasswordClient() instead.

func NewUserConfirmationPasswordClient

func NewUserConfirmationPasswordClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserConfirmationPasswordClient, error)

NewUserConfirmationPasswordClient creates a new instance of UserConfirmationPasswordClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*UserConfirmationPasswordClient) Send

Send - Sends confirmation If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - UserConfirmationPasswordClientSendOptions contains the optional parameters for the UserConfirmationPasswordClient.Send method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserConfirmationPasswordSend.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewUserConfirmationPasswordClient().Send(ctx, "rg1", "apimService1", "57127d485157a511ace86ae7", &armapimanagement.UserConfirmationPasswordClientSendOptions{AppType: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

type UserConfirmationPasswordClientSendOptions added in v0.3.0

type UserConfirmationPasswordClientSendOptions struct {
	// Determines the type of application which send the create user request. Default is legacy publisher portal.
	AppType *AppType
}

UserConfirmationPasswordClientSendOptions contains the optional parameters for the UserConfirmationPasswordClient.Send method.

type UserConfirmationPasswordClientSendResponse added in v0.3.0

type UserConfirmationPasswordClientSendResponse struct {
}

UserConfirmationPasswordClientSendResponse contains the response from method UserConfirmationPasswordClient.Send.

type UserContract

type UserContract struct {
	// User entity contract properties.
	Properties *UserContractProperties

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

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

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

UserContract - User details.

func (UserContract) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UserContract.

func (*UserContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserContract.

type UserContractProperties

type UserContractProperties struct {
	// Email address.
	Email *string

	// First name.
	FirstName *string

	// Collection of user identities.
	Identities []*UserIdentityContract

	// Last name.
	LastName *string

	// Optional note about a user set by the administrator.
	Note *string

	// Date of user registration. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601
	// standard.
	RegistrationDate *time.Time

	// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal
	// or call any APIs of subscribed products. Default state is Active.
	State *UserState

	// READ-ONLY; Collection of groups user is part of.
	Groups []*GroupContractProperties
}

UserContractProperties - User profile.

func (UserContractProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UserContractProperties.

func (*UserContractProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserContractProperties.

type UserCreateParameterProperties

type UserCreateParameterProperties struct {
	// REQUIRED; Email address. Must not be empty and must be unique within the service instance.
	Email *string

	// REQUIRED; First name.
	FirstName *string

	// REQUIRED; Last name.
	LastName *string

	// Determines the type of application which send the create user request. Default is legacy portal.
	AppType *AppType

	// Determines the type of confirmation e-mail that will be sent to the newly created user.
	Confirmation *Confirmation

	// Collection of user identities.
	Identities []*UserIdentityContract

	// Optional note about a user set by the administrator.
	Note *string

	// User Password. If no value is provided, a default password is generated.
	Password *string

	// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal
	// or call any APIs of subscribed products. Default state is Active.
	State *UserState
}

UserCreateParameterProperties - Parameters supplied to the Create User operation.

func (UserCreateParameterProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UserCreateParameterProperties.

func (*UserCreateParameterProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserCreateParameterProperties.

type UserCreateParameters

type UserCreateParameters struct {
	// User entity create contract properties.
	Properties *UserCreateParameterProperties
}

UserCreateParameters - User create details.

func (UserCreateParameters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type UserCreateParameters.

func (*UserCreateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserCreateParameters.

type UserEntityBaseParameters

type UserEntityBaseParameters struct {
	// Collection of user identities.
	Identities []*UserIdentityContract

	// Optional note about a user set by the administrator.
	Note *string

	// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal
	// or call any APIs of subscribed products. Default state is Active.
	State *UserState
}

UserEntityBaseParameters - User Entity Base Parameters set.

func (UserEntityBaseParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UserEntityBaseParameters.

func (*UserEntityBaseParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserEntityBaseParameters.

type UserGroupClient

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

UserGroupClient contains the methods for the UserGroup group. Don't use this type directly, use NewUserGroupClient() instead.

func NewUserGroupClient

func NewUserGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserGroupClient, error)

NewUserGroupClient creates a new instance of UserGroupClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*UserGroupClient) NewListPager added in v0.5.0

func (client *UserGroupClient) NewListPager(resourceGroupName string, serviceName string, userID string, options *UserGroupClientListOptions) *runtime.Pager[UserGroupClientListResponse]

NewListPager - Lists all user groups.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - UserGroupClientListOptions contains the optional parameters for the UserGroupClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserGroups.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewUserGroupClient().NewListPager("rg1", "apimService1", "57681833a40f7eb6c49f6acf", &armapimanagement.UserGroupClientListOptions{Filter: nil,
		Top:  nil,
		Skip: 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.GroupCollection = armapimanagement.GroupCollection{
		// 	Count: to.Ptr[int64](1),
		// 	Value: []*armapimanagement.GroupContract{
		// 		{
		// 			Name: to.Ptr("5600b57e7e8880006a020002"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/users/groups"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57681833a40f7eb6c49f6acf/groups/5600b57e7e8880006a020002"),
		// 			Properties: &armapimanagement.GroupContractProperties{
		// 				Type: to.Ptr(armapimanagement.GroupTypeSystem),
		// 				Description: to.Ptr("Developers is a built-in group. Its membership is managed by the system. Signed-in users fall into this group."),
		// 				BuiltIn: to.Ptr(true),
		// 				DisplayName: to.Ptr("Developers"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type UserGroupClientListOptions added in v0.3.0

type UserGroupClientListOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|------------------------|-----------------------------------|
	// | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

UserGroupClientListOptions contains the optional parameters for the UserGroupClient.NewListPager method.

type UserGroupClientListResponse added in v0.3.0

type UserGroupClientListResponse struct {
	GroupCollection
}

UserGroupClientListResponse contains the response from method UserGroupClient.NewListPager.

type UserIdentitiesClient

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

UserIdentitiesClient contains the methods for the UserIdentities group. Don't use this type directly, use NewUserIdentitiesClient() instead.

func NewUserIdentitiesClient

func NewUserIdentitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserIdentitiesClient, error)

NewUserIdentitiesClient creates a new instance of UserIdentitiesClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*UserIdentitiesClient) NewListPager added in v0.5.0

func (client *UserIdentitiesClient) NewListPager(resourceGroupName string, serviceName string, userID string, options *UserIdentitiesClientListOptions) *runtime.Pager[UserIdentitiesClientListResponse]

NewListPager - List of all user identities.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - UserIdentitiesClientListOptions contains the optional parameters for the UserIdentitiesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserIdentities.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewUserIdentitiesClient().NewListPager("rg1", "apimService1", "57f2af53bb17172280f44057", 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.UserIdentityCollection = armapimanagement.UserIdentityCollection{
		// 	Value: []*armapimanagement.UserIdentityContract{
		// 		{
		// 			ID: to.Ptr("086cf9********55ab"),
		// 			Provider: to.Ptr("Microsoft"),
		// 	}},
		// }
	}
}
Output:

type UserIdentitiesClientListOptions added in v0.3.0

type UserIdentitiesClientListOptions struct {
}

UserIdentitiesClientListOptions contains the optional parameters for the UserIdentitiesClient.NewListPager method.

type UserIdentitiesClientListResponse added in v0.3.0

type UserIdentitiesClientListResponse struct {
	UserIdentityCollection
}

UserIdentitiesClientListResponse contains the response from method UserIdentitiesClient.NewListPager.

type UserIdentityCollection

type UserIdentityCollection struct {
	// Total record count number across all pages.
	Count *int64

	// Next page link if any.
	NextLink *string

	// User Identity values.
	Value []*UserIdentityContract
}

UserIdentityCollection - List of Users Identity list representation.

func (UserIdentityCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UserIdentityCollection.

func (*UserIdentityCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityCollection.

type UserIdentityContract

type UserIdentityContract struct {
	// Identifier value within provider.
	ID *string

	// Identity provider name.
	Provider *string
}

UserIdentityContract - User identity details.

func (UserIdentityContract) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type UserIdentityContract.

func (*UserIdentityContract) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityContract.

type UserIdentityProperties

type UserIdentityProperties struct {
	// The client id of user assigned identity.
	ClientID *string

	// The principal id of user assigned identity.
	PrincipalID *string
}

func (UserIdentityProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type UserIdentityProperties.

func (*UserIdentityProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityProperties.

type UserState

type UserState string

UserState - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.

const (
	// UserStateActive - User state is active.
	UserStateActive UserState = "active"
	// UserStateBlocked - User is blocked. Blocked users cannot authenticate at developer portal or call API.
	UserStateBlocked UserState = "blocked"
	// UserStateDeleted - User account is closed. All identities and related entities are removed.
	UserStateDeleted UserState = "deleted"
	// UserStatePending - User account is pending. Requires identity confirmation before it can be made active.
	UserStatePending UserState = "pending"
)

func PossibleUserStateValues

func PossibleUserStateValues() []UserState

PossibleUserStateValues returns the possible values for the UserState const type.

type UserSubscriptionClient

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

UserSubscriptionClient contains the methods for the UserSubscription group. Don't use this type directly, use NewUserSubscriptionClient() instead.

func NewUserSubscriptionClient

func NewUserSubscriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserSubscriptionClient, error)

NewUserSubscriptionClient creates a new instance of UserSubscriptionClient with the specified values.

  • subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*UserSubscriptionClient) Get

func (client *UserSubscriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, userID string, sid string, options *UserSubscriptionClientGetOptions) (UserSubscriptionClientGetResponse, error)

Get - Gets the specified Subscription entity associated with a particular user. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
  • options - UserSubscriptionClientGetOptions contains the optional parameters for the UserSubscriptionClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetUserSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewUserSubscriptionClient().Get(ctx, "rg1", "apimService1", "1", "5fa9b096f3df14003c070001", 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.SubscriptionContract = armapimanagement.SubscriptionContract{
	// 	Name: to.Ptr("5fa9b096f3df14003c070001"),
	// 	Type: to.Ptr("Microsoft.ApiManagement/service/users/subscriptions"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1/subscriptions/5fa9b096f3df14003c070001"),
	// 	Properties: &armapimanagement.SubscriptionContractProperties{
	// 		AllowTracing: to.Ptr(true),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-09T21:11:50.58Z"); return t}()),
	// 		OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"),
	// 		Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/starter"),
	// 		State: to.Ptr(armapimanagement.SubscriptionStateActive),
	// 	},
	// }
}
Output:

func (*UserSubscriptionClient) NewListPager added in v0.5.0

func (client *UserSubscriptionClient) NewListPager(resourceGroupName string, serviceName string, userID string, options *UserSubscriptionClientListOptions) *runtime.Pager[UserSubscriptionClientListResponse]

NewListPager - Lists the collection of subscriptions of the specified user.

Generated from API version 2021-08-01

  • resourceGroupName - The name of the resource group.
  • serviceName - The name of the API Management service.
  • userID - User identifier. Must be unique in the current API Management service instance.
  • options - UserSubscriptionClientListOptions contains the optional parameters for the UserSubscriptionClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserSubscriptions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewUserSubscriptionClient().NewListPager("rg1", "apimService1", "57681833a40f7eb6c49f6acf", &armapimanagement.UserSubscriptionClientListOptions{Filter: nil,
		Top:  nil,
		Skip: 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.SubscriptionCollection = armapimanagement.SubscriptionCollection{
		// 	Value: []*armapimanagement.SubscriptionContract{
		// 		{
		// 			Name: to.Ptr("57681850a40f7eb6c49f6ae3"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/users/subscriptions"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57681833a40f7eb6c49f6acf/subscriptions/57681850a40f7eb6c49f6ae3"),
		// 			Properties: &armapimanagement.SubscriptionContractProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-06-20T16:22:39.547Z"); return t}()),
		// 				DisplayName: to.Ptr("57681850a40f7eb6c49f6ae5"),
		// 				OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57681833a40f7eb6c49f6acf"),
		// 				Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5768181ea40f7eb6c49f6ac7"),
		// 				StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-06-20T00:00:00Z"); return t}()),
		// 				State: to.Ptr(armapimanagement.SubscriptionStateActive),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("57681850a40f7eb6c49f6b2b"),
		// 			Type: to.Ptr("Microsoft.ApiManagement/service/users/subscriptions"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57681833a40f7eb6c49f6acf/subscriptions/57681850a40f7eb6c49f6b2b"),
		// 			Properties: &armapimanagement.SubscriptionContractProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-06-20T16:22:41.103Z"); return t}()),
		// 				DisplayName: to.Ptr("57681850a40f7eb6c49f6b2d"),
		// 				OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57681833a40f7eb6c49f6acf"),
		// 				Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5768181ea40f7eb6c49f6ac7"),
		// 				StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-06-20T00:00:00Z"); return t}()),
		// 				State: to.Ptr(armapimanagement.SubscriptionStateActive),
		// 			},
		// 	}},
		// }
	}
}
Output:

type UserSubscriptionClientGetOptions added in v0.3.0

type UserSubscriptionClientGetOptions struct {
}

UserSubscriptionClientGetOptions contains the optional parameters for the UserSubscriptionClient.Get method.

type UserSubscriptionClientGetResponse added in v0.3.0

type UserSubscriptionClientGetResponse struct {
	SubscriptionContract
	// ETag contains the information returned from the ETag header response.
	ETag *string
}

UserSubscriptionClientGetResponse contains the response from method UserSubscriptionClient.Get.

type UserSubscriptionClientListOptions added in v0.3.0

type UserSubscriptionClientListOptions struct {
	// | Field | Usage | Supported operators | Supported functions |
	// |-------------|------------------------|-----------------------------------|
	// |name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// |displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// |stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// |ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// |scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// |userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	// |productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
	Filter *string
	// Number of records to skip.
	Skip *int32
	// Number of records to return.
	Top *int32
}

UserSubscriptionClientListOptions contains the optional parameters for the UserSubscriptionClient.NewListPager method.

type UserSubscriptionClientListResponse added in v0.3.0

type UserSubscriptionClientListResponse struct {
	SubscriptionCollection
}

UserSubscriptionClientListResponse contains the response from method UserSubscriptionClient.NewListPager.

type UserTokenParameterProperties

type UserTokenParameterProperties struct {
	// REQUIRED; The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following
	// format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
	Expiry *time.Time

	// REQUIRED; The Key to be used to generate token for user.
	KeyType *KeyType
}

UserTokenParameterProperties - Parameters supplied to the Get User Token operation.

func (UserTokenParameterProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UserTokenParameterProperties.

func (*UserTokenParameterProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserTokenParameterProperties.

type UserTokenParameters

type UserTokenParameters struct {
	// User Token Parameter contract properties.
	Properties *UserTokenParameterProperties
}

UserTokenParameters - Get User Token parameters.

func (UserTokenParameters) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type UserTokenParameters.

func (*UserTokenParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserTokenParameters.

type UserTokenResult

type UserTokenResult struct {
	// Shared Access Authorization token for the User.
	Value *string
}

UserTokenResult - Get User Token response details.

func (UserTokenResult) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type UserTokenResult.

func (*UserTokenResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserTokenResult.

type UserUpdateParameters

type UserUpdateParameters struct {
	// User entity update contract properties.
	Properties *UserUpdateParametersProperties
}

UserUpdateParameters - User update parameters.

func (UserUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UserUpdateParameters.

func (*UserUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserUpdateParameters.

type UserUpdateParametersProperties

type UserUpdateParametersProperties struct {
	// Email address. Must not be empty and must be unique within the service instance.
	Email *string

	// First name.
	FirstName *string

	// Collection of user identities.
	Identities []*UserIdentityContract

	// Last name.
	LastName *string

	// Optional note about a user set by the administrator.
	Note *string

	// User Password.
	Password *string

	// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal
	// or call any APIs of subscribed products. Default state is Active.
	State *UserState
}

UserUpdateParametersProperties - Parameters supplied to the Update User operation.

func (UserUpdateParametersProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UserUpdateParametersProperties.

func (*UserUpdateParametersProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserUpdateParametersProperties.

type Verbosity

type Verbosity string

Verbosity - The verbosity level applied to traces emitted by trace policies.

const (
	// VerbosityError - Only traces with 'severity' set to 'error' will be sent to the logger attached to this diagnostic instance.
	VerbosityError Verbosity = "error"
	// VerbosityInformation - Traces with 'severity' set to 'information' and 'error' will be sent to the logger attached to this
	// diagnostic instance.
	VerbosityInformation Verbosity = "information"
	// VerbosityVerbose - All the traces emitted by trace policies will be sent to the logger attached to this diagnostic instance.
	VerbosityVerbose Verbosity = "verbose"
)

func PossibleVerbosityValues

func PossibleVerbosityValues() []Verbosity

PossibleVerbosityValues returns the possible values for the Verbosity const type.

type VersioningScheme

type VersioningScheme string

VersioningScheme - An value that determines where the API Version identifier will be located in a HTTP request.

const (
	// VersioningSchemeHeader - The API Version is passed in a HTTP header.
	VersioningSchemeHeader VersioningScheme = "Header"
	// VersioningSchemeQuery - The API Version is passed in a query parameter.
	VersioningSchemeQuery VersioningScheme = "Query"
	// VersioningSchemeSegment - The API Version is passed in a path segment.
	VersioningSchemeSegment VersioningScheme = "Segment"
)

func PossibleVersioningSchemeValues

func PossibleVersioningSchemeValues() []VersioningScheme

PossibleVersioningSchemeValues returns the possible values for the VersioningScheme const type.

type VirtualNetworkConfiguration

type VirtualNetworkConfiguration struct {
	// The full resource ID of a subnet in a virtual network to deploy the API Management service in.
	SubnetResourceID *string

	// READ-ONLY; The name of the subnet.
	Subnetname *string

	// READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default.
	Vnetid *string
}

VirtualNetworkConfiguration - Configuration of a virtual network to which API Management service is deployed.

func (VirtualNetworkConfiguration) MarshalJSON added in v1.1.0

func (v VirtualNetworkConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkConfiguration.

func (*VirtualNetworkConfiguration) UnmarshalJSON added in v1.1.0

func (v *VirtualNetworkConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkConfiguration.

type VirtualNetworkType

type VirtualNetworkType string

VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only.

const (
	// VirtualNetworkTypeExternal - The service is part of Virtual Network and it is accessible from Internet.
	VirtualNetworkTypeExternal VirtualNetworkType = "External"
	// VirtualNetworkTypeInternal - The service is part of Virtual Network and it is only accessible from within the virtual network.
	VirtualNetworkTypeInternal VirtualNetworkType = "Internal"
	// VirtualNetworkTypeNone - The service is not part of any Virtual Network.
	VirtualNetworkTypeNone VirtualNetworkType = "None"
)

func PossibleVirtualNetworkTypeValues

func PossibleVirtualNetworkTypeValues() []VirtualNetworkType

PossibleVirtualNetworkTypeValues returns the possible values for the VirtualNetworkType const type.

type X509CertificateName

type X509CertificateName struct {
	// Thumbprint for the Issuer of the Certificate.
	IssuerCertificateThumbprint *string

	// Common Name of the Certificate.
	Name *string
}

X509CertificateName - Properties of server X509Names.

func (X509CertificateName) MarshalJSON added in v1.1.0

func (x X509CertificateName) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type X509CertificateName.

func (*X509CertificateName) UnmarshalJSON added in v1.1.0

func (x *X509CertificateName) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type X509CertificateName.

Source Files

Jump to

Keyboard shortcuts

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