subscriptions

package
v0.20230408.1052134 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MPL-2.0 Imports: 11 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/subscription/2021-10-01/subscriptions Documentation

The subscriptions SDK allows for interaction with the Azure Resource Manager Service subscription (API Version 2021-10-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/subscription/2021-10-01/subscriptions"

Client Initialization

client := subscriptions.NewSubscriptionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SubscriptionsClient.AliasCreate

ctx := context.TODO()
id := subscriptions.NewAliasID("aliasValue")

payload := subscriptions.PutAliasRequest{
	// ...
}


if err := client.AliasCreateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: SubscriptionsClient.AliasDelete

ctx := context.TODO()
id := subscriptions.NewAliasID("aliasValue")

read, err := client.AliasDelete(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SubscriptionsClient.AliasGet

ctx := context.TODO()
id := subscriptions.NewAliasID("aliasValue")

read, err := client.AliasGet(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SubscriptionsClient.AliasList

ctx := context.TODO()


read, err := client.AliasList(ctx)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SubscriptionsClient.BillingAccountGetPolicy

ctx := context.TODO()
id := subscriptions.NewBillingAccountID("billingAccountIdValue")

read, err := client.BillingAccountGetPolicy(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SubscriptionsClient.SubscriptionAcceptOwnership

ctx := context.TODO()
id := subscriptions.NewProviderSubscriptionID("12345678-1234-9876-4563-123456789012")

payload := subscriptions.AcceptOwnershipRequest{
	// ...
}


if err := client.SubscriptionAcceptOwnershipThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: SubscriptionsClient.SubscriptionAcceptOwnershipStatus

ctx := context.TODO()
id := subscriptions.NewProviderSubscriptionID("12345678-1234-9876-4563-123456789012")

read, err := client.SubscriptionAcceptOwnershipStatus(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SubscriptionsClient.SubscriptionCancel

ctx := context.TODO()
id := subscriptions.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

read, err := client.SubscriptionCancel(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SubscriptionsClient.SubscriptionEnable

ctx := context.TODO()
id := subscriptions.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

read, err := client.SubscriptionEnable(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SubscriptionsClient.SubscriptionPolicyAddUpdatePolicyForTenant

ctx := context.TODO()

payload := subscriptions.PutTenantPolicyRequestProperties{
	// ...
}


read, err := client.SubscriptionPolicyAddUpdatePolicyForTenant(ctx, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SubscriptionsClient.SubscriptionPolicyGetPolicyForTenant

ctx := context.TODO()


read, err := client.SubscriptionPolicyGetPolicyForTenant(ctx)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SubscriptionsClient.SubscriptionPolicyListPolicyForTenant

ctx := context.TODO()


// alternatively `client.SubscriptionPolicyListPolicyForTenant(ctx)` can be used to do batched pagination
items, err := client.SubscriptionPolicyListPolicyForTenantComplete(ctx)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: SubscriptionsClient.SubscriptionRename

ctx := context.TODO()
id := subscriptions.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

payload := subscriptions.SubscriptionName{
	// ...
}


read, err := client.SubscriptionRename(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForAcceptOwnership

func PossibleValuesForAcceptOwnership() []string

func PossibleValuesForProvisioning

func PossibleValuesForProvisioning() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForWorkload

func PossibleValuesForWorkload() []string

func ValidateAliasID

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

ValidateAliasID checks that 'input' can be parsed as a Alias ID

func ValidateBillingAccountID

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

ValidateBillingAccountID checks that 'input' can be parsed as a Billing Account ID

func ValidateProviderSubscriptionID

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

ValidateProviderSubscriptionID checks that 'input' can be parsed as a Provider Subscription ID

Types

type AcceptOwnership

type AcceptOwnership string
const (
	AcceptOwnershipCompleted AcceptOwnership = "Completed"
	AcceptOwnershipExpired   AcceptOwnership = "Expired"
	AcceptOwnershipPending   AcceptOwnership = "Pending"
)

type AcceptOwnershipRequest

type AcceptOwnershipRequest struct {
	Properties *AcceptOwnershipRequestProperties `json:"properties,omitempty"`
}

type AcceptOwnershipRequestProperties

type AcceptOwnershipRequestProperties struct {
	DisplayName       string             `json:"displayName"`
	ManagementGroupId *string            `json:"managementGroupId,omitempty"`
	Tags              *map[string]string `json:"tags,omitempty"`
}

type AcceptOwnershipStatusResponse

type AcceptOwnershipStatusResponse struct {
	AcceptOwnershipState *AcceptOwnership   `json:"acceptOwnershipState,omitempty"`
	BillingOwner         *string            `json:"billingOwner,omitempty"`
	DisplayName          *string            `json:"displayName,omitempty"`
	ProvisioningState    *Provisioning      `json:"provisioningState,omitempty"`
	SubscriptionId       *string            `json:"subscriptionId,omitempty"`
	SubscriptionTenantId *string            `json:"subscriptionTenantId,omitempty"`
	Tags                 *map[string]string `json:"tags,omitempty"`
}

type AliasCreateOperationResponse

type AliasCreateOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type AliasDeleteOperationResponse

type AliasDeleteOperationResponse struct {
	HttpResponse *http.Response
}

type AliasGetOperationResponse

type AliasGetOperationResponse struct {
	HttpResponse *http.Response
	Model        *SubscriptionAliasResponse
}

type AliasId

type AliasId struct {
	AliasName string
}

AliasId is a struct representing the Resource ID for a Alias

func NewAliasID

func NewAliasID(aliasName string) AliasId

NewAliasID returns a new AliasId struct

func ParseAliasID

func ParseAliasID(input string) (*AliasId, error)

ParseAliasID parses 'input' into a AliasId

func ParseAliasIDInsensitively

func ParseAliasIDInsensitively(input string) (*AliasId, error)

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

func (AliasId) ID

func (id AliasId) ID() string

ID returns the formatted Alias ID

func (AliasId) Segments

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

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

func (AliasId) String

func (id AliasId) String() string

String returns a human-readable description of this Alias ID

type AliasListOperationResponse

type AliasListOperationResponse struct {
	HttpResponse *http.Response
	Model        *SubscriptionAliasListResult
}

type BillingAccountGetPolicyOperationResponse

type BillingAccountGetPolicyOperationResponse struct {
	HttpResponse *http.Response
	Model        *BillingAccountPoliciesResponse
}

type BillingAccountId

type BillingAccountId struct {
	BillingAccountId string
}

BillingAccountId is a struct representing the Resource ID for a Billing Account

func NewBillingAccountID

func NewBillingAccountID(billingAccountId string) BillingAccountId

NewBillingAccountID returns a new BillingAccountId struct

func ParseBillingAccountID

func ParseBillingAccountID(input string) (*BillingAccountId, error)

ParseBillingAccountID parses 'input' into a BillingAccountId

func ParseBillingAccountIDInsensitively

func ParseBillingAccountIDInsensitively(input string) (*BillingAccountId, error)

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

func (BillingAccountId) ID

func (id BillingAccountId) ID() string

ID returns the formatted Billing Account ID

func (BillingAccountId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Billing Account ID

func (BillingAccountId) String

func (id BillingAccountId) String() string

String returns a human-readable description of this Billing Account ID

type BillingAccountPoliciesResponse

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

type BillingAccountPoliciesResponseProperties

type BillingAccountPoliciesResponseProperties struct {
	AllowTransfers *bool                    `json:"allowTransfers,omitempty"`
	ServiceTenants *[]ServiceTenantResponse `json:"serviceTenants,omitempty"`
}

type CanceledSubscriptionId

type CanceledSubscriptionId struct {
	SubscriptionId *string `json:"subscriptionId,omitempty"`
}

type EnabledSubscriptionId

type EnabledSubscriptionId struct {
	SubscriptionId *string `json:"subscriptionId,omitempty"`
}

type GetTenantPolicyResponse

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

type GetTenantPolicyResponseOperationPredicate

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

func (GetTenantPolicyResponseOperationPredicate) Matches

type ProviderSubscriptionId

type ProviderSubscriptionId struct {
	SubscriptionId string
}

ProviderSubscriptionId is a struct representing the Resource ID for a Provider Subscription

func NewProviderSubscriptionID

func NewProviderSubscriptionID(subscriptionId string) ProviderSubscriptionId

NewProviderSubscriptionID returns a new ProviderSubscriptionId struct

func ParseProviderSubscriptionID

func ParseProviderSubscriptionID(input string) (*ProviderSubscriptionId, error)

ParseProviderSubscriptionID parses 'input' into a ProviderSubscriptionId

func ParseProviderSubscriptionIDInsensitively

func ParseProviderSubscriptionIDInsensitively(input string) (*ProviderSubscriptionId, error)

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

func (ProviderSubscriptionId) ID

ID returns the formatted Provider Subscription ID

func (ProviderSubscriptionId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Provider Subscription ID

func (ProviderSubscriptionId) String

func (id ProviderSubscriptionId) String() string

String returns a human-readable description of this Provider Subscription ID

type Provisioning

type Provisioning string
const (
	ProvisioningAccepted  Provisioning = "Accepted"
	ProvisioningPending   Provisioning = "Pending"
	ProvisioningSucceeded Provisioning = "Succeeded"
)

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateAccepted  ProvisioningState = "Accepted"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)

type PutAliasRequest

type PutAliasRequest struct {
	Properties *PutAliasRequestProperties `json:"properties,omitempty"`
}

type PutAliasRequestAdditionalProperties

type PutAliasRequestAdditionalProperties struct {
	ManagementGroupId    *string            `json:"managementGroupId,omitempty"`
	SubscriptionOwnerId  *string            `json:"subscriptionOwnerId,omitempty"`
	SubscriptionTenantId *string            `json:"subscriptionTenantId,omitempty"`
	Tags                 *map[string]string `json:"tags,omitempty"`
}

type PutAliasRequestProperties

type PutAliasRequestProperties struct {
	AdditionalProperties *PutAliasRequestAdditionalProperties `json:"additionalProperties,omitempty"`
	BillingScope         *string                              `json:"billingScope,omitempty"`
	DisplayName          *string                              `json:"displayName,omitempty"`
	ResellerId           *string                              `json:"resellerId,omitempty"`
	SubscriptionId       *string                              `json:"subscriptionId,omitempty"`
	Workload             *Workload                            `json:"workload,omitempty"`
}

type PutTenantPolicyRequestProperties

type PutTenantPolicyRequestProperties struct {
	BlockSubscriptionsIntoTenant    *bool     `json:"blockSubscriptionsIntoTenant,omitempty"`
	BlockSubscriptionsLeavingTenant *bool     `json:"blockSubscriptionsLeavingTenant,omitempty"`
	ExemptedPrincipals              *[]string `json:"exemptedPrincipals,omitempty"`
}

type RenamedSubscriptionId

type RenamedSubscriptionId struct {
	SubscriptionId *string `json:"subscriptionId,omitempty"`
}

type ServiceTenantResponse

type ServiceTenantResponse struct {
	TenantId   *string `json:"tenantId,omitempty"`
	TenantName *string `json:"tenantName,omitempty"`
}

type SubscriptionAcceptOwnershipOperationResponse

type SubscriptionAcceptOwnershipOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type SubscriptionAcceptOwnershipStatusOperationResponse

type SubscriptionAcceptOwnershipStatusOperationResponse struct {
	HttpResponse *http.Response
	Model        *AcceptOwnershipStatusResponse
}

type SubscriptionAliasListResult

type SubscriptionAliasListResult struct {
	NextLink *string                      `json:"nextLink,omitempty"`
	Value    *[]SubscriptionAliasResponse `json:"value,omitempty"`
}

type SubscriptionAliasResponse

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

type SubscriptionAliasResponseProperties

type SubscriptionAliasResponseProperties struct {
	AcceptOwnershipState *AcceptOwnership   `json:"acceptOwnershipState,omitempty"`
	AcceptOwnershipUrl   *string            `json:"acceptOwnershipUrl,omitempty"`
	BillingScope         *string            `json:"billingScope,omitempty"`
	CreatedTime          *string            `json:"createdTime,omitempty"`
	DisplayName          *string            `json:"displayName,omitempty"`
	ManagementGroupId    *string            `json:"managementGroupId,omitempty"`
	ProvisioningState    *ProvisioningState `json:"provisioningState,omitempty"`
	ResellerId           *string            `json:"resellerId,omitempty"`
	SubscriptionId       *string            `json:"subscriptionId,omitempty"`
	SubscriptionOwnerId  *string            `json:"subscriptionOwnerId,omitempty"`
	Tags                 *map[string]string `json:"tags,omitempty"`
	Workload             *Workload          `json:"workload,omitempty"`
}

type SubscriptionCancelOperationResponse

type SubscriptionCancelOperationResponse struct {
	HttpResponse *http.Response
	Model        *CanceledSubscriptionId
}

type SubscriptionEnableOperationResponse

type SubscriptionEnableOperationResponse struct {
	HttpResponse *http.Response
	Model        *EnabledSubscriptionId
}

type SubscriptionName

type SubscriptionName struct {
	SubscriptionName *string `json:"subscriptionName,omitempty"`
}

type SubscriptionPolicyAddUpdatePolicyForTenantOperationResponse

type SubscriptionPolicyAddUpdatePolicyForTenantOperationResponse struct {
	HttpResponse *http.Response
	Model        *GetTenantPolicyResponse
}

type SubscriptionPolicyGetPolicyForTenantOperationResponse

type SubscriptionPolicyGetPolicyForTenantOperationResponse struct {
	HttpResponse *http.Response
	Model        *GetTenantPolicyResponse
}

type SubscriptionPolicyListPolicyForTenantCompleteResult

type SubscriptionPolicyListPolicyForTenantCompleteResult struct {
	Items []GetTenantPolicyResponse
}

type SubscriptionPolicyListPolicyForTenantOperationResponse

type SubscriptionPolicyListPolicyForTenantOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]GetTenantPolicyResponse
	// contains filtered or unexported fields
}

func (SubscriptionPolicyListPolicyForTenantOperationResponse) HasMore

func (SubscriptionPolicyListPolicyForTenantOperationResponse) LoadMore

type SubscriptionRenameOperationResponse

type SubscriptionRenameOperationResponse struct {
	HttpResponse *http.Response
	Model        *RenamedSubscriptionId
}

type SubscriptionsClient

type SubscriptionsClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewSubscriptionsClientWithBaseURI

func NewSubscriptionsClientWithBaseURI(endpoint string) SubscriptionsClient

func (SubscriptionsClient) AliasCreate

func (c SubscriptionsClient) AliasCreate(ctx context.Context, id AliasId, input PutAliasRequest) (result AliasCreateOperationResponse, err error)

AliasCreate ...

func (SubscriptionsClient) AliasCreateThenPoll

func (c SubscriptionsClient) AliasCreateThenPoll(ctx context.Context, id AliasId, input PutAliasRequest) error

AliasCreateThenPoll performs AliasCreate then polls until it's completed

func (SubscriptionsClient) AliasDelete

func (c SubscriptionsClient) AliasDelete(ctx context.Context, id AliasId) (result AliasDeleteOperationResponse, err error)

AliasDelete ...

func (SubscriptionsClient) AliasGet

func (c SubscriptionsClient) AliasGet(ctx context.Context, id AliasId) (result AliasGetOperationResponse, err error)

AliasGet ...

func (SubscriptionsClient) AliasList

func (c SubscriptionsClient) AliasList(ctx context.Context) (result AliasListOperationResponse, err error)

AliasList ...

func (SubscriptionsClient) BillingAccountGetPolicy

func (c SubscriptionsClient) BillingAccountGetPolicy(ctx context.Context, id BillingAccountId) (result BillingAccountGetPolicyOperationResponse, err error)

BillingAccountGetPolicy ...

func (SubscriptionsClient) SubscriptionAcceptOwnership

SubscriptionAcceptOwnership ...

func (SubscriptionsClient) SubscriptionAcceptOwnershipStatus

SubscriptionAcceptOwnershipStatus ...

func (SubscriptionsClient) SubscriptionAcceptOwnershipThenPoll

func (c SubscriptionsClient) SubscriptionAcceptOwnershipThenPoll(ctx context.Context, id ProviderSubscriptionId, input AcceptOwnershipRequest) error

SubscriptionAcceptOwnershipThenPoll performs SubscriptionAcceptOwnership then polls until it's completed

func (SubscriptionsClient) SubscriptionCancel

SubscriptionCancel ...

func (SubscriptionsClient) SubscriptionEnable

SubscriptionEnable ...

func (SubscriptionsClient) SubscriptionPolicyAddUpdatePolicyForTenant

SubscriptionPolicyAddUpdatePolicyForTenant ...

func (SubscriptionsClient) SubscriptionPolicyGetPolicyForTenant

func (c SubscriptionsClient) SubscriptionPolicyGetPolicyForTenant(ctx context.Context) (result SubscriptionPolicyGetPolicyForTenantOperationResponse, err error)

SubscriptionPolicyGetPolicyForTenant ...

func (SubscriptionsClient) SubscriptionPolicyListPolicyForTenant

func (c SubscriptionsClient) SubscriptionPolicyListPolicyForTenant(ctx context.Context) (resp SubscriptionPolicyListPolicyForTenantOperationResponse, err error)

SubscriptionPolicyListPolicyForTenant ...

func (SubscriptionsClient) SubscriptionPolicyListPolicyForTenantComplete

func (c SubscriptionsClient) SubscriptionPolicyListPolicyForTenantComplete(ctx context.Context) (SubscriptionPolicyListPolicyForTenantCompleteResult, error)

SubscriptionPolicyListPolicyForTenantComplete retrieves all of the results into a single object

func (SubscriptionsClient) SubscriptionPolicyListPolicyForTenantCompleteMatchingPredicate

func (c SubscriptionsClient) SubscriptionPolicyListPolicyForTenantCompleteMatchingPredicate(ctx context.Context, predicate GetTenantPolicyResponseOperationPredicate) (resp SubscriptionPolicyListPolicyForTenantCompleteResult, err error)

SubscriptionPolicyListPolicyForTenantCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (SubscriptionsClient) SubscriptionRename

SubscriptionRename ...

type TenantPolicy

type TenantPolicy struct {
	BlockSubscriptionsIntoTenant    *bool     `json:"blockSubscriptionsIntoTenant,omitempty"`
	BlockSubscriptionsLeavingTenant *bool     `json:"blockSubscriptionsLeavingTenant,omitempty"`
	ExemptedPrincipals              *[]string `json:"exemptedPrincipals,omitempty"`
	PolicyId                        *string   `json:"policyId,omitempty"`
}

type Workload

type Workload string
const (
	WorkloadDevTest    Workload = "DevTest"
	WorkloadProduction Workload = "Production"
)

Jump to

Keyboard shortcuts

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