armfeatures

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 16 Imported by: 3

README

Azure Features Module for Go

PkgGoDev

The armfeatures module provides operations for working with Azure Features.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Features module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Features. 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.

Clients

Azure Features modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armfeatures.NewClient(<subscription ID>, cred, nil)

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

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

Provide Feedback

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

type AuthorizationProfile struct {
	// READ-ONLY; The approved time
	ApprovedTime *time.Time `json:"approvedTime,omitempty" azure:"ro"`

	// READ-ONLY; The approver
	Approver *string `json:"approver,omitempty" azure:"ro"`

	// READ-ONLY; The requested time
	RequestedTime *time.Time `json:"requestedTime,omitempty" azure:"ro"`

	// READ-ONLY; The requester
	Requester *string `json:"requester,omitempty" azure:"ro"`

	// READ-ONLY; The requester object id
	RequesterObjectID *string `json:"requesterObjectId,omitempty" azure:"ro"`
}

AuthorizationProfile - Authorization Profile

func (AuthorizationProfile) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AuthorizationProfile.

func (*AuthorizationProfile) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProfile.

type Client added in v0.2.0

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

Client contains the methods for the Features group. Don't use this type directly, use NewClient() instead.

func NewClient added in v0.2.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 - The Azure subscription ID. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*Client) Get added in v0.2.0

func (client *Client) Get(ctx context.Context, resourceProviderNamespace string, featureName string, options *ClientGetOptions) (ClientGetResponse, error)

Get - Gets the preview feature with the specified name. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 resourceProviderNamespace - The resource provider namespace for the feature. featureName - The name of the feature to get. options - ClientGetOptions contains the optional parameters for the Client.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/getFeature.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"Resource Provider Namespace",
		"feature",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*Client) NewListAllPager added in v0.4.0

func (client *Client) NewListAllPager(options *ClientListAllOptions) *runtime.Pager[ClientListAllResponse]

NewListAllPager - Gets all the preview features that are available through AFEC for the subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 options - ClientListAllOptions contains the optional parameters for the Client.ListAll method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/listSubscriptionFeatures.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListAllPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*Client) NewListPager added in v0.4.0

func (client *Client) NewListPager(resourceProviderNamespace string, options *ClientListOptions) *runtime.Pager[ClientListResponse]

NewListPager - Gets all the preview features in a provider namespace that are available through AFEC for the subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 resourceProviderNamespace - The namespace of the resource provider for getting features. options - ClientListOptions contains the optional parameters for the Client.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/listProviderFeatures.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager("Resource Provider Namespace",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*Client) Register added in v0.2.0

func (client *Client) Register(ctx context.Context, resourceProviderNamespace string, featureName string, options *ClientRegisterOptions) (ClientRegisterResponse, error)

Register - Registers the preview feature for the subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 resourceProviderNamespace - The namespace of the resource provider. featureName - The name of the feature to register. options - ClientRegisterOptions contains the optional parameters for the Client.Register method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/registerFeature.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Register(ctx,
		"Resource Provider Namespace",
		"feature",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*Client) Unregister added in v0.2.0

func (client *Client) Unregister(ctx context.Context, resourceProviderNamespace string, featureName string, options *ClientUnregisterOptions) (ClientUnregisterResponse, error)

Unregister - Unregisters the preview feature for the subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 resourceProviderNamespace - The namespace of the resource provider. featureName - The name of the feature to unregister. options - ClientUnregisterOptions contains the optional parameters for the Client.Unregister method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/unregisterFeature.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewClient("ff23096b-f5a2-46ea-bd62-59c3e93fef9a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Unregister(ctx,
		"Resource Provider Namespace",
		"feature",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type ClientGetOptions added in v0.2.0

type ClientGetOptions struct {
}

ClientGetOptions contains the optional parameters for the Client.Get method.

type ClientGetResponse added in v0.2.0

type ClientGetResponse struct {
	FeatureResult
}

ClientGetResponse contains the response from method Client.Get.

type ClientListAllOptions added in v0.2.0

type ClientListAllOptions struct {
}

ClientListAllOptions contains the optional parameters for the Client.ListAll method.

type ClientListAllResponse added in v0.2.0

type ClientListAllResponse struct {
	FeatureOperationsListResult
}

ClientListAllResponse contains the response from method Client.ListAll.

type ClientListOptions added in v0.2.0

type ClientListOptions struct {
}

ClientListOptions contains the optional parameters for the Client.List method.

type ClientListResponse added in v0.2.0

type ClientListResponse struct {
	FeatureOperationsListResult
}

ClientListResponse contains the response from method Client.List.

type ClientRegisterOptions added in v0.2.0

type ClientRegisterOptions struct {
}

ClientRegisterOptions contains the optional parameters for the Client.Register method.

type ClientRegisterResponse added in v0.2.0

type ClientRegisterResponse struct {
	FeatureResult
}

ClientRegisterResponse contains the response from method Client.Register.

type ClientUnregisterOptions added in v0.2.0

type ClientUnregisterOptions struct {
}

ClientUnregisterOptions contains the optional parameters for the Client.Unregister method.

type ClientUnregisterResponse added in v0.2.0

type ClientUnregisterResponse struct {
	FeatureResult
}

ClientUnregisterResponse contains the response from method Client.Unregister.

type ErrorDefinition

type ErrorDefinition struct {
	// Internal error details.
	Details []*ErrorDefinition `json:"details,omitempty"`

	// READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code.
	Code *string `json:"code,omitempty" azure:"ro"`

	// READ-ONLY; Description of the error.
	Message *string `json:"message,omitempty" azure:"ro"`
}

ErrorDefinition - Error definition.

type ErrorResponse

type ErrorResponse struct {
	// The error details.
	Error *ErrorDefinition `json:"error,omitempty"`
}

ErrorResponse - Error response indicates that the service is not able to process the incoming request.

type FeatureClient

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

FeatureClient contains the methods for the FeatureClient group. Don't use this type directly, use NewFeatureClient() instead.

func NewFeatureClient

func NewFeatureClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*FeatureClient, error)

NewFeatureClient creates a new instance of FeatureClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*FeatureClient) NewListOperationsPager added in v0.4.0

NewListOperationsPager - Lists all of the available Microsoft.Features REST API operations. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 options - FeatureClientListOperationsOptions contains the optional parameters for the FeatureClient.ListOperations method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/listFeaturesOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewFeatureClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListOperationsPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type FeatureClientListOperationsOptions

type FeatureClientListOperationsOptions struct {
}

FeatureClientListOperationsOptions contains the optional parameters for the FeatureClient.ListOperations method.

type FeatureClientListOperationsResponse

type FeatureClientListOperationsResponse struct {
	OperationListResult
}

FeatureClientListOperationsResponse contains the response from method FeatureClient.ListOperations.

type FeatureOperationsListResult

type FeatureOperationsListResult struct {
	// The URL to use for getting the next set of results.
	NextLink *string `json:"nextLink,omitempty"`

	// The array of features.
	Value []*FeatureResult `json:"value,omitempty"`
}

FeatureOperationsListResult - List of previewed features.

type FeatureProperties

type FeatureProperties struct {
	// The registration state of the feature for the subscription.
	State *string `json:"state,omitempty"`
}

FeatureProperties - Information about feature.

type FeatureResult

type FeatureResult struct {
	// The resource ID of the feature.
	ID *string `json:"id,omitempty"`

	// The name of the feature.
	Name *string `json:"name,omitempty"`

	// Properties of the previewed feature.
	Properties *FeatureProperties `json:"properties,omitempty"`

	// The resource type of the feature.
	Type *string `json:"type,omitempty"`
}

FeatureResult - Previewed feature information.

type Operation

type Operation struct {
	// The object that represents the operation.
	Display *OperationDisplay `json:"display,omitempty"`

	// Operation name: {provider}/{resource}/{operation}
	Name *string `json:"name,omitempty"`
}

Operation - Microsoft.Features operation

type OperationDisplay

type OperationDisplay struct {
	// Operation type: Read, write, delete, etc.
	Operation *string `json:"operation,omitempty"`

	// Service provider: Microsoft.Features
	Provider *string `json:"provider,omitempty"`

	// Resource on which the operation is performed: Profile, endpoint, etc.
	Resource *string `json:"resource,omitempty"`
}

OperationDisplay - The object that represents the operation.

type OperationListResult

type OperationListResult struct {
	// URL to get the next set of operation list results if there are any.
	NextLink *string `json:"nextLink,omitempty"`

	// List of Microsoft.Features operations.
	Value []*Operation `json:"value,omitempty"`
}

OperationListResult - Result of the request to list Microsoft.Features operations. It contains a list of operations and a URL link to get the next set of results.

type ProxyResource

type ProxyResource struct {
	// READ-ONLY; Azure resource Id.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ProxyResource - An Azure proxy resource.

type SubscriptionFeatureRegistration

type SubscriptionFeatureRegistration struct {
	Properties *SubscriptionFeatureRegistrationProperties `json:"properties,omitempty"`

	// READ-ONLY; Azure resource Id.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

SubscriptionFeatureRegistration - Subscription feature registration details

type SubscriptionFeatureRegistrationApprovalType

type SubscriptionFeatureRegistrationApprovalType string

SubscriptionFeatureRegistrationApprovalType - The feature approval type.

const (
	SubscriptionFeatureRegistrationApprovalTypeApprovalRequired SubscriptionFeatureRegistrationApprovalType = "ApprovalRequired"
	SubscriptionFeatureRegistrationApprovalTypeAutoApproval     SubscriptionFeatureRegistrationApprovalType = "AutoApproval"
	SubscriptionFeatureRegistrationApprovalTypeNotSpecified     SubscriptionFeatureRegistrationApprovalType = "NotSpecified"
)

func PossibleSubscriptionFeatureRegistrationApprovalTypeValues

func PossibleSubscriptionFeatureRegistrationApprovalTypeValues() []SubscriptionFeatureRegistrationApprovalType

PossibleSubscriptionFeatureRegistrationApprovalTypeValues returns the possible values for the SubscriptionFeatureRegistrationApprovalType const type.

type SubscriptionFeatureRegistrationList

type SubscriptionFeatureRegistrationList struct {
	// The link used to get the next page of subscription feature registrations list.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of subscription feature registrations.
	Value []*SubscriptionFeatureRegistration `json:"value,omitempty"`
}

SubscriptionFeatureRegistrationList - The list of subscription feature registrations.

type SubscriptionFeatureRegistrationProperties

type SubscriptionFeatureRegistrationProperties struct {
	// Authorization Profile
	AuthorizationProfile *AuthorizationProfile `json:"authorizationProfile,omitempty"`

	// The feature description.
	Description *string `json:"description,omitempty"`

	// Key-value pairs for meta data.
	Metadata map[string]*string `json:"metadata,omitempty"`

	// Indicates whether feature should be displayed in Portal.
	ShouldFeatureDisplayInPortal *bool `json:"shouldFeatureDisplayInPortal,omitempty"`

	// The state.
	State *SubscriptionFeatureRegistrationState `json:"state,omitempty"`

	// READ-ONLY; The feature approval type.
	ApprovalType *SubscriptionFeatureRegistrationApprovalType `json:"approvalType,omitempty" azure:"ro"`

	// READ-ONLY; The featureDisplayName.
	DisplayName *string `json:"displayName,omitempty" azure:"ro"`

	// READ-ONLY; The feature documentation link.
	DocumentationLink *string `json:"documentationLink,omitempty" azure:"ro"`

	// READ-ONLY; The featureName.
	FeatureName *string `json:"featureName,omitempty" azure:"ro"`

	// READ-ONLY; The providerNamespace.
	ProviderNamespace *string `json:"providerNamespace,omitempty" azure:"ro"`

	// READ-ONLY; The feature registration date.
	RegistrationDate *time.Time `json:"registrationDate,omitempty" azure:"ro"`

	// READ-ONLY; The feature release date.
	ReleaseDate *time.Time `json:"releaseDate,omitempty" azure:"ro"`

	// READ-ONLY; The subscriptionId.
	SubscriptionID *string `json:"subscriptionId,omitempty" azure:"ro"`

	// READ-ONLY; The tenantId.
	TenantID *string `json:"tenantId,omitempty" azure:"ro"`
}

func (SubscriptionFeatureRegistrationProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SubscriptionFeatureRegistrationProperties.

func (*SubscriptionFeatureRegistrationProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionFeatureRegistrationProperties.

type SubscriptionFeatureRegistrationState

type SubscriptionFeatureRegistrationState string

SubscriptionFeatureRegistrationState - The state.

const (
	SubscriptionFeatureRegistrationStateNotRegistered SubscriptionFeatureRegistrationState = "NotRegistered"
	SubscriptionFeatureRegistrationStateNotSpecified  SubscriptionFeatureRegistrationState = "NotSpecified"
	SubscriptionFeatureRegistrationStatePending       SubscriptionFeatureRegistrationState = "Pending"
	SubscriptionFeatureRegistrationStateRegistered    SubscriptionFeatureRegistrationState = "Registered"
	SubscriptionFeatureRegistrationStateRegistering   SubscriptionFeatureRegistrationState = "Registering"
	SubscriptionFeatureRegistrationStateUnregistered  SubscriptionFeatureRegistrationState = "Unregistered"
	SubscriptionFeatureRegistrationStateUnregistering SubscriptionFeatureRegistrationState = "Unregistering"
)

func PossibleSubscriptionFeatureRegistrationStateValues

func PossibleSubscriptionFeatureRegistrationStateValues() []SubscriptionFeatureRegistrationState

PossibleSubscriptionFeatureRegistrationStateValues returns the possible values for the SubscriptionFeatureRegistrationState const type.

type SubscriptionFeatureRegistrationsClient

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

SubscriptionFeatureRegistrationsClient contains the methods for the SubscriptionFeatureRegistrations group. Don't use this type directly, use NewSubscriptionFeatureRegistrationsClient() instead.

func NewSubscriptionFeatureRegistrationsClient

func NewSubscriptionFeatureRegistrationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionFeatureRegistrationsClient, error)

NewSubscriptionFeatureRegistrationsClient creates a new instance of SubscriptionFeatureRegistrationsClient with the specified values. subscriptionID - The Azure subscription ID. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*SubscriptionFeatureRegistrationsClient) CreateOrUpdate

CreateOrUpdate - Create or update a feature registration. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 providerNamespace - The provider namespace. featureName - The feature name. options - SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.CreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/FeatureRegistration/SubscriptionFeatureRegistrationPUT.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewSubscriptionFeatureRegistrationsClient("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx,
		"subscriptionFeatureRegistrationGroupTestRG",
		"testFeature",
		&armfeatures.SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions{SubscriptionFeatureRegistrationType: &armfeatures.SubscriptionFeatureRegistration{
			Properties: &armfeatures.SubscriptionFeatureRegistrationProperties{},
		},
		})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SubscriptionFeatureRegistrationsClient) Delete

Delete - Deletes a feature registration If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 providerNamespace - The provider namespace. featureName - The feature name. options - SubscriptionFeatureRegistrationsClientDeleteOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/FeatureRegistration/SubscriptionFeatureRegistrationDELETE.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewSubscriptionFeatureRegistrationsClient("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.Delete(ctx,
		"subscriptionFeatureRegistrationGroupTestRG",
		"testFeature",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SubscriptionFeatureRegistrationsClient) Get

Get - Returns a feature registration If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 providerNamespace - The provider namespace. featureName - The feature name. options - SubscriptionFeatureRegistrationsClientGetOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/FeatureRegistration/SubscriptionFeatureRegistrationGET.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewSubscriptionFeatureRegistrationsClient("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"subscriptionFeatureRegistrationGroupTestRG",
		"testFeature",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SubscriptionFeatureRegistrationsClient) NewListAllBySubscriptionPager added in v0.4.0

NewListAllBySubscriptionPager - Returns subscription feature registrations for given subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 options - SubscriptionFeatureRegistrationsClientListAllBySubscriptionOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.ListAllBySubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/FeatureRegistration/SubscriptionFeatureRegistrationLISTALL.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewSubscriptionFeatureRegistrationsClient("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListAllBySubscriptionPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*SubscriptionFeatureRegistrationsClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Returns subscription feature registrations for given subscription and provider namespace. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-07-01 providerNamespace - The provider namespace. options - SubscriptionFeatureRegistrationsClientListBySubscriptionOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.ListBySubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/examples/FeatureRegistration/SubscriptionFeatureRegistrationLIST.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armfeatures"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armfeatures.NewSubscriptionFeatureRegistrationsClient("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListBySubscriptionPager("subscriptionFeatureRegistrationGroupTestRG",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions added in v0.2.0

type SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions struct {
	// Subscription Feature Registration Type details.
	SubscriptionFeatureRegistrationType *SubscriptionFeatureRegistration
}

SubscriptionFeatureRegistrationsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.CreateOrUpdate method.

type SubscriptionFeatureRegistrationsClientCreateOrUpdateResponse added in v0.2.0

type SubscriptionFeatureRegistrationsClientCreateOrUpdateResponse struct {
	SubscriptionFeatureRegistration
}

SubscriptionFeatureRegistrationsClientCreateOrUpdateResponse contains the response from method SubscriptionFeatureRegistrationsClient.CreateOrUpdate.

type SubscriptionFeatureRegistrationsClientDeleteOptions added in v0.2.0

type SubscriptionFeatureRegistrationsClientDeleteOptions struct {
}

SubscriptionFeatureRegistrationsClientDeleteOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.Delete method.

type SubscriptionFeatureRegistrationsClientDeleteResponse added in v0.2.0

type SubscriptionFeatureRegistrationsClientDeleteResponse struct {
}

SubscriptionFeatureRegistrationsClientDeleteResponse contains the response from method SubscriptionFeatureRegistrationsClient.Delete.

type SubscriptionFeatureRegistrationsClientGetOptions added in v0.2.0

type SubscriptionFeatureRegistrationsClientGetOptions struct {
}

SubscriptionFeatureRegistrationsClientGetOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.Get method.

type SubscriptionFeatureRegistrationsClientGetResponse added in v0.2.0

type SubscriptionFeatureRegistrationsClientGetResponse struct {
	SubscriptionFeatureRegistration
}

SubscriptionFeatureRegistrationsClientGetResponse contains the response from method SubscriptionFeatureRegistrationsClient.Get.

type SubscriptionFeatureRegistrationsClientListAllBySubscriptionOptions added in v0.2.0

type SubscriptionFeatureRegistrationsClientListAllBySubscriptionOptions struct {
}

SubscriptionFeatureRegistrationsClientListAllBySubscriptionOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.ListAllBySubscription method.

type SubscriptionFeatureRegistrationsClientListAllBySubscriptionResponse added in v0.2.0

type SubscriptionFeatureRegistrationsClientListAllBySubscriptionResponse struct {
	SubscriptionFeatureRegistrationList
}

SubscriptionFeatureRegistrationsClientListAllBySubscriptionResponse contains the response from method SubscriptionFeatureRegistrationsClient.ListAllBySubscription.

type SubscriptionFeatureRegistrationsClientListBySubscriptionOptions added in v0.2.0

type SubscriptionFeatureRegistrationsClientListBySubscriptionOptions struct {
}

SubscriptionFeatureRegistrationsClientListBySubscriptionOptions contains the optional parameters for the SubscriptionFeatureRegistrationsClient.ListBySubscription method.

type SubscriptionFeatureRegistrationsClientListBySubscriptionResponse added in v0.2.0

type SubscriptionFeatureRegistrationsClientListBySubscriptionResponse struct {
	SubscriptionFeatureRegistrationList
}

SubscriptionFeatureRegistrationsClientListBySubscriptionResponse contains the response from method SubscriptionFeatureRegistrationsClient.ListBySubscription.

Jump to

Keyboard shortcuts

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