Documentation ¶
Index ¶
- type AcceptOwnership
- type AcceptOwnershipRequest
- type AcceptOwnershipRequestProperties
- type AcceptOwnershipStatusResponse
- type AliasClient
- func (client *AliasClient) BeginCreate(ctx context.Context, aliasName string, body PutAliasRequest, ...) (*runtime.Poller[AliasClientCreateResponse], error)
- func (client *AliasClient) Delete(ctx context.Context, aliasName string, options *AliasClientDeleteOptions) (AliasClientDeleteResponse, error)
- func (client *AliasClient) Get(ctx context.Context, aliasName string, options *AliasClientGetOptions) (AliasClientGetResponse, error)
- func (client *AliasClient) List(ctx context.Context, options *AliasClientListOptions) (AliasClientListResponse, error)
- type AliasClientBeginCreateOptions
- type AliasClientCreateResponse
- type AliasClientDeleteOptions
- type AliasClientDeleteResponse
- type AliasClientGetOptions
- type AliasClientGetResponse
- type AliasClientListOptions
- type AliasClientListResponse
- type AliasListResult
- type AliasResponse
- type AliasResponseProperties
- type BillingAccountClient
- type BillingAccountClientGetPolicyOptions
- type BillingAccountClientGetPolicyResponse
- type BillingAccountPoliciesResponse
- type BillingAccountPoliciesResponseProperties
- type CanceledSubscriptionID
- type Client
- func (client *Client) AcceptOwnershipStatus(ctx context.Context, subscriptionID string, ...) (ClientAcceptOwnershipStatusResponse, error)
- func (client *Client) BeginAcceptOwnership(ctx context.Context, subscriptionID string, body AcceptOwnershipRequest, ...) (*runtime.Poller[ClientAcceptOwnershipResponse], error)
- func (client *Client) Cancel(ctx context.Context, subscriptionID string, options *ClientCancelOptions) (ClientCancelResponse, error)
- func (client *Client) Enable(ctx context.Context, subscriptionID string, options *ClientEnableOptions) (ClientEnableResponse, error)
- func (client *Client) Rename(ctx context.Context, subscriptionID string, body Name, ...) (ClientRenameResponse, error)
- type ClientAcceptOwnershipResponse
- type ClientAcceptOwnershipStatusOptions
- type ClientAcceptOwnershipStatusResponse
- type ClientBeginAcceptOwnershipOptions
- type ClientCancelOptions
- type ClientCancelResponse
- type ClientEnableOptions
- type ClientEnableResponse
- type ClientFactory
- func (c *ClientFactory) NewAliasClient() *AliasClient
- func (c *ClientFactory) NewBillingAccountClient() *BillingAccountClient
- func (c *ClientFactory) NewClient() *Client
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewPolicyClient() *PolicyClient
- func (c *ClientFactory) NewSubscriptionsClient() *SubscriptionsClient
- func (c *ClientFactory) NewTenantsClient() *TenantsClient
- type ClientRenameOptions
- type ClientRenameResponse
- type CreatedByType
- type EnabledSubscriptionID
- type ErrorResponse
- type ErrorResponseBody
- type GetTenantPolicyListResponse
- type GetTenantPolicyResponse
- type ListResult
- type Location
- type LocationListResult
- type Name
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Policies
- type PolicyClient
- func (client *PolicyClient) AddUpdatePolicyForTenant(ctx context.Context, body PutTenantPolicyRequestProperties, ...) (PolicyClientAddUpdatePolicyForTenantResponse, error)
- func (client *PolicyClient) GetPolicyForTenant(ctx context.Context, options *PolicyClientGetPolicyForTenantOptions) (PolicyClientGetPolicyForTenantResponse, error)
- func (client *PolicyClient) NewListPolicyForTenantPager(options *PolicyClientListPolicyForTenantOptions) *runtime.Pager[PolicyClientListPolicyForTenantResponse]
- type PolicyClientAddUpdatePolicyForTenantOptions
- type PolicyClientAddUpdatePolicyForTenantResponse
- type PolicyClientGetPolicyForTenantOptions
- type PolicyClientGetPolicyForTenantResponse
- type PolicyClientListPolicyForTenantOptions
- type PolicyClientListPolicyForTenantResponse
- type ProvisioningState
- type PutAliasRequest
- type PutAliasRequestAdditionalProperties
- type PutAliasRequestProperties
- type PutTenantPolicyRequestProperties
- type RenamedSubscriptionID
- type ServiceTenantResponse
- type SpendingLimit
- type Subscription
- type SubscriptionState
- type SubscriptionsClient
- func (client *SubscriptionsClient) Get(ctx context.Context, subscriptionID string, ...) (SubscriptionsClientGetResponse, error)
- func (client *SubscriptionsClient) NewListLocationsPager(subscriptionID string, options *SubscriptionsClientListLocationsOptions) *runtime.Pager[SubscriptionsClientListLocationsResponse]
- func (client *SubscriptionsClient) NewListPager(options *SubscriptionsClientListOptions) *runtime.Pager[SubscriptionsClientListResponse]
- type SubscriptionsClientGetOptions
- type SubscriptionsClientGetResponse
- type SubscriptionsClientListLocationsOptions
- type SubscriptionsClientListLocationsResponse
- type SubscriptionsClientListOptions
- type SubscriptionsClientListResponse
- type SystemData
- type TenantIDDescription
- type TenantListResult
- type TenantPolicy
- type TenantsClient
- type TenantsClientListOptions
- type TenantsClientListResponse
- type Workload
Examples ¶
- AliasClient.BeginCreate
- AliasClient.Delete
- AliasClient.Get
- AliasClient.List
- BillingAccountClient.GetPolicy
- Client.AcceptOwnershipStatus
- Client.BeginAcceptOwnership
- Client.Cancel
- Client.Enable
- Client.Rename
- OperationsClient.NewListPager
- PolicyClient.AddUpdatePolicyForTenant
- PolicyClient.GetPolicyForTenant
- PolicyClient.NewListPolicyForTenantPager
- SubscriptionsClient.Get
- SubscriptionsClient.NewListLocationsPager
- SubscriptionsClient.NewListPager
- TenantsClient.NewListPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptOwnership ¶
type AcceptOwnership string
AcceptOwnership - The accept ownership state of the resource.
const ( AcceptOwnershipCompleted AcceptOwnership = "Completed" AcceptOwnershipExpired AcceptOwnership = "Expired" AcceptOwnershipPending AcceptOwnership = "Pending" )
func PossibleAcceptOwnershipValues ¶
func PossibleAcceptOwnershipValues() []AcceptOwnership
PossibleAcceptOwnershipValues returns the possible values for the AcceptOwnership const type.
type AcceptOwnershipRequest ¶
type AcceptOwnershipRequest struct { // Accept subscription ownership request properties. Properties *AcceptOwnershipRequestProperties }
AcceptOwnershipRequest - The parameters required to accept subscription ownership.
func (AcceptOwnershipRequest) MarshalJSON ¶ added in v1.1.0
func (a AcceptOwnershipRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AcceptOwnershipRequest.
func (*AcceptOwnershipRequest) UnmarshalJSON ¶ added in v1.1.0
func (a *AcceptOwnershipRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AcceptOwnershipRequest.
type AcceptOwnershipRequestProperties ¶
type AcceptOwnershipRequestProperties struct { // REQUIRED; The friendly name of the subscription. DisplayName *string // Management group Id for the subscription. ManagementGroupID *string // Tags for the subscription Tags map[string]*string }
AcceptOwnershipRequestProperties - Accept subscription ownership request properties.
func (AcceptOwnershipRequestProperties) MarshalJSON ¶
func (a AcceptOwnershipRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AcceptOwnershipRequestProperties.
func (*AcceptOwnershipRequestProperties) UnmarshalJSON ¶ added in v1.1.0
func (a *AcceptOwnershipRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AcceptOwnershipRequestProperties.
type AcceptOwnershipStatusResponse ¶
type AcceptOwnershipStatusResponse struct { // The display name of the subscription. DisplayName *string // Tenant Id of the subscription SubscriptionTenantID *string // Tags for the subscription Tags map[string]*string // READ-ONLY; The accept ownership state of the resource. AcceptOwnershipState *AcceptOwnership // READ-ONLY; UPN of the billing owner BillingOwner *string // READ-ONLY; Newly created subscription Id. SubscriptionID *string }
AcceptOwnershipStatusResponse - Subscription Accept Ownership Response
func (AcceptOwnershipStatusResponse) MarshalJSON ¶
func (a AcceptOwnershipStatusResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AcceptOwnershipStatusResponse.
func (*AcceptOwnershipStatusResponse) UnmarshalJSON ¶ added in v1.1.0
func (a *AcceptOwnershipStatusResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AcceptOwnershipStatusResponse.
type AliasClient ¶
type AliasClient struct {
// contains filtered or unexported fields
}
AliasClient contains the methods for the Alias group. Don't use this type directly, use NewAliasClient() instead.
func NewAliasClient ¶
func NewAliasClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AliasClient, error)
NewAliasClient creates a new instance of AliasClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*AliasClient) BeginCreate ¶
func (client *AliasClient) BeginCreate(ctx context.Context, aliasName string, body PutAliasRequest, options *AliasClientBeginCreateOptions) (*runtime.Poller[AliasClientCreateResponse], error)
BeginCreate - Create Alias Subscription. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- aliasName - AliasName is the name for the subscription creation request. Note that this is not the same as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation.
- options - AliasClientBeginCreateOptions contains the optional parameters for the AliasClient.BeginCreate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/createAlias.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/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewAliasClient().BeginCreate(ctx, "aliasForNewSub", armsubscription.PutAliasRequest{ Properties: &armsubscription.PutAliasRequestProperties{ AdditionalProperties: &armsubscription.PutAliasRequestAdditionalProperties{ SubscriptionOwnerID: to.Ptr("f09b39eb-c496-482c-9ab9-afd799572f4c"), SubscriptionTenantID: to.Ptr("66f6e4d6-07dc-4aea-94ea-e12d3026a3c8"), Tags: map[string]*string{ "tag1": to.Ptr("Messi"), "tag2": to.Ptr("Ronaldo"), "tag3": to.Ptr("Lebron"), }, }, BillingScope: to.Ptr("/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH"), DisplayName: to.Ptr("Test Subscription"), Workload: to.Ptr(armsubscription.WorkloadProduction), }, }, 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.AliasResponse = armsubscription.AliasResponse{ // Name: to.Ptr("string"), // Type: to.Ptr("string"), // ID: to.Ptr("string"), // Properties: &armsubscription.AliasResponseProperties{ // AcceptOwnershipState: to.Ptr(armsubscription.AcceptOwnershipPending), // AcceptOwnershipURL: to.Ptr("/providers/Microsoft.Subscription/e2283d0f-acad-4904-b803-627dd74cc072/acceptOwnership"), // BillingScope: to.Ptr("/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH"), // DisplayName: to.Ptr("Test Subscription"), // ProvisioningState: to.Ptr(armsubscription.ProvisioningStateSucceeded), // SubscriptionID: to.Ptr("e2283d0f-acad-4904-b803-627dd74cc072"), // SubscriptionOwnerID: to.Ptr("f09b39eb-c496-482c-9ab9-afd799572f4c"), // Tags: map[string]*string{ // "tag1": to.Ptr("Messi"), // "tag2": to.Ptr("Ronaldo"), // "tag3": to.Ptr("Lebron"), // }, // Workload: to.Ptr(armsubscription.WorkloadProduction), // }, // } }
Output:
func (*AliasClient) Delete ¶
func (client *AliasClient) Delete(ctx context.Context, aliasName string, options *AliasClientDeleteOptions) (AliasClientDeleteResponse, error)
Delete - Delete Alias. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- aliasName - AliasName is the name for the subscription creation request. Note that this is not the same as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation.
- options - AliasClientDeleteOptions contains the optional parameters for the AliasClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/deleteAlias.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewAliasClient().Delete(ctx, "aliasForNewSub", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*AliasClient) Get ¶
func (client *AliasClient) Get(ctx context.Context, aliasName string, options *AliasClientGetOptions) (AliasClientGetResponse, error)
Get - Get Alias Subscription. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- aliasName - AliasName is the name for the subscription creation request. Note that this is not the same as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation.
- options - AliasClientGetOptions contains the optional parameters for the AliasClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getAlias.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAliasClient().Get(ctx, "aliasForNewSub", 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.AliasResponse = armsubscription.AliasResponse{ // Name: to.Ptr("string"), // Type: to.Ptr("string"), // ID: to.Ptr("string"), // Properties: &armsubscription.AliasResponseProperties{ // AcceptOwnershipState: to.Ptr(armsubscription.AcceptOwnershipPending), // AcceptOwnershipURL: to.Ptr("/providers/Microsoft.Subscription/e2283d0f-acad-4904-b803-627dd74cc072/acceptOwnership"), // BillingScope: to.Ptr("/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH"), // DisplayName: to.Ptr("Test Subscription"), // ProvisioningState: to.Ptr(armsubscription.ProvisioningStateSucceeded), // SubscriptionID: to.Ptr("e2283d0f-acad-4904-b803-627dd74cc072"), // SubscriptionOwnerID: to.Ptr("f09b39eb-c496-482c-9ab9-afd799572f4c"), // Tags: map[string]*string{ // "tag1": to.Ptr("Messi"), // "tag2": to.Ptr("Ronaldo"), // "tag3": to.Ptr("Lebron"), // }, // Workload: to.Ptr(armsubscription.WorkloadProduction), // }, // } }
Output:
func (*AliasClient) List ¶
func (client *AliasClient) List(ctx context.Context, options *AliasClientListOptions) (AliasClientListResponse, error)
List - List Alias Subscription. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- options - AliasClientListOptions contains the optional parameters for the AliasClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/listAlias.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAliasClient().List(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.AliasListResult = armsubscription.AliasListResult{ // Value: []*armsubscription.AliasResponse{ // { // Name: to.Ptr("string"), // Type: to.Ptr("string"), // ID: to.Ptr("string"), // Properties: &armsubscription.AliasResponseProperties{ // AcceptOwnershipState: to.Ptr(armsubscription.AcceptOwnershipPending), // AcceptOwnershipURL: to.Ptr("/providers/Microsoft.Subscription/e2283d0f-acad-4904-b803-627dd74cc072/acceptOwnership"), // BillingScope: to.Ptr("/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH"), // DisplayName: to.Ptr("Test Subscription"), // ProvisioningState: to.Ptr(armsubscription.ProvisioningStateSucceeded), // SubscriptionID: to.Ptr("e2283d0f-acad-4904-b803-627dd74cc072"), // SubscriptionOwnerID: to.Ptr("f09b39eb-c496-482c-9ab9-afd799572f4c"), // Tags: map[string]*string{ // "tag1": to.Ptr("Messi"), // "tag2": to.Ptr("Ronaldo"), // "tag3": to.Ptr("Lebron"), // }, // Workload: to.Ptr(armsubscription.WorkloadProduction), // }, // }, // { // Name: to.Ptr("string"), // Type: to.Ptr("string"), // ID: to.Ptr("string"), // Properties: &armsubscription.AliasResponseProperties{ // AcceptOwnershipState: to.Ptr(armsubscription.AcceptOwnershipPending), // AcceptOwnershipURL: to.Ptr("/providers/Microsoft.Subscription/091c6e56-a835-4422-a082-0427308ca9ee/acceptOwnership"), // BillingScope: to.Ptr("/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH"), // DisplayName: to.Ptr("Test Subscription 2"), // ProvisioningState: to.Ptr(armsubscription.ProvisioningStateSucceeded), // SubscriptionID: to.Ptr("091c6e56-a835-4422-a082-0427308ca9ee"), // SubscriptionOwnerID: to.Ptr("f09b39eb-c496-482c-9ab9-afd799572f4c"), // Tags: map[string]*string{ // "tag1": to.Ptr("Messi2"), // "tag2": to.Ptr("Ronaldo2"), // "tag3": to.Ptr("Lebron2"), // }, // Workload: to.Ptr(armsubscription.WorkloadProduction), // }, // }}, // } }
Output:
type AliasClientBeginCreateOptions ¶ added in v0.2.0
type AliasClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
AliasClientBeginCreateOptions contains the optional parameters for the AliasClient.BeginCreate method.
type AliasClientCreateResponse ¶ added in v0.2.0
type AliasClientCreateResponse struct { // Subscription Information with the alias. AliasResponse }
AliasClientCreateResponse contains the response from method AliasClient.BeginCreate.
type AliasClientDeleteOptions ¶ added in v0.2.0
type AliasClientDeleteOptions struct { }
AliasClientDeleteOptions contains the optional parameters for the AliasClient.Delete method.
type AliasClientDeleteResponse ¶ added in v0.2.0
type AliasClientDeleteResponse struct { }
AliasClientDeleteResponse contains the response from method AliasClient.Delete.
type AliasClientGetOptions ¶ added in v0.2.0
type AliasClientGetOptions struct { }
AliasClientGetOptions contains the optional parameters for the AliasClient.Get method.
type AliasClientGetResponse ¶ added in v0.2.0
type AliasClientGetResponse struct { // Subscription Information with the alias. AliasResponse }
AliasClientGetResponse contains the response from method AliasClient.Get.
type AliasClientListOptions ¶ added in v0.2.0
type AliasClientListOptions struct { }
AliasClientListOptions contains the optional parameters for the AliasClient.List method.
type AliasClientListResponse ¶ added in v0.2.0
type AliasClientListResponse struct { // The list of aliases. AliasListResult }
AliasClientListResponse contains the response from method AliasClient.List.
type AliasListResult ¶
type AliasListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of alias. Value []*AliasResponse }
AliasListResult - The list of aliases.
func (AliasListResult) MarshalJSON ¶ added in v0.2.0
func (a AliasListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AliasListResult.
func (*AliasListResult) UnmarshalJSON ¶ added in v1.1.0
func (a *AliasListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AliasListResult.
type AliasResponse ¶ added in v0.2.0
type AliasResponse struct { // Subscription Alias response properties. Properties *AliasResponseProperties // READ-ONLY; Fully qualified ID for the alias resource. ID *string // READ-ONLY; Alias ID. Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *SystemData // READ-ONLY; Resource type, Microsoft.Subscription/aliases. Type *string }
AliasResponse - Subscription Information with the alias.
func (AliasResponse) MarshalJSON ¶ added in v1.1.0
func (a AliasResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AliasResponse.
func (*AliasResponse) UnmarshalJSON ¶ added in v1.1.0
func (a *AliasResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AliasResponse.
type AliasResponseProperties ¶ added in v0.2.0
type AliasResponseProperties struct { // Billing scope of the subscription. For CustomerLed and FieldLed - /billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName} // For PartnerLed - // /billingAccounts/{billingAccountName}/customers/{customerName} For Legacy EA - /billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName} BillingScope *string // Created Time CreatedTime *string // The display name of the subscription. DisplayName *string // The Management Group Id. ManagementGroupID *string // The provisioning state of the resource. ProvisioningState *ProvisioningState // Reseller Id ResellerID *string // Owner Id of the subscription SubscriptionOwnerID *string // Tags for the subscription Tags map[string]*string // The workload type of the subscription. It can be either Production or DevTest. Workload *Workload // READ-ONLY; The accept ownership state of the resource. AcceptOwnershipState *AcceptOwnership // READ-ONLY; Url to accept ownership of the subscription. AcceptOwnershipURL *string // READ-ONLY; Newly created subscription Id. SubscriptionID *string }
AliasResponseProperties - Put subscription creation result properties.
func (AliasResponseProperties) MarshalJSON ¶ added in v0.2.0
func (a AliasResponseProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AliasResponseProperties.
func (*AliasResponseProperties) UnmarshalJSON ¶ added in v1.1.0
func (a *AliasResponseProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AliasResponseProperties.
type BillingAccountClient ¶
type BillingAccountClient struct {
// contains filtered or unexported fields
}
BillingAccountClient contains the methods for the BillingAccount group. Don't use this type directly, use NewBillingAccountClient() instead.
func NewBillingAccountClient ¶
func NewBillingAccountClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*BillingAccountClient, error)
NewBillingAccountClient creates a new instance of BillingAccountClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*BillingAccountClient) GetPolicy ¶
func (client *BillingAccountClient) GetPolicy(ctx context.Context, billingAccountID string, options *BillingAccountClientGetPolicyOptions) (BillingAccountClientGetPolicyResponse, error)
GetPolicy - Get Billing Account Policy. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- billingAccountID - Billing Account Id.
- options - BillingAccountClientGetPolicyOptions contains the optional parameters for the BillingAccountClient.GetPolicy method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getBillingAccountPolicy.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewBillingAccountClient().GetPolicy(ctx, "testBillingAccountId", 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.BillingAccountPoliciesResponse = armsubscription.BillingAccountPoliciesResponse{ // Name: to.Ptr("testBillingAccountId"), // Type: to.Ptr("Microsoft.Subscription/policies"), // ID: to.Ptr("/providers/Microsoft.Subscription/Policies/policyForBillingAccount"), // Properties: &armsubscription.BillingAccountPoliciesResponseProperties{ // AllowTransfers: to.Ptr(true), // ServiceTenants: []*armsubscription.ServiceTenantResponse{ // { // TenantID: to.Ptr("b8ed2088-c458-4e77-bd61-9e048d96a1c0"), // TenantName: to.Ptr("testServiceTenant"), // }}, // }, // } }
Output:
type BillingAccountClientGetPolicyOptions ¶ added in v0.2.0
type BillingAccountClientGetPolicyOptions struct { }
BillingAccountClientGetPolicyOptions contains the optional parameters for the BillingAccountClient.GetPolicy method.
type BillingAccountClientGetPolicyResponse ¶ added in v0.2.0
type BillingAccountClientGetPolicyResponse struct { // Billing account policies information. BillingAccountPoliciesResponse }
BillingAccountClientGetPolicyResponse contains the response from method BillingAccountClient.GetPolicy.
type BillingAccountPoliciesResponse ¶
type BillingAccountPoliciesResponse struct { // Billing account policies response properties. Properties *BillingAccountPoliciesResponseProperties // READ-ONLY; Fully qualified ID for the policy. ID *string // READ-ONLY; Policy name. Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *SystemData // READ-ONLY; Resource type. Type *string }
BillingAccountPoliciesResponse - Billing account policies information.
func (BillingAccountPoliciesResponse) MarshalJSON ¶ added in v1.1.0
func (b BillingAccountPoliciesResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BillingAccountPoliciesResponse.
func (*BillingAccountPoliciesResponse) UnmarshalJSON ¶ added in v1.1.0
func (b *BillingAccountPoliciesResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BillingAccountPoliciesResponse.
type BillingAccountPoliciesResponseProperties ¶
type BillingAccountPoliciesResponseProperties struct { // Determine if the transfers are allowed for the billing account AllowTransfers *bool // Service tenant for the billing account. ServiceTenants []*ServiceTenantResponse }
BillingAccountPoliciesResponseProperties - Put billing account policies response properties.
func (BillingAccountPoliciesResponseProperties) MarshalJSON ¶
func (b BillingAccountPoliciesResponseProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BillingAccountPoliciesResponseProperties.
func (*BillingAccountPoliciesResponseProperties) UnmarshalJSON ¶ added in v1.1.0
func (b *BillingAccountPoliciesResponseProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BillingAccountPoliciesResponseProperties.
type CanceledSubscriptionID ¶
type CanceledSubscriptionID struct { // READ-ONLY; The ID of the canceled subscription SubscriptionID *string }
CanceledSubscriptionID - The ID of the canceled subscription
func (CanceledSubscriptionID) MarshalJSON ¶ added in v1.1.0
func (c CanceledSubscriptionID) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CanceledSubscriptionID.
func (*CanceledSubscriptionID) UnmarshalJSON ¶ added in v1.1.0
func (c *CanceledSubscriptionID) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CanceledSubscriptionID.
type Client ¶ added in v0.2.0
type Client struct {
// contains filtered or unexported fields
}
Client contains the methods for the Subscription group. Don't use this type directly, use NewClient() instead.
func NewClient ¶ added in v0.2.0
func NewClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error)
NewClient creates a new instance of Client with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*Client) AcceptOwnershipStatus ¶ added in v0.2.0
func (client *Client) AcceptOwnershipStatus(ctx context.Context, subscriptionID string, options *ClientAcceptOwnershipStatusOptions) (ClientAcceptOwnershipStatusResponse, error)
AcceptOwnershipStatus - Accept subscription ownership status. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- subscriptionID - Subscription Id.
- options - ClientAcceptOwnershipStatusOptions contains the optional parameters for the Client.AcceptOwnershipStatus method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/acceptOwnershipStatus.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewClient().AcceptOwnershipStatus(ctx, "291bba3f-e0a5-47bc-a099-3bdcb2a50a05", 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.AcceptOwnershipStatusResponse = armsubscription.AcceptOwnershipStatusResponse{ // AcceptOwnershipState: to.Ptr(armsubscription.AcceptOwnershipPending), // BillingOwner: to.Ptr("abc@test.com"), // DisplayName: to.Ptr("Test Subscription"), // SubscriptionID: to.Ptr("291bba3f-e0a5-47bc-a099-3bdcb2a50a05"), // SubscriptionTenantID: to.Ptr("6c541ca7-1cab-4ea0-adde-6305e1d534e2"), // Tags: map[string]*string{ // "tag1": to.Ptr("TagValue1"), // }, // } }
Output:
func (*Client) BeginAcceptOwnership ¶ added in v0.2.0
func (client *Client) BeginAcceptOwnership(ctx context.Context, subscriptionID string, body AcceptOwnershipRequest, options *ClientBeginAcceptOwnershipOptions) (*runtime.Poller[ClientAcceptOwnershipResponse], error)
BeginAcceptOwnership - Accept subscription ownership. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- subscriptionID - Subscription Id.
- options - ClientBeginAcceptOwnershipOptions contains the optional parameters for the Client.BeginAcceptOwnership method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/acceptSubscriptionOwnership.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/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClient().BeginAcceptOwnership(ctx, "291bba3f-e0a5-47bc-a099-3bdcb2a50a05", armsubscription.AcceptOwnershipRequest{ Properties: &armsubscription.AcceptOwnershipRequestProperties{ DisplayName: to.Ptr("Test Subscription"), Tags: map[string]*string{ "tag1": to.Ptr("Messi"), "tag2": to.Ptr("Ronaldo"), "tag3": to.Ptr("Lebron"), }, }, }, 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 (*Client) Cancel ¶ added in v0.2.0
func (client *Client) Cancel(ctx context.Context, subscriptionID string, options *ClientCancelOptions) (ClientCancelResponse, error)
Cancel - The operation to cancel a subscription If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- subscriptionID - Subscription Id.
- options - ClientCancelOptions contains the optional parameters for the Client.Cancel method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/cancelSubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewClient().Cancel(ctx, "83aa47df-e3e9-49ff-877b-94304bf3d3ad", 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.CanceledSubscriptionID = armsubscription.CanceledSubscriptionID{ // SubscriptionID: to.Ptr("83aa47df-e3e9-49ff-877b-94304bf3d3ad"), // } }
Output:
func (*Client) Enable ¶ added in v0.2.0
func (client *Client) Enable(ctx context.Context, subscriptionID string, options *ClientEnableOptions) (ClientEnableResponse, error)
Enable - The operation to enable a subscription If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- subscriptionID - Subscription Id.
- options - ClientEnableOptions contains the optional parameters for the Client.Enable method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/enableSubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewClient().Enable(ctx, "7948bcee-488c-47ce-941c-38e20ede803d", 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.EnabledSubscriptionID = armsubscription.EnabledSubscriptionID{ // SubscriptionID: to.Ptr("7948bcee-488c-47ce-941c-38e20ede803d"), // } }
Output:
func (*Client) Rename ¶ added in v0.2.0
func (client *Client) Rename(ctx context.Context, subscriptionID string, body Name, options *ClientRenameOptions) (ClientRenameResponse, error)
Rename - The operation to rename a subscription If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- subscriptionID - Subscription Id.
- body - Subscription Name
- options - ClientRenameOptions contains the optional parameters for the Client.Rename method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/renameSubscription.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/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewClient().Rename(ctx, "83aa47df-e3e9-49ff-877b-94304bf3d3ad", armsubscription.Name{ SubscriptionName: to.Ptr("Test Sub"), }, 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.RenamedSubscriptionID = armsubscription.RenamedSubscriptionID{ // SubscriptionID: to.Ptr("83aa47df-e3e9-49ff-877b-94304bf3d3ad"), // } }
Output:
type ClientAcceptOwnershipResponse ¶ added in v0.2.0
type ClientAcceptOwnershipResponse struct { }
ClientAcceptOwnershipResponse contains the response from method Client.BeginAcceptOwnership.
type ClientAcceptOwnershipStatusOptions ¶ added in v0.2.0
type ClientAcceptOwnershipStatusOptions struct { }
ClientAcceptOwnershipStatusOptions contains the optional parameters for the Client.AcceptOwnershipStatus method.
type ClientAcceptOwnershipStatusResponse ¶ added in v0.2.0
type ClientAcceptOwnershipStatusResponse struct { // Subscription Accept Ownership Response AcceptOwnershipStatusResponse }
ClientAcceptOwnershipStatusResponse contains the response from method Client.AcceptOwnershipStatus.
type ClientBeginAcceptOwnershipOptions ¶ added in v0.2.0
type ClientBeginAcceptOwnershipOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ClientBeginAcceptOwnershipOptions contains the optional parameters for the Client.BeginAcceptOwnership method.
type ClientCancelOptions ¶ added in v0.2.0
type ClientCancelOptions struct { }
ClientCancelOptions contains the optional parameters for the Client.Cancel method.
type ClientCancelResponse ¶ added in v0.2.0
type ClientCancelResponse struct { // The ID of the canceled subscription CanceledSubscriptionID }
ClientCancelResponse contains the response from method Client.Cancel.
type ClientEnableOptions ¶ added in v0.2.0
type ClientEnableOptions struct { }
ClientEnableOptions contains the optional parameters for the Client.Enable method.
type ClientEnableResponse ¶ added in v0.2.0
type ClientEnableResponse struct { // The ID of the subscriptions that is being enabled EnabledSubscriptionID }
ClientEnableResponse contains the response from method Client.Enable.
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(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.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewAliasClient ¶ added in v1.1.0
func (c *ClientFactory) NewAliasClient() *AliasClient
NewAliasClient creates a new instance of AliasClient.
func (*ClientFactory) NewBillingAccountClient ¶ added in v1.1.0
func (c *ClientFactory) NewBillingAccountClient() *BillingAccountClient
NewBillingAccountClient creates a new instance of BillingAccountClient.
func (*ClientFactory) NewClient ¶ added in v1.1.0
func (c *ClientFactory) NewClient() *Client
NewClient creates a new instance of Client.
func (*ClientFactory) NewOperationsClient ¶ added in v1.1.0
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
func (*ClientFactory) NewPolicyClient ¶ added in v1.1.0
func (c *ClientFactory) NewPolicyClient() *PolicyClient
NewPolicyClient creates a new instance of PolicyClient.
func (*ClientFactory) NewSubscriptionsClient ¶ added in v1.1.0
func (c *ClientFactory) NewSubscriptionsClient() *SubscriptionsClient
NewSubscriptionsClient creates a new instance of SubscriptionsClient.
func (*ClientFactory) NewTenantsClient ¶ added in v1.1.0
func (c *ClientFactory) NewTenantsClient() *TenantsClient
NewTenantsClient creates a new instance of TenantsClient.
type ClientRenameOptions ¶ added in v0.2.0
type ClientRenameOptions struct { }
ClientRenameOptions contains the optional parameters for the Client.Rename method.
type ClientRenameResponse ¶ added in v0.2.0
type ClientRenameResponse struct { // The ID of the subscriptions that is being renamed RenamedSubscriptionID }
ClientRenameResponse contains the response from method Client.Rename.
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 EnabledSubscriptionID ¶
type EnabledSubscriptionID struct { // READ-ONLY; The ID of the subscriptions that is being enabled SubscriptionID *string }
EnabledSubscriptionID - The ID of the subscriptions that is being enabled
func (EnabledSubscriptionID) MarshalJSON ¶ added in v1.1.0
func (e EnabledSubscriptionID) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnabledSubscriptionID.
func (*EnabledSubscriptionID) UnmarshalJSON ¶ added in v1.1.0
func (e *EnabledSubscriptionID) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnabledSubscriptionID.
type ErrorResponse ¶
type ErrorResponse struct { // Error code Code *string // Error message indicating why the operation failed. Message *string }
ErrorResponse - Describes the format of 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 { // Error code Code *string // The details of the error. Error *ErrorResponse // Error message indicating why the operation failed. Message *string }
ErrorResponseBody - Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
func (ErrorResponseBody) MarshalJSON ¶ added in v1.1.0
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 GetTenantPolicyListResponse ¶
type GetTenantPolicyListResponse struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of tenant policies. Value []*GetTenantPolicyResponse }
GetTenantPolicyListResponse - Tenant policy information list.
func (GetTenantPolicyListResponse) MarshalJSON ¶
func (g GetTenantPolicyListResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GetTenantPolicyListResponse.
func (*GetTenantPolicyListResponse) UnmarshalJSON ¶ added in v1.1.0
func (g *GetTenantPolicyListResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GetTenantPolicyListResponse.
type GetTenantPolicyResponse ¶
type GetTenantPolicyResponse struct { // Tenant policy properties. Properties *TenantPolicy // READ-ONLY; Policy Id. ID *string // READ-ONLY; Policy name. Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *SystemData // READ-ONLY; Resource type. Type *string }
GetTenantPolicyResponse - Tenant policy Information.
func (GetTenantPolicyResponse) MarshalJSON ¶ added in v1.1.0
func (g GetTenantPolicyResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GetTenantPolicyResponse.
func (*GetTenantPolicyResponse) UnmarshalJSON ¶ added in v1.1.0
func (g *GetTenantPolicyResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GetTenantPolicyResponse.
type ListResult ¶ added in v0.2.0
type ListResult struct { // The URL to get the next set of results. NextLink *string // An array of subscriptions. Value []*Subscription }
ListResult - Subscription list operation response.
func (ListResult) MarshalJSON ¶ added in v0.2.0
func (l ListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ListResult.
func (*ListResult) UnmarshalJSON ¶ added in v1.1.0
func (l *ListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ListResult.
type Location ¶ added in v0.2.0
type Location struct { // READ-ONLY; The display name of the location. DisplayName *string // READ-ONLY; The fully qualified ID of the location. For example, /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. ID *string // READ-ONLY; The latitude of the location. Latitude *string // READ-ONLY; The longitude of the location. Longitude *string // READ-ONLY; The location name. Name *string // READ-ONLY; The subscription ID. SubscriptionID *string }
Location information.
func (Location) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type Location.
func (*Location) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Location.
type LocationListResult ¶ added in v0.2.0
type LocationListResult struct { // An array of locations. Value []*Location }
LocationListResult - Location list operation response.
func (LocationListResult) MarshalJSON ¶ added in v0.2.0
func (l LocationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LocationListResult.
func (*LocationListResult) UnmarshalJSON ¶ added in v1.1.0
func (l *LocationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LocationListResult.
type Name ¶ added in v0.2.0
type Name struct { // New subscription name SubscriptionName *string }
Name - The new name of the subscription.
func (Name) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type Name.
func (*Name) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Name.
type Operation ¶
type Operation struct { // The object that represents the operation. Display *OperationDisplay // Indicates whether the operation is a data action IsDataAction *bool // Operation name: {provider}/{resource}/{operation} Name *string }
Operation - REST API operation
func (Operation) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct { // Localized friendly description for the operation Description *string // Operation type: Read, write, delete, etc. Operation *string // Service provider: Microsoft.Subscription Provider *string // Resource on which the operation is performed: Profile, endpoint, etc. Resource *string }
OperationDisplay - The object that represents 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 OperationListResult ¶
type OperationListResult struct { // URL to get the next set of operation list results if there are any. NextLink *string // List of operations. Value []*Operation }
OperationListResult - Result of the request to list operations. It contains a list of operations and a URL link to get the next set of results.
func (OperationListResult) MarshalJSON ¶
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
func (*OperationListResult) UnmarshalJSON ¶ added in v1.1.0
func (o *OperationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
type OperationsClient ¶
type OperationsClient struct {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)
NewOperationsClient creates a new instance of OperationsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*OperationsClient) NewListPager ¶ added in v0.4.0
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - Lists all of the available Microsoft.Subscription API operations.
Generated from API version 2021-10-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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getOperations.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(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 = armsubscription.OperationListResult{ // Value: []*armsubscription.Operation{ // { // Name: to.Ptr("Microsoft.Subscription/createOperation/action"), // Display: &armsubscription.OperationDisplay{ // Operation: to.Ptr("Create a subscription"), // Provider: to.Ptr("Microsoft Subscription"), // Resource: to.Ptr("Resources"), // }, // IsDataAction: to.Ptr(false), // }}, // } } }
Output:
type OperationsClientListOptions ¶ added in v0.2.0
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶ added in v0.2.0
type OperationsClientListResponse struct { // Result of the request to list operations. It contains a list of operations and a URL link to get the next set of results. OperationListResult }
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type Policies ¶ added in v0.2.0
type Policies struct { // READ-ONLY; The subscription location placement ID. The ID indicates which regions are visible for a subscription. For example, // a subscription with a location placement Id of Public_2014-09-01 has access to Azure // public regions. LocationPlacementID *string // READ-ONLY; The subscription quota ID. QuotaID *string // READ-ONLY; The subscription spending limit. SpendingLimit *SpendingLimit }
Policies - Subscription policies.
func (Policies) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type Policies.
func (*Policies) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Policies.
type PolicyClient ¶ added in v0.2.0
type PolicyClient struct {
// contains filtered or unexported fields
}
PolicyClient contains the methods for the SubscriptionPolicy group. Don't use this type directly, use NewPolicyClient() instead.
func NewPolicyClient ¶ added in v0.2.0
func NewPolicyClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PolicyClient, error)
NewPolicyClient creates a new instance of PolicyClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PolicyClient) AddUpdatePolicyForTenant ¶ added in v0.2.0
func (client *PolicyClient) AddUpdatePolicyForTenant(ctx context.Context, body PutTenantPolicyRequestProperties, options *PolicyClientAddUpdatePolicyForTenantOptions) (PolicyClientAddUpdatePolicyForTenantResponse, error)
AddUpdatePolicyForTenant - Create or Update Subscription tenant policy for user's tenant. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- options - PolicyClientAddUpdatePolicyForTenantOptions contains the optional parameters for the PolicyClient.AddUpdatePolicyForTenant method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/changeTenantPolicy.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/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPolicyClient().AddUpdatePolicyForTenant(ctx, armsubscription.PutTenantPolicyRequestProperties{ BlockSubscriptionsIntoTenant: to.Ptr(true), BlockSubscriptionsLeavingTenant: to.Ptr(true), ExemptedPrincipals: []*string{ to.Ptr("e879cf0f-2b4d-5431-109a-f72fc9868693"), to.Ptr("9792da87-c97b-410d-a97d-27021ba09ce6")}, }, 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.GetTenantPolicyResponse = armsubscription.GetTenantPolicyResponse{ // Name: to.Ptr("default"), // Type: to.Ptr("providers/Microsoft.Subscription/policies"), // ID: to.Ptr("providers/Microsoft.Subscription/policies/default"), // Properties: &armsubscription.TenantPolicy{ // BlockSubscriptionsIntoTenant: to.Ptr(true), // BlockSubscriptionsLeavingTenant: to.Ptr(true), // ExemptedPrincipals: []*string{ // to.Ptr("e879cf0f-2b4d-5431-109a-f72fc9868693"), // to.Ptr("9792da87-c97b-410d-a97d-27021ba09ce6")}, // PolicyID: to.Ptr("291bba3f-e0a5-47bc-a099-3bdcb2a50a05"), // }, // } }
Output:
func (*PolicyClient) GetPolicyForTenant ¶ added in v0.2.0
func (client *PolicyClient) GetPolicyForTenant(ctx context.Context, options *PolicyClientGetPolicyForTenantOptions) (PolicyClientGetPolicyForTenantResponse, error)
GetPolicyForTenant - Get the subscription tenant policy for the user's tenant. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-10-01
- options - PolicyClientGetPolicyForTenantOptions contains the optional parameters for the PolicyClient.GetPolicyForTenant method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicy.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPolicyClient().GetPolicyForTenant(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.GetTenantPolicyResponse = armsubscription.GetTenantPolicyResponse{ // Name: to.Ptr("default"), // Type: to.Ptr("providers/Microsoft.Subscription/policies"), // ID: to.Ptr("providers/Microsoft.Subscription/policies/default"), // Properties: &armsubscription.TenantPolicy{ // BlockSubscriptionsIntoTenant: to.Ptr(true), // BlockSubscriptionsLeavingTenant: to.Ptr(true), // ExemptedPrincipals: []*string{ // to.Ptr("e879cf0f-2b4d-5431-109a-f72fc9868693"), // to.Ptr("9792da87-c97b-410d-a97d-27021ba09ce6")}, // PolicyID: to.Ptr("291bba3f-e0a5-47bc-a099-3bdcb2a50a05"), // }, // } }
Output:
func (*PolicyClient) NewListPolicyForTenantPager ¶ added in v0.4.0
func (client *PolicyClient) NewListPolicyForTenantPager(options *PolicyClientListPolicyForTenantOptions) *runtime.Pager[PolicyClientListPolicyForTenantResponse]
NewListPolicyForTenantPager - Get the subscription tenant policy for the user's tenant.
Generated from API version 2021-10-01
- options - PolicyClientListPolicyForTenantOptions contains the optional parameters for the PolicyClient.NewListPolicyForTenantPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicyList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPolicyClient().NewListPolicyForTenantPager(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.GetTenantPolicyListResponse = armsubscription.GetTenantPolicyListResponse{ // Value: []*armsubscription.GetTenantPolicyResponse{ // { // Name: to.Ptr("default"), // Type: to.Ptr("providers/Microsoft.Subscription/policies"), // ID: to.Ptr("providers/Microsoft.Subscription/policies/default"), // Properties: &armsubscription.TenantPolicy{ // BlockSubscriptionsIntoTenant: to.Ptr(true), // BlockSubscriptionsLeavingTenant: to.Ptr(true), // ExemptedPrincipals: []*string{ // to.Ptr("e879cf0f-2b4d-5431-109a-f72fc9868693"), // to.Ptr("9792da87-c97b-410d-a97d-27021ba09ce6")}, // PolicyID: to.Ptr("291bba3f-e0a5-47bc-a099-3bdcb2a50a05"), // }, // }}, // } } }
Output:
type PolicyClientAddUpdatePolicyForTenantOptions ¶ added in v0.2.0
type PolicyClientAddUpdatePolicyForTenantOptions struct { }
PolicyClientAddUpdatePolicyForTenantOptions contains the optional parameters for the PolicyClient.AddUpdatePolicyForTenant method.
type PolicyClientAddUpdatePolicyForTenantResponse ¶ added in v0.2.0
type PolicyClientAddUpdatePolicyForTenantResponse struct { // Tenant policy Information. GetTenantPolicyResponse }
PolicyClientAddUpdatePolicyForTenantResponse contains the response from method PolicyClient.AddUpdatePolicyForTenant.
type PolicyClientGetPolicyForTenantOptions ¶ added in v0.2.0
type PolicyClientGetPolicyForTenantOptions struct { }
PolicyClientGetPolicyForTenantOptions contains the optional parameters for the PolicyClient.GetPolicyForTenant method.
type PolicyClientGetPolicyForTenantResponse ¶ added in v0.2.0
type PolicyClientGetPolicyForTenantResponse struct { // Tenant policy Information. GetTenantPolicyResponse }
PolicyClientGetPolicyForTenantResponse contains the response from method PolicyClient.GetPolicyForTenant.
type PolicyClientListPolicyForTenantOptions ¶ added in v0.2.0
type PolicyClientListPolicyForTenantOptions struct { }
PolicyClientListPolicyForTenantOptions contains the optional parameters for the PolicyClient.NewListPolicyForTenantPager method.
type PolicyClientListPolicyForTenantResponse ¶ added in v0.2.0
type PolicyClientListPolicyForTenantResponse struct { // Tenant policy information list. GetTenantPolicyListResponse }
PolicyClientListPolicyForTenantResponse contains the response from method PolicyClient.NewListPolicyForTenantPager.
type ProvisioningState ¶
type ProvisioningState string
ProvisioningState - The provisioning state of the resource.
const ( ProvisioningStateAccepted ProvisioningState = "Accepted" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" )
func PossibleProvisioningStateValues ¶
func PossibleProvisioningStateValues() []ProvisioningState
PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
type PutAliasRequest ¶
type PutAliasRequest struct { // Put alias request properties. Properties *PutAliasRequestProperties }
PutAliasRequest - The parameters required to create a new subscription.
func (PutAliasRequest) MarshalJSON ¶ added in v1.1.0
func (p PutAliasRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PutAliasRequest.
func (*PutAliasRequest) UnmarshalJSON ¶ added in v1.1.0
func (p *PutAliasRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PutAliasRequest.
type PutAliasRequestAdditionalProperties ¶
type PutAliasRequestAdditionalProperties struct { // Management group Id for the subscription. ManagementGroupID *string // Owner Id of the subscription SubscriptionOwnerID *string // Tenant Id of the subscription SubscriptionTenantID *string // Tags for the subscription Tags map[string]*string }
PutAliasRequestAdditionalProperties - Put subscription additional properties.
func (PutAliasRequestAdditionalProperties) MarshalJSON ¶
func (p PutAliasRequestAdditionalProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PutAliasRequestAdditionalProperties.
func (*PutAliasRequestAdditionalProperties) UnmarshalJSON ¶ added in v1.1.0
func (p *PutAliasRequestAdditionalProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PutAliasRequestAdditionalProperties.
type PutAliasRequestProperties ¶
type PutAliasRequestProperties struct { // Put alias request additional properties. AdditionalProperties *PutAliasRequestAdditionalProperties // Billing scope of the subscription. For CustomerLed and FieldLed - /billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName} // For PartnerLed - // /billingAccounts/{billingAccountName}/customers/{customerName} For Legacy EA - /billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName} BillingScope *string // The friendly name of the subscription. DisplayName *string // Reseller Id ResellerID *string // This parameter can be used to create alias for existing subscription Id SubscriptionID *string // The workload type of the subscription. It can be either Production or DevTest. Workload *Workload }
PutAliasRequestProperties - Put subscription properties.
func (PutAliasRequestProperties) MarshalJSON ¶ added in v1.1.0
func (p PutAliasRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PutAliasRequestProperties.
func (*PutAliasRequestProperties) UnmarshalJSON ¶ added in v1.1.0
func (p *PutAliasRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PutAliasRequestProperties.
type PutTenantPolicyRequestProperties ¶
type PutTenantPolicyRequestProperties struct { // Blocks the entering of subscriptions into user's tenant. BlockSubscriptionsIntoTenant *bool // Blocks the leaving of subscriptions from user's tenant. BlockSubscriptionsLeavingTenant *bool // List of user objectIds that are exempted from the set subscription tenant policies for the user's tenant. ExemptedPrincipals []*string }
PutTenantPolicyRequestProperties - Put tenant policy request properties.
func (PutTenantPolicyRequestProperties) MarshalJSON ¶
func (p PutTenantPolicyRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PutTenantPolicyRequestProperties.
func (*PutTenantPolicyRequestProperties) UnmarshalJSON ¶ added in v1.1.0
func (p *PutTenantPolicyRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PutTenantPolicyRequestProperties.
type RenamedSubscriptionID ¶
type RenamedSubscriptionID struct { // READ-ONLY; The ID of the subscriptions that is being renamed SubscriptionID *string }
RenamedSubscriptionID - The ID of the subscriptions that is being renamed
func (RenamedSubscriptionID) MarshalJSON ¶ added in v1.1.0
func (r RenamedSubscriptionID) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RenamedSubscriptionID.
func (*RenamedSubscriptionID) UnmarshalJSON ¶ added in v1.1.0
func (r *RenamedSubscriptionID) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RenamedSubscriptionID.
type ServiceTenantResponse ¶
type ServiceTenantResponse struct { // Service tenant id. TenantID *string // Service tenant name. TenantName *string }
ServiceTenantResponse - Billing account service tenant.
func (ServiceTenantResponse) MarshalJSON ¶ added in v1.1.0
func (s ServiceTenantResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServiceTenantResponse.
func (*ServiceTenantResponse) UnmarshalJSON ¶ added in v1.1.0
func (s *ServiceTenantResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTenantResponse.
type SpendingLimit ¶ added in v0.2.0
type SpendingLimit string
SpendingLimit - The subscription spending limit.
const ( SpendingLimitCurrentPeriodOff SpendingLimit = "CurrentPeriodOff" SpendingLimitOff SpendingLimit = "Off" SpendingLimitOn SpendingLimit = "On" )
func PossibleSpendingLimitValues ¶ added in v0.2.0
func PossibleSpendingLimitValues() []SpendingLimit
PossibleSpendingLimitValues returns the possible values for the SpendingLimit const type.
type Subscription ¶ added in v0.2.0
type Subscription struct { // The authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct // and Management. For example, 'Legacy, RoleBased'. AuthorizationSource *string // The subscription policies. SubscriptionPolicies *Policies // READ-ONLY; The subscription display name. DisplayName *string // READ-ONLY; The fully qualified ID for the subscription. For example, /subscriptions/00000000-0000-0000-0000-000000000000. ID *string // READ-ONLY; The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. State *SubscriptionState // READ-ONLY; The subscription ID. SubscriptionID *string }
Subscription information.
func (Subscription) MarshalJSON ¶ added in v1.1.0
func (s Subscription) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Subscription.
func (*Subscription) UnmarshalJSON ¶ added in v1.1.0
func (s *Subscription) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Subscription.
type SubscriptionState ¶ added in v0.2.0
type SubscriptionState string
SubscriptionState - The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
const ( SubscriptionStateDeleted SubscriptionState = "Deleted" SubscriptionStateDisabled SubscriptionState = "Disabled" SubscriptionStateEnabled SubscriptionState = "Enabled" SubscriptionStatePastDue SubscriptionState = "PastDue" SubscriptionStateWarned SubscriptionState = "Warned" )
func PossibleSubscriptionStateValues ¶ added in v0.2.0
func PossibleSubscriptionStateValues() []SubscriptionState
PossibleSubscriptionStateValues returns the possible values for the SubscriptionState const type.
type SubscriptionsClient ¶ added in v0.2.0
type SubscriptionsClient struct {
// contains filtered or unexported fields
}
SubscriptionsClient contains the methods for the Subscriptions group. Don't use this type directly, use NewSubscriptionsClient() instead.
func NewSubscriptionsClient ¶ added in v0.2.0
func NewSubscriptionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionsClient, error)
NewSubscriptionsClient creates a new instance of SubscriptionsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*SubscriptionsClient) Get ¶ added in v0.2.0
func (client *SubscriptionsClient) Get(ctx context.Context, subscriptionID string, options *SubscriptionsClientGetOptions) (SubscriptionsClientGetResponse, error)
Get - Gets details about a specified subscription. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2016-06-01
- subscriptionID - The ID of the target subscription.
- options - SubscriptionsClientGetOptions contains the optional parameters for the SubscriptionsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/getSubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSubscriptionsClient().Get(ctx, "83aa47df-e3e9-49ff-877b-94304bf3d3ad", 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.Subscription = armsubscription.Subscription{ // AuthorizationSource: to.Ptr("Legacy"), // DisplayName: to.Ptr("Subscription2"), // ID: to.Ptr("/subscriptions/83aa47df-e3e9-49ff-877b-94304bf3d3ad"), // State: to.Ptr(armsubscription.SubscriptionStateEnabled), // SubscriptionID: to.Ptr("83aa47df-e3e9-49ff-877b-94304bf3d3ad"), // SubscriptionPolicies: &armsubscription.Policies{ // LocationPlacementID: to.Ptr("Internal_2014-09-01"), // QuotaID: to.Ptr("Internal_2014-09-01"), // SpendingLimit: to.Ptr(armsubscription.SpendingLimitOff), // }, // } }
Output:
func (*SubscriptionsClient) NewListLocationsPager ¶ added in v0.4.0
func (client *SubscriptionsClient) NewListLocationsPager(subscriptionID string, options *SubscriptionsClientListLocationsOptions) *runtime.Pager[SubscriptionsClientListLocationsResponse]
NewListLocationsPager - This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list.
Generated from API version 2016-06-01
- subscriptionID - The ID of the target subscription.
- options - SubscriptionsClientListLocationsOptions contains the optional parameters for the SubscriptionsClient.NewListLocationsPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/listLocations.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSubscriptionsClient().NewListLocationsPager("83aa47df-e3e9-49ff-877b-94304bf3d3ad", 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.LocationListResult = armsubscription.LocationListResult{ // Value: []*armsubscription.Location{ // { // Name: to.Ptr("eastasia"), // DisplayName: to.Ptr("East Asia"), // ID: to.Ptr("/subscriptions/83aa47df-e3e9-49ff-877b-94304bf3d3ad/locations/eastasia"), // Latitude: to.Ptr("22.267"), // Longitude: to.Ptr("114.188"), // }, // { // Name: to.Ptr("southeastasia"), // DisplayName: to.Ptr("Southeast Asia"), // ID: to.Ptr("/subscriptions/83aa47df-e3e9-49ff-877b-94304bf3d3ad/locations/southeastasia"), // Latitude: to.Ptr("1.283"), // Longitude: to.Ptr("103.833"), // }}, // } } }
Output:
func (*SubscriptionsClient) NewListPager ¶ added in v0.4.0
func (client *SubscriptionsClient) NewListPager(options *SubscriptionsClientListOptions) *runtime.Pager[SubscriptionsClientListResponse]
NewListPager - Gets all subscriptions for a tenant.
Generated from API version 2016-06-01
- options - SubscriptionsClientListOptions contains the optional parameters for the SubscriptionsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/listSubscriptions.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSubscriptionsClient().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.ListResult = armsubscription.ListResult{ // Value: []*armsubscription.Subscription{ // { // AuthorizationSource: to.Ptr("Legacy"), // DisplayName: to.Ptr("SubscriptionName"), // ID: to.Ptr("/subscriptions/83aa47df-e3e9-49ff-877b-94304bf3d3ad"), // State: to.Ptr(armsubscription.SubscriptionStateEnabled), // SubscriptionID: to.Ptr("83aa47df-e3e9-49ff-877b-94304bf3d3ad"), // SubscriptionPolicies: &armsubscription.Policies{ // LocationPlacementID: to.Ptr("Internal_2014-09-01"), // QuotaID: to.Ptr("Internal_2014-09-01"), // SpendingLimit: to.Ptr(armsubscription.SpendingLimitOff), // }, // }}, // } } }
Output:
type SubscriptionsClientGetOptions ¶ added in v0.2.0
type SubscriptionsClientGetOptions struct { }
SubscriptionsClientGetOptions contains the optional parameters for the SubscriptionsClient.Get method.
type SubscriptionsClientGetResponse ¶ added in v0.2.0
type SubscriptionsClientGetResponse struct { // Subscription information. Subscription }
SubscriptionsClientGetResponse contains the response from method SubscriptionsClient.Get.
type SubscriptionsClientListLocationsOptions ¶ added in v0.2.0
type SubscriptionsClientListLocationsOptions struct { }
SubscriptionsClientListLocationsOptions contains the optional parameters for the SubscriptionsClient.NewListLocationsPager method.
type SubscriptionsClientListLocationsResponse ¶ added in v0.2.0
type SubscriptionsClientListLocationsResponse struct { // Location list operation response. LocationListResult }
SubscriptionsClientListLocationsResponse contains the response from method SubscriptionsClient.NewListLocationsPager.
type SubscriptionsClientListOptions ¶ added in v0.2.0
type SubscriptionsClientListOptions struct { }
SubscriptionsClientListOptions contains the optional parameters for the SubscriptionsClient.NewListPager method.
type SubscriptionsClientListResponse ¶ added in v0.2.0
type SubscriptionsClientListResponse struct { // Subscription list operation response. ListResult }
SubscriptionsClientListResponse contains the response from method SubscriptionsClient.NewListPager.
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 TenantIDDescription ¶ added in v0.2.0
type TenantIDDescription struct { // READ-ONLY; The fully qualified ID of the tenant. For example, /tenants/00000000-0000-0000-0000-000000000000. ID *string // READ-ONLY; The tenant ID. For example, 00000000-0000-0000-0000-000000000000. TenantID *string }
TenantIDDescription - Tenant Id information.
func (TenantIDDescription) MarshalJSON ¶ added in v1.1.0
func (t TenantIDDescription) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TenantIDDescription.
func (*TenantIDDescription) UnmarshalJSON ¶ added in v1.1.0
func (t *TenantIDDescription) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TenantIDDescription.
type TenantListResult ¶ added in v0.2.0
type TenantListResult struct { // REQUIRED; The URL to use for getting the next set of results. NextLink *string // An array of tenants. Value []*TenantIDDescription }
TenantListResult - Tenant Ids information.
func (TenantListResult) MarshalJSON ¶ added in v0.2.0
func (t TenantListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TenantListResult.
func (*TenantListResult) UnmarshalJSON ¶ added in v1.1.0
func (t *TenantListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TenantListResult.
type TenantPolicy ¶
type TenantPolicy struct { // Blocks the entering of subscriptions into user's tenant. BlockSubscriptionsIntoTenant *bool // Blocks the leaving of subscriptions from user's tenant. BlockSubscriptionsLeavingTenant *bool // List of user objectIds that are exempted from the set subscription tenant policies for the user's tenant. ExemptedPrincipals []*string // READ-ONLY; Policy Id. PolicyID *string }
TenantPolicy - Tenant policy.
func (TenantPolicy) MarshalJSON ¶
func (t TenantPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TenantPolicy.
func (*TenantPolicy) UnmarshalJSON ¶ added in v1.1.0
func (t *TenantPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TenantPolicy.
type TenantsClient ¶ added in v0.2.0
type TenantsClient struct {
// contains filtered or unexported fields
}
TenantsClient contains the methods for the Tenants group. Don't use this type directly, use NewTenantsClient() instead.
func NewTenantsClient ¶ added in v0.2.0
func NewTenantsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantsClient, error)
NewTenantsClient creates a new instance of TenantsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*TenantsClient) NewListPager ¶ added in v0.4.0
func (client *TenantsClient) NewListPager(options *TenantsClientListOptions) *runtime.Pager[TenantsClientListResponse]
NewListPager - Gets the tenants for your account.
Generated from API version 2016-06-01
- options - TenantsClientListOptions contains the optional parameters for the TenantsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/listTenants.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armsubscription.NewClientFactory(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewTenantsClient().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.TenantListResult = armsubscription.TenantListResult{ // Value: []*armsubscription.TenantIDDescription{ // { // ID: to.Ptr("/tenants/72f988bf-86f1-41af-91ab-2d7cd011db47"), // TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), // }, // { // ID: to.Ptr("/tenants/33e01921-4d64-4f8c-a055-5bdaffd5e33d"), // TenantID: to.Ptr("33e01921-4d64-4f8c-a055-5bdaffd5e33d"), // }}, // } } }
Output:
type TenantsClientListOptions ¶ added in v0.2.0
type TenantsClientListOptions struct { }
TenantsClientListOptions contains the optional parameters for the TenantsClient.NewListPager method.
type TenantsClientListResponse ¶ added in v0.2.0
type TenantsClientListResponse struct { // Tenant Ids information. TenantListResult }
TenantsClientListResponse contains the response from method TenantsClient.NewListPager.