Documentation ¶
Index ¶
- type AcceptanceMode
- type Account
- type AccountListResult
- type AccountProperties
- type AccountStatus
- type AccountType
- type AccountUpdateRequest
- type AccountsClient
- func (client *AccountsClient) BeginUpdate(ctx context.Context, billingAccountName string, ...) (*runtime.Poller[AccountsClientUpdateResponse], error)
- func (client *AccountsClient) Get(ctx context.Context, billingAccountName string, ...) (AccountsClientGetResponse, error)
- func (client *AccountsClient) NewListInvoiceSectionsByCreateSubscriptionPermissionPager(billingAccountName string, ...) ...
- func (client *AccountsClient) NewListPager(options *AccountsClientListOptions) *runtime.Pager[AccountsClientListResponse]
- type AccountsClientBeginUpdateOptions
- type AccountsClientGetOptions
- type AccountsClientGetResponse
- type AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionOptions
- type AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionResponse
- type AccountsClientListOptions
- type AccountsClientListResponse
- type AccountsClientUpdateResponse
- type AddressClient
- type AddressClientValidateOptions
- type AddressClientValidateResponse
- type AddressDetails
- type AddressValidationStatus
- type Agreement
- type AgreementListResult
- type AgreementProperties
- type AgreementType
- type AgreementsClient
- func (client *AgreementsClient) Get(ctx context.Context, billingAccountName string, agreementName string, ...) (AgreementsClientGetResponse, error)
- func (client *AgreementsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[AgreementsClientListByBillingAccountResponse]
- type AgreementsClientGetOptions
- type AgreementsClientGetResponse
- type AgreementsClientListByBillingAccountOptions
- type AgreementsClientListByBillingAccountResponse
- type Amount
- type AutoRenew
- type AvailableBalance
- type AvailableBalanceProperties
- type AvailableBalancesClient
- type AvailableBalancesClientGetOptions
- type AvailableBalancesClientGetResponse
- type AzurePlan
- type BillingFrequency
- type BillingProfileSpendingLimit
- type BillingProfileStatus
- type BillingProfileStatusReasonCode
- type BillingRelationshipType
- type BillingSubscriptionStatusType
- type Category
- type ClientFactory
- func (c *ClientFactory) NewAccountsClient() *AccountsClient
- func (c *ClientFactory) NewAddressClient() *AddressClient
- func (c *ClientFactory) NewAgreementsClient() *AgreementsClient
- func (c *ClientFactory) NewAvailableBalancesClient() *AvailableBalancesClient
- func (c *ClientFactory) NewCustomersClient() *CustomersClient
- func (c *ClientFactory) NewEnrollmentAccountsClient() *EnrollmentAccountsClient
- func (c *ClientFactory) NewInstructionsClient() *InstructionsClient
- func (c *ClientFactory) NewInvoiceSectionsClient() *InvoiceSectionsClient
- func (c *ClientFactory) NewInvoicesClient() *InvoicesClient
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewPeriodsClient() *PeriodsClient
- func (c *ClientFactory) NewPermissionsClient() *PermissionsClient
- func (c *ClientFactory) NewPoliciesClient() *PoliciesClient
- func (c *ClientFactory) NewProductsClient() *ProductsClient
- func (c *ClientFactory) NewProfilesClient() *ProfilesClient
- func (c *ClientFactory) NewPropertyClient() *PropertyClient
- func (c *ClientFactory) NewReservationsClient() *ReservationsClient
- func (c *ClientFactory) NewRoleAssignmentsClient() *RoleAssignmentsClient
- func (c *ClientFactory) NewRoleDefinitionsClient() *RoleDefinitionsClient
- func (c *ClientFactory) NewSubscriptionsClient() *SubscriptionsClient
- func (c *ClientFactory) NewTransactionsClient() *TransactionsClient
- type Customer
- type CustomerListResult
- type CustomerPolicy
- type CustomerPolicyProperties
- type CustomerProperties
- type CustomersClient
- func (client *CustomersClient) Get(ctx context.Context, billingAccountName string, customerName string, ...) (CustomersClientGetResponse, error)
- func (client *CustomersClient) NewListByBillingAccountPager(billingAccountName string, options *CustomersClientListByBillingAccountOptions) *runtime.Pager[CustomersClientListByBillingAccountResponse]
- func (client *CustomersClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[CustomersClientListByBillingProfileResponse]
- type CustomersClientGetOptions
- type CustomersClientGetResponse
- type CustomersClientListByBillingAccountOptions
- type CustomersClientListByBillingAccountResponse
- type CustomersClientListByBillingProfileOptions
- type CustomersClientListByBillingProfileResponse
- type Department
- type DepartmentProperties
- type Document
- type DocumentSource
- type DocumentType
- type DownloadURL
- type Enrollment
- type EnrollmentAccount
- type EnrollmentAccountContext
- type EnrollmentAccountListResult
- type EnrollmentAccountProperties
- type EnrollmentAccountSummary
- type EnrollmentAccountSummaryProperties
- type EnrollmentAccountsClient
- func (client *EnrollmentAccountsClient) Get(ctx context.Context, name string, options *EnrollmentAccountsClientGetOptions) (EnrollmentAccountsClientGetResponse, error)
- func (client *EnrollmentAccountsClient) NewListPager(options *EnrollmentAccountsClientListOptions) *runtime.Pager[EnrollmentAccountsClientListResponse]
- type EnrollmentAccountsClientGetOptions
- type EnrollmentAccountsClientGetResponse
- type EnrollmentAccountsClientListOptions
- type EnrollmentAccountsClientListResponse
- type EnrollmentPolicies
- type ErrorDetails
- type ErrorResponse
- type ErrorSubDetailsItem
- type IndirectRelationshipInfo
- type Instruction
- type InstructionListResult
- type InstructionProperties
- type InstructionsClient
- func (client *InstructionsClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, ...) (InstructionsClientGetResponse, error)
- func (client *InstructionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[InstructionsClientListByBillingProfileResponse]
- func (client *InstructionsClient) Put(ctx context.Context, billingAccountName string, billingProfileName string, ...) (InstructionsClientPutResponse, error)
- type InstructionsClientGetOptions
- type InstructionsClientGetResponse
- type InstructionsClientListByBillingProfileOptions
- type InstructionsClientListByBillingProfileResponse
- type InstructionsClientPutOptions
- type InstructionsClientPutResponse
- type Invoice
- type InvoiceDocumentType
- type InvoiceListResult
- type InvoiceProperties
- type InvoiceSection
- type InvoiceSectionCreationRequest
- type InvoiceSectionListResult
- type InvoiceSectionListWithCreateSubPermissionResult
- type InvoiceSectionProperties
- type InvoiceSectionState
- type InvoiceSectionWithCreateSubPermission
- type InvoiceSectionsClient
- func (client *InvoiceSectionsClient) BeginCreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[InvoiceSectionsClientCreateOrUpdateResponse], error)
- func (client *InvoiceSectionsClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, ...) (InvoiceSectionsClientGetResponse, error)
- func (client *InvoiceSectionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[InvoiceSectionsClientListByBillingProfileResponse]
- type InvoiceSectionsClientBeginCreateOrUpdateOptions
- type InvoiceSectionsClientCreateOrUpdateResponse
- type InvoiceSectionsClientGetOptions
- type InvoiceSectionsClientGetResponse
- type InvoiceSectionsClientListByBillingProfileOptions
- type InvoiceSectionsClientListByBillingProfileResponse
- type InvoiceSectionsOnExpand
- type InvoiceStatus
- type InvoiceType
- type InvoicesClient
- func (client *InvoicesClient) BeginDownloadBillingSubscriptionInvoice(ctx context.Context, invoiceName string, downloadToken string, ...) (*runtime.Poller[InvoicesClientDownloadBillingSubscriptionInvoiceResponse], ...)
- func (client *InvoicesClient) BeginDownloadInvoice(ctx context.Context, billingAccountName string, invoiceName string, ...) (*runtime.Poller[InvoicesClientDownloadInvoiceResponse], error)
- func (client *InvoicesClient) BeginDownloadMultipleBillingProfileInvoices(ctx context.Context, billingAccountName string, downloadUrls []*string, ...) (*runtime.Poller[InvoicesClientDownloadMultipleBillingProfileInvoicesResponse], ...)
- func (client *InvoicesClient) BeginDownloadMultipleBillingSubscriptionInvoices(ctx context.Context, downloadUrls []*string, ...) (...)
- func (client *InvoicesClient) Get(ctx context.Context, billingAccountName string, invoiceName string, ...) (InvoicesClientGetResponse, error)
- func (client *InvoicesClient) GetByID(ctx context.Context, invoiceName string, options *InvoicesClientGetByIDOptions) (InvoicesClientGetByIDResponse, error)
- func (client *InvoicesClient) GetBySubscriptionAndInvoiceID(ctx context.Context, invoiceName string, ...) (InvoicesClientGetBySubscriptionAndInvoiceIDResponse, error)
- func (client *InvoicesClient) NewListByBillingAccountPager(billingAccountName string, periodStartDate string, periodEndDate string, ...) *runtime.Pager[InvoicesClientListByBillingAccountResponse]
- func (client *InvoicesClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, periodStartDate string, ...) *runtime.Pager[InvoicesClientListByBillingProfileResponse]
- func (client *InvoicesClient) NewListByBillingSubscriptionPager(periodStartDate string, periodEndDate string, ...) *runtime.Pager[InvoicesClientListByBillingSubscriptionResponse]
- type InvoicesClientBeginDownloadBillingSubscriptionInvoiceOptions
- type InvoicesClientBeginDownloadInvoiceOptions
- type InvoicesClientBeginDownloadMultipleBillingProfileInvoicesOptions
- type InvoicesClientBeginDownloadMultipleBillingSubscriptionInvoicesOptions
- type InvoicesClientDownloadBillingSubscriptionInvoiceResponse
- type InvoicesClientDownloadInvoiceResponse
- type InvoicesClientDownloadMultipleBillingProfileInvoicesResponse
- type InvoicesClientDownloadMultipleBillingSubscriptionInvoicesResponse
- type InvoicesClientGetByIDOptions
- type InvoicesClientGetByIDResponse
- type InvoicesClientGetBySubscriptionAndInvoiceIDOptions
- type InvoicesClientGetBySubscriptionAndInvoiceIDResponse
- type InvoicesClientGetOptions
- type InvoicesClientGetResponse
- type InvoicesClientListByBillingAccountOptions
- type InvoicesClientListByBillingAccountResponse
- type InvoicesClientListByBillingProfileOptions
- type InvoicesClientListByBillingProfileResponse
- type InvoicesClientListByBillingSubscriptionOptions
- type InvoicesClientListByBillingSubscriptionResponse
- type MarketplacePurchasesPolicy
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type OperationsErrorDetails
- type OperationsErrorResponse
- type Participants
- type PaymentMethodFamily
- type PaymentProperties
- type Period
- type PeriodProperties
- type PeriodsClient
- type PeriodsClientGetOptions
- type PeriodsClientGetResponse
- type PeriodsClientListOptions
- type PeriodsClientListResponse
- type PeriodsListResult
- type PermissionsClient
- func (client *PermissionsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[PermissionsClientListByBillingAccountResponse]
- func (client *PermissionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[PermissionsClientListByBillingProfileResponse]
- func (client *PermissionsClient) NewListByCustomerPager(billingAccountName string, customerName string, ...) *runtime.Pager[PermissionsClientListByCustomerResponse]
- func (client *PermissionsClient) NewListByInvoiceSectionsPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[PermissionsClientListByInvoiceSectionsResponse]
- type PermissionsClientListByBillingAccountOptions
- type PermissionsClientListByBillingAccountResponse
- type PermissionsClientListByBillingProfileOptions
- type PermissionsClientListByBillingProfileResponse
- type PermissionsClientListByCustomerOptions
- type PermissionsClientListByCustomerResponse
- type PermissionsClientListByInvoiceSectionsOptions
- type PermissionsClientListByInvoiceSectionsResponse
- type PermissionsListResult
- type PermissionsProperties
- type PoliciesClient
- func (client *PoliciesClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PoliciesClientGetByBillingProfileResponse, error)
- func (client *PoliciesClient) GetByCustomer(ctx context.Context, billingAccountName string, customerName string, ...) (PoliciesClientGetByCustomerResponse, error)
- func (client *PoliciesClient) Update(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PoliciesClientUpdateResponse, error)
- func (client *PoliciesClient) UpdateCustomer(ctx context.Context, billingAccountName string, customerName string, ...) (PoliciesClientUpdateCustomerResponse, error)
- type PoliciesClientGetByBillingProfileOptions
- type PoliciesClientGetByBillingProfileResponse
- type PoliciesClientGetByCustomerOptions
- type PoliciesClientGetByCustomerResponse
- type PoliciesClientUpdateCustomerOptions
- type PoliciesClientUpdateCustomerResponse
- type PoliciesClientUpdateOptions
- type PoliciesClientUpdateResponse
- type Policy
- type PolicyProperties
- type Product
- type ProductProperties
- type ProductStatusType
- type ProductTransferValidationErrorCode
- type ProductsClient
- func (client *ProductsClient) Get(ctx context.Context, billingAccountName string, productName string, ...) (ProductsClientGetResponse, error)
- func (client *ProductsClient) Move(ctx context.Context, billingAccountName string, productName string, ...) (ProductsClientMoveResponse, error)
- func (client *ProductsClient) NewListByBillingAccountPager(billingAccountName string, options *ProductsClientListByBillingAccountOptions) *runtime.Pager[ProductsClientListByBillingAccountResponse]
- func (client *ProductsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[ProductsClientListByBillingProfileResponse]
- func (client *ProductsClient) NewListByCustomerPager(billingAccountName string, customerName string, ...) *runtime.Pager[ProductsClientListByCustomerResponse]
- func (client *ProductsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[ProductsClientListByInvoiceSectionResponse]
- func (client *ProductsClient) Update(ctx context.Context, billingAccountName string, productName string, ...) (ProductsClientUpdateResponse, error)
- func (client *ProductsClient) ValidateMove(ctx context.Context, billingAccountName string, productName string, ...) (ProductsClientValidateMoveResponse, error)
- type ProductsClientGetOptions
- type ProductsClientGetResponse
- type ProductsClientListByBillingAccountOptions
- type ProductsClientListByBillingAccountResponse
- type ProductsClientListByBillingProfileOptions
- type ProductsClientListByBillingProfileResponse
- type ProductsClientListByCustomerOptions
- type ProductsClientListByCustomerResponse
- type ProductsClientListByInvoiceSectionOptions
- type ProductsClientListByInvoiceSectionResponse
- type ProductsClientMoveOptions
- type ProductsClientMoveResponse
- type ProductsClientUpdateOptions
- type ProductsClientUpdateResponse
- type ProductsClientValidateMoveOptions
- type ProductsClientValidateMoveResponse
- type ProductsListResult
- type Profile
- type ProfileCreationRequest
- type ProfileInfo
- type ProfileListResult
- type ProfileProperties
- type ProfilesClient
- func (client *ProfilesClient) BeginCreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[ProfilesClientCreateOrUpdateResponse], error)
- func (client *ProfilesClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, ...) (ProfilesClientGetResponse, error)
- func (client *ProfilesClient) NewListByBillingAccountPager(billingAccountName string, options *ProfilesClientListByBillingAccountOptions) *runtime.Pager[ProfilesClientListByBillingAccountResponse]
- type ProfilesClientBeginCreateOrUpdateOptions
- type ProfilesClientCreateOrUpdateResponse
- type ProfilesClientGetOptions
- type ProfilesClientGetResponse
- type ProfilesClientListByBillingAccountOptions
- type ProfilesClientListByBillingAccountResponse
- type ProfilesOnExpand
- type Property
- type PropertyClient
- type PropertyClientGetOptions
- type PropertyClientGetResponse
- type PropertyClientUpdateOptions
- type PropertyClientUpdateResponse
- type PropertyProperties
- type RebillDetails
- type Reseller
- type Reservation
- type ReservationProperty
- type ReservationPropertyUtilization
- type ReservationPurchasesPolicy
- type ReservationSKUProperty
- type ReservationSummary
- type ReservationType
- type ReservationUtilizationAggregates
- type ReservationsClient
- func (client *ReservationsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[ReservationsClientListByBillingAccountResponse]
- func (client *ReservationsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[ReservationsClientListByBillingProfileResponse]
- type ReservationsClientListByBillingAccountOptions
- type ReservationsClientListByBillingAccountResponse
- type ReservationsClientListByBillingProfileOptions
- type ReservationsClientListByBillingProfileResponse
- type ReservationsListResult
- type Resource
- type RoleAssignment
- type RoleAssignmentListResult
- type RoleAssignmentProperties
- type RoleAssignmentsClient
- func (client *RoleAssignmentsClient) DeleteByBillingAccount(ctx context.Context, billingAccountName string, ...) (RoleAssignmentsClientDeleteByBillingAccountResponse, error)
- func (client *RoleAssignmentsClient) DeleteByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleAssignmentsClientDeleteByBillingProfileResponse, error)
- func (client *RoleAssignmentsClient) DeleteByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleAssignmentsClientDeleteByInvoiceSectionResponse, error)
- func (client *RoleAssignmentsClient) GetByBillingAccount(ctx context.Context, billingAccountName string, ...) (RoleAssignmentsClientGetByBillingAccountResponse, error)
- func (client *RoleAssignmentsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleAssignmentsClientGetByBillingProfileResponse, error)
- func (client *RoleAssignmentsClient) GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleAssignmentsClientGetByInvoiceSectionResponse, error)
- func (client *RoleAssignmentsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[RoleAssignmentsClientListByBillingAccountResponse]
- func (client *RoleAssignmentsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[RoleAssignmentsClientListByBillingProfileResponse]
- func (client *RoleAssignmentsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[RoleAssignmentsClientListByInvoiceSectionResponse]
- type RoleAssignmentsClientDeleteByBillingAccountOptions
- type RoleAssignmentsClientDeleteByBillingAccountResponse
- type RoleAssignmentsClientDeleteByBillingProfileOptions
- type RoleAssignmentsClientDeleteByBillingProfileResponse
- type RoleAssignmentsClientDeleteByInvoiceSectionOptions
- type RoleAssignmentsClientDeleteByInvoiceSectionResponse
- type RoleAssignmentsClientGetByBillingAccountOptions
- type RoleAssignmentsClientGetByBillingAccountResponse
- type RoleAssignmentsClientGetByBillingProfileOptions
- type RoleAssignmentsClientGetByBillingProfileResponse
- type RoleAssignmentsClientGetByInvoiceSectionOptions
- type RoleAssignmentsClientGetByInvoiceSectionResponse
- type RoleAssignmentsClientListByBillingAccountOptions
- type RoleAssignmentsClientListByBillingAccountResponse
- type RoleAssignmentsClientListByBillingProfileOptions
- type RoleAssignmentsClientListByBillingProfileResponse
- type RoleAssignmentsClientListByInvoiceSectionOptions
- type RoleAssignmentsClientListByInvoiceSectionResponse
- type RoleDefinition
- type RoleDefinitionListResult
- type RoleDefinitionProperties
- type RoleDefinitionsClient
- func (client *RoleDefinitionsClient) GetByBillingAccount(ctx context.Context, billingAccountName string, ...) (RoleDefinitionsClientGetByBillingAccountResponse, error)
- func (client *RoleDefinitionsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleDefinitionsClientGetByBillingProfileResponse, error)
- func (client *RoleDefinitionsClient) GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleDefinitionsClientGetByInvoiceSectionResponse, error)
- func (client *RoleDefinitionsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[RoleDefinitionsClientListByBillingAccountResponse]
- func (client *RoleDefinitionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[RoleDefinitionsClientListByBillingProfileResponse]
- func (client *RoleDefinitionsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[RoleDefinitionsClientListByInvoiceSectionResponse]
- type RoleDefinitionsClientGetByBillingAccountOptions
- type RoleDefinitionsClientGetByBillingAccountResponse
- type RoleDefinitionsClientGetByBillingProfileOptions
- type RoleDefinitionsClientGetByBillingProfileResponse
- type RoleDefinitionsClientGetByInvoiceSectionOptions
- type RoleDefinitionsClientGetByInvoiceSectionResponse
- type RoleDefinitionsClientListByBillingAccountOptions
- type RoleDefinitionsClientListByBillingAccountResponse
- type RoleDefinitionsClientListByBillingProfileOptions
- type RoleDefinitionsClientListByBillingProfileResponse
- type RoleDefinitionsClientListByInvoiceSectionOptions
- type RoleDefinitionsClientListByInvoiceSectionResponse
- type SpendingLimit
- type SpendingLimitForBillingProfile
- type StatusReasonCode
- type StatusReasonCodeForBillingProfile
- type Subscription
- type SubscriptionProperties
- type SubscriptionTransferValidationErrorCode
- type SubscriptionsClient
- func (client *SubscriptionsClient) BeginMove(ctx context.Context, billingAccountName string, ...) (*runtime.Poller[SubscriptionsClientMoveResponse], error)
- func (client *SubscriptionsClient) Get(ctx context.Context, billingAccountName string, ...) (SubscriptionsClientGetResponse, error)
- func (client *SubscriptionsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[SubscriptionsClientListByBillingAccountResponse]
- func (client *SubscriptionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[SubscriptionsClientListByBillingProfileResponse]
- func (client *SubscriptionsClient) NewListByCustomerPager(billingAccountName string, customerName string, ...) *runtime.Pager[SubscriptionsClientListByCustomerResponse]
- func (client *SubscriptionsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[SubscriptionsClientListByInvoiceSectionResponse]
- func (client *SubscriptionsClient) Update(ctx context.Context, billingAccountName string, parameters Subscription, ...) (SubscriptionsClientUpdateResponse, error)
- func (client *SubscriptionsClient) ValidateMove(ctx context.Context, billingAccountName string, ...) (SubscriptionsClientValidateMoveResponse, error)
- type SubscriptionsClientBeginMoveOptions
- type SubscriptionsClientGetOptions
- type SubscriptionsClientGetResponse
- type SubscriptionsClientListByBillingAccountOptions
- type SubscriptionsClientListByBillingAccountResponse
- type SubscriptionsClientListByBillingProfileOptions
- type SubscriptionsClientListByBillingProfileResponse
- type SubscriptionsClientListByCustomerOptions
- type SubscriptionsClientListByCustomerResponse
- type SubscriptionsClientListByInvoiceSectionOptions
- type SubscriptionsClientListByInvoiceSectionResponse
- type SubscriptionsClientMoveResponse
- type SubscriptionsClientUpdateOptions
- type SubscriptionsClientUpdateResponse
- type SubscriptionsClientValidateMoveOptions
- type SubscriptionsClientValidateMoveResponse
- type SubscriptionsListResult
- type TargetCloud
- type Transaction
- type TransactionListResult
- type TransactionProperties
- type TransactionTypeKind
- type TransactionsClient
- type TransactionsClientListByInvoiceOptions
- type TransactionsClientListByInvoiceResponse
- type TransferBillingSubscriptionRequestProperties
- type TransferProductRequestProperties
- type ValidateAddressResponse
- type ValidateProductTransferEligibilityError
- type ValidateProductTransferEligibilityResult
- type ValidateSubscriptionTransferEligibilityError
- type ValidateSubscriptionTransferEligibilityResult
- type ViewCharges
- type ViewChargesPolicy
Examples ¶
- AccountsClient.BeginUpdate
- AccountsClient.Get (BillingAccountWithExpand)
- AccountsClient.Get (BillingAccounts)
- AccountsClient.NewListInvoiceSectionsByCreateSubscriptionPermissionPager
- AccountsClient.NewListPager (BillingAccountsList)
- AccountsClient.NewListPager (BillingAccountsListWithExpand)
- AccountsClient.NewListPager (BillingAccountsListWithExpandForEnrollmentDetails)
- AddressClient.Validate (AddressInvalid)
- AddressClient.Validate (AddressValid)
- AgreementsClient.Get
- AgreementsClient.NewListByBillingAccountPager
- AvailableBalancesClient.Get
- CustomersClient.Get (Customer)
- CustomersClient.Get (CustomerWithExpand)
- CustomersClient.NewListByBillingAccountPager
- CustomersClient.NewListByBillingProfilePager
- EnrollmentAccountsClient.Get
- EnrollmentAccountsClient.NewListPager
- InstructionsClient.Get
- InstructionsClient.NewListByBillingProfilePager
- InstructionsClient.Put
- InvoiceSectionsClient.BeginCreateOrUpdate
- InvoiceSectionsClient.Get
- InvoiceSectionsClient.NewListByBillingProfilePager
- InvoicesClient.BeginDownloadBillingSubscriptionInvoice
- InvoicesClient.BeginDownloadInvoice
- InvoicesClient.BeginDownloadMultipleBillingProfileInvoices
- InvoicesClient.BeginDownloadMultipleBillingSubscriptionInvoices
- InvoicesClient.Get (CreditNote)
- InvoicesClient.Get (Invoice)
- InvoicesClient.Get (InvoiceWithRebillDetails)
- InvoicesClient.Get (VoidInvoice)
- InvoicesClient.GetByID
- InvoicesClient.GetBySubscriptionAndInvoiceID
- InvoicesClient.NewListByBillingAccountPager (BillingAccountInvoicesList)
- InvoicesClient.NewListByBillingAccountPager (BillingAccountInvoicesListWithRebillDetails)
- InvoicesClient.NewListByBillingProfilePager (InvoicesListByBillingProfile)
- InvoicesClient.NewListByBillingProfilePager (InvoicesListByBillingProfileWithRebillDetails)
- InvoicesClient.NewListByBillingSubscriptionPager
- PeriodsClient.Get
- PeriodsClient.NewListPager
- PermissionsClient.NewListByBillingAccountPager
- PermissionsClient.NewListByBillingProfilePager
- PermissionsClient.NewListByCustomerPager
- PermissionsClient.NewListByInvoiceSectionsPager
- PoliciesClient.GetByBillingProfile
- PoliciesClient.GetByCustomer
- PoliciesClient.Update
- PoliciesClient.UpdateCustomer
- ProductsClient.Get
- ProductsClient.Move
- ProductsClient.NewListByBillingAccountPager
- ProductsClient.NewListByBillingProfilePager
- ProductsClient.NewListByCustomerPager
- ProductsClient.NewListByInvoiceSectionPager
- ProductsClient.Update
- ProductsClient.ValidateMove (SubscriptionMoveValidateFailure)
- ProductsClient.ValidateMove (SubscriptionMoveValidateSuccess)
- ProfilesClient.BeginCreateOrUpdate
- ProfilesClient.Get (BillingProfile)
- ProfilesClient.Get (BillingProfileWithExpand)
- ProfilesClient.NewListByBillingAccountPager (BillingProfilesListByBillingAccount)
- ProfilesClient.NewListByBillingAccountPager (BillingProfilesListWithExpand)
- PropertyClient.Get
- PropertyClient.Update
- ReservationsClient.NewListByBillingAccountPager
- ReservationsClient.NewListByBillingProfilePager
- RoleAssignmentsClient.DeleteByBillingAccount
- RoleAssignmentsClient.DeleteByBillingProfile
- RoleAssignmentsClient.DeleteByInvoiceSection
- RoleAssignmentsClient.GetByBillingAccount
- RoleAssignmentsClient.GetByBillingProfile
- RoleAssignmentsClient.GetByInvoiceSection
- RoleAssignmentsClient.NewListByBillingAccountPager
- RoleAssignmentsClient.NewListByBillingProfilePager
- RoleAssignmentsClient.NewListByInvoiceSectionPager
- RoleDefinitionsClient.GetByBillingAccount
- RoleDefinitionsClient.GetByBillingProfile
- RoleDefinitionsClient.GetByInvoiceSection
- RoleDefinitionsClient.NewListByBillingAccountPager
- RoleDefinitionsClient.NewListByBillingProfilePager
- RoleDefinitionsClient.NewListByInvoiceSectionPager
- SubscriptionsClient.BeginMove
- SubscriptionsClient.Get
- SubscriptionsClient.NewListByBillingAccountPager
- SubscriptionsClient.NewListByBillingProfilePager
- SubscriptionsClient.NewListByCustomerPager
- SubscriptionsClient.NewListByInvoiceSectionPager
- SubscriptionsClient.Update
- SubscriptionsClient.ValidateMove (SubscriptionMoveValidateFailure)
- SubscriptionsClient.ValidateMove (SubscriptionMoveValidateSuccess)
- TransactionsClient.NewListByInvoicePager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptanceMode ¶
type AcceptanceMode string
AcceptanceMode - The mode of acceptance for an agreement.
const ( AcceptanceModeClickToAccept AcceptanceMode = "ClickToAccept" AcceptanceModeESignEmbedded AcceptanceMode = "ESignEmbedded" AcceptanceModeESignOffline AcceptanceMode = "ESignOffline" )
func PossibleAcceptanceModeValues ¶
func PossibleAcceptanceModeValues() []AcceptanceMode
PossibleAcceptanceModeValues returns the possible values for the AcceptanceMode const type.
type Account ¶ added in v0.2.0
type Account struct { // The properties of the billing account. Properties *AccountProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Account - A billing account.
func (Account) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Account.
func (*Account) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Account.
type AccountListResult ¶ added in v0.2.0
type AccountListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of billing accounts. Value []*Account }
AccountListResult - The list of billing accounts.
func (AccountListResult) MarshalJSON ¶ added in v0.2.0
func (a AccountListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccountListResult.
func (*AccountListResult) UnmarshalJSON ¶ added in v0.6.0
func (a *AccountListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccountListResult.
type AccountProperties ¶ added in v0.2.0
type AccountProperties struct { // The billing profiles associated with the billing account. By default this is not populated, unless it's specified in $expand. BillingProfiles *ProfilesOnExpand // The departments associated to the enrollment. Departments []*Department // The billing account name. DisplayName *string // The accounts associated to the enrollment. EnrollmentAccounts []*EnrollmentAccount // Notification email address, only for legacy accounts NotificationEmailAddress *string // The address of the individual or organization that is responsible for the billing account. SoldTo *AddressDetails // READ-ONLY; The current status of the billing account. AccountStatus *AccountStatus // READ-ONLY; The type of customer. AccountType *AccountType // READ-ONLY; The type of agreement. AgreementType *AgreementType // READ-ONLY; The details about the associated legacy enrollment. By default this is not populated, unless it's specified // in $expand. EnrollmentDetails *Enrollment // READ-ONLY; Indicates whether user has read access to the billing account. HasReadAccess *bool }
AccountProperties - The properties of the billing account.
func (AccountProperties) MarshalJSON ¶ added in v0.2.0
func (a AccountProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccountProperties.
func (*AccountProperties) UnmarshalJSON ¶ added in v0.6.0
func (a *AccountProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccountProperties.
type AccountStatus ¶
type AccountStatus string
AccountStatus - The current status of the billing account.
const ( AccountStatusActive AccountStatus = "Active" AccountStatusDeleted AccountStatus = "Deleted" AccountStatusDisabled AccountStatus = "Disabled" AccountStatusExpired AccountStatus = "Expired" AccountStatusExtended AccountStatus = "Extended" AccountStatusTerminated AccountStatus = "Terminated" AccountStatusTransferred AccountStatus = "Transferred" )
func PossibleAccountStatusValues ¶
func PossibleAccountStatusValues() []AccountStatus
PossibleAccountStatusValues returns the possible values for the AccountStatus const type.
type AccountType ¶
type AccountType string
AccountType - The type of customer.
const ( AccountTypeEnterprise AccountType = "Enterprise" AccountTypeIndividual AccountType = "Individual" AccountTypePartner AccountType = "Partner" )
func PossibleAccountTypeValues ¶
func PossibleAccountTypeValues() []AccountType
PossibleAccountTypeValues returns the possible values for the AccountType const type.
type AccountUpdateRequest ¶ added in v0.2.0
type AccountUpdateRequest struct { // A billing property. Properties *AccountProperties }
AccountUpdateRequest - The request properties of the billing account that can be updated.
func (AccountUpdateRequest) MarshalJSON ¶ added in v0.2.0
func (a AccountUpdateRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccountUpdateRequest.
func (*AccountUpdateRequest) UnmarshalJSON ¶ added in v0.6.0
func (a *AccountUpdateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccountUpdateRequest.
type AccountsClient ¶ added in v0.2.0
type AccountsClient struct {
// contains filtered or unexported fields
}
AccountsClient contains the methods for the BillingAccounts group. Don't use this type directly, use NewAccountsClient() instead.
func NewAccountsClient ¶ added in v0.2.0
func NewAccountsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountsClient, error)
NewAccountsClient creates a new instance of AccountsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*AccountsClient) BeginUpdate ¶ added in v0.2.0
func (client *AccountsClient) BeginUpdate(ctx context.Context, billingAccountName string, parameters AccountUpdateRequest, options *AccountsClientBeginUpdateOptions) (*runtime.Poller[AccountsClientUpdateResponse], error)
BeginUpdate - Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - Request parameters that are provided to the update billing account operation.
- options - AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingAccount.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewAccountsClient().BeginUpdate(ctx, "{billingAccountName}", armbilling.AccountUpdateRequest{ Properties: &armbilling.AccountProperties{ DisplayName: to.Ptr("Test Account"), SoldTo: &armbilling.AddressDetails{ AddressLine1: to.Ptr("Test Address 1"), City: to.Ptr("Redmond"), CompanyName: to.Ptr("Contoso"), Country: to.Ptr("US"), FirstName: to.Ptr("Test"), LastName: to.Ptr("User"), PostalCode: to.Ptr("12345"), Region: to.Ptr("WA"), }, }, }, 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.Account = armbilling.Account{ // Name: to.Ptr("{billingAccountName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Test Account"), // HasReadAccess: to.Ptr(true), // SoldTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address 1"), // City: to.Ptr("Redmond"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PostalCode: to.Ptr("12345"), // Region: to.Ptr("WA"), // }, // }, // } }
Output:
func (*AccountsClient) Get ¶ added in v0.2.0
func (client *AccountsClient) Get(ctx context.Context, billingAccountName string, options *AccountsClientGetOptions) (AccountsClientGetResponse, error)
Get - Gets a billing account by its ID. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method.
Example (BillingAccountWithExpand) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountWithExpand.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAccountsClient().Get(ctx, "{billingAccountName}", &armbilling.AccountsClientGetOptions{Expand: to.Ptr("soldTo,billingProfiles,billingProfiles/invoiceSections")}) 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.Account = armbilling.Account{ // Name: to.Ptr("{billingAccountName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // BillingProfiles: &armbilling.ProfilesOnExpand{ // HasMoreResults: to.Ptr(true), // Value: []*armbilling.Profile{ // { // Name: to.Ptr("11000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("BillingProfile1"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ // HasMoreResults: to.Ptr(true), // Value: []*armbilling.InvoiceSection{ // { // Name: to.Ptr("invoiceSectionId1"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/invoiceSectionId1"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName1"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("9XXX-11XX-XX1-XXXX-XXX"), // }, // }}, // }, // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), // }, // }, // { // Name: to.Ptr("11000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeIndirectCustomer), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("BillingProfile2"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // IndirectRelationshipInfo: &armbilling.IndirectRelationshipInfo{ // BillingAccountName: to.Ptr("30000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), // BillingProfileName: to.Ptr("33000000-0000-0000-0000-000000000001"), // DisplayName: to.Ptr("Partner1"), // }, // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ // HasMoreResults: to.Ptr(true), // Value: []*armbilling.InvoiceSection{ // { // Name: to.Ptr("invoiceSectionId2"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001/invoiceSections/invoiceSectionId2"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName2"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Marketing"), // "pcCode": to.Ptr("Z223456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("9XXX-22XX-XX1-XXXX-XXX"), // }, // }}, // }, // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOff), // Status: to.Ptr(armbilling.BillingProfileStatusActive), // SystemID: to.Ptr("2XXX-22XX-XX1-XXXX-XXX"), // }, // }}, // }, // DisplayName: to.Ptr("Test Account 1"), // HasReadAccess: to.Ptr(true), // SoldTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address"), // AddressLine2: to.Ptr("Test Address"), // AddressLine3: to.Ptr("Test Address"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // }, // } }
Output:
Example (BillingAccounts) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAccountsClient().Get(ctx, "{billingAccountName}", &armbilling.AccountsClientGetOptions{Expand: 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.Account = armbilling.Account{ // Name: to.Ptr("{billingAccountName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Test Account"), // HasReadAccess: to.Ptr(true), // }, // } }
Output:
func (*AccountsClient) NewListInvoiceSectionsByCreateSubscriptionPermissionPager ¶ added in v0.4.0
func (client *AccountsClient) NewListInvoiceSectionsByCreateSubscriptionPermissionPager(billingAccountName string, options *AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionOptions) *runtime.Pager[AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionResponse]
NewListInvoiceSectionsByCreateSubscriptionPermissionPager - Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionOptions contains the optional parameters for the AccountsClient.NewListInvoiceSectionsByCreateSubscriptionPermissionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListWithCreateSubPermission.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAccountsClient().NewListInvoiceSectionsByCreateSubscriptionPermissionPager("{billingAccountName}", 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.InvoiceSectionListWithCreateSubPermissionResult = armbilling.InvoiceSectionListWithCreateSubPermissionResult{ // Value: []*armbilling.InvoiceSectionWithCreateSubPermission{ // { // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // BillingProfileSpendingLimit: to.Ptr(armbilling.SpendingLimitForBillingProfileOn), // BillingProfileStatus: to.Ptr(armbilling.BillingProfileStatusWarned), // BillingProfileStatusReasonCode: to.Ptr(armbilling.StatusReasonCodeForBillingProfilePastDue), // BillingProfileSystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // InvoiceSectionDisplayName: to.Ptr("invoiceSection1"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), // InvoiceSectionSystemID: to.Ptr("9XXX-11XX-XX1-XXXX-XXX"), // }}, // } } }
Output:
func (*AccountsClient) NewListPager ¶ added in v0.4.0
func (client *AccountsClient) NewListPager(options *AccountsClientListOptions) *runtime.Pager[AccountsClientListResponse]
NewListPager - Lists the billing accounts that a user has access to.
Generated from API version 2020-05-01
- options - AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method.
Example (BillingAccountsList) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAccountsClient().NewListPager(&armbilling.AccountsClientListOptions{Expand: 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.AccountListResult = armbilling.AccountListResult{ // Value: []*armbilling.Account{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Test Account 1"), // HasReadAccess: to.Ptr(true), // }, // }, // { // Name: to.Ptr("10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Test Account 2"), // HasReadAccess: to.Ptr(true), // }, // }, // { // Name: to.Ptr("20000000-0000-0000-0000-000000000002_00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-0000-0000-0000-000000000002_00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Test Account 3"), // HasReadAccess: to.Ptr(true), // }, // }}, // } } }
Output:
Example (BillingAccountsListWithExpand) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpand.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAccountsClient().NewListPager(&armbilling.AccountsClientListOptions{Expand: to.Ptr("soldTo,billingProfiles,billingProfiles/invoiceSections")}) 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.AccountListResult = armbilling.AccountListResult{ // Value: []*armbilling.Account{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // BillingProfiles: &armbilling.ProfilesOnExpand{ // HasMoreResults: to.Ptr(true), // Value: []*armbilling.Profile{ // { // Name: to.Ptr("11000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000000"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("BillingProfile1"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ // HasMoreResults: to.Ptr(false), // Value: []*armbilling.InvoiceSection{ // { // Name: to.Ptr("invoiceSectionId1"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/invoiceSectionId1"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName1"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("9XXX-11XX-XX1-XXXX-XXX"), // }, // }, // { // Name: to.Ptr("invoiceSectionId2"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/invoiceSectionId2"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName2"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Finance"), // "pcCode": to.Ptr("B223456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("9XXX-22XX-XX1-XXXX-XXX"), // }, // }}, // }, // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), // }, // }, // { // Name: to.Ptr("11000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000001"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeCSPPartner), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("BillingProfile2"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ // HasMoreResults: to.Ptr(false), // Value: []*armbilling.InvoiceSection{ // { // Name: to.Ptr("invoiceSectionId11"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000001/invoiceSections/invoiceSectionId11"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName11"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Marketing"), // "pcCode": to.Ptr("Z223456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("9XXX-33XX-XX1-XXXX-XXX"), // }, // }}, // }, // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOff), // Status: to.Ptr(armbilling.BillingProfileStatusActive), // SystemID: to.Ptr("2XXX-22XX-XX1-XXXX-XXX"), // }, // }}, // }, // DisplayName: to.Ptr("Test Account 1"), // HasReadAccess: to.Ptr(true), // SoldTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address"), // AddressLine2: to.Ptr("Test Address"), // AddressLine3: to.Ptr("Test Address"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // }, // }, // { // Name: to.Ptr("10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // BillingProfiles: &armbilling.ProfilesOnExpand{ // HasMoreResults: to.Ptr(true), // Value: []*armbilling.Profile{ // { // Name: to.Ptr("11000000-0000-0000-0000-000000000004"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000004"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso Test"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeIndirectPartner), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("BillingProfile3"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // IndirectRelationshipInfo: &armbilling.IndirectRelationshipInfo{ // BillingAccountName: to.Ptr("20000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), // BillingProfileName: to.Ptr("22000000-0000-0000-0000-000000000001"), // DisplayName: to.Ptr("Customer1"), // }, // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ // HasMoreResults: to.Ptr(true), // Value: []*armbilling.InvoiceSection{ // { // Name: to.Ptr("invoiceSectionId3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000004/invoiceSections/invoiceSectionId3"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName3"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("C123456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateRestricted), // SystemID: to.Ptr("9XXX-44XX-XX1-XXXX-XXX"), // TargetCloud: to.Ptr(armbilling.TargetCloudUSNat), // }, // }, // { // Name: to.Ptr("invoiceSectionId4"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000004/invoiceSections/invoiceSectionId4"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName4"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Marketing"), // "pcCode": to.Ptr("D123456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateRestricted), // SystemID: to.Ptr("9XXX-55XX-XX1-XXXX-XXX"), // TargetCloud: to.Ptr(armbilling.TargetCloudUSSec), // }, // }}, // }, // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), // SystemID: to.Ptr("3XXX-33XX-XX1-XXXX-XXX"), // TargetClouds: []*armbilling.TargetCloud{ // to.Ptr(armbilling.TargetCloudUSNat), // to.Ptr(armbilling.TargetCloudUSSec)}, // }, // }, // { // Name: to.Ptr("11000000-0000-0000-0000-000000000005"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000005"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso Test"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeIndirectCustomer), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("BillingProfile4"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // IndirectRelationshipInfo: &armbilling.IndirectRelationshipInfo{ // BillingAccountName: to.Ptr("30000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), // BillingProfileName: to.Ptr("33000000-0000-0000-0000-000000000001"), // DisplayName: to.Ptr("Partner1"), // }, // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ // HasMoreResults: to.Ptr(true), // Value: []*armbilling.InvoiceSection{ // { // Name: to.Ptr("invoiceSectionId5"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000005/invoiceSections/invoiceSectionId5"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName5"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Finance"), // "pcCode": to.Ptr("E123456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("9XXX-66XX-XX1-XXXX-XXX"), // }, // }, // { // Name: to.Ptr("invoiceSectionId6"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000005/invoiceSections/invoiceSectionId6"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName6"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("O123456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateRestricted), // SystemID: to.Ptr("9XXX-77XX-XX1-XXXX-XXX"), // TargetCloud: to.Ptr(armbilling.TargetCloudUSSec), // }, // }}, // }, // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), // SystemID: to.Ptr("4XXX-44XX-XX1-XXXX-XXX"), // TargetClouds: []*armbilling.TargetCloud{ // to.Ptr(armbilling.TargetCloudUSSec)}, // }, // }}, // }, // DisplayName: to.Ptr("Test Account 2"), // HasReadAccess: to.Ptr(true), // }, // }}, // } } }
Output:
Example (BillingAccountsListWithExpandForEnrollmentDetails) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpandForEnrollmentDetails.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAccountsClient().NewListPager(&armbilling.AccountsClientListOptions{Expand: to.Ptr("enrollmentDetails,departments,enrollmentAccounts")}) 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.AccountListResult = armbilling.AccountListResult{ // Value: []*armbilling.Account{ // { // Name: to.Ptr("7645820"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7645820"), // Properties: &armbilling.AccountProperties{ // AgreementType: to.Ptr(armbilling.AgreementTypeEnterpriseAgreement), // Departments: []*armbilling.Department{ // { // Name: to.Ptr("departmentId1"), // Type: to.Ptr("Microsoft.Billing/departments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/departmentId1"), // Properties: &armbilling.DepartmentProperties{ // CostCenter: to.Ptr("C1"), // DepartmentName: to.Ptr("departmentName1"), // Status: to.Ptr("Active"), // }, // }, // { // Name: to.Ptr("departmentId2"), // Type: to.Ptr("Microsoft.Billing/departments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/departmentId2"), // Properties: &armbilling.DepartmentProperties{ // CostCenter: to.Ptr("C4"), // DepartmentName: to.Ptr("departmentName2"), // Status: to.Ptr("Active"), // }, // }}, // EnrollmentAccounts: []*armbilling.EnrollmentAccount{ // { // Name: to.Ptr("accountId0"), // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/accountId0"), // Properties: &armbilling.EnrollmentAccountProperties{ // AccountName: to.Ptr("AccountName0"), // CostCenter: to.Ptr("C0"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Status: to.Ptr("Active"), // }, // }, // { // Name: to.Ptr("accountId1"), // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/accountId1"), // Properties: &armbilling.EnrollmentAccountProperties{ // AccountName: to.Ptr("AccountName1"), // CostCenter: to.Ptr("C4"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Status: to.Ptr("Active"), // }, // }, // { // Name: to.Ptr("accountId2"), // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/accountId2"), // Properties: &armbilling.EnrollmentAccountProperties{ // AccountName: to.Ptr("AccountName2"), // CostCenter: to.Ptr("C4"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Status: to.Ptr("Active"), // }, // }}, // EnrollmentDetails: &armbilling.Enrollment{ // BillingCycle: to.Ptr("Monthly"), // Channel: to.Ptr("EaDirect"), // CountryCode: to.Ptr("US"), // Currency: to.Ptr("USD"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // Policies: &armbilling.EnrollmentPolicies{ // AccountOwnerViewCharges: to.Ptr(true), // DepartmentAdminViewCharges: to.Ptr(true), // MarketplaceEnabled: to.Ptr(true), // ReservedInstancesEnabled: to.Ptr(true), // }, // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Status: to.Ptr("Active"), // Language: to.Ptr("en"), // }, // SoldTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address"), // AddressLine2: to.Ptr("Test Address"), // AddressLine3: to.Ptr("Test Address"), // City: to.Ptr("City"), // Country: to.Ptr("US"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // }, // }}, // } } }
Output:
type AccountsClientBeginUpdateOptions ¶ added in v0.2.0
type AccountsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method.
type AccountsClientGetOptions ¶ added in v0.2.0
type AccountsClientGetOptions struct { // May be used to expand the soldTo, invoice sections and billing profiles. Expand *string }
AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method.
type AccountsClientGetResponse ¶ added in v0.2.0
type AccountsClientGetResponse struct { // A billing account. Account }
AccountsClientGetResponse contains the response from method AccountsClient.Get.
type AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionOptions ¶ added in v0.2.0
type AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionOptions struct { }
AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionOptions contains the optional parameters for the AccountsClient.NewListInvoiceSectionsByCreateSubscriptionPermissionPager method.
type AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionResponse ¶ added in v0.2.0
type AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionResponse struct { // The list of invoice section properties with create subscription permission. InvoiceSectionListWithCreateSubPermissionResult }
AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionResponse contains the response from method AccountsClient.NewListInvoiceSectionsByCreateSubscriptionPermissionPager.
type AccountsClientListOptions ¶ added in v0.2.0
type AccountsClientListOptions struct { // May be used to expand the soldTo, invoice sections and billing profiles. Expand *string }
AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method.
type AccountsClientListResponse ¶ added in v0.2.0
type AccountsClientListResponse struct { // The list of billing accounts. AccountListResult }
AccountsClientListResponse contains the response from method AccountsClient.NewListPager.
type AccountsClientUpdateResponse ¶ added in v0.2.0
type AccountsClientUpdateResponse struct { // A billing account. Account }
AccountsClientUpdateResponse contains the response from method AccountsClient.BeginUpdate.
type AddressClient ¶
type AddressClient struct {
// contains filtered or unexported fields
}
AddressClient contains the methods for the Address group. Don't use this type directly, use NewAddressClient() instead.
func NewAddressClient ¶
func NewAddressClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AddressClient, error)
NewAddressClient creates a new instance of AddressClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*AddressClient) Validate ¶
func (client *AddressClient) Validate(ctx context.Context, address AddressDetails, options *AddressClientValidateOptions) (AddressClientValidateResponse, error)
Validate - Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- options - AddressClientValidateOptions contains the optional parameters for the AddressClient.Validate method.
Example (AddressInvalid) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressInvalid.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAddressClient().Validate(ctx, armbilling.AddressDetails{ AddressLine1: to.Ptr("1 Test"), City: to.Ptr("bellevue"), Country: to.Ptr("us"), PostalCode: to.Ptr("12345"), Region: to.Ptr("wa"), }, 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.ValidateAddressResponse = armbilling.ValidateAddressResponse{ // Status: to.Ptr(armbilling.AddressValidationStatusInvalid), // SuggestedAddresses: []*armbilling.AddressDetails{ // { // AddressLine1: to.Ptr("1 Test Address"), // City: to.Ptr("Bellevue"), // Country: to.Ptr("US"), // PostalCode: to.Ptr("98052"), // Region: to.Ptr("WA"), // }, // { // AddressLine1: to.Ptr("1 Test Address"), // City: to.Ptr("Bellevue"), // Country: to.Ptr("US"), // PostalCode: to.Ptr("12345-0000"), // Region: to.Ptr("WA"), // }}, // ValidationMessage: to.Ptr("Invalid address"), // } }
Output:
Example (AddressValid) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressValid.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAddressClient().Validate(ctx, armbilling.AddressDetails{ AddressLine1: to.Ptr("1 Test Address"), City: to.Ptr("bellevue"), Country: to.Ptr("us"), PostalCode: to.Ptr("12345"), Region: to.Ptr("wa"), }, 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.ValidateAddressResponse = armbilling.ValidateAddressResponse{ // Status: to.Ptr(armbilling.AddressValidationStatusValid), // SuggestedAddresses: []*armbilling.AddressDetails{ // { // AddressLine1: to.Ptr("1 Test Address"), // City: to.Ptr("Bellevue"), // Country: to.Ptr("US"), // PostalCode: to.Ptr("12345-0000"), // Region: to.Ptr("WA"), // }}, // } }
Output:
type AddressClientValidateOptions ¶ added in v0.2.0
type AddressClientValidateOptions struct { }
AddressClientValidateOptions contains the optional parameters for the AddressClient.Validate method.
type AddressClientValidateResponse ¶ added in v0.2.0
type AddressClientValidateResponse struct { // Result of the address validation ValidateAddressResponse }
AddressClientValidateResponse contains the response from method AddressClient.Validate.
type AddressDetails ¶
type AddressDetails struct { // REQUIRED; Address line 1. AddressLine1 *string // REQUIRED; Country code uses ISO2, 2-digit format. Country *string // Address line 2. AddressLine2 *string // Address line 3. AddressLine3 *string // Address city. City *string // Company name. CompanyName *string // Address district. District *string // Email address. Email *string // First name. FirstName *string // Last name. LastName *string // Middle name. MiddleName *string // Phone number. PhoneNumber *string // Postal code. PostalCode *string // Address region. Region *string }
AddressDetails - Address details.
func (AddressDetails) MarshalJSON ¶ added in v0.6.0
func (a AddressDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AddressDetails.
func (*AddressDetails) UnmarshalJSON ¶ added in v0.6.0
func (a *AddressDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AddressDetails.
type AddressValidationStatus ¶
type AddressValidationStatus string
AddressValidationStatus - Status of the address validation.
const ( AddressValidationStatusInvalid AddressValidationStatus = "Invalid" AddressValidationStatusValid AddressValidationStatus = "Valid" )
func PossibleAddressValidationStatusValues ¶
func PossibleAddressValidationStatusValues() []AddressValidationStatus
PossibleAddressValidationStatusValues returns the possible values for the AddressValidationStatus const type.
type Agreement ¶
type Agreement struct { // The properties of an agreement. Properties *AgreementProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Agreement - An agreement.
func (Agreement) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Agreement.
func (*Agreement) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Agreement.
type AgreementListResult ¶
type AgreementListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of agreements. Value []*Agreement }
AgreementListResult - Result of listing agreements.
func (AgreementListResult) MarshalJSON ¶
func (a AgreementListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AgreementListResult.
func (*AgreementListResult) UnmarshalJSON ¶ added in v0.6.0
func (a *AgreementListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AgreementListResult.
type AgreementProperties ¶
type AgreementProperties struct { // The list of participants that participates in acceptance of an agreement. Participants []*Participants // READ-ONLY; The mode of acceptance for an agreement. AcceptanceMode *AcceptanceMode // READ-ONLY; The URL to download the agreement. AgreementLink *string // READ-ONLY; The list of billing profiles associated with agreement and present only for specific agreements. BillingProfileInfo *ProfileInfo // READ-ONLY; The category of the agreement signed by a customer. Category *Category // READ-ONLY; The date from which the agreement is effective. EffectiveDate *time.Time // READ-ONLY; The date when the agreement expires. ExpirationDate *time.Time // READ-ONLY; The current status of the agreement. Status *string }
AgreementProperties - The properties of an agreement.
func (AgreementProperties) MarshalJSON ¶
func (a AgreementProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AgreementProperties.
func (*AgreementProperties) UnmarshalJSON ¶
func (a *AgreementProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AgreementProperties.
type AgreementType ¶
type AgreementType string
AgreementType - The type of agreement.
const ( AgreementTypeEnterpriseAgreement AgreementType = "EnterpriseAgreement" AgreementTypeMicrosoftCustomerAgreement AgreementType = "MicrosoftCustomerAgreement" AgreementTypeMicrosoftOnlineServicesProgram AgreementType = "MicrosoftOnlineServicesProgram" AgreementTypeMicrosoftPartnerAgreement AgreementType = "MicrosoftPartnerAgreement" )
func PossibleAgreementTypeValues ¶
func PossibleAgreementTypeValues() []AgreementType
PossibleAgreementTypeValues returns the possible values for the AgreementType const type.
type AgreementsClient ¶
type AgreementsClient struct {
// contains filtered or unexported fields
}
AgreementsClient contains the methods for the Agreements group. Don't use this type directly, use NewAgreementsClient() instead.
func NewAgreementsClient ¶
func NewAgreementsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AgreementsClient, error)
NewAgreementsClient creates a new instance of AgreementsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*AgreementsClient) Get ¶
func (client *AgreementsClient) Get(ctx context.Context, billingAccountName string, agreementName string, options *AgreementsClientGetOptions) (AgreementsClientGetResponse, error)
Get - Gets an agreement by ID. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- agreementName - The ID that uniquely identifies an agreement.
- options - AgreementsClientGetOptions contains the optional parameters for the AgreementsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementByName.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAgreementsClient().Get(ctx, "{billingAccountName}", "{agreementName}", &armbilling.AgreementsClientGetOptions{Expand: 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.Agreement = armbilling.Agreement{ // Name: to.Ptr("{agreementName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/agreements"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/{agreementName}"), // Properties: &armbilling.AgreementProperties{ // AcceptanceMode: to.Ptr(armbilling.AcceptanceModeClickToAccept), // AgreementLink: to.Ptr("https://agreementuri1.com"), // Category: to.Ptr(armbilling.CategoryMicrosoftCustomerAgreement), // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00.000Z"); return t}()), // Participants: []*armbilling.Participants{ // { // Email: to.Ptr("abc@contoso.com"), // Status: to.Ptr("Accepted"), // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-01T00:00:00.000Z"); return t}()), // }, // { // Email: to.Ptr("xyz@contoso.com"), // Status: to.Ptr("Declined"), // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-02T00:00:00.000Z"); return t}()), // }}, // Status: to.Ptr("Published"), // }, // } }
Output:
func (*AgreementsClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *AgreementsClient) NewListByBillingAccountPager(billingAccountName string, options *AgreementsClientListByBillingAccountOptions) *runtime.Pager[AgreementsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the agreements for a billing account.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - AgreementsClientListByBillingAccountOptions contains the optional parameters for the AgreementsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementsListByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAgreementsClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.AgreementsClientListByBillingAccountOptions{Expand: 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.AgreementListResult = armbilling.AgreementListResult{ // Value: []*armbilling.Agreement{ // { // Name: to.Ptr("Agreement1"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/agreements"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/Agreement1"), // Properties: &armbilling.AgreementProperties{ // AcceptanceMode: to.Ptr(armbilling.AcceptanceModeClickToAccept), // AgreementLink: to.Ptr("https://agreementuri1.com"), // Category: to.Ptr(armbilling.CategoryMicrosoftCustomerAgreement), // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00.000Z"); return t}()), // Participants: []*armbilling.Participants{ // { // Email: to.Ptr("abc@contoso.com"), // Status: to.Ptr("Accepted"), // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-01T00:00:00.000Z"); return t}()), // }, // { // Email: to.Ptr("xtz@contoso.com"), // Status: to.Ptr("Declined"), // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-02T00:00:00.000Z"); return t}()), // }}, // Status: to.Ptr("Published"), // }, // }, // { // Name: to.Ptr("Agreement2"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/agreements"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/Agreement2"), // Properties: &armbilling.AgreementProperties{ // AcceptanceMode: to.Ptr(armbilling.AcceptanceModeESignEmbedded), // AgreementLink: to.Ptr("https://agreementuri2.com"), // Category: to.Ptr(armbilling.CategoryMicrosoftCustomerAgreement), // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00.000Z"); return t}()), // Participants: []*armbilling.Participants{ // { // Email: to.Ptr("abc@contoso.com"), // Status: to.Ptr("Unknown"), // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-01T00:00:00.000Z"); return t}()), // }}, // Status: to.Ptr("PendingSignature"), // }, // }}, // } } }
Output:
type AgreementsClientGetOptions ¶ added in v0.2.0
type AgreementsClientGetOptions struct { // May be used to expand the participants. Expand *string }
AgreementsClientGetOptions contains the optional parameters for the AgreementsClient.Get method.
type AgreementsClientGetResponse ¶ added in v0.2.0
type AgreementsClientGetResponse struct { // An agreement. Agreement }
AgreementsClientGetResponse contains the response from method AgreementsClient.Get.
type AgreementsClientListByBillingAccountOptions ¶ added in v0.2.0
type AgreementsClientListByBillingAccountOptions struct { // May be used to expand the participants. Expand *string }
AgreementsClientListByBillingAccountOptions contains the optional parameters for the AgreementsClient.NewListByBillingAccountPager method.
type AgreementsClientListByBillingAccountResponse ¶ added in v0.2.0
type AgreementsClientListByBillingAccountResponse struct { // Result of listing agreements. AgreementListResult }
AgreementsClientListByBillingAccountResponse contains the response from method AgreementsClient.NewListByBillingAccountPager.
type Amount ¶
type Amount struct { // Amount value. Value *float32 // READ-ONLY; The currency for the amount value. Currency *string }
Amount - The amount.
func (Amount) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Amount.
func (*Amount) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Amount.
type AutoRenew ¶
type AutoRenew string
AutoRenew - Indicates whether auto renewal is turned on or off for a product.
func PossibleAutoRenewValues ¶
func PossibleAutoRenewValues() []AutoRenew
PossibleAutoRenewValues returns the possible values for the AutoRenew const type.
type AvailableBalance ¶
type AvailableBalance struct { // The properties of available balance. Properties *AvailableBalanceProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
AvailableBalance - The latest Azure credit balance. This is the balance available for pay now.
func (AvailableBalance) MarshalJSON ¶
func (a AvailableBalance) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AvailableBalance.
func (*AvailableBalance) UnmarshalJSON ¶ added in v0.6.0
func (a *AvailableBalance) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AvailableBalance.
type AvailableBalanceProperties ¶
type AvailableBalanceProperties struct { // READ-ONLY; Balance amount. Amount *Amount }
AvailableBalanceProperties - The properties of available balance.
func (AvailableBalanceProperties) MarshalJSON ¶ added in v0.6.0
func (a AvailableBalanceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AvailableBalanceProperties.
func (*AvailableBalanceProperties) UnmarshalJSON ¶ added in v0.6.0
func (a *AvailableBalanceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AvailableBalanceProperties.
type AvailableBalancesClient ¶
type AvailableBalancesClient struct {
// contains filtered or unexported fields
}
AvailableBalancesClient contains the methods for the AvailableBalances group. Don't use this type directly, use NewAvailableBalancesClient() instead.
func NewAvailableBalancesClient ¶
func NewAvailableBalancesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableBalancesClient, error)
NewAvailableBalancesClient creates a new instance of AvailableBalancesClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*AvailableBalancesClient) Get ¶
func (client *AvailableBalancesClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, options *AvailableBalancesClientGetOptions) (AvailableBalancesClientGetResponse, error)
Get - The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - AvailableBalancesClientGetOptions contains the optional parameters for the AvailableBalancesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAvailableBalancesClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", 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.AvailableBalance = armbilling.AvailableBalance{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/availableBalance"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default"), // Properties: &armbilling.AvailableBalanceProperties{ // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](500), // }, // }, // } }
Output:
type AvailableBalancesClientGetOptions ¶ added in v0.2.0
type AvailableBalancesClientGetOptions struct { }
AvailableBalancesClientGetOptions contains the optional parameters for the AvailableBalancesClient.Get method.
type AvailableBalancesClientGetResponse ¶ added in v0.2.0
type AvailableBalancesClientGetResponse struct { // The latest Azure credit balance. This is the balance available for pay now. AvailableBalance }
AvailableBalancesClientGetResponse contains the response from method AvailableBalancesClient.Get.
type AzurePlan ¶
type AzurePlan struct { // The sku id. SKUID *string // READ-ONLY; The sku description. SKUDescription *string }
AzurePlan - Details of the Azure plan.
func (AzurePlan) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type AzurePlan.
func (*AzurePlan) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type AzurePlan.
type BillingFrequency ¶
type BillingFrequency string
BillingFrequency - The frequency at which the product will be billed.
const ( BillingFrequencyMonthly BillingFrequency = "Monthly" BillingFrequencyOneTime BillingFrequency = "OneTime" BillingFrequencyUsageBased BillingFrequency = "UsageBased" )
func PossibleBillingFrequencyValues ¶
func PossibleBillingFrequencyValues() []BillingFrequency
PossibleBillingFrequencyValues returns the possible values for the BillingFrequency const type.
type BillingProfileSpendingLimit ¶
type BillingProfileSpendingLimit string
BillingProfileSpendingLimit - The billing profile spending limit.
const ( BillingProfileSpendingLimitOff BillingProfileSpendingLimit = "Off" BillingProfileSpendingLimitOn BillingProfileSpendingLimit = "On" )
func PossibleBillingProfileSpendingLimitValues ¶
func PossibleBillingProfileSpendingLimitValues() []BillingProfileSpendingLimit
PossibleBillingProfileSpendingLimitValues returns the possible values for the BillingProfileSpendingLimit const type.
type BillingProfileStatus ¶
type BillingProfileStatus string
BillingProfileStatus - The status of the billing profile.
const ( BillingProfileStatusActive BillingProfileStatus = "Active" BillingProfileStatusDisabled BillingProfileStatus = "Disabled" BillingProfileStatusWarned BillingProfileStatus = "Warned" )
func PossibleBillingProfileStatusValues ¶
func PossibleBillingProfileStatusValues() []BillingProfileStatus
PossibleBillingProfileStatusValues returns the possible values for the BillingProfileStatus const type.
type BillingProfileStatusReasonCode ¶
type BillingProfileStatusReasonCode string
BillingProfileStatusReasonCode - Reason for the specified billing profile status.
const ( BillingProfileStatusReasonCodePastDue BillingProfileStatusReasonCode = "PastDue" BillingProfileStatusReasonCodeSpendingLimitExpired BillingProfileStatusReasonCode = "SpendingLimitExpired" BillingProfileStatusReasonCodeSpendingLimitReached BillingProfileStatusReasonCode = "SpendingLimitReached" )
func PossibleBillingProfileStatusReasonCodeValues ¶
func PossibleBillingProfileStatusReasonCodeValues() []BillingProfileStatusReasonCode
PossibleBillingProfileStatusReasonCodeValues returns the possible values for the BillingProfileStatusReasonCode const type.
type BillingRelationshipType ¶
type BillingRelationshipType string
BillingRelationshipType - Identifies which services and purchases are paid by a billing profile.
const ( BillingRelationshipTypeCSPPartner BillingRelationshipType = "CSPPartner" BillingRelationshipTypeDirect BillingRelationshipType = "Direct" BillingRelationshipTypeIndirectCustomer BillingRelationshipType = "IndirectCustomer" BillingRelationshipTypeIndirectPartner BillingRelationshipType = "IndirectPartner" )
func PossibleBillingRelationshipTypeValues ¶
func PossibleBillingRelationshipTypeValues() []BillingRelationshipType
PossibleBillingRelationshipTypeValues returns the possible values for the BillingRelationshipType const type.
type BillingSubscriptionStatusType ¶
type BillingSubscriptionStatusType string
BillingSubscriptionStatusType - The current billing status of the subscription.
const ( BillingSubscriptionStatusTypeAbandoned BillingSubscriptionStatusType = "Abandoned" BillingSubscriptionStatusTypeActive BillingSubscriptionStatusType = "Active" BillingSubscriptionStatusTypeDeleted BillingSubscriptionStatusType = "Deleted" BillingSubscriptionStatusTypeInactive BillingSubscriptionStatusType = "Inactive" BillingSubscriptionStatusTypeWarning BillingSubscriptionStatusType = "Warning" )
func PossibleBillingSubscriptionStatusTypeValues ¶
func PossibleBillingSubscriptionStatusTypeValues() []BillingSubscriptionStatusType
PossibleBillingSubscriptionStatusTypeValues returns the possible values for the BillingSubscriptionStatusType const type.
type Category ¶
type Category string
Category - The category of the agreement signed by a customer.
func PossibleCategoryValues ¶
func PossibleCategoryValues() []Category
PossibleCategoryValues returns the possible values for the Category const type.
type ClientFactory ¶ added in v0.6.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 v0.6.0
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - The ID that uniquely identifies an Azure subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewAccountsClient ¶ added in v0.6.0
func (c *ClientFactory) NewAccountsClient() *AccountsClient
NewAccountsClient creates a new instance of AccountsClient.
func (*ClientFactory) NewAddressClient ¶ added in v0.6.0
func (c *ClientFactory) NewAddressClient() *AddressClient
NewAddressClient creates a new instance of AddressClient.
func (*ClientFactory) NewAgreementsClient ¶ added in v0.6.0
func (c *ClientFactory) NewAgreementsClient() *AgreementsClient
NewAgreementsClient creates a new instance of AgreementsClient.
func (*ClientFactory) NewAvailableBalancesClient ¶ added in v0.6.0
func (c *ClientFactory) NewAvailableBalancesClient() *AvailableBalancesClient
NewAvailableBalancesClient creates a new instance of AvailableBalancesClient.
func (*ClientFactory) NewCustomersClient ¶ added in v0.6.0
func (c *ClientFactory) NewCustomersClient() *CustomersClient
NewCustomersClient creates a new instance of CustomersClient.
func (*ClientFactory) NewEnrollmentAccountsClient ¶ added in v0.6.0
func (c *ClientFactory) NewEnrollmentAccountsClient() *EnrollmentAccountsClient
NewEnrollmentAccountsClient creates a new instance of EnrollmentAccountsClient.
func (*ClientFactory) NewInstructionsClient ¶ added in v0.6.0
func (c *ClientFactory) NewInstructionsClient() *InstructionsClient
NewInstructionsClient creates a new instance of InstructionsClient.
func (*ClientFactory) NewInvoiceSectionsClient ¶ added in v0.6.0
func (c *ClientFactory) NewInvoiceSectionsClient() *InvoiceSectionsClient
NewInvoiceSectionsClient creates a new instance of InvoiceSectionsClient.
func (*ClientFactory) NewInvoicesClient ¶ added in v0.6.0
func (c *ClientFactory) NewInvoicesClient() *InvoicesClient
NewInvoicesClient creates a new instance of InvoicesClient.
func (*ClientFactory) NewOperationsClient ¶ added in v0.6.0
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
func (*ClientFactory) NewPeriodsClient ¶ added in v0.6.0
func (c *ClientFactory) NewPeriodsClient() *PeriodsClient
NewPeriodsClient creates a new instance of PeriodsClient.
func (*ClientFactory) NewPermissionsClient ¶ added in v0.6.0
func (c *ClientFactory) NewPermissionsClient() *PermissionsClient
NewPermissionsClient creates a new instance of PermissionsClient.
func (*ClientFactory) NewPoliciesClient ¶ added in v0.6.0
func (c *ClientFactory) NewPoliciesClient() *PoliciesClient
NewPoliciesClient creates a new instance of PoliciesClient.
func (*ClientFactory) NewProductsClient ¶ added in v0.6.0
func (c *ClientFactory) NewProductsClient() *ProductsClient
NewProductsClient creates a new instance of ProductsClient.
func (*ClientFactory) NewProfilesClient ¶ added in v0.6.0
func (c *ClientFactory) NewProfilesClient() *ProfilesClient
NewProfilesClient creates a new instance of ProfilesClient.
func (*ClientFactory) NewPropertyClient ¶ added in v0.6.0
func (c *ClientFactory) NewPropertyClient() *PropertyClient
NewPropertyClient creates a new instance of PropertyClient.
func (*ClientFactory) NewReservationsClient ¶ added in v0.6.0
func (c *ClientFactory) NewReservationsClient() *ReservationsClient
NewReservationsClient creates a new instance of ReservationsClient.
func (*ClientFactory) NewRoleAssignmentsClient ¶ added in v0.6.0
func (c *ClientFactory) NewRoleAssignmentsClient() *RoleAssignmentsClient
NewRoleAssignmentsClient creates a new instance of RoleAssignmentsClient.
func (*ClientFactory) NewRoleDefinitionsClient ¶ added in v0.6.0
func (c *ClientFactory) NewRoleDefinitionsClient() *RoleDefinitionsClient
NewRoleDefinitionsClient creates a new instance of RoleDefinitionsClient.
func (*ClientFactory) NewSubscriptionsClient ¶ added in v0.6.0
func (c *ClientFactory) NewSubscriptionsClient() *SubscriptionsClient
NewSubscriptionsClient creates a new instance of SubscriptionsClient.
func (*ClientFactory) NewTransactionsClient ¶ added in v0.6.0
func (c *ClientFactory) NewTransactionsClient() *TransactionsClient
NewTransactionsClient creates a new instance of TransactionsClient.
type Customer ¶
type Customer struct { // The customer. Properties *CustomerProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Customer - A partner's customer.
func (Customer) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Customer.
func (*Customer) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Customer.
type CustomerListResult ¶
type CustomerListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; Total number of records. TotalCount *int32 // READ-ONLY; The list of customers. Value []*Customer }
CustomerListResult - The list of customers.
func (CustomerListResult) MarshalJSON ¶
func (c CustomerListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CustomerListResult.
func (*CustomerListResult) UnmarshalJSON ¶ added in v0.6.0
func (c *CustomerListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CustomerListResult.
type CustomerPolicy ¶
type CustomerPolicy struct { // The properties of a customer's policy. Properties *CustomerPolicyProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
CustomerPolicy - The customer's Policy.
func (CustomerPolicy) MarshalJSON ¶
func (c CustomerPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CustomerPolicy.
func (*CustomerPolicy) UnmarshalJSON ¶ added in v0.6.0
func (c *CustomerPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CustomerPolicy.
type CustomerPolicyProperties ¶
type CustomerPolicyProperties struct { // The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. ViewCharges *ViewCharges }
CustomerPolicyProperties - The properties of a customer's policy.
func (CustomerPolicyProperties) MarshalJSON ¶ added in v0.6.0
func (c CustomerPolicyProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CustomerPolicyProperties.
func (*CustomerPolicyProperties) UnmarshalJSON ¶ added in v0.6.0
func (c *CustomerPolicyProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CustomerPolicyProperties.
type CustomerProperties ¶
type CustomerProperties struct { // The name of the customer. DisplayName *string // Azure plans enabled for the customer. EnabledAzurePlans []*AzurePlan // The list of resellers for which an Azure plan is enabled for the customer. Resellers []*Reseller // READ-ONLY; The name of the billing profile for the invoice section. BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile for the invoice section. BillingProfileID *string }
CustomerProperties - The properties of a customer.
func (CustomerProperties) MarshalJSON ¶
func (c CustomerProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CustomerProperties.
func (*CustomerProperties) UnmarshalJSON ¶ added in v0.6.0
func (c *CustomerProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CustomerProperties.
type CustomersClient ¶
type CustomersClient struct {
// contains filtered or unexported fields
}
CustomersClient contains the methods for the Customers group. Don't use this type directly, use NewCustomersClient() instead.
func NewCustomersClient ¶
func NewCustomersClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomersClient, error)
NewCustomersClient creates a new instance of CustomersClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*CustomersClient) Get ¶
func (client *CustomersClient) Get(ctx context.Context, billingAccountName string, customerName string, options *CustomersClientGetOptions) (CustomersClientGetResponse, error)
Get - Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- options - CustomersClientGetOptions contains the optional parameters for the CustomersClient.Get method.
Example (Customer) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Customer.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCustomersClient().Get(ctx, "{billingAccountName}", "{customerName}", &armbilling.CustomersClientGetOptions{Expand: 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.Customer = armbilling.Customer{ // Name: to.Ptr("{customerName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("customer1"), // }, // } }
Output:
Example (CustomerWithExpand) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerWithExpand.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCustomersClient().Get(ctx, "{billingAccountName}", "{customerName}", &armbilling.CustomersClientGetOptions{Expand: to.Ptr("enabledAzurePlans,resellers")}) 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.Customer = armbilling.Customer{ // Name: to.Ptr("{customerName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("customerName1"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // Resellers: []*armbilling.Reseller{ // { // Description: to.Ptr("Reseller1"), // ResellerID: to.Ptr("89e87bdf-a2a2-4687-925f-4c18b27bccfd"), // }, // { // Description: to.Ptr("Reseller2"), // ResellerID: to.Ptr("3b65b5a8-bd4f-4084-90e9-e1bd667a2b19"), // }}, // }, // } }
Output:
func (*CustomersClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *CustomersClient) NewListByBillingAccountPager(billingAccountName string, options *CustomersClientListByBillingAccountOptions) *runtime.Pager[CustomersClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - CustomersClientListByBillingAccountOptions contains the optional parameters for the CustomersClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCustomersClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.CustomersClientListByBillingAccountOptions{Search: nil, Filter: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CustomerListResult = armbilling.CustomerListResult{ // Value: []*armbilling.Customer{ // { // Name: to.Ptr("22000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/22000000-0000-0000-0000-000000000000"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("customer1"), // }, // }, // { // Name: to.Ptr("22000000-0000-0000-0000-000000000011"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/22000000-0000-0000-0000-000000000011"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("customer2"), // }, // }}, // } } }
Output:
func (*CustomersClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *CustomersClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *CustomersClientListByBillingProfileOptions) *runtime.Pager[CustomersClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - CustomersClientListByBillingProfileOptions contains the optional parameters for the CustomersClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCustomersClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", &armbilling.CustomersClientListByBillingProfileOptions{Search: nil, Filter: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CustomerListResult = armbilling.CustomerListResult{ // Value: []*armbilling.Customer{ // { // Name: to.Ptr("22000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/22000000-0000-0000-0000-000000000000"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("customer1"), // }, // }, // { // Name: to.Ptr("22000000-0000-0000-0000-000000000011"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/22000000-0000-0000-0000-000000000011"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("customer2"), // }, // }}, // } } }
Output:
type CustomersClientGetOptions ¶ added in v0.2.0
type CustomersClientGetOptions struct { // May be used to expand enabledAzurePlans and resellers Expand *string }
CustomersClientGetOptions contains the optional parameters for the CustomersClient.Get method.
type CustomersClientGetResponse ¶ added in v0.2.0
type CustomersClientGetResponse struct { // A partner's customer. Customer }
CustomersClientGetResponse contains the response from method CustomersClient.Get.
type CustomersClientListByBillingAccountOptions ¶ added in v0.2.0
type CustomersClientListByBillingAccountOptions struct { // May be used to filter the list of customers. Filter *string // Used for searching customers by their name. Any customer with name containing the search text will be included in the response Search *string }
CustomersClientListByBillingAccountOptions contains the optional parameters for the CustomersClient.NewListByBillingAccountPager method.
type CustomersClientListByBillingAccountResponse ¶ added in v0.2.0
type CustomersClientListByBillingAccountResponse struct { // The list of customers. CustomerListResult }
CustomersClientListByBillingAccountResponse contains the response from method CustomersClient.NewListByBillingAccountPager.
type CustomersClientListByBillingProfileOptions ¶ added in v0.2.0
type CustomersClientListByBillingProfileOptions struct { // May be used to filter the list of customers. Filter *string // Used for searching customers by their name. Any customer with name containing the search text will be included in the response Search *string }
CustomersClientListByBillingProfileOptions contains the optional parameters for the CustomersClient.NewListByBillingProfilePager method.
type CustomersClientListByBillingProfileResponse ¶ added in v0.2.0
type CustomersClientListByBillingProfileResponse struct { // The list of customers. CustomerListResult }
CustomersClientListByBillingProfileResponse contains the response from method CustomersClient.NewListByBillingProfilePager.
type Department ¶
type Department struct { // A department. Properties *DepartmentProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Department - A department.
func (Department) MarshalJSON ¶
func (d Department) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Department.
func (*Department) UnmarshalJSON ¶ added in v0.6.0
func (d *Department) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Department.
type DepartmentProperties ¶
type DepartmentProperties struct { // The cost center associated with the department. CostCenter *string // The name of the department. DepartmentName *string // Associated enrollment accounts. By default this is not populated, unless it's specified in $expand. EnrollmentAccounts []*EnrollmentAccount // The status of the department. Status *string }
DepartmentProperties - The properties of a department.
func (DepartmentProperties) MarshalJSON ¶
func (d DepartmentProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DepartmentProperties.
func (*DepartmentProperties) UnmarshalJSON ¶ added in v0.6.0
func (d *DepartmentProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DepartmentProperties.
type Document ¶
type Document struct { // READ-ONLY; The type of the document. Kind *DocumentType // READ-ONLY; The source of the document. ENF for Brazil and DRS for rest of the world. Source *DocumentSource // READ-ONLY; Document URL. URL *string }
Document - The properties of a document.
func (Document) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Document.
func (*Document) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Document.
type DocumentSource ¶
type DocumentSource string
DocumentSource - The source of the document. ENF for Brazil and DRS for rest of the world.
const ( DocumentSourceDRS DocumentSource = "DRS" DocumentSourceENF DocumentSource = "ENF" )
func PossibleDocumentSourceValues ¶
func PossibleDocumentSourceValues() []DocumentSource
PossibleDocumentSourceValues returns the possible values for the DocumentSource const type.
type DocumentType ¶
type DocumentType string
DocumentType - The type of the document.
const ( DocumentTypeCreditNote DocumentType = "CreditNote" DocumentTypeInvoice DocumentType = "Invoice" DocumentTypeTaxReceipt DocumentType = "TaxReceipt" DocumentTypeVoidNote DocumentType = "VoidNote" )
func PossibleDocumentTypeValues ¶
func PossibleDocumentTypeValues() []DocumentType
PossibleDocumentTypeValues returns the possible values for the DocumentType const type.
type DownloadURL ¶
type DownloadURL struct { // READ-ONLY; The time in UTC when the download URL will expire. ExpiryTime *time.Time // READ-ONLY; The URL to the PDF file. URL *string }
DownloadURL - A secure URL that can be used to download a an entity until the URL expires.
func (DownloadURL) MarshalJSON ¶
func (d DownloadURL) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DownloadURL.
func (*DownloadURL) UnmarshalJSON ¶
func (d *DownloadURL) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DownloadURL.
type Enrollment ¶
type Enrollment struct { // The end date of the enrollment. EndDate *time.Time // The start date of the enrollment. StartDate *time.Time // READ-ONLY; The billing cycle for the enrollment. BillingCycle *string // READ-ONLY; The channel type of the enrollment. Channel *string // READ-ONLY; The country code of the enrollment. CountryCode *string // READ-ONLY; The billing currency for the enrollment. Currency *string // READ-ONLY; The language for the enrollment. Language *string // READ-ONLY; The policies for Enterprise Agreement enrollments. Policies *EnrollmentPolicies // READ-ONLY; The current status of the enrollment. Status *string }
Enrollment - The properties of an enrollment.
func (Enrollment) MarshalJSON ¶
func (e Enrollment) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Enrollment.
func (*Enrollment) UnmarshalJSON ¶
func (e *Enrollment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Enrollment.
type EnrollmentAccount ¶
type EnrollmentAccount struct { // The properties of an enrollment account. Properties *EnrollmentAccountProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
EnrollmentAccount - An enrollment account.
func (EnrollmentAccount) MarshalJSON ¶
func (e EnrollmentAccount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnrollmentAccount.
func (*EnrollmentAccount) UnmarshalJSON ¶ added in v0.6.0
func (e *EnrollmentAccount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnrollmentAccount.
type EnrollmentAccountContext ¶
type EnrollmentAccountContext struct { // The cost center associated with the enrollment account. CostCenter *string // The end date of the enrollment account. EndDate *time.Time // The ID of the enrollment account. EnrollmentAccountName *string // The start date of the enrollment account. StartDate *time.Time }
EnrollmentAccountContext - The enrollment account context
func (EnrollmentAccountContext) MarshalJSON ¶
func (e EnrollmentAccountContext) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnrollmentAccountContext.
func (*EnrollmentAccountContext) UnmarshalJSON ¶
func (e *EnrollmentAccountContext) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnrollmentAccountContext.
type EnrollmentAccountListResult ¶
type EnrollmentAccountListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of enrollment accounts. Value []*EnrollmentAccountSummary }
EnrollmentAccountListResult - Result of listing enrollment accounts.
func (EnrollmentAccountListResult) MarshalJSON ¶
func (e EnrollmentAccountListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnrollmentAccountListResult.
func (*EnrollmentAccountListResult) UnmarshalJSON ¶ added in v0.6.0
func (e *EnrollmentAccountListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnrollmentAccountListResult.
type EnrollmentAccountProperties ¶
type EnrollmentAccountProperties struct { // The name of the enrollment account. AccountName *string // The owner of the enrollment account. AccountOwner *string // The enrollment account owner email address. AccountOwnerEmail *string // The cost center associated with the enrollment account. CostCenter *string // Associated department. By default this is not populated, unless it's specified in $expand. Department *Department // The end date of the enrollment account. EndDate *time.Time // The start date of the enrollment account. StartDate *time.Time // The status of the enrollment account. Status *string }
EnrollmentAccountProperties - The properties of an enrollment account.
func (EnrollmentAccountProperties) MarshalJSON ¶
func (e EnrollmentAccountProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnrollmentAccountProperties.
func (*EnrollmentAccountProperties) UnmarshalJSON ¶
func (e *EnrollmentAccountProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnrollmentAccountProperties.
type EnrollmentAccountSummary ¶
type EnrollmentAccountSummary struct { // An enrollment account. Properties *EnrollmentAccountSummaryProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
EnrollmentAccountSummary - An enrollment account resource.
func (EnrollmentAccountSummary) MarshalJSON ¶
func (e EnrollmentAccountSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnrollmentAccountSummary.
func (*EnrollmentAccountSummary) UnmarshalJSON ¶ added in v0.6.0
func (e *EnrollmentAccountSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnrollmentAccountSummary.
type EnrollmentAccountSummaryProperties ¶
type EnrollmentAccountSummaryProperties struct { // READ-ONLY; The account owner's principal name. PrincipalName *string }
EnrollmentAccountSummaryProperties - The properties of the enrollment account.
func (EnrollmentAccountSummaryProperties) MarshalJSON ¶ added in v0.6.0
func (e EnrollmentAccountSummaryProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnrollmentAccountSummaryProperties.
func (*EnrollmentAccountSummaryProperties) UnmarshalJSON ¶ added in v0.6.0
func (e *EnrollmentAccountSummaryProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnrollmentAccountSummaryProperties.
type EnrollmentAccountsClient ¶
type EnrollmentAccountsClient struct {
// contains filtered or unexported fields
}
EnrollmentAccountsClient contains the methods for the EnrollmentAccounts group. Don't use this type directly, use NewEnrollmentAccountsClient() instead.
func NewEnrollmentAccountsClient ¶
func NewEnrollmentAccountsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*EnrollmentAccountsClient, error)
NewEnrollmentAccountsClient creates a new instance of EnrollmentAccountsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*EnrollmentAccountsClient) Get ¶
func (client *EnrollmentAccountsClient) Get(ctx context.Context, name string, options *EnrollmentAccountsClientGetOptions) (EnrollmentAccountsClientGetResponse, error)
Get - Gets a enrollment account by name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2018-03-01-preview
- name - Enrollment Account name.
- options - EnrollmentAccountsClientGetOptions contains the optional parameters for the EnrollmentAccountsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEnrollmentAccountsClient().Get(ctx, "e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556", 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.EnrollmentAccountSummary = armbilling.EnrollmentAccountSummary{ // Name: to.Ptr("e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"), // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/enrollmentAccounts/e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"), // Properties: &armbilling.EnrollmentAccountSummaryProperties{ // PrincipalName: to.Ptr("kathy@contoso.com"), // }, // } }
Output:
func (*EnrollmentAccountsClient) NewListPager ¶ added in v0.4.0
func (client *EnrollmentAccountsClient) NewListPager(options *EnrollmentAccountsClientListOptions) *runtime.Pager[EnrollmentAccountsClientListResponse]
NewListPager - Lists the enrollment accounts the caller has access to.
Generated from API version 2018-03-01-preview
- options - EnrollmentAccountsClientListOptions contains the optional parameters for the EnrollmentAccountsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewEnrollmentAccountsClient().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.EnrollmentAccountListResult = armbilling.EnrollmentAccountListResult{ // Value: []*armbilling.EnrollmentAccountSummary{ // { // Name: to.Ptr("e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"), // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/enrollmentAccounts/e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"), // Properties: &armbilling.EnrollmentAccountSummaryProperties{ // PrincipalName: to.Ptr("kathy@contoso.com"), // }, // }, // { // Name: to.Ptr("edd24053-07cd-4ed4-aa5b-326160a6680d"), // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/enrollmentAccounts/edd24053-07cd-4ed4-aa5b-326160a6680d"), // Properties: &armbilling.EnrollmentAccountSummaryProperties{ // PrincipalName: to.Ptr("dan@contoso.com"), // }, // }}, // } } }
Output:
type EnrollmentAccountsClientGetOptions ¶ added in v0.2.0
type EnrollmentAccountsClientGetOptions struct { }
EnrollmentAccountsClientGetOptions contains the optional parameters for the EnrollmentAccountsClient.Get method.
type EnrollmentAccountsClientGetResponse ¶ added in v0.2.0
type EnrollmentAccountsClientGetResponse struct { // An enrollment account resource. EnrollmentAccountSummary }
EnrollmentAccountsClientGetResponse contains the response from method EnrollmentAccountsClient.Get.
type EnrollmentAccountsClientListOptions ¶ added in v0.2.0
type EnrollmentAccountsClientListOptions struct { }
EnrollmentAccountsClientListOptions contains the optional parameters for the EnrollmentAccountsClient.NewListPager method.
type EnrollmentAccountsClientListResponse ¶ added in v0.2.0
type EnrollmentAccountsClientListResponse struct { // Result of listing enrollment accounts. EnrollmentAccountListResult }
EnrollmentAccountsClientListResponse contains the response from method EnrollmentAccountsClient.NewListPager.
type EnrollmentPolicies ¶
type EnrollmentPolicies struct { // READ-ONLY; The policy that controls whether Account Owners can view charges. AccountOwnerViewCharges *bool // READ-ONLY; The policy that controls whether Department Administrators can view charges. DepartmentAdminViewCharges *bool // READ-ONLY; The policy that controls whether Azure marketplace purchases are allowed in the enrollment. MarketplaceEnabled *bool // READ-ONLY; The policy that controls whether Azure reservation purchases are allowed in the enrollment. ReservedInstancesEnabled *bool }
EnrollmentPolicies - The policies for Enterprise Agreement enrollments.
func (EnrollmentPolicies) MarshalJSON ¶ added in v0.6.0
func (e EnrollmentPolicies) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnrollmentPolicies.
func (*EnrollmentPolicies) UnmarshalJSON ¶ added in v0.6.0
func (e *EnrollmentPolicies) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnrollmentPolicies.
type ErrorDetails ¶
type ErrorDetails struct { // READ-ONLY; Error code. Code *string // READ-ONLY; The sub details of the error. Details []*ErrorSubDetailsItem // READ-ONLY; Error message indicating why the operation failed. Message *string // READ-ONLY; The target of the particular error. Target *string }
ErrorDetails - The details of the error.
func (ErrorDetails) MarshalJSON ¶
func (e ErrorDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorDetails.
func (*ErrorDetails) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails.
type ErrorResponse ¶
type ErrorResponse struct { // The details of the error. Error *ErrorDetails }
ErrorResponse - Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
func (ErrorResponse) MarshalJSON ¶ added in v0.6.0
func (e ErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponse.
func (*ErrorResponse) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.
type ErrorSubDetailsItem ¶
type ErrorSubDetailsItem struct { // READ-ONLY; Error code. Code *string // READ-ONLY; Error message indicating why the operation failed. Message *string // READ-ONLY; The target of the particular error. Target *string }
func (ErrorSubDetailsItem) MarshalJSON ¶ added in v0.6.0
func (e ErrorSubDetailsItem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorSubDetailsItem.
func (*ErrorSubDetailsItem) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorSubDetailsItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorSubDetailsItem.
type IndirectRelationshipInfo ¶
type IndirectRelationshipInfo struct { // The billing account name of the partner or the customer for an indirect motion. BillingAccountName *string // The billing profile name of the partner or the customer for an indirect motion. BillingProfileName *string // The display name of the partner or customer for an indirect motion. DisplayName *string }
IndirectRelationshipInfo - The billing profile details of the partner of the customer for an indirect motion.
func (IndirectRelationshipInfo) MarshalJSON ¶ added in v0.6.0
func (i IndirectRelationshipInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IndirectRelationshipInfo.
func (*IndirectRelationshipInfo) UnmarshalJSON ¶ added in v0.6.0
func (i *IndirectRelationshipInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IndirectRelationshipInfo.
type Instruction ¶
type Instruction struct { // A billing instruction used during invoice generation. Properties *InstructionProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Instruction - An instruction.
func (Instruction) MarshalJSON ¶
func (i Instruction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Instruction.
func (*Instruction) UnmarshalJSON ¶ added in v0.6.0
func (i *Instruction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Instruction.
type InstructionListResult ¶
type InstructionListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of billing instructions used during invoice generation. Value []*Instruction }
InstructionListResult - The list of billing instructions used during invoice generation.
func (InstructionListResult) MarshalJSON ¶
func (i InstructionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InstructionListResult.
func (*InstructionListResult) UnmarshalJSON ¶ added in v0.6.0
func (i *InstructionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InstructionListResult.
type InstructionProperties ¶
type InstructionProperties struct { // REQUIRED; The amount budgeted for this billing instruction. Amount *float32 // REQUIRED; The date this billing instruction is no longer in effect. EndDate *time.Time // REQUIRED; The date this billing instruction goes into effect. StartDate *time.Time // The date this billing instruction was created. CreationDate *time.Time }
InstructionProperties - A billing instruction used during invoice generation.
func (InstructionProperties) MarshalJSON ¶
func (i InstructionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InstructionProperties.
func (*InstructionProperties) UnmarshalJSON ¶
func (i *InstructionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InstructionProperties.
type InstructionsClient ¶
type InstructionsClient struct {
// contains filtered or unexported fields
}
InstructionsClient contains the methods for the Instructions group. Don't use this type directly, use NewInstructionsClient() instead.
func NewInstructionsClient ¶
func NewInstructionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*InstructionsClient, error)
NewInstructionsClient creates a new instance of InstructionsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*InstructionsClient) Get ¶
func (client *InstructionsClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, instructionName string, options *InstructionsClientGetOptions) (InstructionsClientGetResponse, error)
Get - Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- instructionName - Instruction Name.
- options - InstructionsClientGetOptions contains the optional parameters for the InstructionsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Instruction.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewInstructionsClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", "{instructionName}", 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.Instruction = armbilling.Instruction{ // Name: to.Ptr("{instructionName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/instructions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}"), // Properties: &armbilling.InstructionProperties{ // Amount: to.Ptr[float32](5000), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-30T21:26:47.997Z"); return t}()), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-30T21:26:47.997Z"); return t}()), // }, // } }
Output:
func (*InstructionsClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *InstructionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *InstructionsClientListByBillingProfileOptions) *runtime.Pager[InstructionsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the instructions by billing profile id.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - InstructionsClientListByBillingProfileOptions contains the optional parameters for the InstructionsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InstructionsListByBillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewInstructionsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.InstructionListResult = armbilling.InstructionListResult{ // Value: []*armbilling.Instruction{ // { // Name: to.Ptr("TO1:CLIN001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/instructions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/TO1:CLIN001"), // Properties: &armbilling.InstructionProperties{ // Amount: to.Ptr[float32](5000), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-30T21:26:47.997Z"); return t}()), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-30T21:26:47.997Z"); return t}()), // }, // }, // { // Name: to.Ptr("TO1:CLIN002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/instructions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/TO1:CLIN002"), // Properties: &armbilling.InstructionProperties{ // Amount: to.Ptr[float32](2000), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-30T21:26:47.997Z"); return t}()), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-30T21:26:47.997Z"); return t}()), // }, // }}, // } } }
Output:
func (*InstructionsClient) Put ¶
func (client *InstructionsClient) Put(ctx context.Context, billingAccountName string, billingProfileName string, instructionName string, parameters Instruction, options *InstructionsClientPutOptions) (InstructionsClientPutResponse, error)
Put - Creates or updates an instruction. These are custom billing instructions and are only applicable for certain customers. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- instructionName - Instruction Name.
- parameters - The new instruction.
- options - InstructionsClientPutOptions contains the optional parameters for the InstructionsClient.Put method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInstruction.json
package main import ( "context" "log" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewInstructionsClient().Put(ctx, "{billingAccountName}", "{billingProfileName}", "{instructionName}", armbilling.Instruction{ Properties: &armbilling.InstructionProperties{ Amount: to.Ptr[float32](5000), EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-30T21:26:47.997Z"); return t }()), StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-30T21:26:47.997Z"); return t }()), }, }, 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.Instruction = armbilling.Instruction{ // Name: to.Ptr("{instructionName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/instructions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}"), // Properties: &armbilling.InstructionProperties{ // Amount: to.Ptr[float32](5000), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-30T21:26:47.997Z"); return t}()), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-30T21:26:47.997Z"); return t}()), // }, // } }
Output:
type InstructionsClientGetOptions ¶ added in v0.2.0
type InstructionsClientGetOptions struct { }
InstructionsClientGetOptions contains the optional parameters for the InstructionsClient.Get method.
type InstructionsClientGetResponse ¶ added in v0.2.0
type InstructionsClientGetResponse struct { // An instruction. Instruction }
InstructionsClientGetResponse contains the response from method InstructionsClient.Get.
type InstructionsClientListByBillingProfileOptions ¶ added in v0.2.0
type InstructionsClientListByBillingProfileOptions struct { }
InstructionsClientListByBillingProfileOptions contains the optional parameters for the InstructionsClient.NewListByBillingProfilePager method.
type InstructionsClientListByBillingProfileResponse ¶ added in v0.2.0
type InstructionsClientListByBillingProfileResponse struct { // The list of billing instructions used during invoice generation. InstructionListResult }
InstructionsClientListByBillingProfileResponse contains the response from method InstructionsClient.NewListByBillingProfilePager.
type InstructionsClientPutOptions ¶ added in v0.2.0
type InstructionsClientPutOptions struct { }
InstructionsClientPutOptions contains the optional parameters for the InstructionsClient.Put method.
type InstructionsClientPutResponse ¶ added in v0.2.0
type InstructionsClientPutResponse struct { // An instruction. Instruction }
InstructionsClientPutResponse contains the response from method InstructionsClient.Put.
type Invoice ¶
type Invoice struct { // An invoice. Properties *InvoiceProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Invoice - An invoice.
func (Invoice) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Invoice.
func (*Invoice) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Invoice.
type InvoiceDocumentType ¶
type InvoiceDocumentType string
InvoiceDocumentType - The type of the document.
const ( InvoiceDocumentTypeCreditNote InvoiceDocumentType = "CreditNote" InvoiceDocumentTypeInvoice InvoiceDocumentType = "Invoice" )
func PossibleInvoiceDocumentTypeValues ¶
func PossibleInvoiceDocumentTypeValues() []InvoiceDocumentType
PossibleInvoiceDocumentTypeValues returns the possible values for the InvoiceDocumentType const type.
type InvoiceListResult ¶
type InvoiceListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; Total number of records. TotalCount *int32 // READ-ONLY; The list of invoices. Value []*Invoice }
InvoiceListResult - The list of invoices.
func (InvoiceListResult) MarshalJSON ¶
func (i InvoiceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceListResult.
func (*InvoiceListResult) UnmarshalJSON ¶ added in v0.6.0
func (i *InvoiceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceListResult.
type InvoiceProperties ¶
type InvoiceProperties struct { // READ-ONLY; The amount due as of now. AmountDue *Amount // READ-ONLY; The amount of Azure prepayment applied to the charges. This field is applicable to billing accounts with agreement // type Microsoft Customer Agreement. AzurePrepaymentApplied *Amount // READ-ONLY; The total charges for the invoice billing period. BilledAmount *Amount // READ-ONLY; The Id of the active invoice which is originally billed after this invoice was voided. This field is applicable // to the void invoices only. BilledDocumentID *string // READ-ONLY; The name of the billing profile for which the invoice is generated. BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile for which the invoice is generated. BillingProfileID *string // READ-ONLY; The total refund for returns and cancellations during the invoice billing period. This field is applicable to // billing accounts with agreement type Microsoft Customer Agreement. CreditAmount *Amount // READ-ONLY; The Id of the invoice which got voided and this credit note was issued as a result. This field is applicable // to the credit notes only. CreditForDocumentID *string // READ-ONLY; The type of the document. DocumentType *InvoiceDocumentType // READ-ONLY; List of documents available to download such as invoice and tax receipt. Documents []*Document // READ-ONLY; The due date for the invoice. DueDate *time.Time // READ-ONLY; The amount of free Azure credits applied to the charges. This field is applicable to billing accounts with agreement // type Microsoft Customer Agreement. FreeAzureCreditApplied *Amount // READ-ONLY; The date when the invoice was generated. InvoiceDate *time.Time // READ-ONLY; The end date of the billing period for which the invoice is generated. InvoicePeriodEndDate *time.Time // READ-ONLY; The start date of the billing period for which the invoice is generated. InvoicePeriodStartDate *time.Time // READ-ONLY; Invoice type. InvoiceType *InvoiceType // READ-ONLY; Specifies if the invoice is generated as part of monthly invoicing cycle or not. This field is applicable to // billing accounts with agreement type Microsoft Customer Agreement. IsMonthlyInvoice *bool // READ-ONLY; List of payments. Payments []*PaymentProperties // READ-ONLY; An optional purchase order number for the invoice. PurchaseOrderNumber *string // READ-ONLY; Rebill details for an invoice. RebillDetails map[string]*RebillDetails // READ-ONLY; The current status of the invoice. Status *InvoiceStatus // READ-ONLY; The pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer // Agreement. SubTotal *Amount // READ-ONLY; The ID of the subscription for which the invoice is generated. SubscriptionID *string // READ-ONLY; The amount of tax charged for the billing period. This field is applicable to billing accounts with agreement // type Microsoft Customer Agreement. TaxAmount *Amount // READ-ONLY; The amount due when the invoice was generated. This field is applicable to billing accounts with agreement type // Microsoft Customer Agreement. TotalAmount *Amount }
InvoiceProperties - The properties of the invoice.
func (InvoiceProperties) MarshalJSON ¶
func (i InvoiceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceProperties.
func (*InvoiceProperties) UnmarshalJSON ¶
func (i *InvoiceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceProperties.
type InvoiceSection ¶
type InvoiceSection struct { // The properties of an invoice section. Properties *InvoiceSectionProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
InvoiceSection - An invoice section.
func (InvoiceSection) MarshalJSON ¶
func (i InvoiceSection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceSection.
func (*InvoiceSection) UnmarshalJSON ¶ added in v0.6.0
func (i *InvoiceSection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceSection.
type InvoiceSectionCreationRequest ¶
type InvoiceSectionCreationRequest struct { // The name of the invoice section. DisplayName *string }
InvoiceSectionCreationRequest - The properties of the invoice section.
func (InvoiceSectionCreationRequest) MarshalJSON ¶ added in v0.6.0
func (i InvoiceSectionCreationRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceSectionCreationRequest.
func (*InvoiceSectionCreationRequest) UnmarshalJSON ¶ added in v0.6.0
func (i *InvoiceSectionCreationRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceSectionCreationRequest.
type InvoiceSectionListResult ¶
type InvoiceSectionListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; Total number of records. TotalCount *int32 // READ-ONLY; The list of invoice sections. Value []*InvoiceSection }
InvoiceSectionListResult - The list of invoice sections.
func (InvoiceSectionListResult) MarshalJSON ¶
func (i InvoiceSectionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceSectionListResult.
func (*InvoiceSectionListResult) UnmarshalJSON ¶ added in v0.6.0
func (i *InvoiceSectionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceSectionListResult.
type InvoiceSectionListWithCreateSubPermissionResult ¶
type InvoiceSectionListWithCreateSubPermissionResult struct { // The list of invoice section properties with create subscription permission. Value []*InvoiceSectionWithCreateSubPermission // READ-ONLY; The link (url) to the next page of results. NextLink *string }
InvoiceSectionListWithCreateSubPermissionResult - The list of invoice section properties with create subscription permission.
func (InvoiceSectionListWithCreateSubPermissionResult) MarshalJSON ¶
func (i InvoiceSectionListWithCreateSubPermissionResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceSectionListWithCreateSubPermissionResult.
func (*InvoiceSectionListWithCreateSubPermissionResult) UnmarshalJSON ¶ added in v0.6.0
func (i *InvoiceSectionListWithCreateSubPermissionResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceSectionListWithCreateSubPermissionResult.
type InvoiceSectionProperties ¶
type InvoiceSectionProperties struct { // The name of the invoice section. DisplayName *string // Dictionary of metadata associated with the invoice section. Labels map[string]*string // Dictionary of metadata associated with the invoice section. Maximum key/value length supported of 256 characters. Keys/value // should not empty value nor null. Keys can not contain < > % & \ ? / Tags map[string]*string // READ-ONLY; Identifies the state of an invoice section. State *InvoiceSectionState // READ-ONLY; The system generated unique identifier for an invoice section. SystemID *string // READ-ONLY; Identifies the cloud environments that are associated with an invoice section. This is a system managed optional // field and gets updated as the invoice section gets associated with accounts in various // clouds. TargetCloud *TargetCloud }
InvoiceSectionProperties - The properties of an invoice section.
func (InvoiceSectionProperties) MarshalJSON ¶
func (i InvoiceSectionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceSectionProperties.
func (*InvoiceSectionProperties) UnmarshalJSON ¶ added in v0.6.0
func (i *InvoiceSectionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceSectionProperties.
type InvoiceSectionState ¶
type InvoiceSectionState string
InvoiceSectionState - Identifies the state of an invoice section.
const ( InvoiceSectionStateActive InvoiceSectionState = "Active" InvoiceSectionStateRestricted InvoiceSectionState = "Restricted" )
func PossibleInvoiceSectionStateValues ¶
func PossibleInvoiceSectionStateValues() []InvoiceSectionState
PossibleInvoiceSectionStateValues returns the possible values for the InvoiceSectionState const type.
type InvoiceSectionWithCreateSubPermission ¶
type InvoiceSectionWithCreateSubPermission struct { // Enabled azure plans for the associated billing profile. EnabledAzurePlans []*AzurePlan // READ-ONLY; The name of the billing profile for the invoice section. BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile for the invoice section. BillingProfileID *string // READ-ONLY; The billing profile spending limit. BillingProfileSpendingLimit *SpendingLimitForBillingProfile // READ-ONLY; The status of the billing profile. BillingProfileStatus *BillingProfileStatus // READ-ONLY; Reason for the specified billing profile status. BillingProfileStatusReasonCode *StatusReasonCodeForBillingProfile // READ-ONLY; The system generated unique identifier for a billing profile. BillingProfileSystemID *string // READ-ONLY; The name of the invoice section. InvoiceSectionDisplayName *string // READ-ONLY; The ID of the invoice section. InvoiceSectionID *string // READ-ONLY; The system generated unique identifier for an invoice section. InvoiceSectionSystemID *string }
InvoiceSectionWithCreateSubPermission - Invoice section properties with create subscription permission.
func (InvoiceSectionWithCreateSubPermission) MarshalJSON ¶
func (i InvoiceSectionWithCreateSubPermission) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceSectionWithCreateSubPermission.
func (*InvoiceSectionWithCreateSubPermission) UnmarshalJSON ¶ added in v0.6.0
func (i *InvoiceSectionWithCreateSubPermission) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceSectionWithCreateSubPermission.
type InvoiceSectionsClient ¶
type InvoiceSectionsClient struct {
// contains filtered or unexported fields
}
InvoiceSectionsClient contains the methods for the InvoiceSections group. Don't use this type directly, use NewInvoiceSectionsClient() instead.
func NewInvoiceSectionsClient ¶
func NewInvoiceSectionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*InvoiceSectionsClient, error)
NewInvoiceSectionsClient creates a new instance of InvoiceSectionsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*InvoiceSectionsClient) BeginCreateOrUpdate ¶
func (client *InvoiceSectionsClient) BeginCreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, parameters InvoiceSection, options *InvoiceSectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InvoiceSectionsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- invoiceSectionName - The ID that uniquely identifies an invoice section.
- parameters - The new or updated invoice section.
- options - InvoiceSectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the InvoiceSectionsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInvoiceSection.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewInvoiceSectionsClient().BeginCreateOrUpdate(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", armbilling.InvoiceSection{ Properties: &armbilling.InvoiceSectionProperties{ DisplayName: to.Ptr("invoiceSection1"), Labels: map[string]*string{ "costCategory": to.Ptr("Support"), "pcCode": to.Ptr("A123456"), }, }, }, 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.InvoiceSection = armbilling.InvoiceSection{ // Name: to.Ptr("{invoiceSectionName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSection1"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // SystemID: to.Ptr("XX1X-XXAA-XXX-ZZZ"), // }, // } }
Output:
func (*InvoiceSectionsClient) Get ¶
func (client *InvoiceSectionsClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, options *InvoiceSectionsClientGetOptions) (InvoiceSectionsClientGetResponse, error)
Get - Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- invoiceSectionName - The ID that uniquely identifies an invoice section.
- options - InvoiceSectionsClientGetOptions contains the optional parameters for the InvoiceSectionsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSection.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewInvoiceSectionsClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", 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.InvoiceSection = armbilling.InvoiceSection{ // Name: to.Ptr("{invoiceSectionName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSection1"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("XX1X-XXAA-XXX-ZZZ"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // }, // } }
Output:
func (*InvoiceSectionsClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *InvoiceSectionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *InvoiceSectionsClientListByBillingProfileOptions) *runtime.Pager[InvoiceSectionsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - InvoiceSectionsClientListByBillingProfileOptions contains the optional parameters for the InvoiceSectionsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListByBillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewInvoiceSectionsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.InvoiceSectionListResult = armbilling.InvoiceSectionListResult{ // Value: []*armbilling.InvoiceSection{ // { // Name: to.Ptr("22000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSection1"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("XX1X-XXAA-XXX-ZZZ"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // }, // }, // { // Name: to.Ptr("22000000-0000-0000-0000-000000000011"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000011"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSection2"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Marketing"), // "pcCode": to.Ptr("Z223456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateRestricted), // SystemID: to.Ptr("YY1X-BBAA-XXX-ZZZ"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Marketing"), // "pcCode": to.Ptr("Z223456"), // }, // TargetCloud: to.Ptr(armbilling.TargetCloudUSSec), // }, // }}, // } } }
Output:
type InvoiceSectionsClientBeginCreateOrUpdateOptions ¶ added in v0.2.0
type InvoiceSectionsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
InvoiceSectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the InvoiceSectionsClient.BeginCreateOrUpdate method.
type InvoiceSectionsClientCreateOrUpdateResponse ¶ added in v0.2.0
type InvoiceSectionsClientCreateOrUpdateResponse struct { // An invoice section. InvoiceSection }
InvoiceSectionsClientCreateOrUpdateResponse contains the response from method InvoiceSectionsClient.BeginCreateOrUpdate.
type InvoiceSectionsClientGetOptions ¶ added in v0.2.0
type InvoiceSectionsClientGetOptions struct { }
InvoiceSectionsClientGetOptions contains the optional parameters for the InvoiceSectionsClient.Get method.
type InvoiceSectionsClientGetResponse ¶ added in v0.2.0
type InvoiceSectionsClientGetResponse struct { // An invoice section. InvoiceSection }
InvoiceSectionsClientGetResponse contains the response from method InvoiceSectionsClient.Get.
type InvoiceSectionsClientListByBillingProfileOptions ¶ added in v0.2.0
type InvoiceSectionsClientListByBillingProfileOptions struct { }
InvoiceSectionsClientListByBillingProfileOptions contains the optional parameters for the InvoiceSectionsClient.NewListByBillingProfilePager method.
type InvoiceSectionsClientListByBillingProfileResponse ¶ added in v0.2.0
type InvoiceSectionsClientListByBillingProfileResponse struct { // The list of invoice sections. InvoiceSectionListResult }
InvoiceSectionsClientListByBillingProfileResponse contains the response from method InvoiceSectionsClient.NewListByBillingProfilePager.
type InvoiceSectionsOnExpand ¶
type InvoiceSectionsOnExpand struct { // The invoice sections associated to the billing profile. Value []*InvoiceSection // READ-ONLY; Indicates whether there are more invoice sections than the ones listed in this collection. The collection lists // a maximum of 50 invoice sections. To get all invoice sections, use the list invoice // sections API. HasMoreResults *bool }
InvoiceSectionsOnExpand - The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in $expand.
func (InvoiceSectionsOnExpand) MarshalJSON ¶
func (i InvoiceSectionsOnExpand) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceSectionsOnExpand.
func (*InvoiceSectionsOnExpand) UnmarshalJSON ¶ added in v0.6.0
func (i *InvoiceSectionsOnExpand) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceSectionsOnExpand.
type InvoiceStatus ¶
type InvoiceStatus string
InvoiceStatus - The current status of the invoice.
const ( InvoiceStatusDue InvoiceStatus = "Due" InvoiceStatusOverDue InvoiceStatus = "OverDue" InvoiceStatusPaid InvoiceStatus = "Paid" InvoiceStatusVoid InvoiceStatus = "Void" )
func PossibleInvoiceStatusValues ¶
func PossibleInvoiceStatusValues() []InvoiceStatus
PossibleInvoiceStatusValues returns the possible values for the InvoiceStatus const type.
type InvoiceType ¶
type InvoiceType string
InvoiceType - Invoice type.
const ( InvoiceTypeAzureMarketplace InvoiceType = "AzureMarketplace" InvoiceTypeAzureService InvoiceType = "AzureService" InvoiceTypeAzureSupport InvoiceType = "AzureSupport" )
func PossibleInvoiceTypeValues ¶
func PossibleInvoiceTypeValues() []InvoiceType
PossibleInvoiceTypeValues returns the possible values for the InvoiceType const type.
type InvoicesClient ¶
type InvoicesClient struct {
// contains filtered or unexported fields
}
InvoicesClient contains the methods for the Invoices group. Don't use this type directly, use NewInvoicesClient() instead.
func NewInvoicesClient ¶
func NewInvoicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InvoicesClient, error)
NewInvoicesClient creates a new instance of InvoicesClient with the specified values.
- subscriptionID - The ID that uniquely identifies an Azure subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*InvoicesClient) BeginDownloadBillingSubscriptionInvoice ¶
func (client *InvoicesClient) BeginDownloadBillingSubscriptionInvoice(ctx context.Context, invoiceName string, downloadToken string, options *InvoicesClientBeginDownloadBillingSubscriptionInvoiceOptions) (*runtime.Poller[InvoicesClientDownloadBillingSubscriptionInvoiceResponse], error)
BeginDownloadBillingSubscriptionInvoice - Gets a URL to download an invoice. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- invoiceName - The ID that uniquely identifies an invoice.
- downloadToken - Download token with document source and document ID.
- options - InvoicesClientBeginDownloadBillingSubscriptionInvoiceOptions contains the optional parameters for the InvoicesClient.BeginDownloadBillingSubscriptionInvoice method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoiceDownload.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewInvoicesClient().BeginDownloadBillingSubscriptionInvoice(ctx, "{invoiceName}", "DRS_12345", 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.DownloadURL = armbilling.DownloadURL{ // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sig=sp=r"), // } }
Output:
func (*InvoicesClient) BeginDownloadInvoice ¶
func (client *InvoicesClient) BeginDownloadInvoice(ctx context.Context, billingAccountName string, invoiceName string, downloadToken string, options *InvoicesClientBeginDownloadInvoiceOptions) (*runtime.Poller[InvoicesClientDownloadInvoiceResponse], error)
BeginDownloadInvoice - Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- invoiceName - The ID that uniquely identifies an invoice.
- downloadToken - Download token with document source and document ID.
- options - InvoicesClientBeginDownloadInvoiceOptions contains the optional parameters for the InvoicesClient.BeginDownloadInvoice method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewInvoicesClient().BeginDownloadInvoice(ctx, "{billingAccountName}", "{invoiceName}", "DRS_12345", 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.DownloadURL = armbilling.DownloadURL{ // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"), // } }
Output:
func (*InvoicesClient) BeginDownloadMultipleBillingProfileInvoices ¶
func (client *InvoicesClient) BeginDownloadMultipleBillingProfileInvoices(ctx context.Context, billingAccountName string, downloadUrls []*string, options *InvoicesClientBeginDownloadMultipleBillingProfileInvoicesOptions) (*runtime.Poller[InvoicesClientDownloadMultipleBillingProfileInvoicesResponse], error)
BeginDownloadMultipleBillingProfileInvoices - Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- downloadUrls - An array of download urls for individual documents
- options - InvoicesClientBeginDownloadMultipleBillingProfileInvoicesOptions contains the optional parameters for the InvoicesClient.BeginDownloadMultipleBillingProfileInvoices method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewInvoicesClient().BeginDownloadMultipleBillingProfileInvoices(ctx, "{billingAccountName}", []*string{ to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"), to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"), to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01")}, 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.DownloadURL = armbilling.DownloadURL{ // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"), // } }
Output:
func (*InvoicesClient) BeginDownloadMultipleBillingSubscriptionInvoices ¶
func (client *InvoicesClient) BeginDownloadMultipleBillingSubscriptionInvoices(ctx context.Context, downloadUrls []*string, options *InvoicesClientBeginDownloadMultipleBillingSubscriptionInvoicesOptions) (*runtime.Poller[InvoicesClientDownloadMultipleBillingSubscriptionInvoicesResponse], error)
BeginDownloadMultipleBillingSubscriptionInvoices - Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- downloadUrls - An array of download urls for individual documents
- options - InvoicesClientBeginDownloadMultipleBillingSubscriptionInvoicesOptions contains the optional parameters for the InvoicesClient.BeginDownloadMultipleBillingSubscriptionInvoices method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewInvoicesClient().BeginDownloadMultipleBillingSubscriptionInvoices(ctx, []*string{ to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"), to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"), to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01")}, 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.DownloadURL = armbilling.DownloadURL{ // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"), // } }
Output:
func (*InvoicesClient) Get ¶
func (client *InvoicesClient) Get(ctx context.Context, billingAccountName string, invoiceName string, options *InvoicesClientGetOptions) (InvoicesClientGetResponse, error)
Get - Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- invoiceName - The ID that uniquely identifies an invoice.
- options - InvoicesClientGetOptions contains the optional parameters for the InvoicesClient.Get method.
Example (CreditNote) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CreditNote.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewInvoicesClient().Get(ctx, "{billingAccountName}", "{invoiceName}", 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.Invoice = armbilling.Invoice{ // Name: to.Ptr("{invoiceName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](15.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // CreditForDocumentID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000001"), // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeCreditNote), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }, // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusPaid), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // }, // } }
Output:
Example (Invoice) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Invoice.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewInvoicesClient().Get(ctx, "{billingAccountName}", "{invoiceName}", 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.Invoice = armbilling.Invoice{ // Name: to.Ptr("{invoiceName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](15.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }, // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // }, // } }
Output:
Example (InvoiceWithRebillDetails) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceWithRebillDetails.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewInvoicesClient().Get(ctx, "{billingAccountName}", "{invoiceName}", 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.Invoice = armbilling.Invoice{ // Name: to.Ptr("{invoiceName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](15.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }, // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // RebillDetails: map[string]*armbilling.RebillDetails{ // "creditNoteDocumentId": &armbilling.RebillDetails{ // }, // "invoiceDocumentId": &armbilling.RebillDetails{ // }, // "rebillDetails": &armbilling.RebillDetails{ // }, // }, // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // }, // } }
Output:
Example (VoidInvoice) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/VoidInvoice.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewInvoicesClient().Get(ctx, "{billingAccountName}", "{invoiceName}", 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.Invoice = armbilling.Invoice{ // Name: to.Ptr("{invoiceName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](15.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BilledDocumentID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000002"), // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }, // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusVoid), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // }, // } }
Output:
func (*InvoicesClient) GetByID ¶
func (client *InvoicesClient) GetByID(ctx context.Context, invoiceName string, options *InvoicesClientGetByIDOptions) (InvoicesClientGetByIDResponse, error)
GetByID - Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- invoiceName - The ID that uniquely identifies an invoice.
- options - InvoicesClientGetByIDOptions contains the optional parameters for the InvoicesClient.GetByID method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceById.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewInvoicesClient().GetByID(ctx, "{invoiceName}", 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.Invoice = armbilling.Invoice{ // Name: to.Ptr("{invoiceName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](15.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }, // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // }, // } }
Output:
func (*InvoicesClient) GetBySubscriptionAndInvoiceID ¶
func (client *InvoicesClient) GetBySubscriptionAndInvoiceID(ctx context.Context, invoiceName string, options *InvoicesClientGetBySubscriptionAndInvoiceIDOptions) (InvoicesClientGetBySubscriptionAndInvoiceIDResponse, error)
GetBySubscriptionAndInvoiceID - Gets an invoice by subscription ID and invoice ID. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- invoiceName - The ID that uniquely identifies an invoice.
- options - InvoicesClientGetBySubscriptionAndInvoiceIDOptions contains the optional parameters for the InvoicesClient.GetBySubscriptionAndInvoiceID method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoice.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewInvoicesClient().GetBySubscriptionAndInvoiceID(ctx, "{invoiceName}", 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.Invoice = armbilling.Invoice{ // Name: to.Ptr("1383724"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions/invoices"), // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/11000000-0000-0000-0000-000000000000/invoices/1383724"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/11000000-0000-0000-0000-000000000000/invoices/1383724/download"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28.000Z"); return t}()), // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-02T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28.000Z"); return t}()), // InvoiceType: to.Ptr(armbilling.InvoiceTypeAzureMarketplace), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusPaid), // SubscriptionID: to.Ptr("55000000-0000-0000-0000-000000000011"), // }, // } }
Output:
func (*InvoicesClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *InvoicesClient) NewListByBillingAccountPager(billingAccountName string, periodStartDate string, periodEndDate string, options *InvoicesClientListByBillingAccountOptions) *runtime.Pager[InvoicesClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- periodStartDate - The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format.
- periodEndDate - The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format.
- options - InvoicesClientListByBillingAccountOptions contains the optional parameters for the InvoicesClient.NewListByBillingAccountPager method.
Example (BillingAccountInvoicesList) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewInvoicesClient().NewListByBillingAccountPager("{billingAccountName}", "2018-01-01", "2018-06-30", 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.InvoiceListResult = armbilling.InvoiceListResult{ // Value: []*armbilling.Invoice{ // { // Name: to.Ptr("1383723"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383723"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](25.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](7.53), // }, // }, // }, // { // Name: to.Ptr("1383724"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383724"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](15.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxreceipt.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(true), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatus("PastDue")), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // }, // }}, // } } }
Output:
Example (BillingAccountInvoicesListWithRebillDetails) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesListWithRebillDetails.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewInvoicesClient().NewListByBillingAccountPager("{billingAccountName}", "2018-01-01", "2018-06-30", 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.InvoiceListResult = armbilling.InvoiceListResult{ // Value: []*armbilling.Invoice{ // { // Name: to.Ptr("I000003"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000003"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](25.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // RebillDetails: map[string]*armbilling.RebillDetails{ // "creditNoteDocumentId": &armbilling.RebillDetails{ // }, // "invoiceDocumentId": &armbilling.RebillDetails{ // }, // "rebillDetails": &armbilling.RebillDetails{ // }, // }, // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](7.53), // }, // }, // }, // { // Name: to.Ptr("1383724"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383724"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](15.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxreceipt.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(true), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatus("PastDue")), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // }, // }}, // } } }
Output:
func (*InvoicesClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *InvoicesClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, periodStartDate string, periodEndDate string, options *InvoicesClientListByBillingProfileOptions) *runtime.Pager[InvoicesClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- periodStartDate - The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format.
- periodEndDate - The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format.
- options - InvoicesClientListByBillingProfileOptions contains the optional parameters for the InvoicesClient.NewListByBillingProfilePager method.
Example (InvoicesListByBillingProfile) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewInvoicesClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", "2018-01-01", "2018-06-30", 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.InvoiceListResult = armbilling.InvoiceListResult{ // Value: []*armbilling.Invoice{ // { // Name: to.Ptr("1383723"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383723"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](25.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }, // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](7.53), // }, // }, // }, // { // Name: to.Ptr("1383724"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383724"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](15.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }, // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(true), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // }, // }}, // } } }
Output:
Example (InvoicesListByBillingProfileWithRebillDetails) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfileWithRebillDetails.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewInvoicesClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", "2018-01-01", "2018-06-30", 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.InvoiceListResult = armbilling.InvoiceListResult{ // Value: []*armbilling.Invoice{ // { // Name: to.Ptr("I000003"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000003"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](25.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }, // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // RebillDetails: map[string]*armbilling.RebillDetails{ // "creditNoteDocumentId": &armbilling.RebillDetails{ // }, // "invoiceDocumentId": &armbilling.RebillDetails{ // }, // "rebillDetails": &armbilling.RebillDetails{ // }, // }, // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](7.53), // }, // }, // }, // { // Name: to.Ptr("1383724"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383724"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // AzurePrepaymentApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](15.46), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CreditAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/invoice.pdf"), // }, // { // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(true), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // TotalAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](16.53), // }, // }, // }}, // } } }
Output:
func (*InvoicesClient) NewListByBillingSubscriptionPager ¶ added in v0.4.0
func (client *InvoicesClient) NewListByBillingSubscriptionPager(periodStartDate string, periodEndDate string, options *InvoicesClientListByBillingSubscriptionOptions) *runtime.Pager[InvoicesClientListByBillingSubscriptionResponse]
NewListByBillingSubscriptionPager - Lists the invoices for a subscription.
Generated from API version 2020-05-01
- periodStartDate - Invoice period start date.
- periodEndDate - Invoice period end date.
- options - InvoicesClientListByBillingSubscriptionOptions contains the optional parameters for the InvoicesClient.NewListByBillingSubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoicesList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewInvoicesClient().NewListByBillingSubscriptionPager("2018-01-01", "2018-06-30", 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.InvoiceListResult = armbilling.InvoiceListResult{ // Value: []*armbilling.Invoice{ // { // Name: to.Ptr("1383723"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions/invoices"), // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/11000000-0000-0000-0000-000000000000/invoices/1383723"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28.000Z"); return t}()), // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28.000Z"); return t}()), // InvoiceType: to.Ptr(armbilling.InvoiceType("AzureServices")), // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubscriptionID: to.Ptr("55000000-0000-0000-0000-000000000011"), // }, // }, // { // Name: to.Ptr("1383724"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions/invoices"), // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/11000000-0000-0000-0000-000000000000/invoices/1383724"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // BilledAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // Documents: []*armbilling.Document{ // { // Kind: to.Ptr(armbilling.DocumentTypeInvoice), // Source: to.Ptr(armbilling.DocumentSourceDRS), // URL: to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/11000000-0000-0000-0000-000000000000/invoices/1383724/download"), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28.000Z"); return t}()), // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-02T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28.000Z"); return t}()), // InvoiceType: to.Ptr(armbilling.InvoiceTypeAzureMarketplace), // Payments: []*armbilling.PaymentProperties{ // { // Amount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("credited"), // }}, // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusPaid), // SubscriptionID: to.Ptr("55000000-0000-0000-0000-000000000011"), // }, // }}, // } } }
Output:
type InvoicesClientBeginDownloadBillingSubscriptionInvoiceOptions ¶ added in v0.2.0
type InvoicesClientBeginDownloadBillingSubscriptionInvoiceOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
InvoicesClientBeginDownloadBillingSubscriptionInvoiceOptions contains the optional parameters for the InvoicesClient.BeginDownloadBillingSubscriptionInvoice method.
type InvoicesClientBeginDownloadInvoiceOptions ¶ added in v0.2.0
type InvoicesClientBeginDownloadInvoiceOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
InvoicesClientBeginDownloadInvoiceOptions contains the optional parameters for the InvoicesClient.BeginDownloadInvoice method.
type InvoicesClientBeginDownloadMultipleBillingProfileInvoicesOptions ¶ added in v0.2.0
type InvoicesClientBeginDownloadMultipleBillingProfileInvoicesOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
InvoicesClientBeginDownloadMultipleBillingProfileInvoicesOptions contains the optional parameters for the InvoicesClient.BeginDownloadMultipleBillingProfileInvoices method.
type InvoicesClientBeginDownloadMultipleBillingSubscriptionInvoicesOptions ¶ added in v0.2.0
type InvoicesClientBeginDownloadMultipleBillingSubscriptionInvoicesOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
InvoicesClientBeginDownloadMultipleBillingSubscriptionInvoicesOptions contains the optional parameters for the InvoicesClient.BeginDownloadMultipleBillingSubscriptionInvoices method.
type InvoicesClientDownloadBillingSubscriptionInvoiceResponse ¶ added in v0.2.0
type InvoicesClientDownloadBillingSubscriptionInvoiceResponse struct { // A secure URL that can be used to download a an entity until the URL expires. DownloadURL }
InvoicesClientDownloadBillingSubscriptionInvoiceResponse contains the response from method InvoicesClient.BeginDownloadBillingSubscriptionInvoice.
type InvoicesClientDownloadInvoiceResponse ¶ added in v0.2.0
type InvoicesClientDownloadInvoiceResponse struct { // A secure URL that can be used to download a an entity until the URL expires. DownloadURL }
InvoicesClientDownloadInvoiceResponse contains the response from method InvoicesClient.BeginDownloadInvoice.
type InvoicesClientDownloadMultipleBillingProfileInvoicesResponse ¶ added in v0.2.0
type InvoicesClientDownloadMultipleBillingProfileInvoicesResponse struct { // A secure URL that can be used to download a an entity until the URL expires. DownloadURL }
InvoicesClientDownloadMultipleBillingProfileInvoicesResponse contains the response from method InvoicesClient.BeginDownloadMultipleBillingProfileInvoices.
type InvoicesClientDownloadMultipleBillingSubscriptionInvoicesResponse ¶ added in v0.2.0
type InvoicesClientDownloadMultipleBillingSubscriptionInvoicesResponse struct { // A secure URL that can be used to download a an entity until the URL expires. DownloadURL }
InvoicesClientDownloadMultipleBillingSubscriptionInvoicesResponse contains the response from method InvoicesClient.BeginDownloadMultipleBillingSubscriptionInvoices.
type InvoicesClientGetByIDOptions ¶ added in v0.2.0
type InvoicesClientGetByIDOptions struct { }
InvoicesClientGetByIDOptions contains the optional parameters for the InvoicesClient.GetByID method.
type InvoicesClientGetByIDResponse ¶ added in v0.2.0
type InvoicesClientGetByIDResponse struct { // An invoice. Invoice }
InvoicesClientGetByIDResponse contains the response from method InvoicesClient.GetByID.
type InvoicesClientGetBySubscriptionAndInvoiceIDOptions ¶ added in v0.2.0
type InvoicesClientGetBySubscriptionAndInvoiceIDOptions struct { }
InvoicesClientGetBySubscriptionAndInvoiceIDOptions contains the optional parameters for the InvoicesClient.GetBySubscriptionAndInvoiceID method.
type InvoicesClientGetBySubscriptionAndInvoiceIDResponse ¶ added in v0.2.0
type InvoicesClientGetBySubscriptionAndInvoiceIDResponse struct { // An invoice. Invoice }
InvoicesClientGetBySubscriptionAndInvoiceIDResponse contains the response from method InvoicesClient.GetBySubscriptionAndInvoiceID.
type InvoicesClientGetOptions ¶ added in v0.2.0
type InvoicesClientGetOptions struct { }
InvoicesClientGetOptions contains the optional parameters for the InvoicesClient.Get method.
type InvoicesClientGetResponse ¶ added in v0.2.0
type InvoicesClientGetResponse struct { // An invoice. Invoice }
InvoicesClientGetResponse contains the response from method InvoicesClient.Get.
type InvoicesClientListByBillingAccountOptions ¶ added in v0.2.0
type InvoicesClientListByBillingAccountOptions struct { }
InvoicesClientListByBillingAccountOptions contains the optional parameters for the InvoicesClient.NewListByBillingAccountPager method.
type InvoicesClientListByBillingAccountResponse ¶ added in v0.2.0
type InvoicesClientListByBillingAccountResponse struct { // The list of invoices. InvoiceListResult }
InvoicesClientListByBillingAccountResponse contains the response from method InvoicesClient.NewListByBillingAccountPager.
type InvoicesClientListByBillingProfileOptions ¶ added in v0.2.0
type InvoicesClientListByBillingProfileOptions struct { }
InvoicesClientListByBillingProfileOptions contains the optional parameters for the InvoicesClient.NewListByBillingProfilePager method.
type InvoicesClientListByBillingProfileResponse ¶ added in v0.2.0
type InvoicesClientListByBillingProfileResponse struct { // The list of invoices. InvoiceListResult }
InvoicesClientListByBillingProfileResponse contains the response from method InvoicesClient.NewListByBillingProfilePager.
type InvoicesClientListByBillingSubscriptionOptions ¶ added in v0.2.0
type InvoicesClientListByBillingSubscriptionOptions struct { }
InvoicesClientListByBillingSubscriptionOptions contains the optional parameters for the InvoicesClient.NewListByBillingSubscriptionPager method.
type InvoicesClientListByBillingSubscriptionResponse ¶ added in v0.2.0
type InvoicesClientListByBillingSubscriptionResponse struct { // The list of invoices. InvoiceListResult }
InvoicesClientListByBillingSubscriptionResponse contains the response from method InvoicesClient.NewListByBillingSubscriptionPager.
type MarketplacePurchasesPolicy ¶
type MarketplacePurchasesPolicy string
MarketplacePurchasesPolicy - The policy that controls whether Azure marketplace purchases are allowed for a billing profile.
const ( MarketplacePurchasesPolicyAllAllowed MarketplacePurchasesPolicy = "AllAllowed" MarketplacePurchasesPolicyNotAllowed MarketplacePurchasesPolicy = "NotAllowed" MarketplacePurchasesPolicyOnlyFreeAllowed MarketplacePurchasesPolicy = "OnlyFreeAllowed" )
func PossibleMarketplacePurchasesPolicyValues ¶
func PossibleMarketplacePurchasesPolicyValues() []MarketplacePurchasesPolicy
PossibleMarketplacePurchasesPolicyValues returns the possible values for the MarketplacePurchasesPolicy const type.
type Operation ¶
type Operation struct { // The object that represents the operation. Display *OperationDisplay // READ-ONLY; Identifies if the operation is a data operation. IsDataAction *bool // READ-ONLY; Operation name: {provider}/{resource}/{operation}. Name *string }
Operation - A Billing REST API operation.
func (Operation) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct { // READ-ONLY; Description of operation. Description *string // READ-ONLY; Operation type such as read, write and delete. Operation *string // READ-ONLY; Service provider: Microsoft.Billing. Provider *string // READ-ONLY; Resource on which the operation is performed such as invoice and billing subscription. Resource *string }
OperationDisplay - The object that represents the operation.
func (OperationDisplay) MarshalJSON ¶ added in v0.6.0
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationListResult ¶
type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results if there are any. NextLink *string // READ-ONLY; The list of billing operations supported by the Microsoft.Billing resource provider. Value []*Operation }
OperationListResult - The list of billing 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 v0.6.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 the available billing REST API operations.
Generated from API version 2020-05-01
- options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
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 { // The list of billing operations and a URL link to get the next set of results. OperationListResult }
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type OperationsErrorDetails ¶ added in v0.3.0
type OperationsErrorDetails struct { // READ-ONLY; Error code. Code *string // READ-ONLY; Error message indicating why the operation failed. Message *string // READ-ONLY; The target of the particular error. Target *string }
OperationsErrorDetails - The details of the error.
func (OperationsErrorDetails) MarshalJSON ¶ added in v0.6.0
func (o OperationsErrorDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationsErrorDetails.
func (*OperationsErrorDetails) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationsErrorDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationsErrorDetails.
type OperationsErrorResponse ¶ added in v0.3.0
type OperationsErrorResponse struct { // The details of the error. Error *OperationsErrorDetails }
OperationsErrorResponse - Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
func (OperationsErrorResponse) MarshalJSON ¶ added in v0.6.0
func (o OperationsErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationsErrorResponse.
func (*OperationsErrorResponse) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationsErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationsErrorResponse.
type Participants ¶
type Participants struct { // READ-ONLY; The email address of the participant. Email *string // READ-ONLY; The acceptance status of the participant. Status *string // READ-ONLY; The date when the status got changed. StatusDate *time.Time }
Participants - The details about a participant.
func (Participants) MarshalJSON ¶
func (p Participants) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Participants.
func (*Participants) UnmarshalJSON ¶
func (p *Participants) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Participants.
type PaymentMethodFamily ¶
type PaymentMethodFamily string
PaymentMethodFamily - The family of payment method.
const ( PaymentMethodFamilyCheckWire PaymentMethodFamily = "CheckWire" PaymentMethodFamilyCreditCard PaymentMethodFamily = "CreditCard" PaymentMethodFamilyCredits PaymentMethodFamily = "Credits" PaymentMethodFamilyNone PaymentMethodFamily = "None" )
func PossiblePaymentMethodFamilyValues ¶
func PossiblePaymentMethodFamilyValues() []PaymentMethodFamily
PossiblePaymentMethodFamilyValues returns the possible values for the PaymentMethodFamily const type.
type PaymentProperties ¶
type PaymentProperties struct { // The family of payment method. PaymentMethodFamily *PaymentMethodFamily // READ-ONLY; The paid amount. Amount *Amount // READ-ONLY; The date when the payment was made. Date *time.Time // READ-ONLY; The type of payment method. PaymentMethodType *string // READ-ONLY; The type of payment. PaymentType *string }
PaymentProperties - The properties of a payment.
func (PaymentProperties) MarshalJSON ¶
func (p PaymentProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentProperties.
func (*PaymentProperties) UnmarshalJSON ¶
func (p *PaymentProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentProperties.
type Period ¶ added in v0.2.0
type Period struct { // A billing period. Properties *PeriodProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Period - A billing period resource.
func (Period) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Period.
func (*Period) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Period.
type PeriodProperties ¶ added in v0.2.0
type PeriodProperties struct { // READ-ONLY; The end of the date range covered by the billing period. BillingPeriodEndDate *time.Time // READ-ONLY; The start of the date range covered by the billing period. BillingPeriodStartDate *time.Time // READ-ONLY; Array of invoice ids that associated with. InvoiceIDs []*string }
PeriodProperties - The properties of the billing period.
func (PeriodProperties) MarshalJSON ¶ added in v0.2.0
func (p PeriodProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PeriodProperties.
func (*PeriodProperties) UnmarshalJSON ¶ added in v0.2.0
func (p *PeriodProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PeriodProperties.
type PeriodsClient ¶ added in v0.2.0
type PeriodsClient struct {
// contains filtered or unexported fields
}
PeriodsClient contains the methods for the BillingPeriods group. Don't use this type directly, use NewPeriodsClient() instead.
func NewPeriodsClient ¶ added in v0.2.0
func NewPeriodsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PeriodsClient, error)
NewPeriodsClient creates a new instance of PeriodsClient with the specified values.
- subscriptionID - The ID that uniquely identifies an Azure subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PeriodsClient) Get ¶ added in v0.2.0
func (client *PeriodsClient) Get(ctx context.Context, billingPeriodName string, options *PeriodsClientGetOptions) (PeriodsClientGetResponse, error)
Get - Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2018-03-01-preview
- billingPeriodName - The name of a BillingPeriod resource.
- options - PeriodsClientGetOptions contains the optional parameters for the PeriodsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPeriodsClient().Get(ctx, "201702-1", 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.Period = armbilling.Period{ // Name: to.Ptr("201702-1"), // Type: to.Ptr("Microsoft.Billing/billingPeriods"), // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702-1"), // Properties: &armbilling.PeriodProperties{ // BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2017-02-01"); return t}()), // BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2017-01-01"); return t}()), // InvoiceIDs: []*string{ // to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/invoices/2017-02-05-123456789"), // to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/invoices/2017-01-05-987654321")}, // }, // } }
Output:
func (*PeriodsClient) NewListPager ¶ added in v0.4.0
func (client *PeriodsClient) NewListPager(options *PeriodsClientListOptions) *runtime.Pager[PeriodsClientListResponse]
NewListPager - Lists the available billing periods for a subscription in reverse chronological order. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API.
Generated from API version 2018-03-01-preview
- options - PeriodsClientListOptions contains the optional parameters for the PeriodsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPeriodsClient().NewListPager(&armbilling.PeriodsClientListOptions{Filter: nil, Skiptoken: nil, Top: 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.PeriodsListResult = armbilling.PeriodsListResult{ // Value: []*armbilling.Period{ // { // Name: to.Ptr("201702-1"), // Type: to.Ptr("Microsoft.Billing/billingPeriods"), // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702-1"), // Properties: &armbilling.PeriodProperties{ // BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2017-02-01"); return t}()), // BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2017-01-01"); return t}()), // InvoiceIDs: []*string{ // to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/invoices/2017-02-05-123456789"), // to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/invoices/2017-01-05-987654321")}, // }, // }}, // } } }
Output:
type PeriodsClientGetOptions ¶ added in v0.2.0
type PeriodsClientGetOptions struct { }
PeriodsClientGetOptions contains the optional parameters for the PeriodsClient.Get method.
type PeriodsClientGetResponse ¶ added in v0.2.0
type PeriodsClientGetResponse struct { // A billing period resource. Period }
PeriodsClientGetResponse contains the response from method PeriodsClient.Get.
type PeriodsClientListOptions ¶ added in v0.2.0
type PeriodsClientListOptions struct { // May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. // It does not currently support 'ne', 'or', or 'not'. Filter *string // Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, // the value of the nextLink element will include a skiptoken parameter that // specifies a starting point to use for subsequent calls. Skiptoken *string // May be used to limit the number of results to the most recent N billing periods. Top *int32 }
PeriodsClientListOptions contains the optional parameters for the PeriodsClient.NewListPager method.
type PeriodsClientListResponse ¶ added in v0.2.0
type PeriodsClientListResponse struct { // Result of listing billing periods. It contains a list of available billing periods in reverse chronological order. PeriodsListResult }
PeriodsClientListResponse contains the response from method PeriodsClient.NewListPager.
type PeriodsListResult ¶ added in v0.2.0
type PeriodsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of billing periods. Value []*Period }
PeriodsListResult - Result of listing billing periods. It contains a list of available billing periods in reverse chronological order.
func (PeriodsListResult) MarshalJSON ¶ added in v0.2.0
func (p PeriodsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PeriodsListResult.
func (*PeriodsListResult) UnmarshalJSON ¶ added in v0.6.0
func (p *PeriodsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PeriodsListResult.
type PermissionsClient ¶ added in v0.2.0
type PermissionsClient struct {
// contains filtered or unexported fields
}
PermissionsClient contains the methods for the BillingPermissions group. Don't use this type directly, use NewPermissionsClient() instead.
func NewPermissionsClient ¶ added in v0.2.0
func NewPermissionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PermissionsClient, error)
NewPermissionsClient creates a new instance of PermissionsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PermissionsClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *PermissionsClient) NewListByBillingAccountPager(billingAccountName string, options *PermissionsClientListByBillingAccountOptions) *runtime.Pager[PermissionsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the billing permissions the caller has on a billing account.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - PermissionsClientListByBillingAccountOptions contains the optional parameters for the PermissionsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountPermissionsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPermissionsClient().NewListByBillingAccountPager("{billingAccountName}", 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.PermissionsListResult = armbilling.PermissionsListResult{ // Value: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001")}, // NotActions: []*string{ // }, // }}, // } } }
Output:
func (*PermissionsClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *PermissionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *PermissionsClientListByBillingProfileOptions) *runtime.Pager[PermissionsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the billing permissions the caller has on a billing profile.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - PermissionsClientListByBillingProfileOptions contains the optional parameters for the PermissionsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilePermissionsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPermissionsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.PermissionsListResult = armbilling.PermissionsListResult{ // Value: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001")}, // NotActions: []*string{ // }, // }}, // } } }
Output:
func (*PermissionsClient) NewListByCustomerPager ¶ added in v0.4.0
func (client *PermissionsClient) NewListByCustomerPager(billingAccountName string, customerName string, options *PermissionsClientListByCustomerOptions) *runtime.Pager[PermissionsClientListByCustomerResponse]
NewListByCustomerPager - Lists the billing permissions the caller has for a customer.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- options - PermissionsClientListByCustomerOptions contains the optional parameters for the PermissionsClient.NewListByCustomerPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPermissionsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPermissionsClient().NewListByCustomerPager("{billingAccountName}", "{customerName}", 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.PermissionsListResult = armbilling.PermissionsListResult{ // Value: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001")}, // NotActions: []*string{ // }, // }}, // } } }
Output:
func (*PermissionsClient) NewListByInvoiceSectionsPager ¶ added in v0.4.0
func (client *PermissionsClient) NewListByInvoiceSectionsPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *PermissionsClientListByInvoiceSectionsOptions) *runtime.Pager[PermissionsClientListByInvoiceSectionsResponse]
NewListByInvoiceSectionsPager - Lists the billing permissions the caller has on an invoice section.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- invoiceSectionName - The ID that uniquely identifies an invoice section.
- options - PermissionsClientListByInvoiceSectionsOptions contains the optional parameters for the PermissionsClient.NewListByInvoiceSectionsPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionPermissionsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPermissionsClient().NewListByInvoiceSectionsPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", 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.PermissionsListResult = armbilling.PermissionsListResult{ // Value: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001")}, // NotActions: []*string{ // }, // }}, // } } }
Output:
type PermissionsClientListByBillingAccountOptions ¶ added in v0.2.0
type PermissionsClientListByBillingAccountOptions struct { }
PermissionsClientListByBillingAccountOptions contains the optional parameters for the PermissionsClient.NewListByBillingAccountPager method.
type PermissionsClientListByBillingAccountResponse ¶ added in v0.2.0
type PermissionsClientListByBillingAccountResponse struct { // Result of list billingPermissions a caller has on a billing account. PermissionsListResult }
PermissionsClientListByBillingAccountResponse contains the response from method PermissionsClient.NewListByBillingAccountPager.
type PermissionsClientListByBillingProfileOptions ¶ added in v0.2.0
type PermissionsClientListByBillingProfileOptions struct { }
PermissionsClientListByBillingProfileOptions contains the optional parameters for the PermissionsClient.NewListByBillingProfilePager method.
type PermissionsClientListByBillingProfileResponse ¶ added in v0.2.0
type PermissionsClientListByBillingProfileResponse struct { // Result of list billingPermissions a caller has on a billing account. PermissionsListResult }
PermissionsClientListByBillingProfileResponse contains the response from method PermissionsClient.NewListByBillingProfilePager.
type PermissionsClientListByCustomerOptions ¶ added in v0.2.0
type PermissionsClientListByCustomerOptions struct { }
PermissionsClientListByCustomerOptions contains the optional parameters for the PermissionsClient.NewListByCustomerPager method.
type PermissionsClientListByCustomerResponse ¶ added in v0.2.0
type PermissionsClientListByCustomerResponse struct { // Result of list billingPermissions a caller has on a billing account. PermissionsListResult }
PermissionsClientListByCustomerResponse contains the response from method PermissionsClient.NewListByCustomerPager.
type PermissionsClientListByInvoiceSectionsOptions ¶ added in v0.2.0
type PermissionsClientListByInvoiceSectionsOptions struct { }
PermissionsClientListByInvoiceSectionsOptions contains the optional parameters for the PermissionsClient.NewListByInvoiceSectionsPager method.
type PermissionsClientListByInvoiceSectionsResponse ¶ added in v0.2.0
type PermissionsClientListByInvoiceSectionsResponse struct { // Result of list billingPermissions a caller has on a billing account. PermissionsListResult }
PermissionsClientListByInvoiceSectionsResponse contains the response from method PermissionsClient.NewListByInvoiceSectionsPager.
type PermissionsListResult ¶ added in v0.2.0
type PermissionsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of billingPermissions a caller has on a billing account. Value []*PermissionsProperties }
PermissionsListResult - Result of list billingPermissions a caller has on a billing account.
func (PermissionsListResult) MarshalJSON ¶ added in v0.2.0
func (p PermissionsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PermissionsListResult.
func (*PermissionsListResult) UnmarshalJSON ¶ added in v0.6.0
func (p *PermissionsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PermissionsListResult.
type PermissionsProperties ¶ added in v0.2.0
type PermissionsProperties struct { // READ-ONLY; The set of actions that the caller is allowed to perform. Actions []*string // READ-ONLY; The set of actions that the caller is not allowed to perform. NotActions []*string }
PermissionsProperties - The set of allowed action and not allowed actions a caller has on a billing account
func (PermissionsProperties) MarshalJSON ¶ added in v0.2.0
func (p PermissionsProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PermissionsProperties.
func (*PermissionsProperties) UnmarshalJSON ¶ added in v0.6.0
func (p *PermissionsProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PermissionsProperties.
type PoliciesClient ¶
type PoliciesClient struct {
// contains filtered or unexported fields
}
PoliciesClient contains the methods for the Policies group. Don't use this type directly, use NewPoliciesClient() instead.
func NewPoliciesClient ¶
func NewPoliciesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PoliciesClient, error)
NewPoliciesClient creates a new instance of PoliciesClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PoliciesClient) GetByBillingProfile ¶
func (client *PoliciesClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, options *PoliciesClientGetByBillingProfileOptions) (PoliciesClientGetByBillingProfileResponse, error)
GetByBillingProfile - Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - PoliciesClientGetByBillingProfileOptions contains the optional parameters for the PoliciesClient.GetByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Policy.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPoliciesClient().GetByBillingProfile(ctx, "{billingAccountName}", "{billingProfileName}", 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.Policy = armbilling.Policy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default"), // Properties: &armbilling.PolicyProperties{ // MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyAllAllowed), // ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyAllowed), // ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), // }, // } }
Output:
func (*PoliciesClient) GetByCustomer ¶
func (client *PoliciesClient) GetByCustomer(ctx context.Context, billingAccountName string, customerName string, options *PoliciesClientGetByCustomerOptions) (PoliciesClientGetByCustomerResponse, error)
GetByCustomer - Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- options - PoliciesClientGetByCustomerOptions contains the optional parameters for the PoliciesClient.GetByCustomer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPolicy.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPoliciesClient().GetByCustomer(ctx, "{billingAccountName}", "{customerName}", 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.CustomerPolicy = armbilling.CustomerPolicy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default"), // Properties: &armbilling.CustomerPolicyProperties{ // ViewCharges: to.Ptr(armbilling.ViewChargesAllowed), // }, // } }
Output:
func (*PoliciesClient) Update ¶
func (client *PoliciesClient) Update(ctx context.Context, billingAccountName string, billingProfileName string, parameters Policy, options *PoliciesClientUpdateOptions) (PoliciesClientUpdateResponse, error)
Update - Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- parameters - Request parameters that are provided to the update policies operation.
- options - PoliciesClientUpdateOptions contains the optional parameters for the PoliciesClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdatePolicy.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPoliciesClient().Update(ctx, "{billingAccountName}", "{billingProfileName}", armbilling.Policy{ Properties: &armbilling.PolicyProperties{ MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyOnlyFreeAllowed), ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyNotAllowed), ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), }, }, 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.Policy = armbilling.Policy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default"), // Properties: &armbilling.PolicyProperties{ // MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyOnlyFreeAllowed), // ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyNotAllowed), // ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), // }, // } }
Output:
func (*PoliciesClient) UpdateCustomer ¶
func (client *PoliciesClient) UpdateCustomer(ctx context.Context, billingAccountName string, customerName string, parameters CustomerPolicy, options *PoliciesClientUpdateCustomerOptions) (PoliciesClientUpdateCustomerResponse, error)
UpdateCustomer - Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- parameters - Request parameters that are provided to the update policies operation.
- options - PoliciesClientUpdateCustomerOptions contains the optional parameters for the PoliciesClient.UpdateCustomer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateCustomerPolicy.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPoliciesClient().UpdateCustomer(ctx, "{billingAccountName}", "{customerName}", armbilling.CustomerPolicy{ Properties: &armbilling.CustomerPolicyProperties{ ViewCharges: to.Ptr(armbilling.ViewChargesNotAllowed), }, }, 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.CustomerPolicy = armbilling.CustomerPolicy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default"), // Properties: &armbilling.CustomerPolicyProperties{ // ViewCharges: to.Ptr(armbilling.ViewChargesNotAllowed), // }, // } }
Output:
type PoliciesClientGetByBillingProfileOptions ¶ added in v0.2.0
type PoliciesClientGetByBillingProfileOptions struct { }
PoliciesClientGetByBillingProfileOptions contains the optional parameters for the PoliciesClient.GetByBillingProfile method.
type PoliciesClientGetByBillingProfileResponse ¶ added in v0.2.0
type PoliciesClientGetByBillingProfileResponse struct { // A policy. Policy }
PoliciesClientGetByBillingProfileResponse contains the response from method PoliciesClient.GetByBillingProfile.
type PoliciesClientGetByCustomerOptions ¶ added in v0.2.0
type PoliciesClientGetByCustomerOptions struct { }
PoliciesClientGetByCustomerOptions contains the optional parameters for the PoliciesClient.GetByCustomer method.
type PoliciesClientGetByCustomerResponse ¶ added in v0.2.0
type PoliciesClientGetByCustomerResponse struct { // The customer's Policy. CustomerPolicy }
PoliciesClientGetByCustomerResponse contains the response from method PoliciesClient.GetByCustomer.
type PoliciesClientUpdateCustomerOptions ¶ added in v0.2.0
type PoliciesClientUpdateCustomerOptions struct { }
PoliciesClientUpdateCustomerOptions contains the optional parameters for the PoliciesClient.UpdateCustomer method.
type PoliciesClientUpdateCustomerResponse ¶ added in v0.2.0
type PoliciesClientUpdateCustomerResponse struct { // The customer's Policy. CustomerPolicy }
PoliciesClientUpdateCustomerResponse contains the response from method PoliciesClient.UpdateCustomer.
type PoliciesClientUpdateOptions ¶ added in v0.2.0
type PoliciesClientUpdateOptions struct { }
PoliciesClientUpdateOptions contains the optional parameters for the PoliciesClient.Update method.
type PoliciesClientUpdateResponse ¶ added in v0.2.0
type PoliciesClientUpdateResponse struct { // A policy. Policy }
PoliciesClientUpdateResponse contains the response from method PoliciesClient.Update.
type Policy ¶
type Policy struct { // The properties of a policy. Properties *PolicyProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Policy - A policy.
func (Policy) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Policy.
func (*Policy) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Policy.
type PolicyProperties ¶
type PolicyProperties struct { // The policy that controls whether Azure marketplace purchases are allowed for a billing profile. MarketplacePurchases *MarketplacePurchasesPolicy // The policy that controls whether Azure reservation purchases are allowed for a billing profile. ReservationPurchases *ReservationPurchasesPolicy // The policy that controls whether users with Azure RBAC access to a subscription can view its charges. ViewCharges *ViewChargesPolicy }
PolicyProperties - The properties of a policy.
func (PolicyProperties) MarshalJSON ¶ added in v0.6.0
func (p PolicyProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PolicyProperties.
func (*PolicyProperties) UnmarshalJSON ¶ added in v0.6.0
func (p *PolicyProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PolicyProperties.
type Product ¶
type Product struct { // The properties of a product. Properties *ProductProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Product - A product.
func (Product) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Product.
func (*Product) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Product.
type ProductProperties ¶
type ProductProperties struct { // Indicates whether auto renewal is turned on or off for a product. AutoRenew *AutoRenew // The frequency at which the product will be billed. BillingFrequency *BillingFrequency // The current status of the product. Status *ProductStatusType // READ-ONLY; The availability of the product. AvailabilityID *string // READ-ONLY; The name of the billing profile to which the product is billed. BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile to which the product is billed. BillingProfileID *string // READ-ONLY; The name of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner // Agreement billing account. CustomerDisplayName *string // READ-ONLY; The ID of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner // Agreement billing account. CustomerID *string // READ-ONLY; The display name of the product. DisplayName *string // READ-ONLY; The date when the product will be renewed or canceled. EndDate *time.Time // READ-ONLY; The name of the invoice section to which the product is billed. InvoiceSectionDisplayName *string // READ-ONLY; The ID of the invoice section to which the product is billed. InvoiceSectionID *string // READ-ONLY; The last month charges. LastCharge *Amount // READ-ONLY; The date of the last charge. LastChargeDate *time.Time // READ-ONLY; The description of the type of product. ProductType *string // READ-ONLY; The ID of the type of product. ProductTypeID *string // READ-ONLY; The date when the product was purchased. PurchaseDate *time.Time // READ-ONLY; The quantity purchased for the product. Quantity *float32 // READ-ONLY; Reseller for this product. Reseller *Reseller // READ-ONLY; The sku description of the product. SKUDescription *string // READ-ONLY; The sku ID of the product. SKUID *string // READ-ONLY; The id of the tenant in which the product is used. TenantID *string }
ProductProperties - The properties of a product.
func (ProductProperties) MarshalJSON ¶
func (p ProductProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProductProperties.
func (*ProductProperties) UnmarshalJSON ¶
func (p *ProductProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProductProperties.
type ProductStatusType ¶
type ProductStatusType string
ProductStatusType - The current status of the product.
const ( ProductStatusTypeActive ProductStatusType = "Active" ProductStatusTypeAutoRenew ProductStatusType = "AutoRenew" ProductStatusTypeCancelled ProductStatusType = "Cancelled" ProductStatusTypeDisabled ProductStatusType = "Disabled" ProductStatusTypeExpired ProductStatusType = "Expired" ProductStatusTypeExpiring ProductStatusType = "Expiring" ProductStatusTypeInactive ProductStatusType = "Inactive" ProductStatusTypePastDue ProductStatusType = "PastDue" )
func PossibleProductStatusTypeValues ¶
func PossibleProductStatusTypeValues() []ProductStatusType
PossibleProductStatusTypeValues returns the possible values for the ProductStatusType const type.
type ProductTransferValidationErrorCode ¶
type ProductTransferValidationErrorCode string
ProductTransferValidationErrorCode - Error code of the transfer validation response.
const ( ProductTransferValidationErrorCodeCrossBillingAccountNotAllowed ProductTransferValidationErrorCode = "CrossBillingAccountNotAllowed" ProductTransferValidationErrorCodeDestinationBillingProfilePastDue ProductTransferValidationErrorCode = "DestinationBillingProfilePastDue" ProductTransferValidationErrorCodeInsufficientPermissionOnDestination ProductTransferValidationErrorCode = "InsufficientPermissionOnDestination" ProductTransferValidationErrorCodeInsufficientPermissionOnSource ProductTransferValidationErrorCode = "InsufficientPermissionOnSource" ProductTransferValidationErrorCodeInvalidSource ProductTransferValidationErrorCode = "InvalidSource" ProductTransferValidationErrorCodeNotAvailableForDestinationMarket ProductTransferValidationErrorCode = "NotAvailableForDestinationMarket" ProductTransferValidationErrorCodeOneTimePurchaseProductTransferNotAllowed ProductTransferValidationErrorCode = "OneTimePurchaseProductTransferNotAllowed" ProductTransferValidationErrorCodeProductNotActive ProductTransferValidationErrorCode = "ProductNotActive" ProductTransferValidationErrorCodeProductTypeNotSupported ProductTransferValidationErrorCode = "ProductTypeNotSupported" )
func PossibleProductTransferValidationErrorCodeValues ¶
func PossibleProductTransferValidationErrorCodeValues() []ProductTransferValidationErrorCode
PossibleProductTransferValidationErrorCodeValues returns the possible values for the ProductTransferValidationErrorCode const type.
type ProductsClient ¶
type ProductsClient struct {
// contains filtered or unexported fields
}
ProductsClient contains the methods for the Products group. Don't use this type directly, use NewProductsClient() instead.
func NewProductsClient ¶
func NewProductsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductsClient, error)
NewProductsClient creates a new instance of ProductsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ProductsClient) Get ¶
func (client *ProductsClient) Get(ctx context.Context, billingAccountName string, productName string, options *ProductsClientGetOptions) (ProductsClientGetResponse, error)
Get - Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- productName - The ID that uniquely identifies a product.
- options - ProductsClientGetOptions contains the optional parameters for the ProductsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Product.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProductsClient().Get(ctx, "{billingAccountName}", "{productName}", 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.Product = armbilling.Product{ // Name: to.Ptr("{productName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/{productName}"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("AIP Dev"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Subscription"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), // }, // } }
Output:
func (*ProductsClient) Move ¶
func (client *ProductsClient) Move(ctx context.Context, billingAccountName string, productName string, parameters TransferProductRequestProperties, options *ProductsClientMoveOptions) (ProductsClientMoveResponse, error)
Move - Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- productName - The ID that uniquely identifies a product.
- parameters - Request parameters that are provided to the move product operation.
- options - ProductsClientMoveOptions contains the optional parameters for the ProductsClient.Move method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveProduct.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProductsClient().Move(ctx, "{billingAccountName}", "{productName}", armbilling.TransferProductRequestProperties{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), }, 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.Product = armbilling.Product{ // Name: to.Ptr("{productName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}/products/{productName}"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("Test Product"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{newBillingProfileName}/invoiceSections/{newInvoiceSectionName}"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Subscription"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), // }, // } }
Output:
func (*ProductsClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *ProductsClient) NewListByBillingAccountPager(billingAccountName string, options *ProductsClientListByBillingAccountOptions) *runtime.Pager[ProductsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - ProductsClientListByBillingAccountOptions contains the optional parameters for the ProductsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewProductsClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.ProductsClientListByBillingAccountOptions{Filter: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ProductsListResult = armbilling.ProductsListResult{ // TotalCount: to.Ptr[int32](2), // Value: []*armbilling.Product{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyOneTime), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("Eng Reservation (1a13s21awe)"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Reservation"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), // }, // }, // { // Name: to.Ptr("10000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/10000000-0000-0000-0000-000000000001"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("Engineering Email"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Azure subscription"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), // }, // }}, // } } }
Output:
func (*ProductsClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *ProductsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *ProductsClientListByBillingProfileOptions) *runtime.Pager[ProductsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - ProductsClientListByBillingProfileOptions contains the optional parameters for the ProductsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewProductsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", &armbilling.ProductsClientListByBillingProfileOptions{Filter: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ProductsListResult = armbilling.ProductsListResult{ // TotalCount: to.Ptr[int32](2), // Value: []*armbilling.Product{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyOneTime), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("Eng Reservation (1a13s21awe)"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Reservation"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), // }, // }, // { // Name: to.Ptr("10000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/10000000-0000-0000-0000-000000000001"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("Engineering Email"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Azure subscription"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), // }, // }}, // } } }
Output:
func (*ProductsClient) NewListByCustomerPager ¶ added in v0.4.0
func (client *ProductsClient) NewListByCustomerPager(billingAccountName string, customerName string, options *ProductsClientListByCustomerOptions) *runtime.Pager[ProductsClientListByCustomerResponse]
NewListByCustomerPager - Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- options - ProductsClientListByCustomerOptions contains the optional parameters for the ProductsClient.NewListByCustomerPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByCustomer.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewProductsClient().NewListByCustomerPager("{billingAccountName}", "{customerName}", 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.ProductsListResult = armbilling.ProductsListResult{ // TotalCount: to.Ptr[int32](2), // Value: []*armbilling.Product{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyOneTime), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CustomerDisplayName: to.Ptr("Customer 1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), // DisplayName: to.Ptr("Eng Reservation (1a13s21awe)"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Reservation"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // Reseller: &armbilling.Reseller{ // Description: to.Ptr("Reseller1"), // ResellerID: to.Ptr("2c917292-b7bc-42f2-99a2-e498b9087c06"), // }, // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), // }, // }, // { // Name: to.Ptr("10000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/10000000-0000-0000-0000-000000000001"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CustomerDisplayName: to.Ptr("Customer 1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), // DisplayName: to.Ptr("Engineering Email"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](500), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Azure subscription"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), // }, // }}, // } } }
Output:
func (*ProductsClient) NewListByInvoiceSectionPager ¶ added in v0.4.0
func (client *ProductsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *ProductsClientListByInvoiceSectionOptions) *runtime.Pager[ProductsClientListByInvoiceSectionResponse]
NewListByInvoiceSectionPager - Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- invoiceSectionName - The ID that uniquely identifies an invoice section.
- options - ProductsClientListByInvoiceSectionOptions contains the optional parameters for the ProductsClient.NewListByInvoiceSectionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByInvoiceSection.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewProductsClient().NewListByInvoiceSectionPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", &armbilling.ProductsClientListByInvoiceSectionOptions{Filter: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ProductsListResult = armbilling.ProductsListResult{ // TotalCount: to.Ptr[int32](2), // Value: []*armbilling.Product{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyOneTime), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("Eng Reservation (1a13s21awe)"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Reservation"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), // }, // }, // { // Name: to.Ptr("10000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/10000000-0000-0000-0000-000000000001"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("Engineering Email"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](500), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Azure subscription"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // }, // }}, // } } }
Output:
func (*ProductsClient) Update ¶
func (client *ProductsClient) Update(ctx context.Context, billingAccountName string, productName string, parameters Product, options *ProductsClientUpdateOptions) (ProductsClientUpdateResponse, error)
Update - Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- productName - The ID that uniquely identifies a product.
- parameters - Request parameters that are provided to the update product operation.
- options - ProductsClientUpdateOptions contains the optional parameters for the ProductsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateProduct.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProductsClient().Update(ctx, "{billingAccountName}", "{productName}", armbilling.Product{ Properties: &armbilling.ProductProperties{ AutoRenew: to.Ptr(armbilling.AutoRenewOff), }, }, 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.Product = armbilling.Product{ // Name: to.Ptr("{productName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/{productName}"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOff), // AvailabilityID: to.Ptr("AvailabilityId1"), // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("AIP Dev"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // LastCharge: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28.000Z"); return t}()), // ProductType: to.Ptr("Subscription"), // ProductTypeID: to.Ptr("A12345"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Quantity: to.Ptr[float32](4), // SKUDescription: to.Ptr("Enterprise Agreement Development"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusTypeActive), // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), // }, // } }
Output:
func (*ProductsClient) ValidateMove ¶
func (client *ProductsClient) ValidateMove(ctx context.Context, billingAccountName string, productName string, parameters TransferProductRequestProperties, options *ProductsClientValidateMoveOptions) (ProductsClientValidateMoveResponse, error)
ValidateMove - Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- productName - The ID that uniquely identifies a product.
- parameters - Request parameters that are provided to the validate move eligibility operation.
- options - ProductsClientValidateMoveOptions contains the optional parameters for the ProductsClient.ValidateMove method.
Example (SubscriptionMoveValidateFailure) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveFailure.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProductsClient().ValidateMove(ctx, "{billingAccountName}", "{productName}", armbilling.TransferProductRequestProperties{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), }, 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.ValidateProductTransferEligibilityResult = armbilling.ValidateProductTransferEligibilityResult{ // ErrorDetails: &armbilling.ValidateProductTransferEligibilityError{ // Code: to.Ptr(armbilling.ProductTransferValidationErrorCodeProductTypeNotSupported), // Message: to.Ptr("Product '{productName}' is not allowed to be transferred."), // }, // IsMoveEligible: to.Ptr(false), // } }
Output:
Example (SubscriptionMoveValidateSuccess) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveSuccess.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProductsClient().ValidateMove(ctx, "{billingAccountName}", "{productName}", armbilling.TransferProductRequestProperties{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), }, 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.ValidateProductTransferEligibilityResult = armbilling.ValidateProductTransferEligibilityResult{ // IsMoveEligible: to.Ptr(true), // } }
Output:
type ProductsClientGetOptions ¶ added in v0.2.0
type ProductsClientGetOptions struct { }
ProductsClientGetOptions contains the optional parameters for the ProductsClient.Get method.
type ProductsClientGetResponse ¶ added in v0.2.0
type ProductsClientGetResponse struct { // A product. Product }
ProductsClientGetResponse contains the response from method ProductsClient.Get.
type ProductsClientListByBillingAccountOptions ¶ added in v0.2.0
type ProductsClientListByBillingAccountOptions struct { // May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently // support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key // and value are separated by a colon (:). Filter *string }
ProductsClientListByBillingAccountOptions contains the optional parameters for the ProductsClient.NewListByBillingAccountPager method.
type ProductsClientListByBillingAccountResponse ¶ added in v0.2.0
type ProductsClientListByBillingAccountResponse struct { // The list of products. It contains a list of available product summaries in reverse chronological order by purchase date. ProductsListResult }
ProductsClientListByBillingAccountResponse contains the response from method ProductsClient.NewListByBillingAccountPager.
type ProductsClientListByBillingProfileOptions ¶ added in v0.2.0
type ProductsClientListByBillingProfileOptions struct { // May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently // support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key // and value are separated by a colon (:). Filter *string }
ProductsClientListByBillingProfileOptions contains the optional parameters for the ProductsClient.NewListByBillingProfilePager method.
type ProductsClientListByBillingProfileResponse ¶ added in v0.2.0
type ProductsClientListByBillingProfileResponse struct { // The list of products. It contains a list of available product summaries in reverse chronological order by purchase date. ProductsListResult }
ProductsClientListByBillingProfileResponse contains the response from method ProductsClient.NewListByBillingProfilePager.
type ProductsClientListByCustomerOptions ¶ added in v0.2.0
type ProductsClientListByCustomerOptions struct { }
ProductsClientListByCustomerOptions contains the optional parameters for the ProductsClient.NewListByCustomerPager method.
type ProductsClientListByCustomerResponse ¶ added in v0.2.0
type ProductsClientListByCustomerResponse struct { // The list of products. It contains a list of available product summaries in reverse chronological order by purchase date. ProductsListResult }
ProductsClientListByCustomerResponse contains the response from method ProductsClient.NewListByCustomerPager.
type ProductsClientListByInvoiceSectionOptions ¶ added in v0.2.0
type ProductsClientListByInvoiceSectionOptions struct { // May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently // support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key // and value are separated by a colon (:). Filter *string }
ProductsClientListByInvoiceSectionOptions contains the optional parameters for the ProductsClient.NewListByInvoiceSectionPager method.
type ProductsClientListByInvoiceSectionResponse ¶ added in v0.2.0
type ProductsClientListByInvoiceSectionResponse struct { // The list of products. It contains a list of available product summaries in reverse chronological order by purchase date. ProductsListResult }
ProductsClientListByInvoiceSectionResponse contains the response from method ProductsClient.NewListByInvoiceSectionPager.
type ProductsClientMoveOptions ¶ added in v0.2.0
type ProductsClientMoveOptions struct { }
ProductsClientMoveOptions contains the optional parameters for the ProductsClient.Move method.
type ProductsClientMoveResponse ¶ added in v0.2.0
type ProductsClientMoveResponse struct { // A product. Product // Location contains the information returned from the Location header response. Location *string // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 }
ProductsClientMoveResponse contains the response from method ProductsClient.Move.
type ProductsClientUpdateOptions ¶ added in v0.2.0
type ProductsClientUpdateOptions struct { }
ProductsClientUpdateOptions contains the optional parameters for the ProductsClient.Update method.
type ProductsClientUpdateResponse ¶ added in v0.2.0
type ProductsClientUpdateResponse struct { // A product. Product }
ProductsClientUpdateResponse contains the response from method ProductsClient.Update.
type ProductsClientValidateMoveOptions ¶ added in v0.2.0
type ProductsClientValidateMoveOptions struct { }
ProductsClientValidateMoveOptions contains the optional parameters for the ProductsClient.ValidateMove method.
type ProductsClientValidateMoveResponse ¶ added in v0.2.0
type ProductsClientValidateMoveResponse struct { // Result of the product transfer eligibility validation. ValidateProductTransferEligibilityResult }
ProductsClientValidateMoveResponse contains the response from method ProductsClient.ValidateMove.
type ProductsListResult ¶
type ProductsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; Total number of records. TotalCount *int32 // READ-ONLY; The list of products. Value []*Product }
ProductsListResult - The list of products. It contains a list of available product summaries in reverse chronological order by purchase date.
func (ProductsListResult) MarshalJSON ¶
func (p ProductsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProductsListResult.
func (*ProductsListResult) UnmarshalJSON ¶ added in v0.6.0
func (p *ProductsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProductsListResult.
type Profile ¶ added in v0.2.0
type Profile struct { // The properties of the billing profile. Properties *ProfileProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Profile - A billing profile.
func (Profile) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Profile.
func (*Profile) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Profile.
type ProfileCreationRequest ¶ added in v0.2.0
type ProfileCreationRequest struct { // The address of the individual or organization that is responsible for the billing profile. BillTo *AddressDetails // The name of the billing profile. DisplayName *string // Enabled azure plans for the billing profile. EnabledAzurePlans []*AzurePlan // Flag controlling whether the invoices for the billing profile are sent through email. InvoiceEmailOptIn *bool // The purchase order name that will appear on the invoices generated for the billing profile. PoNumber *string }
ProfileCreationRequest - The request parameters for creating a new billing profile.
func (ProfileCreationRequest) MarshalJSON ¶ added in v0.2.0
func (p ProfileCreationRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfileCreationRequest.
func (*ProfileCreationRequest) UnmarshalJSON ¶ added in v0.6.0
func (p *ProfileCreationRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfileCreationRequest.
type ProfileInfo ¶ added in v0.3.0
type ProfileInfo struct { // The name of the billing profile BillingProfileDisplayName *string // The unique identifier for the billing profile. BillingProfileID *string // Billing account name. This property is available for a specific type of agreement. IndirectRelationshipOrganizationName *string }
ProfileInfo - Details about billing profile associated with agreement and available only for specific agreements.
func (ProfileInfo) MarshalJSON ¶ added in v0.6.0
func (p ProfileInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfileInfo.
func (*ProfileInfo) UnmarshalJSON ¶ added in v0.6.0
func (p *ProfileInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfileInfo.
type ProfileListResult ¶ added in v0.2.0
type ProfileListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; Total number of records. TotalCount *int32 // READ-ONLY; The list of billing profiles. Value []*Profile }
ProfileListResult - The list of billing profiles.
func (ProfileListResult) MarshalJSON ¶ added in v0.2.0
func (p ProfileListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfileListResult.
func (*ProfileListResult) UnmarshalJSON ¶ added in v0.6.0
func (p *ProfileListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfileListResult.
type ProfileProperties ¶ added in v0.2.0
type ProfileProperties struct { // Billing address. BillTo *AddressDetails // The name of the billing profile. DisplayName *string // Information about the enabled azure plans. EnabledAzurePlans []*AzurePlan // Flag controlling whether the invoices for the billing profile are sent through email. InvoiceEmailOptIn *bool // The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in $expand. InvoiceSections *InvoiceSectionsOnExpand // The purchase order name that will appear on the invoices generated for the billing profile. PoNumber *string // Tags of billing profiles. Tags map[string]*string // READ-ONLY; Identifies which services and purchases are paid by a billing profile. BillingRelationshipType *BillingRelationshipType // READ-ONLY; The currency in which the charges for the billing profile are billed. Currency *string // READ-ONLY; Indicates whether user has read access to the billing profile. HasReadAccess *bool // READ-ONLY; Identifies the billing profile that is linked to another billing profile in indirect purchase motion. IndirectRelationshipInfo *IndirectRelationshipInfo // READ-ONLY; The day of the month when the invoice for the billing profile is generated. InvoiceDay *int32 // READ-ONLY; The billing profile spending limit. SpendingLimit *SpendingLimit // READ-ONLY; The status of the billing profile. Status *BillingProfileStatus // READ-ONLY; Reason for the specified billing profile status. StatusReasonCode *StatusReasonCode // READ-ONLY; The system generated unique identifier for a billing profile. SystemID *string // READ-ONLY; Identifies the cloud environments that are associated with a billing profile. This is a system managed optional // field and gets updated as the billing profile gets associated with accounts in various // clouds. TargetClouds []*TargetCloud }
ProfileProperties - The properties of the billing profile.
func (ProfileProperties) MarshalJSON ¶ added in v0.2.0
func (p ProfileProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfileProperties.
func (*ProfileProperties) UnmarshalJSON ¶ added in v0.6.0
func (p *ProfileProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfileProperties.
type ProfilesClient ¶ added in v0.2.0
type ProfilesClient struct {
// contains filtered or unexported fields
}
ProfilesClient contains the methods for the BillingProfiles group. Don't use this type directly, use NewProfilesClient() instead.
func NewProfilesClient ¶ added in v0.2.0
func NewProfilesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ProfilesClient, error)
NewProfilesClient creates a new instance of ProfilesClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ProfilesClient) BeginCreateOrUpdate ¶ added in v0.2.0
func (client *ProfilesClient) BeginCreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, parameters Profile, options *ProfilesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ProfilesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- parameters - The new or updated billing profile.
- options - ProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutBillingProfile.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewProfilesClient().BeginCreateOrUpdate(ctx, "{billingAccountName}", "{billingProfileName}", armbilling.Profile{ Properties: &armbilling.ProfileProperties{ BillTo: &armbilling.AddressDetails{ AddressLine1: to.Ptr("Test Address 1"), City: to.Ptr("Redmond"), Country: to.Ptr("US"), FirstName: to.Ptr("Test"), LastName: to.Ptr("User"), PostalCode: to.Ptr("12345"), Region: to.Ptr("WA"), }, DisplayName: to.Ptr("Finance"), EnabledAzurePlans: []*armbilling.AzurePlan{ { SKUID: to.Ptr("0001"), }, { SKUID: to.Ptr("0002"), }}, InvoiceEmailOptIn: to.Ptr(true), PoNumber: to.Ptr("ABC12345"), }, }, 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.Profile = armbilling.Profile{ // Name: to.Ptr("billingProfileId1"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/billingProfileId1"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address 1"), // City: to.Ptr("Redmond"), // Country: to.Ptr("US"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PostalCode: to.Ptr("12345"), // Region: to.Ptr("WA"), // }, // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("Finance"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOff), // Status: to.Ptr(armbilling.BillingProfileStatusActive), // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), // }, // } }
Output:
func (*ProfilesClient) Get ¶ added in v0.2.0
func (client *ProfilesClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, options *ProfilesClientGetOptions) (ProfilesClientGetResponse, error)
Get - Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method.
Example (BillingProfile) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", &armbilling.ProfilesClientGetOptions{Expand: 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.Profile = armbilling.Profile{ // Name: to.Ptr("{billingProfileName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("Billing Profile1"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), // }, // } }
Output:
Example (BillingProfileWithExpand) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileWithExpand.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", &armbilling.ProfilesClientGetOptions{Expand: to.Ptr("invoiceSections")}) 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.Profile = armbilling.Profile{ // Name: to.Ptr("{billingProfileName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("Billing Profile1"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ // HasMoreResults: to.Ptr(false), // Value: []*armbilling.InvoiceSection{ // { // Name: to.Ptr("invoiceSectionId1"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/invoiceSectionId1"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName1"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("9XXX-11XX-XX1-XXXX-XXX"), // }, // }}, // }, // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), // }, // } }
Output:
func (*ProfilesClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *ProfilesClient) NewListByBillingAccountPager(billingAccountName string, options *ProfilesClientListByBillingAccountOptions) *runtime.Pager[ProfilesClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - ProfilesClientListByBillingAccountOptions contains the optional parameters for the ProfilesClient.NewListByBillingAccountPager method.
Example (BillingProfilesListByBillingAccount) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewProfilesClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.ProfilesClientListByBillingAccountOptions{Expand: 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.ProfileListResult = armbilling.ProfileListResult{ // Value: []*armbilling.Profile{ // { // Name: to.Ptr("11000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("BillingProfile1"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), // }, // }, // { // Name: to.Ptr("11000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeIndirectCustomer), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("BillingProfile2"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // IndirectRelationshipInfo: &armbilling.IndirectRelationshipInfo{ // BillingAccountName: to.Ptr("30000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), // BillingProfileName: to.Ptr("33000000-0000-0000-0000-000000000001"), // DisplayName: to.Ptr("Partner1"), // }, // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOff), // Status: to.Ptr(armbilling.BillingProfileStatusActive), // SystemID: to.Ptr("2XXX-22XX-XX1-XXXX-XXX"), // TargetClouds: []*armbilling.TargetCloud{ // }, // }, // }}, // } } }
Output:
Example (BillingProfilesListWithExpand) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListWithExpand.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewProfilesClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.ProfilesClientListByBillingAccountOptions{Expand: to.Ptr("invoiceSections")}) 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.ProfileListResult = armbilling.ProfileListResult{ // Value: []*armbilling.Profile{ // { // Name: to.Ptr("11000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("BillingProfile1"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ // HasMoreResults: to.Ptr(false), // Value: []*armbilling.InvoiceSection{ // { // Name: to.Ptr("invoiceSectionId1"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/invoiceSectionId1"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName1"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("9XXX-11XX-XX1-XXXX-XXX"), // }, // }}, // }, // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), // TargetClouds: []*armbilling.TargetCloud{ // }, // }, // }, // { // Name: to.Ptr("11000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.AddressDetails{ // AddressLine1: to.Ptr("Test Address1"), // AddressLine2: to.Ptr("Test Address2"), // AddressLine3: to.Ptr("Test Address3"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // Email: to.Ptr("abc@contoso.com"), // FirstName: to.Ptr("Test"), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeIndirectCustomer), // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("BillingProfile2"), // EnabledAzurePlans: []*armbilling.AzurePlan{ // { // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // }, // { // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // }}, // HasReadAccess: to.Ptr(true), // IndirectRelationshipInfo: &armbilling.IndirectRelationshipInfo{ // BillingAccountName: to.Ptr("30000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), // BillingProfileName: to.Ptr("33000000-0000-0000-0000-000000000001"), // DisplayName: to.Ptr("Partner1"), // }, // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ // HasMoreResults: to.Ptr(false), // Value: []*armbilling.InvoiceSection{ // { // Name: to.Ptr("invoiceSectionId2"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001/invoiceSections/invoiceSectionId2"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("invoiceSectionName2"), // Labels: map[string]*string{ // "costCategory": to.Ptr("Marketing"), // "pcCode": to.Ptr("Z223456"), // }, // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("9XXX-22XX-XX1-XXXX-XXX"), // }, // }}, // }, // PoNumber: to.Ptr("ABC12345"), // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), // SystemID: to.Ptr("2XXX-22XX-XX1-XXXX-XXX"), // TargetClouds: []*armbilling.TargetCloud{ // }, // }, // }}, // } } }
Output:
type ProfilesClientBeginCreateOrUpdateOptions ¶ added in v0.2.0
type ProfilesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.BeginCreateOrUpdate method.
type ProfilesClientCreateOrUpdateResponse ¶ added in v0.2.0
type ProfilesClientCreateOrUpdateResponse struct { // A billing profile. Profile }
ProfilesClientCreateOrUpdateResponse contains the response from method ProfilesClient.BeginCreateOrUpdate.
type ProfilesClientGetOptions ¶ added in v0.2.0
type ProfilesClientGetOptions struct { // May be used to expand the invoice sections. Expand *string }
ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method.
type ProfilesClientGetResponse ¶ added in v0.2.0
type ProfilesClientGetResponse struct { // A billing profile. Profile }
ProfilesClientGetResponse contains the response from method ProfilesClient.Get.
type ProfilesClientListByBillingAccountOptions ¶ added in v0.2.0
type ProfilesClientListByBillingAccountOptions struct { // May be used to expand the invoice sections. Expand *string }
ProfilesClientListByBillingAccountOptions contains the optional parameters for the ProfilesClient.NewListByBillingAccountPager method.
type ProfilesClientListByBillingAccountResponse ¶ added in v0.2.0
type ProfilesClientListByBillingAccountResponse struct { // The list of billing profiles. ProfileListResult }
ProfilesClientListByBillingAccountResponse contains the response from method ProfilesClient.NewListByBillingAccountPager.
type ProfilesOnExpand ¶ added in v0.2.0
type ProfilesOnExpand struct { // The billing profiles associated with the billing account. Value []*Profile // READ-ONLY; Indicates whether there are more billing profiles than the ones listed in this collection. The collection lists // a maximum of 50 billing profiles. To get all billing profiles, use the list billing // profiles API. HasMoreResults *bool }
ProfilesOnExpand - The billing profiles associated with the billing account. By default this is not populated, unless it's specified in $expand.
func (ProfilesOnExpand) MarshalJSON ¶ added in v0.2.0
func (p ProfilesOnExpand) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfilesOnExpand.
func (*ProfilesOnExpand) UnmarshalJSON ¶ added in v0.6.0
func (p *ProfilesOnExpand) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfilesOnExpand.
type Property ¶ added in v0.2.0
type Property struct { // A billing property. Properties *PropertyProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Property - A billing property.
func (Property) MarshalJSON ¶ added in v0.2.0
MarshalJSON implements the json.Marshaller interface for type Property.
func (*Property) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Property.
type PropertyClient ¶ added in v0.2.0
type PropertyClient struct {
// contains filtered or unexported fields
}
PropertyClient contains the methods for the BillingProperty group. Don't use this type directly, use NewPropertyClient() instead.
func NewPropertyClient ¶ added in v0.2.0
func NewPropertyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PropertyClient, error)
NewPropertyClient creates a new instance of PropertyClient with the specified values.
- subscriptionID - The ID that uniquely identifies an Azure subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PropertyClient) Get ¶ added in v0.2.0
func (client *PropertyClient) Get(ctx context.Context, options *PropertyClientGetOptions) (PropertyClientGetResponse, error)
Get - Get the billing properties for a subscription. This operation is not supported for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- options - PropertyClientGetOptions contains the optional parameters for the PropertyClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProperty.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPropertyClient().Get(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.Property = armbilling.Property{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingProperty"), // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default"), // Properties: &armbilling.PropertyProperties{ // AccountAdminNotificationEmailAddress: to.Ptr("test@contoso.com"), // BillingAccountDisplayName: to.Ptr("My Account"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000000"), // BillingProfileSpendingLimit: to.Ptr(armbilling.BillingProfileSpendingLimitOn), // BillingProfileStatus: to.Ptr(armbilling.BillingProfileStatusWarned), // BillingProfileStatusReasonCode: to.Ptr(armbilling.BillingProfileStatusReasonCodePastDue), // BillingTenantID: to.Ptr("90000000-0000-0000-0000-000000000011"), // CostCenter: to.Ptr("1010"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoice section"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), // IsAccountAdmin: to.Ptr(true), // ProductID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000/products/44000000-0000-0000-0000-000000000000"), // ProductName: to.Ptr("Standard Dev"), // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0001"), // }, // } }
Output:
func (*PropertyClient) Update ¶ added in v0.2.0
func (client *PropertyClient) Update(ctx context.Context, parameters Property, options *PropertyClientUpdateOptions) (PropertyClientUpdateResponse, error)
Update - Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- parameters - Request parameters that are provided to the update billing property operation.
- options - PropertyClientUpdateOptions contains the optional parameters for the PropertyClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingProperty.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPropertyClient().Update(ctx, armbilling.Property{ Properties: &armbilling.PropertyProperties{ CostCenter: to.Ptr("1010"), }, }, 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.Property = armbilling.Property{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingProperty"), // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default"), // Properties: &armbilling.PropertyProperties{ // AccountAdminNotificationEmailAddress: to.Ptr("test@contoso.com"), // BillingAccountDisplayName: to.Ptr("My Account"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000000"), // BillingProfileSpendingLimit: to.Ptr(armbilling.BillingProfileSpendingLimitOn), // BillingProfileStatus: to.Ptr(armbilling.BillingProfileStatusWarned), // BillingProfileStatusReasonCode: to.Ptr(armbilling.BillingProfileStatusReasonCodePastDue), // BillingTenantID: to.Ptr("90000000-0000-0000-0000-000000000011"), // CostCenter: to.Ptr("1010"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoice section"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), // IsAccountAdmin: to.Ptr(true), // ProductID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000/products/44000000-0000-0000-0000-000000000000"), // ProductName: to.Ptr("Standard Dev"), // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0001"), // }, // } }
Output:
type PropertyClientGetOptions ¶ added in v0.2.0
type PropertyClientGetOptions struct { }
PropertyClientGetOptions contains the optional parameters for the PropertyClient.Get method.
type PropertyClientGetResponse ¶ added in v0.2.0
type PropertyClientGetResponse struct { // A billing property. Property }
PropertyClientGetResponse contains the response from method PropertyClient.Get.
type PropertyClientUpdateOptions ¶ added in v0.2.0
type PropertyClientUpdateOptions struct { }
PropertyClientUpdateOptions contains the optional parameters for the PropertyClient.Update method.
type PropertyClientUpdateResponse ¶ added in v0.2.0
type PropertyClientUpdateResponse struct { // A billing property. Property }
PropertyClientUpdateResponse contains the response from method PropertyClient.Update.
type PropertyProperties ¶ added in v0.2.0
type PropertyProperties struct { // The cost center applied to the subscription. CostCenter *string // READ-ONLY; The email address on which the account admin gets all Azure notifications. AccountAdminNotificationEmailAddress *string // READ-ONLY; The name of the billing account to which the subscription is billed. BillingAccountDisplayName *string // READ-ONLY; The ID of the billing account to which the subscription is billed. BillingAccountID *string // READ-ONLY; The name of the billing profile to which the subscription is billed. BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile to which the subscription is billed. BillingProfileID *string // READ-ONLY; The billing profile spending limit. BillingProfileSpendingLimit *BillingProfileSpendingLimit // READ-ONLY; The status of the billing profile. BillingProfileStatus *BillingProfileStatus // READ-ONLY; Reason for the specified billing profile status. BillingProfileStatusReasonCode *BillingProfileStatusReasonCode // READ-ONLY; The Azure AD tenant ID of the billing account for the subscription. BillingTenantID *string // READ-ONLY; The name of the invoice section to which the subscription is billed. InvoiceSectionDisplayName *string // READ-ONLY; The ID of the invoice section to which the subscription is billed. InvoiceSectionID *string // READ-ONLY; Indicates whether user is the account admin. IsAccountAdmin *bool // READ-ONLY; The product ID of the Azure plan. ProductID *string // READ-ONLY; The product name of the Azure plan. ProductName *string // READ-ONLY; The sku description of the Azure plan for the subscription. SKUDescription *string // READ-ONLY; The sku ID of the Azure plan for the subscription. SKUID *string }
PropertyProperties - The billing property.
func (PropertyProperties) MarshalJSON ¶ added in v0.6.0
func (p PropertyProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PropertyProperties.
func (*PropertyProperties) UnmarshalJSON ¶ added in v0.6.0
func (p *PropertyProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PropertyProperties.
type RebillDetails ¶
type RebillDetails struct { // READ-ONLY; The ID of credit note. CreditNoteDocumentID *string // READ-ONLY; The ID of invoice. InvoiceDocumentID *string // READ-ONLY; Rebill details for an invoice. RebillDetails map[string]*RebillDetails }
RebillDetails - The rebill details of an invoice.
func (RebillDetails) MarshalJSON ¶
func (r RebillDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RebillDetails.
func (*RebillDetails) UnmarshalJSON ¶ added in v0.6.0
func (r *RebillDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RebillDetails.
type Reseller ¶
type Reseller struct { // READ-ONLY; The name of the reseller. Description *string // READ-ONLY; The MPN ID of the reseller. ResellerID *string }
Reseller - Details of the reseller.
func (Reseller) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Reseller.
func (*Reseller) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Reseller.
type Reservation ¶
type Reservation struct { // The properties associated to this reservation Properties *ReservationProperty // The sku information associated to this reservation SKU *ReservationSKUProperty // READ-ONLY; The id of the reservation. ID *string // READ-ONLY; The location of the reservation. Location *string // READ-ONLY; The name of the reservation. Name *string // READ-ONLY; The type of the reservation. Type *string }
Reservation - The definition of the reservation.
func (Reservation) MarshalJSON ¶ added in v0.6.0
func (r Reservation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Reservation.
func (*Reservation) UnmarshalJSON ¶ added in v0.6.0
func (r *Reservation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Reservation.
type ReservationProperty ¶
type ReservationProperty struct { // The array of applied scopes of a reservation. Will be null if the reservation is in Shared scope AppliedScopes []*string // READ-ONLY; The applied scope type of the reservation. AppliedScopeType *string // READ-ONLY; The display name of the reservation DisplayName *string // READ-ONLY; The provisioning state of the reservation for display, e.g. Succeeded DisplayProvisioningState *string // READ-ONLY; The effective date time of the reservation EffectiveDateTime *string // READ-ONLY; The expiry date of the reservation ExpiryDate *string // READ-ONLY; The provisioning state of the reservation, e.g. Succeeded ProvisioningState *string // READ-ONLY; The provisioning state of the reservation, e.g. Succeeded ProvisioningSubState *string // READ-ONLY; The number of the reservation. Quantity *float32 // READ-ONLY; The renew state of the reservation Renew *bool // READ-ONLY; The renew source of the reservation RenewSource *string // READ-ONLY; The reserved source type of the reservation, e.g. virtual machine. ReservedResourceType *string // READ-ONLY; The sku description of the reservation SKUDescription *string // READ-ONLY; The term of the reservation, e.g. P1Y Term *string // READ-ONLY; The applied scope type of the reservation for display, e.g. Shared UserFriendlyAppliedScopeType *string // READ-ONLY; The renew state of the reservation for display, e.g. On UserFriendlyRenewState *string // READ-ONLY; Reservation utilization Utilization *ReservationPropertyUtilization }
ReservationProperty - The property of reservation object.
func (ReservationProperty) MarshalJSON ¶
func (r ReservationProperty) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationProperty.
func (*ReservationProperty) UnmarshalJSON ¶ added in v0.6.0
func (r *ReservationProperty) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationProperty.
type ReservationPropertyUtilization ¶
type ReservationPropertyUtilization struct { // The array of aggregates of a reservation's utilization Aggregates []*ReservationUtilizationAggregates // READ-ONLY; The number of days trend for a reservation Trend *string }
ReservationPropertyUtilization - Reservation utilization
func (ReservationPropertyUtilization) MarshalJSON ¶
func (r ReservationPropertyUtilization) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationPropertyUtilization.
func (*ReservationPropertyUtilization) UnmarshalJSON ¶ added in v0.6.0
func (r *ReservationPropertyUtilization) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationPropertyUtilization.
type ReservationPurchasesPolicy ¶
type ReservationPurchasesPolicy string
ReservationPurchasesPolicy - The policy that controls whether Azure reservation purchases are allowed for a billing profile.
const ( ReservationPurchasesPolicyAllowed ReservationPurchasesPolicy = "Allowed" ReservationPurchasesPolicyNotAllowed ReservationPurchasesPolicy = "NotAllowed" )
func PossibleReservationPurchasesPolicyValues ¶
func PossibleReservationPurchasesPolicyValues() []ReservationPurchasesPolicy
PossibleReservationPurchasesPolicyValues returns the possible values for the ReservationPurchasesPolicy const type.
type ReservationSKUProperty ¶
type ReservationSKUProperty struct { // READ-ONLY; The name of the reservation sku. Name *string }
ReservationSKUProperty - The property of reservation sku object.
func (ReservationSKUProperty) MarshalJSON ¶ added in v0.6.0
func (r ReservationSKUProperty) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationSKUProperty.
func (*ReservationSKUProperty) UnmarshalJSON ¶ added in v0.6.0
func (r *ReservationSKUProperty) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationSKUProperty.
type ReservationSummary ¶
type ReservationSummary struct { // READ-ONLY; The number of reservation in Cancelled state CancelledCount *float32 // READ-ONLY; The number of reservation in Expired state ExpiredCount *float32 // READ-ONLY; The number of reservation in Expiring state ExpiringCount *float32 // READ-ONLY; The number of reservation in Failed state FailedCount *float32 // READ-ONLY; The number of reservation in Pending state PendingCount *float32 // READ-ONLY; The number of reservation in Succeeded state SucceededCount *float32 }
ReservationSummary - The roll up count summary of reservations in each state
func (ReservationSummary) MarshalJSON ¶ added in v0.6.0
func (r ReservationSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationSummary.
func (*ReservationSummary) UnmarshalJSON ¶ added in v0.6.0
func (r *ReservationSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationSummary.
type ReservationType ¶
type ReservationType string
ReservationType - The type of transaction.
const ( ReservationTypePurchase ReservationType = "Purchase" ReservationTypeUsageCharge ReservationType = "Usage Charge" )
func PossibleReservationTypeValues ¶
func PossibleReservationTypeValues() []ReservationType
PossibleReservationTypeValues returns the possible values for the ReservationType const type.
type ReservationUtilizationAggregates ¶
type ReservationUtilizationAggregates struct { // READ-ONLY; The grain of the aggregate Grain *float32 // READ-ONLY; The grain unit of the aggregate GrainUnit *string // READ-ONLY; The aggregate value Value *float32 // READ-ONLY; The aggregate value unit ValueUnit *string }
ReservationUtilizationAggregates - The aggregate values of reservation utilization
func (ReservationUtilizationAggregates) MarshalJSON ¶ added in v0.6.0
func (r ReservationUtilizationAggregates) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationUtilizationAggregates.
func (*ReservationUtilizationAggregates) UnmarshalJSON ¶ added in v0.6.0
func (r *ReservationUtilizationAggregates) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationUtilizationAggregates.
type ReservationsClient ¶
type ReservationsClient struct {
// contains filtered or unexported fields
}
ReservationsClient contains the methods for the Reservations group. Don't use this type directly, use NewReservationsClient() instead.
func NewReservationsClient ¶
func NewReservationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationsClient, error)
NewReservationsClient creates a new instance of ReservationsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ReservationsClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *ReservationsClient) NewListByBillingAccountPager(billingAccountName string, options *ReservationsClientListByBillingAccountOptions) *runtime.Pager[ReservationsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - ReservationsClientListByBillingAccountOptions contains the optional parameters for the ReservationsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingAccount.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewReservationsClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.ReservationsClientListByBillingAccountOptions{Filter: to.Ptr("properties/reservedResourceType eq 'VirtualMachines'"), Orderby: to.Ptr("properties/userFriendlyAppliedScopeType asc"), RefreshSummary: nil, SelectedState: to.Ptr("Succeeded"), }) 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.ReservationsListResult = armbilling.ReservationsListResult{ // Summary: &armbilling.ReservationSummary{ // CancelledCount: to.Ptr[float32](0), // ExpiredCount: to.Ptr[float32](0), // ExpiringCount: to.Ptr[float32](0), // FailedCount: to.Ptr[float32](0), // PendingCount: to.Ptr[float32](0), // SucceededCount: to.Ptr[float32](1), // }, // Value: []*armbilling.Reservation{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000001/00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"), // ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/00000000-0000-0000-0000-000000000001/reservations/00000000-0000-0000-0000-000000000000"), // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationProperty{ // AppliedScopeType: to.Ptr("Shared"), // DisplayName: to.Ptr("VM_RI_07-21-2020_12-06"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr("0001-01-01T00:00:00"), // ExpiryDate: to.Ptr("2023-07-21"), // ProvisioningState: to.Ptr("Succeeded"), // Quantity: to.Ptr[float32](2), // Renew: to.Ptr(false), // ReservedResourceType: to.Ptr("VirtualMachines"), // UserFriendlyAppliedScopeType: to.Ptr("Shared"), // UserFriendlyRenewState: to.Ptr("Off"), // Utilization: &armbilling.ReservationPropertyUtilization{ // Aggregates: []*armbilling.ReservationUtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0.05), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0.05), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0.05), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("UP"), // }, // }, // SKU: &armbilling.ReservationSKUProperty{ // Name: to.Ptr("Standard_D1"), // }, // }}, // } } }
Output:
func (*ReservationsClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *ReservationsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *ReservationsClientListByBillingProfileOptions) *runtime.Pager[ReservationsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - ReservationsClientListByBillingProfileOptions contains the optional parameters for the ReservationsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingProfile.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewReservationsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", &armbilling.ReservationsClientListByBillingProfileOptions{Filter: to.Ptr("properties/reservedResourceType eq 'VirtualMachines'"), Orderby: to.Ptr("properties/userFriendlyAppliedScopeType asc"), RefreshSummary: nil, SelectedState: to.Ptr("Succeeded"), }) 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.ReservationsListResult = armbilling.ReservationsListResult{ // Summary: &armbilling.ReservationSummary{ // CancelledCount: to.Ptr[float32](0), // ExpiredCount: to.Ptr[float32](0), // ExpiringCount: to.Ptr[float32](0), // FailedCount: to.Ptr[float32](0), // PendingCount: to.Ptr[float32](0), // SucceededCount: to.Ptr[float32](1), // }, // Value: []*armbilling.Reservation{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000001/00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"), // ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/00000000-0000-0000-0000-000000000001/reservations/00000000-0000-0000-0000-000000000000"), // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationProperty{ // AppliedScopeType: to.Ptr("Shared"), // DisplayName: to.Ptr("VM_RI_07-21-2020_12-06"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr("0001-01-01T00:00:00"), // ExpiryDate: to.Ptr("2023-07-21"), // ProvisioningState: to.Ptr("Succeeded"), // Quantity: to.Ptr[float32](2), // Renew: to.Ptr(false), // RenewSource: to.Ptr("/providers/Microsoft.Capacity/reservationorders/00000000-0000-0000-0000-000000000002/reservations/00000000-0000-0000-0000-000000000003"), // ReservedResourceType: to.Ptr("VirtualMachines"), // UserFriendlyAppliedScopeType: to.Ptr("Shared"), // UserFriendlyRenewState: to.Ptr("Off"), // Utilization: &armbilling.ReservationPropertyUtilization{ // Aggregates: []*armbilling.ReservationUtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0.05), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0.05), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0.05), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("UP"), // }, // }, // SKU: &armbilling.ReservationSKUProperty{ // Name: to.Ptr("Standard_D1"), // }, // }}, // } } }
Output:
type ReservationsClientListByBillingAccountOptions ¶ added in v0.2.0
type ReservationsClientListByBillingAccountOptions struct { // May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support // 'ne', 'gt', 'le', 'ge', or 'not'. Filter *string // May be used to sort order by reservation properties. Orderby *string // To indicate whether to refresh the roll up counts of the reservations group by provisioning states RefreshSummary *string // The selected provisioning state SelectedState *string }
ReservationsClientListByBillingAccountOptions contains the optional parameters for the ReservationsClient.NewListByBillingAccountPager method.
type ReservationsClientListByBillingAccountResponse ¶ added in v0.2.0
type ReservationsClientListByBillingAccountResponse struct { // The list of reservations and summary of roll out count of reservations in each state. ReservationsListResult }
ReservationsClientListByBillingAccountResponse contains the response from method ReservationsClient.NewListByBillingAccountPager.
type ReservationsClientListByBillingProfileOptions ¶ added in v0.2.0
type ReservationsClientListByBillingProfileOptions struct { // May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support // 'ne', 'gt', 'le', 'ge', or 'not'. Filter *string // May be used to sort order by reservation properties. Orderby *string // To indicate whether to refresh the roll up counts of the reservations group by provisioning state RefreshSummary *string // The selected provisioning state SelectedState *string }
ReservationsClientListByBillingProfileOptions contains the optional parameters for the ReservationsClient.NewListByBillingProfilePager method.
type ReservationsClientListByBillingProfileResponse ¶ added in v0.2.0
type ReservationsClientListByBillingProfileResponse struct { // The list of reservations and summary of roll out count of reservations in each state. ReservationsListResult }
ReservationsClientListByBillingProfileResponse contains the response from method ReservationsClient.NewListByBillingProfilePager.
type ReservationsListResult ¶
type ReservationsListResult struct { // The roll out count summary of the reservations Summary *ReservationSummary // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of reservations. Value []*Reservation }
ReservationsListResult - The list of reservations and summary of roll out count of reservations in each state.
func (ReservationsListResult) MarshalJSON ¶
func (r ReservationsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationsListResult.
func (*ReservationsListResult) UnmarshalJSON ¶ added in v0.6.0
func (r *ReservationsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationsListResult.
type Resource ¶
type Resource struct { // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Resource - The Resource model definition.
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type RoleAssignment ¶ added in v0.2.0
type RoleAssignment struct { // The properties of the role assignment. Properties *RoleAssignmentProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
RoleAssignment - The role assignment
func (RoleAssignment) MarshalJSON ¶ added in v0.6.0
func (r RoleAssignment) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleAssignment.
func (*RoleAssignment) UnmarshalJSON ¶ added in v0.6.0
func (r *RoleAssignment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleAssignment.
type RoleAssignmentListResult ¶ added in v0.2.0
type RoleAssignmentListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of role assignments. Value []*RoleAssignment }
RoleAssignmentListResult - The list of role assignments.
func (RoleAssignmentListResult) MarshalJSON ¶ added in v0.2.0
func (r RoleAssignmentListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleAssignmentListResult.
func (*RoleAssignmentListResult) UnmarshalJSON ¶ added in v0.6.0
func (r *RoleAssignmentListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleAssignmentListResult.
type RoleAssignmentProperties ¶ added in v0.2.0
type RoleAssignmentProperties struct { // The principal id of the user to whom the role was assigned. PrincipalID *string // The principal tenant id of the user to whom the role was assigned. PrincipalTenantID *string // The ID of the role definition. RoleDefinitionID *string // The authentication type. UserAuthenticationType *string // The email address of the user. UserEmailAddress *string // READ-ONLY; The principal Id of the user who created the role assignment. CreatedByPrincipalID *string // READ-ONLY; The tenant Id of the user who created the role assignment. CreatedByPrincipalTenantID *string // READ-ONLY; The email address of the user who created the role assignment. CreatedByUserEmailAddress *string // READ-ONLY; The date the role assignment was created. CreatedOn *string // READ-ONLY; The scope at which the role was assigned. Scope *string }
RoleAssignmentProperties - The properties of the role assignment.
func (RoleAssignmentProperties) MarshalJSON ¶ added in v0.6.0
func (r RoleAssignmentProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleAssignmentProperties.
func (*RoleAssignmentProperties) UnmarshalJSON ¶ added in v0.6.0
func (r *RoleAssignmentProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleAssignmentProperties.
type RoleAssignmentsClient ¶ added in v0.2.0
type RoleAssignmentsClient struct {
// contains filtered or unexported fields
}
RoleAssignmentsClient contains the methods for the BillingRoleAssignments group. Don't use this type directly, use NewRoleAssignmentsClient() instead.
func NewRoleAssignmentsClient ¶ added in v0.2.0
func NewRoleAssignmentsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*RoleAssignmentsClient, error)
NewRoleAssignmentsClient creates a new instance of RoleAssignmentsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*RoleAssignmentsClient) DeleteByBillingAccount ¶ added in v0.2.0
func (client *RoleAssignmentsClient) DeleteByBillingAccount(ctx context.Context, billingAccountName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByBillingAccountOptions) (RoleAssignmentsClientDeleteByBillingAccountResponse, error)
DeleteByBillingAccount - Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientDeleteByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRoleAssignmentsClient().DeleteByBillingAccount(ctx, "{billingAccountName}", "{billingRoleAssignmentName}", 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), // }, // } }
Output:
func (*RoleAssignmentsClient) DeleteByBillingProfile ¶ added in v0.2.0
func (client *RoleAssignmentsClient) DeleteByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByBillingProfileOptions) (RoleAssignmentsClientDeleteByBillingProfileResponse, error)
DeleteByBillingProfile - Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientDeleteByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRoleAssignmentsClient().DeleteByBillingProfile(ctx, "{billingAccountName}", "{billingProfileName}", "{billingRoleAssignmentName}", 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:58:19.9073876+00:00"), // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // }, // } }
Output:
func (*RoleAssignmentsClient) DeleteByInvoiceSection ¶ added in v0.2.0
func (client *RoleAssignmentsClient) DeleteByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByInvoiceSectionOptions) (RoleAssignmentsClientDeleteByInvoiceSectionResponse, error)
DeleteByInvoiceSection - Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- invoiceSectionName - The ID that uniquely identifies an invoice section.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientDeleteByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByInvoiceSection method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRoleAssignmentsClient().DeleteByInvoiceSection(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{billingRoleAssignmentName}", 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // }, // } }
Output:
func (*RoleAssignmentsClient) GetByBillingAccount ¶ added in v0.2.0
func (client *RoleAssignmentsClient) GetByBillingAccount(ctx context.Context, billingAccountName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByBillingAccountOptions) (RoleAssignmentsClientGetByBillingAccountResponse, error)
GetByBillingAccount - Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientGetByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.GetByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignment.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRoleAssignmentsClient().GetByBillingAccount(ctx, "{billingAccountName}", "{billingRoleAssignmentId}", 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), // }, // } }
Output:
func (*RoleAssignmentsClient) GetByBillingProfile ¶ added in v0.2.0
func (client *RoleAssignmentsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByBillingProfileOptions) (RoleAssignmentsClientGetByBillingProfileResponse, error)
GetByBillingProfile - Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientGetByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.GetByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignment.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRoleAssignmentsClient().GetByBillingProfile(ctx, "{billingAccountName}", "{billingProfileName}", "{billingRoleAssignmentName}", 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:58:19.9073876+00:00"), // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // }, // } }
Output:
func (*RoleAssignmentsClient) GetByInvoiceSection ¶ added in v0.2.0
func (client *RoleAssignmentsClient) GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByInvoiceSectionOptions) (RoleAssignmentsClientGetByInvoiceSectionResponse, error)
GetByInvoiceSection - Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- invoiceSectionName - The ID that uniquely identifies an invoice section.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientGetByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.GetByInvoiceSection method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignment.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRoleAssignmentsClient().GetByInvoiceSection(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{billingRoleAssignmentName}", 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // }, // } }
Output:
func (*RoleAssignmentsClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *RoleAssignmentsClient) NewListByBillingAccountPager(billingAccountName string, options *RoleAssignmentsClientListByBillingAccountOptions) *runtime.Pager[RoleAssignmentsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - RoleAssignmentsClientListByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewRoleAssignmentsClient().NewListByBillingAccountPager("{billingAccountName}", 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.RoleAssignmentListResult = armbilling.RoleAssignmentListResult{ // Value: []*armbilling.RoleAssignment{ // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), // }, // }, // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:58:19.9073876+00:00"), // PrincipalID: to.Ptr("b1839933-b3ac-42ca-8112-d29c43f3ab47"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), // }, // }}, // } } }
Output:
func (*RoleAssignmentsClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *RoleAssignmentsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *RoleAssignmentsClientListByBillingProfileOptions) *runtime.Pager[RoleAssignmentsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - RoleAssignmentsClientListByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewRoleAssignmentsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.RoleAssignmentListResult = armbilling.RoleAssignmentListResult{ // Value: []*armbilling.RoleAssignment{ // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // }, // }, // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/10000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:58:19.9073876+00:00"), // PrincipalID: to.Ptr("b1839933-b3ac-42ca-8112-d29c43f3ab47"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // }, // }}, // } } }
Output:
func (*RoleAssignmentsClient) NewListByInvoiceSectionPager ¶ added in v0.4.0
func (client *RoleAssignmentsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *RoleAssignmentsClientListByInvoiceSectionOptions) *runtime.Pager[RoleAssignmentsClientListByInvoiceSectionResponse]
NewListByInvoiceSectionPager - Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- invoiceSectionName - The ID that uniquely identifies an invoice section.
- options - RoleAssignmentsClientListByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.NewListByInvoiceSectionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewRoleAssignmentsClient().NewListByInvoiceSectionPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", 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.RoleAssignmentListResult = armbilling.RoleAssignmentListResult{ // Value: []*armbilling.RoleAssignment{ // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // }, // }, // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // CreatedOn: to.Ptr("2018-06-21T21:58:19.9073876+00:00"), // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // }, // }}, // } } }
Output:
type RoleAssignmentsClientDeleteByBillingAccountOptions ¶ added in v0.2.0
type RoleAssignmentsClientDeleteByBillingAccountOptions struct { }
RoleAssignmentsClientDeleteByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByBillingAccount method.
type RoleAssignmentsClientDeleteByBillingAccountResponse ¶ added in v0.2.0
type RoleAssignmentsClientDeleteByBillingAccountResponse struct { // The role assignment RoleAssignment }
RoleAssignmentsClientDeleteByBillingAccountResponse contains the response from method RoleAssignmentsClient.DeleteByBillingAccount.
type RoleAssignmentsClientDeleteByBillingProfileOptions ¶ added in v0.2.0
type RoleAssignmentsClientDeleteByBillingProfileOptions struct { }
RoleAssignmentsClientDeleteByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByBillingProfile method.
type RoleAssignmentsClientDeleteByBillingProfileResponse ¶ added in v0.2.0
type RoleAssignmentsClientDeleteByBillingProfileResponse struct { // The role assignment RoleAssignment }
RoleAssignmentsClientDeleteByBillingProfileResponse contains the response from method RoleAssignmentsClient.DeleteByBillingProfile.
type RoleAssignmentsClientDeleteByInvoiceSectionOptions ¶ added in v0.2.0
type RoleAssignmentsClientDeleteByInvoiceSectionOptions struct { }
RoleAssignmentsClientDeleteByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByInvoiceSection method.
type RoleAssignmentsClientDeleteByInvoiceSectionResponse ¶ added in v0.2.0
type RoleAssignmentsClientDeleteByInvoiceSectionResponse struct { // The role assignment RoleAssignment }
RoleAssignmentsClientDeleteByInvoiceSectionResponse contains the response from method RoleAssignmentsClient.DeleteByInvoiceSection.
type RoleAssignmentsClientGetByBillingAccountOptions ¶ added in v0.2.0
type RoleAssignmentsClientGetByBillingAccountOptions struct { }
RoleAssignmentsClientGetByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.GetByBillingAccount method.
type RoleAssignmentsClientGetByBillingAccountResponse ¶ added in v0.2.0
type RoleAssignmentsClientGetByBillingAccountResponse struct { // The role assignment RoleAssignment }
RoleAssignmentsClientGetByBillingAccountResponse contains the response from method RoleAssignmentsClient.GetByBillingAccount.
type RoleAssignmentsClientGetByBillingProfileOptions ¶ added in v0.2.0
type RoleAssignmentsClientGetByBillingProfileOptions struct { }
RoleAssignmentsClientGetByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.GetByBillingProfile method.
type RoleAssignmentsClientGetByBillingProfileResponse ¶ added in v0.2.0
type RoleAssignmentsClientGetByBillingProfileResponse struct { // The role assignment RoleAssignment }
RoleAssignmentsClientGetByBillingProfileResponse contains the response from method RoleAssignmentsClient.GetByBillingProfile.
type RoleAssignmentsClientGetByInvoiceSectionOptions ¶ added in v0.2.0
type RoleAssignmentsClientGetByInvoiceSectionOptions struct { }
RoleAssignmentsClientGetByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.GetByInvoiceSection method.
type RoleAssignmentsClientGetByInvoiceSectionResponse ¶ added in v0.2.0
type RoleAssignmentsClientGetByInvoiceSectionResponse struct { // The role assignment RoleAssignment }
RoleAssignmentsClientGetByInvoiceSectionResponse contains the response from method RoleAssignmentsClient.GetByInvoiceSection.
type RoleAssignmentsClientListByBillingAccountOptions ¶ added in v0.2.0
type RoleAssignmentsClientListByBillingAccountOptions struct { }
RoleAssignmentsClientListByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.NewListByBillingAccountPager method.
type RoleAssignmentsClientListByBillingAccountResponse ¶ added in v0.2.0
type RoleAssignmentsClientListByBillingAccountResponse struct { // The list of role assignments. RoleAssignmentListResult }
RoleAssignmentsClientListByBillingAccountResponse contains the response from method RoleAssignmentsClient.NewListByBillingAccountPager.
type RoleAssignmentsClientListByBillingProfileOptions ¶ added in v0.2.0
type RoleAssignmentsClientListByBillingProfileOptions struct { }
RoleAssignmentsClientListByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.NewListByBillingProfilePager method.
type RoleAssignmentsClientListByBillingProfileResponse ¶ added in v0.2.0
type RoleAssignmentsClientListByBillingProfileResponse struct { // The list of role assignments. RoleAssignmentListResult }
RoleAssignmentsClientListByBillingProfileResponse contains the response from method RoleAssignmentsClient.NewListByBillingProfilePager.
type RoleAssignmentsClientListByInvoiceSectionOptions ¶ added in v0.2.0
type RoleAssignmentsClientListByInvoiceSectionOptions struct { }
RoleAssignmentsClientListByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.NewListByInvoiceSectionPager method.
type RoleAssignmentsClientListByInvoiceSectionResponse ¶ added in v0.2.0
type RoleAssignmentsClientListByInvoiceSectionResponse struct { // The list of role assignments. RoleAssignmentListResult }
RoleAssignmentsClientListByInvoiceSectionResponse contains the response from method RoleAssignmentsClient.NewListByInvoiceSectionPager.
type RoleDefinition ¶ added in v0.2.0
type RoleDefinition struct { // The properties of the a role definition. Properties *RoleDefinitionProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
RoleDefinition - The properties of a role definition.
func (RoleDefinition) MarshalJSON ¶ added in v0.6.0
func (r RoleDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleDefinition.
func (*RoleDefinition) UnmarshalJSON ¶ added in v0.6.0
func (r *RoleDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleDefinition.
type RoleDefinitionListResult ¶ added in v0.2.0
type RoleDefinitionListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The role definitions. Value []*RoleDefinition }
RoleDefinitionListResult - The list of role definitions.
func (RoleDefinitionListResult) MarshalJSON ¶ added in v0.2.0
func (r RoleDefinitionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleDefinitionListResult.
func (*RoleDefinitionListResult) UnmarshalJSON ¶ added in v0.6.0
func (r *RoleDefinitionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleDefinitionListResult.
type RoleDefinitionProperties ¶ added in v0.2.0
type RoleDefinitionProperties struct { // The billingPermissions the role has Permissions []*PermissionsProperties // READ-ONLY; The role description Description *string // READ-ONLY; The name of the role RoleName *string }
RoleDefinitionProperties - The properties of the a role definition.
func (RoleDefinitionProperties) MarshalJSON ¶ added in v0.2.0
func (r RoleDefinitionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleDefinitionProperties.
func (*RoleDefinitionProperties) UnmarshalJSON ¶ added in v0.6.0
func (r *RoleDefinitionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleDefinitionProperties.
type RoleDefinitionsClient ¶ added in v0.2.0
type RoleDefinitionsClient struct {
// contains filtered or unexported fields
}
RoleDefinitionsClient contains the methods for the BillingRoleDefinitions group. Don't use this type directly, use NewRoleDefinitionsClient() instead.
func NewRoleDefinitionsClient ¶ added in v0.2.0
func NewRoleDefinitionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*RoleDefinitionsClient, error)
NewRoleDefinitionsClient creates a new instance of RoleDefinitionsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*RoleDefinitionsClient) GetByBillingAccount ¶ added in v0.2.0
func (client *RoleDefinitionsClient) GetByBillingAccount(ctx context.Context, billingAccountName string, billingRoleDefinitionName string, options *RoleDefinitionsClientGetByBillingAccountOptions) (RoleDefinitionsClientGetByBillingAccountResponse, error)
GetByBillingAccount - Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingRoleDefinitionName - The ID that uniquely identifies a role definition.
- options - RoleDefinitionsClientGetByBillingAccountOptions contains the optional parameters for the RoleDefinitionsClient.GetByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinition.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRoleDefinitionsClient().GetByBillingAccount(ctx, "{billingAccountName}", "{billingRoleDefinitionName}", 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.RoleDefinition = armbilling.RoleDefinition{ // Name: to.Ptr("{billingRoleDefinitionName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the billing account."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Billing acount owner"), // }, // } }
Output:
func (*RoleDefinitionsClient) GetByBillingProfile ¶ added in v0.2.0
func (client *RoleDefinitionsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleDefinitionName string, options *RoleDefinitionsClientGetByBillingProfileOptions) (RoleDefinitionsClientGetByBillingProfileResponse, error)
GetByBillingProfile - Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- billingRoleDefinitionName - The ID that uniquely identifies a role definition.
- options - RoleDefinitionsClientGetByBillingProfileOptions contains the optional parameters for the RoleDefinitionsClient.GetByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinition.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRoleDefinitionsClient().GetByBillingProfile(ctx, "{billingAccountName}", "{billingProfileName}", "{billingRoleDefinitionName}", 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.RoleDefinition = armbilling.RoleDefinition{ // Name: to.Ptr("{billingRoleDefinitionName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the billing profile."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Billing profile owner"), // }, // } }
Output:
func (*RoleDefinitionsClient) GetByInvoiceSection ¶ added in v0.2.0
func (client *RoleDefinitionsClient) GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleDefinitionName string, options *RoleDefinitionsClientGetByInvoiceSectionOptions) (RoleDefinitionsClientGetByInvoiceSectionResponse, error)
GetByInvoiceSection - Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- invoiceSectionName - The ID that uniquely identifies an invoice section.
- billingRoleDefinitionName - The ID that uniquely identifies a role definition.
- options - RoleDefinitionsClientGetByInvoiceSectionOptions contains the optional parameters for the RoleDefinitionsClient.GetByInvoiceSection method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinition.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRoleDefinitionsClient().GetByInvoiceSection(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{billingRoleDefinitionName}", 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.RoleDefinition = armbilling.RoleDefinition{ // Name: to.Ptr("{billingRoleDefinitionName}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the invoice section."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Invoice section owner"), // }, // } }
Output:
func (*RoleDefinitionsClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *RoleDefinitionsClient) NewListByBillingAccountPager(billingAccountName string, options *RoleDefinitionsClientListByBillingAccountOptions) *runtime.Pager[RoleDefinitionsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - RoleDefinitionsClientListByBillingAccountOptions contains the optional parameters for the RoleDefinitionsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinitionsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewRoleDefinitionsClient().NewListByBillingAccountPager("{billingAccountName}", 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.RoleDefinitionListResult = armbilling.RoleDefinitionListResult{ // Value: []*armbilling.RoleDefinition{ // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the billing account."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Billing account owner"), // }, // }, // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000001"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Contributor role give the user all permissions except access management rights to the billing account."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Billing account contributor"), // }, // }, // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000002"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Reader role gives the user read only access to the billing account."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Billing account reader"), // }, // }, // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000003"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000003"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Signatory role can sign agreements on behalf of the customer."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Signatory"), // }, // }}, // } } }
Output:
func (*RoleDefinitionsClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *RoleDefinitionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *RoleDefinitionsClientListByBillingProfileOptions) *runtime.Pager[RoleDefinitionsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - RoleDefinitionsClientListByBillingProfileOptions contains the optional parameters for the RoleDefinitionsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinitionsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewRoleDefinitionsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.RoleDefinitionListResult = armbilling.RoleDefinitionListResult{ // Value: []*armbilling.RoleDefinition{ // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the billing profile."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Billing profile owner"), // }, // }, // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000001"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Contributor role give the user all permissions except access management rights to the billing profile."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Billing profile contributor"), // }, // }}, // } } }
Output:
func (*RoleDefinitionsClient) NewListByInvoiceSectionPager ¶ added in v0.4.0
func (client *RoleDefinitionsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *RoleDefinitionsClientListByInvoiceSectionOptions) *runtime.Pager[RoleDefinitionsClientListByInvoiceSectionResponse]
NewListByInvoiceSectionPager - Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- invoiceSectionName - The ID that uniquely identifies an invoice section.
- options - RoleDefinitionsClientListByInvoiceSectionOptions contains the optional parameters for the RoleDefinitionsClient.NewListByInvoiceSectionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinitionsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewRoleDefinitionsClient().NewListByInvoiceSectionPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", 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.RoleDefinitionListResult = armbilling.RoleDefinitionListResult{ // Value: []*armbilling.RoleDefinition{ // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the invoice section."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Invoice section owner"), // }, // }, // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000001"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Contributor role give the user all permissions except access management rights to the invoice section."), // Permissions: []*armbilling.PermissionsProperties{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Invoice section contributor"), // }, // }}, // } } }
Output:
type RoleDefinitionsClientGetByBillingAccountOptions ¶ added in v0.2.0
type RoleDefinitionsClientGetByBillingAccountOptions struct { }
RoleDefinitionsClientGetByBillingAccountOptions contains the optional parameters for the RoleDefinitionsClient.GetByBillingAccount method.
type RoleDefinitionsClientGetByBillingAccountResponse ¶ added in v0.2.0
type RoleDefinitionsClientGetByBillingAccountResponse struct { // The properties of a role definition. RoleDefinition }
RoleDefinitionsClientGetByBillingAccountResponse contains the response from method RoleDefinitionsClient.GetByBillingAccount.
type RoleDefinitionsClientGetByBillingProfileOptions ¶ added in v0.2.0
type RoleDefinitionsClientGetByBillingProfileOptions struct { }
RoleDefinitionsClientGetByBillingProfileOptions contains the optional parameters for the RoleDefinitionsClient.GetByBillingProfile method.
type RoleDefinitionsClientGetByBillingProfileResponse ¶ added in v0.2.0
type RoleDefinitionsClientGetByBillingProfileResponse struct { // The properties of a role definition. RoleDefinition }
RoleDefinitionsClientGetByBillingProfileResponse contains the response from method RoleDefinitionsClient.GetByBillingProfile.
type RoleDefinitionsClientGetByInvoiceSectionOptions ¶ added in v0.2.0
type RoleDefinitionsClientGetByInvoiceSectionOptions struct { }
RoleDefinitionsClientGetByInvoiceSectionOptions contains the optional parameters for the RoleDefinitionsClient.GetByInvoiceSection method.
type RoleDefinitionsClientGetByInvoiceSectionResponse ¶ added in v0.2.0
type RoleDefinitionsClientGetByInvoiceSectionResponse struct { // The properties of a role definition. RoleDefinition }
RoleDefinitionsClientGetByInvoiceSectionResponse contains the response from method RoleDefinitionsClient.GetByInvoiceSection.
type RoleDefinitionsClientListByBillingAccountOptions ¶ added in v0.2.0
type RoleDefinitionsClientListByBillingAccountOptions struct { }
RoleDefinitionsClientListByBillingAccountOptions contains the optional parameters for the RoleDefinitionsClient.NewListByBillingAccountPager method.
type RoleDefinitionsClientListByBillingAccountResponse ¶ added in v0.2.0
type RoleDefinitionsClientListByBillingAccountResponse struct { // The list of role definitions. RoleDefinitionListResult }
RoleDefinitionsClientListByBillingAccountResponse contains the response from method RoleDefinitionsClient.NewListByBillingAccountPager.
type RoleDefinitionsClientListByBillingProfileOptions ¶ added in v0.2.0
type RoleDefinitionsClientListByBillingProfileOptions struct { }
RoleDefinitionsClientListByBillingProfileOptions contains the optional parameters for the RoleDefinitionsClient.NewListByBillingProfilePager method.
type RoleDefinitionsClientListByBillingProfileResponse ¶ added in v0.2.0
type RoleDefinitionsClientListByBillingProfileResponse struct { // The list of role definitions. RoleDefinitionListResult }
RoleDefinitionsClientListByBillingProfileResponse contains the response from method RoleDefinitionsClient.NewListByBillingProfilePager.
type RoleDefinitionsClientListByInvoiceSectionOptions ¶ added in v0.2.0
type RoleDefinitionsClientListByInvoiceSectionOptions struct { }
RoleDefinitionsClientListByInvoiceSectionOptions contains the optional parameters for the RoleDefinitionsClient.NewListByInvoiceSectionPager method.
type RoleDefinitionsClientListByInvoiceSectionResponse ¶ added in v0.2.0
type RoleDefinitionsClientListByInvoiceSectionResponse struct { // The list of role definitions. RoleDefinitionListResult }
RoleDefinitionsClientListByInvoiceSectionResponse contains the response from method RoleDefinitionsClient.NewListByInvoiceSectionPager.
type SpendingLimit ¶
type SpendingLimit string
SpendingLimit - The billing profile spending limit.
const ( SpendingLimitOff SpendingLimit = "Off" SpendingLimitOn SpendingLimit = "On" )
func PossibleSpendingLimitValues ¶
func PossibleSpendingLimitValues() []SpendingLimit
PossibleSpendingLimitValues returns the possible values for the SpendingLimit const type.
type SpendingLimitForBillingProfile ¶
type SpendingLimitForBillingProfile string
SpendingLimitForBillingProfile - The billing profile spending limit.
const ( SpendingLimitForBillingProfileOff SpendingLimitForBillingProfile = "Off" SpendingLimitForBillingProfileOn SpendingLimitForBillingProfile = "On" )
func PossibleSpendingLimitForBillingProfileValues ¶
func PossibleSpendingLimitForBillingProfileValues() []SpendingLimitForBillingProfile
PossibleSpendingLimitForBillingProfileValues returns the possible values for the SpendingLimitForBillingProfile const type.
type StatusReasonCode ¶
type StatusReasonCode string
StatusReasonCode - Reason for the specified billing profile status.
const ( StatusReasonCodePastDue StatusReasonCode = "PastDue" StatusReasonCodeSpendingLimitExpired StatusReasonCode = "SpendingLimitExpired" StatusReasonCodeSpendingLimitReached StatusReasonCode = "SpendingLimitReached" )
func PossibleStatusReasonCodeValues ¶
func PossibleStatusReasonCodeValues() []StatusReasonCode
PossibleStatusReasonCodeValues returns the possible values for the StatusReasonCode const type.
type StatusReasonCodeForBillingProfile ¶
type StatusReasonCodeForBillingProfile string
StatusReasonCodeForBillingProfile - Reason for the specified billing profile status.
const ( StatusReasonCodeForBillingProfilePastDue StatusReasonCodeForBillingProfile = "PastDue" StatusReasonCodeForBillingProfileSpendingLimitExpired StatusReasonCodeForBillingProfile = "SpendingLimitExpired" StatusReasonCodeForBillingProfileSpendingLimitReached StatusReasonCodeForBillingProfile = "SpendingLimitReached" )
func PossibleStatusReasonCodeForBillingProfileValues ¶
func PossibleStatusReasonCodeForBillingProfileValues() []StatusReasonCodeForBillingProfile
PossibleStatusReasonCodeForBillingProfileValues returns the possible values for the StatusReasonCodeForBillingProfile const type.
type Subscription ¶ added in v0.2.0
type Subscription struct { // The billing properties of a subscription. Properties *SubscriptionProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Subscription - A billing subscription.
func (Subscription) MarshalJSON ¶ added in v0.2.0
func (s Subscription) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Subscription.
func (*Subscription) UnmarshalJSON ¶ added in v0.6.0
func (s *Subscription) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Subscription.
type SubscriptionProperties ¶ added in v0.2.0
type SubscriptionProperties struct { // The cost center applied to the subscription. CostCenter *string // The sku ID of the Azure plan for the subscription. SKUID *string // The current billing status of the subscription. SubscriptionBillingStatus *BillingSubscriptionStatusType // READ-ONLY; The name of the billing profile to which the subscription is billed. BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile to which the subscription is billed. BillingProfileID *string // READ-ONLY; The name of the customer for whom the subscription was created. The field is applicable only for Microsoft Partner // Agreement billing account. CustomerDisplayName *string // READ-ONLY; The ID of the customer for whom the subscription was created. The field is applicable only for Microsoft Partner // Agreement billing account. CustomerID *string // READ-ONLY; The name of the subscription. DisplayName *string // READ-ONLY; The name of the invoice section to which the subscription is billed. InvoiceSectionDisplayName *string // READ-ONLY; The ID of the invoice section to which the subscription is billed. InvoiceSectionID *string // READ-ONLY; The last month charges. LastMonthCharges *Amount // READ-ONLY; The current month to date charges. MonthToDateCharges *Amount // READ-ONLY; Reseller for this subscription. Reseller *Reseller // READ-ONLY; The sku description of the Azure plan for the subscription. SKUDescription *string // READ-ONLY; The ID of the subscription. SubscriptionID *string // READ-ONLY; The suspension reason for a subscription. Applies only to subscriptions in Microsoft Online Services Program // billing accounts. SuspensionReasons []*string }
SubscriptionProperties - The billing properties of a subscription.
func (SubscriptionProperties) MarshalJSON ¶ added in v0.2.0
func (s SubscriptionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionProperties.
func (*SubscriptionProperties) UnmarshalJSON ¶ added in v0.6.0
func (s *SubscriptionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionProperties.
type SubscriptionTransferValidationErrorCode ¶
type SubscriptionTransferValidationErrorCode string
SubscriptionTransferValidationErrorCode - Error code of the transfer validation response.
const ( SubscriptionTransferValidationErrorCodeBillingAccountInactive SubscriptionTransferValidationErrorCode = "BillingAccountInactive" SubscriptionTransferValidationErrorCodeCrossBillingAccountNotAllowed SubscriptionTransferValidationErrorCode = "CrossBillingAccountNotAllowed" SubscriptionTransferValidationErrorCodeDestinationBillingProfileInactive SubscriptionTransferValidationErrorCode = "DestinationBillingProfileInactive" SubscriptionTransferValidationErrorCodeDestinationBillingProfileNotFound SubscriptionTransferValidationErrorCode = "DestinationBillingProfileNotFound" SubscriptionTransferValidationErrorCodeDestinationBillingProfilePastDue SubscriptionTransferValidationErrorCode = "DestinationBillingProfilePastDue" SubscriptionTransferValidationErrorCodeDestinationInvoiceSectionInactive SubscriptionTransferValidationErrorCode = "DestinationInvoiceSectionInactive" SubscriptionTransferValidationErrorCodeDestinationInvoiceSectionNotFound SubscriptionTransferValidationErrorCode = "DestinationInvoiceSectionNotFound" SubscriptionTransferValidationErrorCodeInsufficientPermissionOnDestination SubscriptionTransferValidationErrorCode = "InsufficientPermissionOnDestination" SubscriptionTransferValidationErrorCodeInsufficientPermissionOnSource SubscriptionTransferValidationErrorCode = "InsufficientPermissionOnSource" SubscriptionTransferValidationErrorCodeInvalidDestination SubscriptionTransferValidationErrorCode = "InvalidDestination" SubscriptionTransferValidationErrorCodeInvalidSource SubscriptionTransferValidationErrorCode = "InvalidSource" SubscriptionTransferValidationErrorCodeMarketplaceNotEnabledOnDestination SubscriptionTransferValidationErrorCode = "MarketplaceNotEnabledOnDestination" SubscriptionTransferValidationErrorCodeNotAvailableForDestinationMarket SubscriptionTransferValidationErrorCode = "NotAvailableForDestinationMarket" SubscriptionTransferValidationErrorCodeProductInactive SubscriptionTransferValidationErrorCode = "ProductInactive" SubscriptionTransferValidationErrorCodeProductNotFound SubscriptionTransferValidationErrorCode = "ProductNotFound" SubscriptionTransferValidationErrorCodeProductTypeNotSupported SubscriptionTransferValidationErrorCode = "ProductTypeNotSupported" SubscriptionTransferValidationErrorCodeSourceBillingProfilePastDue SubscriptionTransferValidationErrorCode = "SourceBillingProfilePastDue" SubscriptionTransferValidationErrorCodeSourceInvoiceSectionInactive SubscriptionTransferValidationErrorCode = "SourceInvoiceSectionInactive" SubscriptionTransferValidationErrorCodeSubscriptionNotActive SubscriptionTransferValidationErrorCode = "SubscriptionNotActive" SubscriptionTransferValidationErrorCodeSubscriptionTypeNotSupported SubscriptionTransferValidationErrorCode = "SubscriptionTypeNotSupported" )
func PossibleSubscriptionTransferValidationErrorCodeValues ¶
func PossibleSubscriptionTransferValidationErrorCodeValues() []SubscriptionTransferValidationErrorCode
PossibleSubscriptionTransferValidationErrorCodeValues returns the possible values for the SubscriptionTransferValidationErrorCode const type.
type SubscriptionsClient ¶ added in v0.2.0
type SubscriptionsClient struct {
// contains filtered or unexported fields
}
SubscriptionsClient contains the methods for the BillingSubscriptions group. Don't use this type directly, use NewSubscriptionsClient() instead.
func NewSubscriptionsClient ¶ added in v0.2.0
func NewSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionsClient, error)
NewSubscriptionsClient creates a new instance of SubscriptionsClient with the specified values.
- subscriptionID - The ID that uniquely identifies an Azure subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*SubscriptionsClient) BeginMove ¶ added in v0.2.0
func (client *SubscriptionsClient) BeginMove(ctx context.Context, billingAccountName string, parameters TransferBillingSubscriptionRequestProperties, options *SubscriptionsClientBeginMoveOptions) (*runtime.Poller[SubscriptionsClientMoveResponse], error)
BeginMove - Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - Request parameters that are provided to the move subscription operation.
- options - SubscriptionsClientBeginMoveOptions contains the optional parameters for the SubscriptionsClient.BeginMove method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveBillingSubscription.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSubscriptionsClient().BeginMove(ctx, "{billingAccountName}", armbilling.TransferBillingSubscriptionRequestProperties{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), }, 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.Subscription = armbilling.Subscription{ // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("My Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](600), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // } }
Output:
func (*SubscriptionsClient) Get ¶ added in v0.2.0
func (client *SubscriptionsClient) Get(ctx context.Context, billingAccountName string, options *SubscriptionsClientGetOptions) (SubscriptionsClientGetResponse, error)
Get - Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- 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/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSubscriptionsClient().Get(ctx, "{billingAccountName}", 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 = armbilling.Subscription{ // Name: to.Ptr("{subscriptionId}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("My Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](600), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // } }
Output:
func (*SubscriptionsClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *SubscriptionsClient) NewListByBillingAccountPager(billingAccountName string, options *SubscriptionsClientListByBillingAccountOptions) *runtime.Pager[SubscriptionsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - SubscriptionsClientListByBillingAccountOptions contains the optional parameters for the SubscriptionsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSubscriptionsClient().NewListByBillingAccountPager("{billingAccountName}", 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.SubscriptionsListResult = armbilling.SubscriptionsListResult{ // Value: []*armbilling.Subscription{ // { // Name: to.Ptr("90000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/90000000-0000-0000-0000-000000000000"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("My subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](600), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // }, // { // Name: to.Ptr("90000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/90000000-0000-0000-0000-000000000001"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("Test subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](400), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-6b96d3f2"), // }, // }, // { // Name: to.Ptr("90000000-0000-0000-0000-000000000002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/90000000-0000-0000-0000-000000000002"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("Dev Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](6000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](900), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-4a9d-9008-912f-f87744185aa3"), // }, // }}, // } } }
Output:
func (*SubscriptionsClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *SubscriptionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *SubscriptionsClientListByBillingProfileOptions) *runtime.Pager[SubscriptionsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - SubscriptionsClientListByBillingProfileOptions contains the optional parameters for the SubscriptionsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSubscriptionsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.SubscriptionsListResult = armbilling.SubscriptionsListResult{ // Value: []*armbilling.Subscription{ // { // Name: to.Ptr("billingSubscriptionId1"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId1"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("My subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](600), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // }, // { // Name: to.Ptr("billingSubscriptionId2"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId2"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("Test subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](400), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-6b96d3f2"), // }, // }, // { // Name: to.Ptr("billingSubscriptionId3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId3"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("Dev Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](6000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](900), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-4a9d-9008-912f-f87744185aa3"), // }, // }}, // } } }
Output:
func (*SubscriptionsClient) NewListByCustomerPager ¶ added in v0.4.0
func (client *SubscriptionsClient) NewListByCustomerPager(billingAccountName string, customerName string, options *SubscriptionsClientListByCustomerOptions) *runtime.Pager[SubscriptionsClientListByCustomerResponse]
NewListByCustomerPager - Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- options - SubscriptionsClientListByCustomerOptions contains the optional parameters for the SubscriptionsClient.NewListByCustomerPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByCustomer.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSubscriptionsClient().NewListByCustomerPager("{billingAccountName}", "{customerName}", 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.SubscriptionsListResult = armbilling.SubscriptionsListResult{ // Value: []*armbilling.Subscription{ // { // Name: to.Ptr("billingSubscriptionId1"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId1"), // Properties: &armbilling.SubscriptionProperties{ // CostCenter: to.Ptr("ABC1234"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), // DisplayName: to.Ptr("My subscription"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](600), // }, // Reseller: &armbilling.Reseller{ // Description: to.Ptr("Reseller1"), // ResellerID: to.Ptr("89e87bdf-a2a2-4687-925f-4c18b27bccfd"), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // }, // { // Name: to.Ptr("billingSubscriptionId2"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId2"), // Properties: &armbilling.SubscriptionProperties{ // CostCenter: to.Ptr("ABC1234"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), // DisplayName: to.Ptr("Test subscription"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](400), // }, // Reseller: &armbilling.Reseller{ // Description: to.Ptr("Reseller3"), // ResellerID: to.Ptr("3b65b5a8-bd4f-4084-90e9-e1bd667a2b19"), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), // SKUID: to.Ptr("0002"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-6b96d3f2"), // }, // }}, // } } }
Output:
func (*SubscriptionsClient) NewListByInvoiceSectionPager ¶ added in v0.4.0
func (client *SubscriptionsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *SubscriptionsClientListByInvoiceSectionOptions) *runtime.Pager[SubscriptionsClientListByInvoiceSectionResponse]
NewListByInvoiceSectionPager - Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- invoiceSectionName - The ID that uniquely identifies an invoice section.
- options - SubscriptionsClientListByInvoiceSectionOptions contains the optional parameters for the SubscriptionsClient.NewListByInvoiceSectionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByInvoiceSection.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSubscriptionsClient().NewListByInvoiceSectionPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", 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.SubscriptionsListResult = armbilling.SubscriptionsListResult{ // Value: []*armbilling.Subscription{ // { // Name: to.Ptr("billingSubscriptionId1"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId1"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("My subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](600), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // }, // { // Name: to.Ptr("billingSubscriptionId2"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId2"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("Test subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](400), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-6b96d3f2"), // }, // }, // { // Name: to.Ptr("billingSubscriptionId3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId3"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("Dev Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](6000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](900), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-4a9d-9008-912f-f87744185aa3"), // }, // }}, // } } }
Output:
func (*SubscriptionsClient) Update ¶ added in v0.2.0
func (client *SubscriptionsClient) Update(ctx context.Context, billingAccountName string, parameters Subscription, options *SubscriptionsClientUpdateOptions) (SubscriptionsClientUpdateResponse, error)
Update - Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - Request parameters that are provided to the update billing subscription operation.
- options - SubscriptionsClientUpdateOptions contains the optional parameters for the SubscriptionsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingSubscription.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSubscriptionsClient().Update(ctx, "{billingAccountName}", armbilling.Subscription{ Properties: &armbilling.SubscriptionProperties{ CostCenter: to.Ptr("ABC1234"), }, }, 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 = armbilling.Subscription{ // Name: to.Ptr("{subscriptionId}"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), // CostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("My Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), // LastMonthCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // MonthToDateCharges: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](600), // }, // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // } }
Output:
func (*SubscriptionsClient) ValidateMove ¶ added in v0.2.0
func (client *SubscriptionsClient) ValidateMove(ctx context.Context, billingAccountName string, parameters TransferBillingSubscriptionRequestProperties, options *SubscriptionsClientValidateMoveOptions) (SubscriptionsClientValidateMoveResponse, error)
ValidateMove - Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - Request parameters that are provided to the validate move eligibility operation.
- options - SubscriptionsClientValidateMoveOptions contains the optional parameters for the SubscriptionsClient.ValidateMove method.
Example (SubscriptionMoveValidateFailure) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveFailure.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSubscriptionsClient().ValidateMove(ctx, "{billingAccountName}", armbilling.TransferBillingSubscriptionRequestProperties{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), }, 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.ValidateSubscriptionTransferEligibilityResult = armbilling.ValidateSubscriptionTransferEligibilityResult{ // ErrorDetails: &armbilling.ValidateSubscriptionTransferEligibilityError{ // Code: to.Ptr(armbilling.SubscriptionTransferValidationErrorCodeSubscriptionNotActive), // Message: to.Ptr("Invoice Sections can only be changed for active subscriptions."), // }, // IsMoveEligible: to.Ptr(false), // } }
Output:
Example (SubscriptionMoveValidateSuccess) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveSuccess.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/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSubscriptionsClient().ValidateMove(ctx, "{billingAccountName}", armbilling.TransferBillingSubscriptionRequestProperties{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), }, 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.ValidateSubscriptionTransferEligibilityResult = armbilling.ValidateSubscriptionTransferEligibilityResult{ // IsMoveEligible: to.Ptr(true), // } }
Output:
type SubscriptionsClientBeginMoveOptions ¶ added in v0.2.0
type SubscriptionsClientBeginMoveOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SubscriptionsClientBeginMoveOptions contains the optional parameters for the SubscriptionsClient.BeginMove method.
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 { // A billing subscription. Subscription }
SubscriptionsClientGetResponse contains the response from method SubscriptionsClient.Get.
type SubscriptionsClientListByBillingAccountOptions ¶ added in v0.2.0
type SubscriptionsClientListByBillingAccountOptions struct { }
SubscriptionsClientListByBillingAccountOptions contains the optional parameters for the SubscriptionsClient.NewListByBillingAccountPager method.
type SubscriptionsClientListByBillingAccountResponse ¶ added in v0.2.0
type SubscriptionsClientListByBillingAccountResponse struct { // The list of billing subscriptions. SubscriptionsListResult }
SubscriptionsClientListByBillingAccountResponse contains the response from method SubscriptionsClient.NewListByBillingAccountPager.
type SubscriptionsClientListByBillingProfileOptions ¶ added in v0.2.0
type SubscriptionsClientListByBillingProfileOptions struct { }
SubscriptionsClientListByBillingProfileOptions contains the optional parameters for the SubscriptionsClient.NewListByBillingProfilePager method.
type SubscriptionsClientListByBillingProfileResponse ¶ added in v0.2.0
type SubscriptionsClientListByBillingProfileResponse struct { // The list of billing subscriptions. SubscriptionsListResult }
SubscriptionsClientListByBillingProfileResponse contains the response from method SubscriptionsClient.NewListByBillingProfilePager.
type SubscriptionsClientListByCustomerOptions ¶ added in v0.2.0
type SubscriptionsClientListByCustomerOptions struct { }
SubscriptionsClientListByCustomerOptions contains the optional parameters for the SubscriptionsClient.NewListByCustomerPager method.
type SubscriptionsClientListByCustomerResponse ¶ added in v0.2.0
type SubscriptionsClientListByCustomerResponse struct { // The list of billing subscriptions. SubscriptionsListResult }
SubscriptionsClientListByCustomerResponse contains the response from method SubscriptionsClient.NewListByCustomerPager.
type SubscriptionsClientListByInvoiceSectionOptions ¶ added in v0.2.0
type SubscriptionsClientListByInvoiceSectionOptions struct { }
SubscriptionsClientListByInvoiceSectionOptions contains the optional parameters for the SubscriptionsClient.NewListByInvoiceSectionPager method.
type SubscriptionsClientListByInvoiceSectionResponse ¶ added in v0.2.0
type SubscriptionsClientListByInvoiceSectionResponse struct { // The list of billing subscriptions. SubscriptionsListResult }
SubscriptionsClientListByInvoiceSectionResponse contains the response from method SubscriptionsClient.NewListByInvoiceSectionPager.
type SubscriptionsClientMoveResponse ¶ added in v0.2.0
type SubscriptionsClientMoveResponse struct { // A billing subscription. Subscription }
SubscriptionsClientMoveResponse contains the response from method SubscriptionsClient.BeginMove.
type SubscriptionsClientUpdateOptions ¶ added in v0.2.0
type SubscriptionsClientUpdateOptions struct { }
SubscriptionsClientUpdateOptions contains the optional parameters for the SubscriptionsClient.Update method.
type SubscriptionsClientUpdateResponse ¶ added in v0.2.0
type SubscriptionsClientUpdateResponse struct { // A billing subscription. Subscription }
SubscriptionsClientUpdateResponse contains the response from method SubscriptionsClient.Update.
type SubscriptionsClientValidateMoveOptions ¶ added in v0.2.0
type SubscriptionsClientValidateMoveOptions struct { }
SubscriptionsClientValidateMoveOptions contains the optional parameters for the SubscriptionsClient.ValidateMove method.
type SubscriptionsClientValidateMoveResponse ¶ added in v0.2.0
type SubscriptionsClientValidateMoveResponse struct { // Result of the transfer eligibility validation. ValidateSubscriptionTransferEligibilityResult }
SubscriptionsClientValidateMoveResponse contains the response from method SubscriptionsClient.ValidateMove.
type SubscriptionsListResult ¶ added in v0.2.0
type SubscriptionsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; Total number of records. TotalCount *int32 // READ-ONLY; The list of billing subscriptions. Value []*Subscription }
SubscriptionsListResult - The list of billing subscriptions.
func (SubscriptionsListResult) MarshalJSON ¶ added in v0.2.0
func (s SubscriptionsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionsListResult.
func (*SubscriptionsListResult) UnmarshalJSON ¶ added in v0.6.0
func (s *SubscriptionsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionsListResult.
type TargetCloud ¶
type TargetCloud string
TargetCloud - Possible cloud environments.
const ( TargetCloudUSGov TargetCloud = "USGov" TargetCloudUSNat TargetCloud = "USNat" TargetCloudUSSec TargetCloud = "USSec" )
func PossibleTargetCloudValues ¶
func PossibleTargetCloudValues() []TargetCloud
PossibleTargetCloudValues returns the possible values for the TargetCloud const type.
type Transaction ¶
type Transaction struct { // The properties of a transaction. Properties *TransactionProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
Transaction - A transaction.
func (Transaction) MarshalJSON ¶
func (t Transaction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Transaction.
func (*Transaction) UnmarshalJSON ¶ added in v0.6.0
func (t *Transaction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Transaction.
type TransactionListResult ¶
type TransactionListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; Total number of records. TotalCount *int32 // READ-ONLY; The list of transactions. Value []*Transaction }
TransactionListResult - The list of transactions.
func (TransactionListResult) MarshalJSON ¶
func (t TransactionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionListResult.
func (*TransactionListResult) UnmarshalJSON ¶ added in v0.6.0
func (t *TransactionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionListResult.
type TransactionProperties ¶
type TransactionProperties struct { // The kind of transaction. Options are all or reservation. Kind *TransactionTypeKind // The type of transaction. TransactionType *ReservationType // READ-ONLY; The amount of any Azure credits automatically applied to this transaction. AzureCreditApplied *Amount // READ-ONLY; The type of azure plan of the subscription that was used for the transaction. AzurePlan *string // READ-ONLY; The ISO 4217 code for the currency in which this transaction is billed. BillingCurrency *string // READ-ONLY; The name of the billing profile which will be billed for the transaction. BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile which will be billed for the transaction. BillingProfileID *string // READ-ONLY; The name of the customer for which the transaction took place. The field is applicable only for Microsoft Partner // Agreement billing account. CustomerDisplayName *string // READ-ONLY; The ID of the customer for which the transaction took place. The field is applicable only for Microsoft Partner // Agreement billing account. CustomerID *string // READ-ONLY; The date of transaction. Date *time.Time // READ-ONLY; The percentage discount, if any, applied to this transaction. Discount *float32 // READ-ONLY; The price of the product after applying any discounts. EffectivePrice *Amount // READ-ONLY; The exchange rate used to convert charged amount to billing currency, if applicable. ExchangeRate *float32 // READ-ONLY; Invoice on which the transaction was billed or 'pending' if the transaction is not billed. Invoice *string // READ-ONLY; The ID of the invoice on which the transaction was billed. This field is only applicable for transactions which // are billed. InvoiceID *string // READ-ONLY; The name of the invoice section which will be billed for the transaction. InvoiceSectionDisplayName *string // READ-ONLY; The ID of the invoice section which will be billed for the transaction. InvoiceSectionID *string // READ-ONLY; The retail price of the product. MarketPrice *Amount // READ-ONLY; The order ID of the reservation. The field is only applicable for transaction of kind reservation. OrderID *string // READ-ONLY; The name of the reservation order. The field is only applicable for transactions of kind reservation. OrderName *string // READ-ONLY; The ISO 4217 code for the currency in which the product is priced. PricingCurrency *string // READ-ONLY; The description of the product for which the transaction took place. ProductDescription *string // READ-ONLY; The family of the product for which the transaction took place. ProductFamily *string // READ-ONLY; The type of the product for which the transaction took place. ProductType *string // READ-ONLY; The ID of the product type for which the transaction took place. ProductTypeID *string // READ-ONLY; The quantity purchased in the transaction. Quantity *int32 // READ-ONLY; The end date of the product term, or the end date of the month in which usage ended. ServicePeriodEndDate *time.Time // READ-ONLY; The date of the purchase of the product, or the start date of the month in which usage started. ServicePeriodStartDate *time.Time // READ-ONLY; The pre-tax charged amount for the transaction. SubTotal *Amount // READ-ONLY; The ID of the subscription that was used for the transaction. The field is only applicable for transaction of // kind reservation. SubscriptionID *string // READ-ONLY; The name of the subscription that was used for the transaction. The field is only applicable for transaction // of kind reservation. SubscriptionName *string // READ-ONLY; The tax amount applied to the transaction. Tax *Amount // READ-ONLY; The charge associated with the transaction. TransactionAmount *Amount // READ-ONLY; The unit of measure used to bill for the product. For example, compute services are billed per hour. UnitOfMeasure *string // READ-ONLY; The description for the unit of measure for a given product. UnitType *string // READ-ONLY; The number of units used for a given product. Units *float32 }
TransactionProperties - The properties of a transaction.
func (TransactionProperties) MarshalJSON ¶
func (t TransactionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionProperties.
func (*TransactionProperties) UnmarshalJSON ¶
func (t *TransactionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionProperties.
type TransactionTypeKind ¶
type TransactionTypeKind string
TransactionTypeKind - The kind of transaction. Options are all or reservation.
const ( TransactionTypeKindAll TransactionTypeKind = "all" TransactionTypeKindReservation TransactionTypeKind = "reservation" )
func PossibleTransactionTypeKindValues ¶
func PossibleTransactionTypeKindValues() []TransactionTypeKind
PossibleTransactionTypeKindValues returns the possible values for the TransactionTypeKind const type.
type TransactionsClient ¶
type TransactionsClient struct {
// contains filtered or unexported fields
}
TransactionsClient contains the methods for the Transactions group. Don't use this type directly, use NewTransactionsClient() instead.
func NewTransactionsClient ¶
func NewTransactionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*TransactionsClient, error)
NewTransactionsClient creates a new instance of TransactionsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*TransactionsClient) NewListByInvoicePager ¶ added in v0.4.0
func (client *TransactionsClient) NewListByInvoicePager(billingAccountName string, invoiceName string, options *TransactionsClientListByInvoiceOptions) *runtime.Pager[TransactionsClientListByInvoiceResponse]
NewListByInvoicePager - Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges.
Generated from API version 2020-05-01
- billingAccountName - The ID that uniquely identifies a billing account.
- invoiceName - The ID that uniquely identifies an invoice.
- options - TransactionsClientListByInvoiceOptions contains the optional parameters for the TransactionsClient.NewListByInvoicePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/TransactionsListByInvoice.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewTransactionsClient().NewListByInvoicePager("{billingAccountName}", "{invoiceName}", 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.TransactionListResult = armbilling.TransactionListResult{ // Value: []*armbilling.Transaction{ // { // Name: to.Ptr("41000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/transactions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/transactions/41000000-0000-0000-0000-000000000000"), // Properties: &armbilling.TransactionProperties{ // AzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // AzurePlan: to.Ptr("Microsoft Azure Plan for DevTest"), // BillingCurrency: to.Ptr("USD"), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T00:00:00.000Z"); return t}()), // Discount: to.Ptr[float32](0.1), // EffectivePrice: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](10), // }, // ExchangeRate: to.Ptr[float32](1), // Invoice: to.Ptr("2344233"), // InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/2344233"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // Kind: to.Ptr(armbilling.TransactionTypeKindAll), // MarketPrice: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // PricingCurrency: to.Ptr("USD"), // ProductDescription: to.Ptr("Standard D1, US West 3"), // ProductFamily: to.Ptr("Storage"), // ProductType: to.Ptr("VM Instance"), // ProductTypeID: to.Ptr("A12345"), // Quantity: to.Ptr[int32](1), // ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-30T00:00:00.000Z"); return t}()), // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T00:00:00.000Z"); return t}()), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](4500), // }, // Tax: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](500), // }, // TransactionAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // TransactionType: to.Ptr(armbilling.ReservationTypePurchase), // UnitOfMeasure: to.Ptr("1 Minute"), // UnitType: to.Ptr("1 Runtime Minute"), // Units: to.Ptr[float32](11.25), // }, // }, // { // Name: to.Ptr("51000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/transactions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/transactions/51000000-0000-0000-0000-000000000000"), // Properties: &armbilling.TransactionProperties{ // AzureCreditApplied: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // AzurePlan: to.Ptr("Microsoft Azure Plan for DevTest"), // BillingCurrency: to.Ptr("USD"), // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-01T00:00:00.000Z"); return t}()), // Discount: to.Ptr[float32](0.1), // EffectivePrice: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](10), // }, // ExchangeRate: to.Ptr[float32](1), // Invoice: to.Ptr("pending"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), // Kind: to.Ptr(armbilling.TransactionTypeKindAll), // MarketPrice: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // PricingCurrency: to.Ptr("USD"), // ProductDescription: to.Ptr("Standard Support"), // ProductFamily: to.Ptr("Storage"), // ProductType: to.Ptr("VM Instance"), // ProductTypeID: to.Ptr("A12345"), // Quantity: to.Ptr[int32](1), // ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-30T00:00:00.000Z"); return t}()), // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T00:00:00.000Z"); return t}()), // SubTotal: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](45), // }, // Tax: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5), // }, // TransactionAmount: &armbilling.Amount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // TransactionType: to.Ptr(armbilling.ReservationType("Cancel")), // UnitOfMeasure: to.Ptr("1 Minute"), // UnitType: to.Ptr("1 Runtime Minute"), // Units: to.Ptr[float32](1.25), // }, // }}, // } } }
Output:
type TransactionsClientListByInvoiceOptions ¶ added in v0.2.0
type TransactionsClientListByInvoiceOptions struct { }
TransactionsClientListByInvoiceOptions contains the optional parameters for the TransactionsClient.NewListByInvoicePager method.
type TransactionsClientListByInvoiceResponse ¶ added in v0.2.0
type TransactionsClientListByInvoiceResponse struct { // The list of transactions. TransactionListResult }
TransactionsClientListByInvoiceResponse contains the response from method TransactionsClient.NewListByInvoicePager.
type TransferBillingSubscriptionRequestProperties ¶
type TransferBillingSubscriptionRequestProperties struct { // REQUIRED; The destination invoice section id. DestinationInvoiceSectionID *string }
TransferBillingSubscriptionRequestProperties - Request parameters to transfer billing subscription.
func (TransferBillingSubscriptionRequestProperties) MarshalJSON ¶ added in v0.6.0
func (t TransferBillingSubscriptionRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransferBillingSubscriptionRequestProperties.
func (*TransferBillingSubscriptionRequestProperties) UnmarshalJSON ¶ added in v0.6.0
func (t *TransferBillingSubscriptionRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransferBillingSubscriptionRequestProperties.
type TransferProductRequestProperties ¶
type TransferProductRequestProperties struct { // The destination invoice section id. DestinationInvoiceSectionID *string }
TransferProductRequestProperties - The properties of the product to initiate a transfer.
func (TransferProductRequestProperties) MarshalJSON ¶ added in v0.6.0
func (t TransferProductRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransferProductRequestProperties.
func (*TransferProductRequestProperties) UnmarshalJSON ¶ added in v0.6.0
func (t *TransferProductRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransferProductRequestProperties.
type ValidateAddressResponse ¶
type ValidateAddressResponse struct { // status of the address validation. Status *AddressValidationStatus // The list of suggested addresses. SuggestedAddresses []*AddressDetails // Validation error message. ValidationMessage *string }
ValidateAddressResponse - Result of the address validation
func (ValidateAddressResponse) MarshalJSON ¶
func (v ValidateAddressResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ValidateAddressResponse.
func (*ValidateAddressResponse) UnmarshalJSON ¶ added in v0.6.0
func (v *ValidateAddressResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ValidateAddressResponse.
type ValidateProductTransferEligibilityError ¶
type ValidateProductTransferEligibilityError struct { // Error code for the product transfer validation. Code *ProductTransferValidationErrorCode // Detailed error message explaining the error. Details *string // The error message. Message *string }
ValidateProductTransferEligibilityError - Error details of the product transfer eligibility validation.
func (ValidateProductTransferEligibilityError) MarshalJSON ¶ added in v0.6.0
func (v ValidateProductTransferEligibilityError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ValidateProductTransferEligibilityError.
func (*ValidateProductTransferEligibilityError) UnmarshalJSON ¶ added in v0.6.0
func (v *ValidateProductTransferEligibilityError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ValidateProductTransferEligibilityError.
type ValidateProductTransferEligibilityResult ¶
type ValidateProductTransferEligibilityResult struct { // Validation error details. ErrorDetails *ValidateProductTransferEligibilityError // READ-ONLY; Specifies whether the transfer is eligible or not. IsMoveEligible *bool }
ValidateProductTransferEligibilityResult - Result of the product transfer eligibility validation.
func (ValidateProductTransferEligibilityResult) MarshalJSON ¶ added in v0.6.0
func (v ValidateProductTransferEligibilityResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ValidateProductTransferEligibilityResult.
func (*ValidateProductTransferEligibilityResult) UnmarshalJSON ¶ added in v0.6.0
func (v *ValidateProductTransferEligibilityResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ValidateProductTransferEligibilityResult.
type ValidateSubscriptionTransferEligibilityError ¶
type ValidateSubscriptionTransferEligibilityError struct { // Error code for the product transfer validation. Code *SubscriptionTransferValidationErrorCode // Detailed error message explaining the error. Details *string // The error message. Message *string }
ValidateSubscriptionTransferEligibilityError - Error details of the transfer eligibility validation
func (ValidateSubscriptionTransferEligibilityError) MarshalJSON ¶ added in v0.6.0
func (v ValidateSubscriptionTransferEligibilityError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ValidateSubscriptionTransferEligibilityError.
func (*ValidateSubscriptionTransferEligibilityError) UnmarshalJSON ¶ added in v0.6.0
func (v *ValidateSubscriptionTransferEligibilityError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ValidateSubscriptionTransferEligibilityError.
type ValidateSubscriptionTransferEligibilityResult ¶
type ValidateSubscriptionTransferEligibilityResult struct { // Validation error details. ErrorDetails *ValidateSubscriptionTransferEligibilityError // READ-ONLY; Specifies whether the subscription is eligible to be transferred. IsMoveEligible *bool }
ValidateSubscriptionTransferEligibilityResult - Result of the transfer eligibility validation.
func (ValidateSubscriptionTransferEligibilityResult) MarshalJSON ¶ added in v0.6.0
func (v ValidateSubscriptionTransferEligibilityResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ValidateSubscriptionTransferEligibilityResult.
func (*ValidateSubscriptionTransferEligibilityResult) UnmarshalJSON ¶ added in v0.6.0
func (v *ValidateSubscriptionTransferEligibilityResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ValidateSubscriptionTransferEligibilityResult.
type ViewCharges ¶
type ViewCharges string
ViewCharges - The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices.
const ( ViewChargesAllowed ViewCharges = "Allowed" ViewChargesNotAllowed ViewCharges = "NotAllowed" )
func PossibleViewChargesValues ¶
func PossibleViewChargesValues() []ViewCharges
PossibleViewChargesValues returns the possible values for the ViewCharges const type.
type ViewChargesPolicy ¶
type ViewChargesPolicy string
ViewChargesPolicy - The policy that controls whether users with Azure RBAC access to a subscription can view its charges.
const ( ViewChargesPolicyAllowed ViewChargesPolicy = "Allowed" ViewChargesPolicyNotAllowed ViewChargesPolicy = "NotAllowed" )
func PossibleViewChargesPolicyValues ¶
func PossibleViewChargesPolicyValues() []ViewChargesPolicy
PossibleViewChargesPolicyValues returns the possible values for the ViewChargesPolicy const type.
Source Files ¶
- accounts_client.go
- address_client.go
- agreements_client.go
- availablebalances_client.go
- build.go
- client_factory.go
- constants.go
- customers_client.go
- date_type.go
- enrollmentaccounts_client.go
- instructions_client.go
- invoices_client.go
- invoicesections_client.go
- models.go
- models_serde.go
- operations_client.go
- options.go
- periods_client.go
- permissions_client.go
- policies_client.go
- products_client.go
- profiles_client.go
- property_client.go
- reservations_client.go
- response_types.go
- roleassignments_client.go
- roledefinitions_client.go
- subscriptions_client.go
- time_rfc3339.go
- transactions_client.go