Documentation ¶
Index ¶
- type AcceptTransferProperties
- type AcceptTransferRequest
- type AcceptanceMode
- type AccessDecision
- type Account
- type AccountListResult
- type AccountPatch
- type AccountPolicy
- type AccountPolicyProperties
- type AccountPolicyPropertiesEnterpriseAgreementPolicies
- type AccountProperties
- type AccountPropertiesEnrollmentDetails
- type AccountPropertiesRegistrationNumber
- type AccountPropertiesSoldTo
- type AccountStatus
- type AccountSubType
- type AccountType
- type AccountsClient
- func (client *AccountsClient) BeginAddPaymentTerms(ctx context.Context, billingAccountName string, parameters []*PaymentTerm, ...) (*runtime.Poller[AccountsClientAddPaymentTermsResponse], error)
- func (client *AccountsClient) BeginCancelPaymentTerms(ctx context.Context, billingAccountName string, parameters time.Time, ...) (*runtime.Poller[AccountsClientCancelPaymentTermsResponse], error)
- func (client *AccountsClient) BeginUpdate(ctx context.Context, billingAccountName string, parameters AccountPatch, ...) (*runtime.Poller[AccountsClientUpdateResponse], error)
- func (client *AccountsClient) ConfirmTransition(ctx context.Context, billingAccountName string, ...) (AccountsClientConfirmTransitionResponse, 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]
- func (client *AccountsClient) ValidatePaymentTerms(ctx context.Context, billingAccountName string, parameters []*PaymentTerm, ...) (AccountsClientValidatePaymentTermsResponse, error)
- type AccountsClientAddPaymentTermsResponse
- type AccountsClientBeginAddPaymentTermsOptions
- type AccountsClientBeginCancelPaymentTermsOptions
- type AccountsClientBeginUpdateOptions
- type AccountsClientCancelPaymentTermsResponse
- type AccountsClientConfirmTransitionOptions
- type AccountsClientConfirmTransitionResponse
- type AccountsClientGetOptions
- type AccountsClientGetResponse
- type AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionOptions
- type AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionResponse
- type AccountsClientListOptions
- type AccountsClientListResponse
- type AccountsClientUpdateResponse
- type AccountsClientValidatePaymentTermsOptions
- type AccountsClientValidatePaymentTermsResponse
- type AddressClient
- type AddressClientValidateOptions
- type AddressClientValidateResponse
- type AddressDetails
- type AddressValidationResponse
- 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 AppliedScopeProperties
- type AppliedScopeType
- type AssociatedTenant
- type AssociatedTenantListResult
- type AssociatedTenantProperties
- type AssociatedTenantsClient
- func (client *AssociatedTenantsClient) BeginCreateOrUpdate(ctx context.Context, billingAccountName string, associatedTenantName string, ...) (*runtime.Poller[AssociatedTenantsClientCreateOrUpdateResponse], error)
- func (client *AssociatedTenantsClient) BeginDelete(ctx context.Context, billingAccountName string, associatedTenantName string, ...) (*runtime.Poller[AssociatedTenantsClientDeleteResponse], error)
- func (client *AssociatedTenantsClient) Get(ctx context.Context, billingAccountName string, associatedTenantName string, ...) (AssociatedTenantsClientGetResponse, error)
- func (client *AssociatedTenantsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[AssociatedTenantsClientListByBillingAccountResponse]
- type AssociatedTenantsClientBeginCreateOrUpdateOptions
- type AssociatedTenantsClientBeginDeleteOptions
- type AssociatedTenantsClientCreateOrUpdateResponse
- type AssociatedTenantsClientDeleteResponse
- type AssociatedTenantsClientGetOptions
- type AssociatedTenantsClientGetResponse
- type AssociatedTenantsClientListByBillingAccountOptions
- type AssociatedTenantsClientListByBillingAccountResponse
- type AutoRenew
- type AvailableBalance
- type AvailableBalanceProperties
- type AvailableBalancePropertiesAmount
- type AvailableBalancePropertiesTotalPaymentsOnAccount
- type AvailableBalancesClient
- func (client *AvailableBalancesClient) GetByBillingAccount(ctx context.Context, billingAccountName string, ...) (AvailableBalancesClientGetByBillingAccountResponse, error)
- func (client *AvailableBalancesClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (AvailableBalancesClientGetByBillingProfileResponse, error)
- type AvailableBalancesClientGetByBillingAccountOptions
- type AvailableBalancesClientGetByBillingAccountResponse
- type AvailableBalancesClientGetByBillingProfileOptions
- type AvailableBalancesClientGetByBillingProfileResponse
- type AzurePlan
- type Beneficiary
- type BillingAccountStatusReasonCode
- type BillingManagementTenantState
- type BillingPlan
- type BillingProfileStatus
- type BillingProfileStatusReasonCode
- type BillingRelationshipType
- type BillingRequestStatus
- type BillingRequestType
- type BillingSubscriptionOperationStatus
- type BillingSubscriptionStatus
- type CancelSubscriptionRequest
- type Cancellation
- type CancellationReason
- type Category
- type CheckAccessRequest
- type CheckAccessResponse
- type ClientFactory
- func (c *ClientFactory) NewAccountsClient() *AccountsClient
- func (c *ClientFactory) NewAddressClient() *AddressClient
- func (c *ClientFactory) NewAgreementsClient() *AgreementsClient
- func (c *ClientFactory) NewAssociatedTenantsClient() *AssociatedTenantsClient
- func (c *ClientFactory) NewAvailableBalancesClient() *AvailableBalancesClient
- func (c *ClientFactory) NewCustomersClient() *CustomersClient
- func (c *ClientFactory) NewDepartmentsClient() *DepartmentsClient
- func (c *ClientFactory) NewEnrollmentAccountsClient() *EnrollmentAccountsClient
- func (c *ClientFactory) NewInvoiceSectionsClient() *InvoiceSectionsClient
- func (c *ClientFactory) NewInvoicesClient() *InvoicesClient
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewPartnerTransfersClient() *PartnerTransfersClient
- func (c *ClientFactory) NewPaymentMethodsClient() *PaymentMethodsClient
- 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) NewRecipientTransfersClient() *RecipientTransfersClient
- func (c *ClientFactory) NewRequestsClient() *RequestsClient
- func (c *ClientFactory) NewReservationOrdersClient() *ReservationOrdersClient
- func (c *ClientFactory) NewReservationsClient() *ReservationsClient
- func (c *ClientFactory) NewRoleAssignmentsClient() *RoleAssignmentsClient
- func (c *ClientFactory) NewRoleDefinitionClient() *RoleDefinitionClient
- func (c *ClientFactory) NewSavingsPlanOrdersClient() *SavingsPlanOrdersClient
- func (c *ClientFactory) NewSavingsPlansClient() *SavingsPlansClient
- func (c *ClientFactory) NewSubscriptionsAliasesClient() *SubscriptionsAliasesClient
- func (c *ClientFactory) NewSubscriptionsClient() *SubscriptionsClient
- func (c *ClientFactory) NewTransactionsClient() *TransactionsClient
- func (c *ClientFactory) NewTransfersClient() *TransfersClient
- type Commitment
- type CommitmentGrain
- type CreatedByType
- type CreditType
- type Customer
- type CustomerListResult
- type CustomerPolicy
- type CustomerPolicyProperties
- type CustomerProperties
- type CustomerStatus
- type CustomersClient
- func (client *CustomersClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, ...) (CustomersClientGetResponse, error)
- func (client *CustomersClient) GetByBillingAccount(ctx context.Context, billingAccountName string, customerName string, ...) (CustomersClientGetByBillingAccountResponse, error)
- func (client *CustomersClient) NewListByBillingAccountPager(billingAccountName string, options *CustomersClientListByBillingAccountOptions) *runtime.Pager[CustomersClientListByBillingAccountResponse]
- func (client *CustomersClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[CustomersClientListByBillingProfileResponse]
- type CustomersClientGetByBillingAccountOptions
- type CustomersClientGetByBillingAccountResponse
- type CustomersClientGetOptions
- type CustomersClientGetResponse
- type CustomersClientListByBillingAccountOptions
- type CustomersClientListByBillingAccountResponse
- type CustomersClientListByBillingProfileOptions
- type CustomersClientListByBillingProfileResponse
- type DeleteBillingProfileEligibilityCode
- type DeleteBillingProfileEligibilityDetail
- type DeleteBillingProfileEligibilityResult
- type DeleteBillingProfileEligibilityStatus
- type DeleteInvoiceSectionEligibilityCode
- type DeleteInvoiceSectionEligibilityDetail
- type DeleteInvoiceSectionEligibilityResult
- type DeleteInvoiceSectionEligibilityStatus
- type Department
- type DepartmentListResult
- type DepartmentProperties
- type DepartmentsClient
- func (client *DepartmentsClient) Get(ctx context.Context, billingAccountName string, departmentName string, ...) (DepartmentsClientGetResponse, error)
- func (client *DepartmentsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[DepartmentsClientListByBillingAccountResponse]
- type DepartmentsClientGetOptions
- type DepartmentsClientGetResponse
- type DepartmentsClientListByBillingAccountOptions
- type DepartmentsClientListByBillingAccountResponse
- type DetailedTransferStatus
- type DocumentDownloadRequest
- type DocumentDownloadResult
- type DocumentSource
- type EligibleProductType
- type EnrollmentAccount
- type EnrollmentAccountListResult
- type EnrollmentAccountOwnerViewCharges
- type EnrollmentAccountProperties
- type EnrollmentAccountSubscriptionDetails
- type EnrollmentAccountsClient
- func (client *EnrollmentAccountsClient) Get(ctx context.Context, billingAccountName string, enrollmentAccountName string, ...) (EnrollmentAccountsClientGetResponse, error)
- func (client *EnrollmentAccountsClient) GetByDepartment(ctx context.Context, billingAccountName string, departmentName string, ...) (EnrollmentAccountsClientGetByDepartmentResponse, error)
- func (client *EnrollmentAccountsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[EnrollmentAccountsClientListByBillingAccountResponse]
- func (client *EnrollmentAccountsClient) NewListByDepartmentPager(billingAccountName string, departmentName string, ...) *runtime.Pager[EnrollmentAccountsClientListByDepartmentResponse]
- type EnrollmentAccountsClientGetByDepartmentOptions
- type EnrollmentAccountsClientGetByDepartmentResponse
- type EnrollmentAccountsClientGetOptions
- type EnrollmentAccountsClientGetResponse
- type EnrollmentAccountsClientListByBillingAccountOptions
- type EnrollmentAccountsClientListByBillingAccountResponse
- type EnrollmentAccountsClientListByDepartmentOptions
- type EnrollmentAccountsClientListByDepartmentResponse
- type EnrollmentAuthLevelState
- type EnrollmentDepartmentAdminViewCharges
- type EnrollmentDetails
- type EnrollmentDetailsIndirectRelationshipInfo
- type EnterpriseAgreementPolicies
- type ErrorAdditionalInfo
- type ErrorDetail
- type ErrorResponse
- type ExtendedStatusDefinitionProperties
- type ExtendedStatusInfo
- type ExtendedStatusInfoProperties
- type ExtendedTermOption
- type ExternalReference
- type FailedPayment
- type FailedPaymentReason
- type IndirectRelationshipInfo
- type InitiateTransferProperties
- type InitiateTransferRequest
- type InitiatorCustomerType
- type InstanceFlexibility
- type Invoice
- type InvoiceDocument
- type InvoiceDocumentType
- type InvoiceListResult
- type InvoiceProperties
- type InvoicePropertiesAmountDue
- type InvoicePropertiesAzurePrepaymentApplied
- type InvoicePropertiesBilledAmount
- type InvoicePropertiesCreditAmount
- type InvoicePropertiesFreeAzureCreditApplied
- type InvoicePropertiesRebillDetails
- type InvoicePropertiesRefundDetails
- type InvoicePropertiesSubTotal
- type InvoicePropertiesTaxAmount
- type InvoicePropertiesTotalAmount
- type InvoiceSection
- type InvoiceSectionLabelManagementPolicy
- type InvoiceSectionListResult
- type InvoiceSectionProperties
- type InvoiceSectionState
- type InvoiceSectionStateReasonCode
- type InvoiceSectionWithCreateSubPermission
- type InvoiceSectionWithCreateSubPermissionListResult
- type InvoiceSectionsClient
- func (client *InvoiceSectionsClient) BeginCreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[InvoiceSectionsClientCreateOrUpdateResponse], error)
- func (client *InvoiceSectionsClient) BeginDelete(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[InvoiceSectionsClientDeleteResponse], 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]
- func (client *InvoiceSectionsClient) ValidateDeleteEligibility(ctx context.Context, billingAccountName string, billingProfileName string, ...) (InvoiceSectionsClientValidateDeleteEligibilityResponse, error)
- type InvoiceSectionsClientBeginCreateOrUpdateOptions
- type InvoiceSectionsClientBeginDeleteOptions
- type InvoiceSectionsClientCreateOrUpdateResponse
- type InvoiceSectionsClientDeleteResponse
- type InvoiceSectionsClientGetOptions
- type InvoiceSectionsClientGetResponse
- type InvoiceSectionsClientListByBillingProfileOptions
- type InvoiceSectionsClientListByBillingProfileResponse
- type InvoiceSectionsClientValidateDeleteEligibilityOptions
- type InvoiceSectionsClientValidateDeleteEligibilityResponse
- type InvoiceStatus
- type InvoiceType
- type InvoicesClient
- func (client *InvoicesClient) BeginAmend(ctx context.Context, billingAccountName string, invoiceName string, ...) (*runtime.Poller[InvoicesClientAmendResponse], error)
- func (client *InvoicesClient) BeginDownloadByBillingAccount(ctx context.Context, billingAccountName string, invoiceName string, ...) (*runtime.Poller[InvoicesClientDownloadByBillingAccountResponse], error)
- func (client *InvoicesClient) BeginDownloadByBillingSubscription(ctx context.Context, invoiceName string, ...) (*runtime.Poller[InvoicesClientDownloadByBillingSubscriptionResponse], error)
- func (client *InvoicesClient) BeginDownloadDocumentsByBillingAccount(ctx context.Context, billingAccountName string, ...) (*runtime.Poller[InvoicesClientDownloadDocumentsByBillingAccountResponse], ...)
- func (client *InvoicesClient) BeginDownloadDocumentsByBillingSubscription(ctx context.Context, parameters []*DocumentDownloadRequest, ...) (*runtime.Poller[InvoicesClientDownloadDocumentsByBillingSubscriptionResponse], ...)
- func (client *InvoicesClient) BeginDownloadSummaryByBillingAccount(ctx context.Context, billingAccountName string, invoiceName string, ...) (*runtime.Poller[InvoicesClientDownloadSummaryByBillingAccountResponse], error)
- func (client *InvoicesClient) Get(ctx context.Context, invoiceName string, options *InvoicesClientGetOptions) (InvoicesClientGetResponse, error)
- func (client *InvoicesClient) GetByBillingAccount(ctx context.Context, billingAccountName string, invoiceName string, ...) (InvoicesClientGetByBillingAccountResponse, error)
- func (client *InvoicesClient) GetByBillingSubscription(ctx context.Context, invoiceName string, ...) (InvoicesClientGetByBillingSubscriptionResponse, error)
- func (client *InvoicesClient) NewListByBillingAccountPager(billingAccountName string, options *InvoicesClientListByBillingAccountOptions) *runtime.Pager[InvoicesClientListByBillingAccountResponse]
- func (client *InvoicesClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[InvoicesClientListByBillingProfileResponse]
- func (client *InvoicesClient) NewListByBillingSubscriptionPager(options *InvoicesClientListByBillingSubscriptionOptions) *runtime.Pager[InvoicesClientListByBillingSubscriptionResponse]
- type InvoicesClientAmendResponse
- type InvoicesClientBeginAmendOptions
- type InvoicesClientBeginDownloadByBillingAccountOptions
- type InvoicesClientBeginDownloadByBillingSubscriptionOptions
- type InvoicesClientBeginDownloadDocumentsByBillingAccountOptions
- type InvoicesClientBeginDownloadDocumentsByBillingSubscriptionOptions
- type InvoicesClientBeginDownloadSummaryByBillingAccountOptions
- type InvoicesClientDownloadByBillingAccountResponse
- type InvoicesClientDownloadByBillingSubscriptionResponse
- type InvoicesClientDownloadDocumentsByBillingAccountResponse
- type InvoicesClientDownloadDocumentsByBillingSubscriptionResponse
- type InvoicesClientDownloadSummaryByBillingAccountResponse
- type InvoicesClientGetByBillingAccountOptions
- type InvoicesClientGetByBillingAccountResponse
- type InvoicesClientGetByBillingSubscriptionOptions
- type InvoicesClientGetByBillingSubscriptionResponse
- type InvoicesClientGetOptions
- type InvoicesClientGetResponse
- type InvoicesClientListByBillingAccountOptions
- type InvoicesClientListByBillingAccountResponse
- type InvoicesClientListByBillingProfileOptions
- type InvoicesClientListByBillingProfileResponse
- type InvoicesClientListByBillingSubscriptionOptions
- type InvoicesClientListByBillingSubscriptionResponse
- type MarketplacePurchasesPolicy
- type MarkupStatus
- type MoveBillingSubscriptionEligibilityResult
- type MoveBillingSubscriptionErrorDetails
- type MoveBillingSubscriptionRequest
- type MoveProductEligibilityResult
- type MoveProductEligibilityResultErrorDetails
- type MoveProductErrorDetails
- type MoveProductRequest
- type MoveValidationErrorCode
- type NextBillingCycleDetails
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Participant
- type PartnerInitiateTransferProperties
- type PartnerInitiateTransferRequest
- type PartnerTransferDetails
- type PartnerTransferDetailsListResult
- type PartnerTransferProperties
- type PartnerTransfersClient
- func (client *PartnerTransfersClient) Cancel(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PartnerTransfersClientCancelResponse, error)
- func (client *PartnerTransfersClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PartnerTransfersClientGetResponse, error)
- func (client *PartnerTransfersClient) Initiate(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PartnerTransfersClientInitiateResponse, error)
- func (client *PartnerTransfersClient) NewListPager(billingAccountName string, billingProfileName string, customerName string, ...) *runtime.Pager[PartnerTransfersClientListResponse]
- type PartnerTransfersClientCancelOptions
- type PartnerTransfersClientCancelResponse
- type PartnerTransfersClientGetOptions
- type PartnerTransfersClientGetResponse
- type PartnerTransfersClientInitiateOptions
- type PartnerTransfersClientInitiateResponse
- type PartnerTransfersClientListOptions
- type PartnerTransfersClientListResponse
- type Patch
- type PatchProperties
- type PatchPropertiesRenewProperties
- type Payment
- type PaymentAmount
- type PaymentDetail
- type PaymentMethod
- type PaymentMethodFamily
- type PaymentMethodLink
- type PaymentMethodLinkProperties
- type PaymentMethodLinksListResult
- type PaymentMethodLogo
- type PaymentMethodProperties
- type PaymentMethodStatus
- type PaymentMethodsClient
- func (client *PaymentMethodsClient) DeleteByUser(ctx context.Context, paymentMethodName string, ...) (PaymentMethodsClientDeleteByUserResponse, error)
- func (client *PaymentMethodsClient) GetByBillingAccount(ctx context.Context, billingAccountName string, paymentMethodName string, ...) (PaymentMethodsClientGetByBillingAccountResponse, error)
- func (client *PaymentMethodsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PaymentMethodsClientGetByBillingProfileResponse, error)
- func (client *PaymentMethodsClient) GetByUser(ctx context.Context, paymentMethodName string, ...) (PaymentMethodsClientGetByUserResponse, error)
- func (client *PaymentMethodsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[PaymentMethodsClientListByBillingAccountResponse]
- func (client *PaymentMethodsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[PaymentMethodsClientListByBillingProfileResponse]
- func (client *PaymentMethodsClient) NewListByUserPager(options *PaymentMethodsClientListByUserOptions) *runtime.Pager[PaymentMethodsClientListByUserResponse]
- type PaymentMethodsClientDeleteByUserOptions
- type PaymentMethodsClientDeleteByUserResponse
- type PaymentMethodsClientGetByBillingAccountOptions
- type PaymentMethodsClientGetByBillingAccountResponse
- type PaymentMethodsClientGetByBillingProfileOptions
- type PaymentMethodsClientGetByBillingProfileResponse
- type PaymentMethodsClientGetByUserOptions
- type PaymentMethodsClientGetByUserResponse
- type PaymentMethodsClientListByBillingAccountOptions
- type PaymentMethodsClientListByBillingAccountResponse
- type PaymentMethodsClientListByBillingProfileOptions
- type PaymentMethodsClientListByBillingProfileResponse
- type PaymentMethodsClientListByUserOptions
- type PaymentMethodsClientListByUserResponse
- type PaymentMethodsListResult
- type PaymentOnAccount
- type PaymentOnAccountAmount
- type PaymentStatus
- type PaymentTerm
- type PaymentTermsEligibilityCode
- type PaymentTermsEligibilityDetail
- type PaymentTermsEligibilityResult
- type PaymentTermsEligibilityStatus
- type Permission
- type PermissionListResult
- type PermissionsClient
- func (client *PermissionsClient) CheckAccessByBillingAccount(ctx context.Context, billingAccountName string, parameters CheckAccessRequest, ...) (PermissionsClientCheckAccessByBillingAccountResponse, error)
- func (client *PermissionsClient) CheckAccessByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PermissionsClientCheckAccessByBillingProfileResponse, error)
- func (client *PermissionsClient) CheckAccessByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PermissionsClientCheckAccessByCustomerResponse, error)
- func (client *PermissionsClient) CheckAccessByDepartment(ctx context.Context, billingAccountName string, departmentName string, ...) (PermissionsClientCheckAccessByDepartmentResponse, error)
- func (client *PermissionsClient) CheckAccessByEnrollmentAccount(ctx context.Context, billingAccountName string, enrollmentAccountName string, ...) (PermissionsClientCheckAccessByEnrollmentAccountResponse, error)
- func (client *PermissionsClient) CheckAccessByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PermissionsClientCheckAccessByInvoiceSectionResponse, error)
- func (client *PermissionsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[PermissionsClientListByBillingAccountResponse]
- func (client *PermissionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[PermissionsClientListByBillingProfileResponse]
- func (client *PermissionsClient) NewListByCustomerAtBillingAccountPager(billingAccountName string, customerName string, ...) *runtime.Pager[PermissionsClientListByCustomerAtBillingAccountResponse]
- func (client *PermissionsClient) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, ...) *runtime.Pager[PermissionsClientListByCustomerResponse]
- func (client *PermissionsClient) NewListByDepartmentPager(billingAccountName string, departmentName string, ...) *runtime.Pager[PermissionsClientListByDepartmentResponse]
- func (client *PermissionsClient) NewListByEnrollmentAccountPager(billingAccountName string, enrollmentAccountName string, ...) *runtime.Pager[PermissionsClientListByEnrollmentAccountResponse]
- func (client *PermissionsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[PermissionsClientListByInvoiceSectionResponse]
- type PermissionsClientCheckAccessByBillingAccountOptions
- type PermissionsClientCheckAccessByBillingAccountResponse
- type PermissionsClientCheckAccessByBillingProfileOptions
- type PermissionsClientCheckAccessByBillingProfileResponse
- type PermissionsClientCheckAccessByCustomerOptions
- type PermissionsClientCheckAccessByCustomerResponse
- type PermissionsClientCheckAccessByDepartmentOptions
- type PermissionsClientCheckAccessByDepartmentResponse
- type PermissionsClientCheckAccessByEnrollmentAccountOptions
- type PermissionsClientCheckAccessByEnrollmentAccountResponse
- type PermissionsClientCheckAccessByInvoiceSectionOptions
- type PermissionsClientCheckAccessByInvoiceSectionResponse
- type PermissionsClientListByBillingAccountOptions
- type PermissionsClientListByBillingAccountResponse
- type PermissionsClientListByBillingProfileOptions
- type PermissionsClientListByBillingProfileResponse
- type PermissionsClientListByCustomerAtBillingAccountOptions
- type PermissionsClientListByCustomerAtBillingAccountResponse
- type PermissionsClientListByCustomerOptions
- type PermissionsClientListByCustomerResponse
- type PermissionsClientListByDepartmentOptions
- type PermissionsClientListByDepartmentResponse
- type PermissionsClientListByEnrollmentAccountOptions
- type PermissionsClientListByEnrollmentAccountResponse
- type PermissionsClientListByInvoiceSectionOptions
- type PermissionsClientListByInvoiceSectionResponse
- type PlanInformation
- type PoliciesClient
- func (client *PoliciesClient) BeginCreateOrUpdateByBillingAccount(ctx context.Context, billingAccountName string, parameters AccountPolicy, ...) (*runtime.Poller[PoliciesClientCreateOrUpdateByBillingAccountResponse], error)
- func (client *PoliciesClient) BeginCreateOrUpdateByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[PoliciesClientCreateOrUpdateByBillingProfileResponse], error)
- func (client *PoliciesClient) BeginCreateOrUpdateByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[PoliciesClientCreateOrUpdateByCustomerResponse], error)
- func (client *PoliciesClient) BeginCreateOrUpdateByCustomerAtBillingAccount(ctx context.Context, billingAccountName string, customerName string, ...) (...)
- func (client *PoliciesClient) GetByBillingAccount(ctx context.Context, billingAccountName string, ...) (PoliciesClientGetByBillingAccountResponse, error)
- func (client *PoliciesClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PoliciesClientGetByBillingProfileResponse, error)
- func (client *PoliciesClient) GetByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, ...) (PoliciesClientGetByCustomerResponse, error)
- func (client *PoliciesClient) GetByCustomerAtBillingAccount(ctx context.Context, billingAccountName string, customerName string, ...) (PoliciesClientGetByCustomerAtBillingAccountResponse, error)
- func (client *PoliciesClient) GetBySubscription(ctx context.Context, options *PoliciesClientGetBySubscriptionOptions) (PoliciesClientGetBySubscriptionResponse, error)
- type PoliciesClientBeginCreateOrUpdateByBillingAccountOptions
- type PoliciesClientBeginCreateOrUpdateByBillingProfileOptions
- type PoliciesClientBeginCreateOrUpdateByCustomerAtBillingAccountOptions
- type PoliciesClientBeginCreateOrUpdateByCustomerOptions
- type PoliciesClientCreateOrUpdateByBillingAccountResponse
- type PoliciesClientCreateOrUpdateByBillingProfileResponse
- type PoliciesClientCreateOrUpdateByCustomerAtBillingAccountResponse
- type PoliciesClientCreateOrUpdateByCustomerResponse
- type PoliciesClientGetByBillingAccountOptions
- type PoliciesClientGetByBillingAccountResponse
- type PoliciesClientGetByBillingProfileOptions
- type PoliciesClientGetByBillingProfileResponse
- type PoliciesClientGetByCustomerAtBillingAccountOptions
- type PoliciesClientGetByCustomerAtBillingAccountResponse
- type PoliciesClientGetByCustomerOptions
- type PoliciesClientGetByCustomerResponse
- type PoliciesClientGetBySubscriptionOptions
- type PoliciesClientGetBySubscriptionResponse
- type PolicySummary
- type PolicyType
- type Price
- type Principal
- type PrincipalType
- type Product
- type ProductDetails
- type ProductListResult
- type ProductPatch
- type ProductProperties
- type ProductPropertiesLastCharge
- type ProductPropertiesReseller
- type ProductStatus
- type ProductTransferStatus
- type ProductType
- type ProductsClient
- func (client *ProductsClient) BeginMove(ctx context.Context, billingAccountName string, productName string, ...) (*runtime.Poller[ProductsClientMoveResponse], error)
- func (client *ProductsClient) Get(ctx context.Context, billingAccountName string, productName string, ...) (ProductsClientGetResponse, 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) ValidateMoveEligibility(ctx context.Context, billingAccountName string, productName string, ...) (ProductsClientValidateMoveEligibilityResponse, error)
- type ProductsClientBeginMoveOptions
- type ProductsClientGetOptions
- type ProductsClientGetResponse
- type ProductsClientListByBillingAccountOptions
- type ProductsClientListByBillingAccountResponse
- type ProductsClientListByBillingProfileOptions
- type ProductsClientListByBillingProfileResponse
- type ProductsClientListByCustomerOptions
- type ProductsClientListByCustomerResponse
- type ProductsClientListByInvoiceSectionOptions
- type ProductsClientListByInvoiceSectionResponse
- type ProductsClientMoveResponse
- type ProductsClientUpdateOptions
- type ProductsClientUpdateResponse
- type ProductsClientValidateMoveEligibilityOptions
- type ProductsClientValidateMoveEligibilityResponse
- type Profile
- type ProfileInfo
- type ProfileListResult
- type ProfilePolicy
- type ProfilePolicyProperties
- type ProfilePolicyPropertiesEnterpriseAgreementPolicies
- type ProfileProperties
- type ProfilePropertiesBillTo
- type ProfilePropertiesCurrentPaymentTerm
- type ProfilePropertiesIndirectRelationshipInfo
- type ProfilePropertiesShipTo
- type ProfilePropertiesSoldTo
- type ProfilesClient
- func (client *ProfilesClient) BeginCreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[ProfilesClientCreateOrUpdateResponse], error)
- func (client *ProfilesClient) BeginDelete(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[ProfilesClientDeleteResponse], 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]
- func (client *ProfilesClient) ValidateDeleteEligibility(ctx context.Context, billingAccountName string, billingProfileName string, ...) (ProfilesClientValidateDeleteEligibilityResponse, error)
- type ProfilesClientBeginCreateOrUpdateOptions
- type ProfilesClientBeginDeleteOptions
- type ProfilesClientCreateOrUpdateResponse
- type ProfilesClientDeleteResponse
- type ProfilesClientGetOptions
- type ProfilesClientGetResponse
- type ProfilesClientListByBillingAccountOptions
- type ProfilesClientListByBillingAccountResponse
- type ProfilesClientValidateDeleteEligibilityOptions
- type ProfilesClientValidateDeleteEligibilityResponse
- type Property
- type PropertyClient
- type PropertyClientGetOptions
- type PropertyClientGetResponse
- type PropertyClientUpdateOptions
- type PropertyClientUpdateResponse
- type PropertyProperties
- type PropertyPropertiesEnrollmentDetails
- type PropertyPropertiesSubscriptionServiceUsageAddress
- type ProvisioningState
- type ProvisioningTenantState
- type ProxyResource
- type ProxyResourceWithTags
- type PurchaseRequest
- type PurchaseRequestProperties
- type RebillDetails
- type RecipientTransferDetails
- type RecipientTransferDetailsListResult
- type RecipientTransferProperties
- type RecipientTransfersClient
- func (client *RecipientTransfersClient) Accept(ctx context.Context, transferName string, parameters AcceptTransferRequest, ...) (RecipientTransfersClientAcceptResponse, error)
- func (client *RecipientTransfersClient) Decline(ctx context.Context, transferName string, ...) (RecipientTransfersClientDeclineResponse, error)
- func (client *RecipientTransfersClient) Get(ctx context.Context, transferName string, ...) (RecipientTransfersClientGetResponse, error)
- func (client *RecipientTransfersClient) NewListPager(options *RecipientTransfersClientListOptions) *runtime.Pager[RecipientTransfersClientListResponse]
- func (client *RecipientTransfersClient) Validate(ctx context.Context, transferName string, parameters AcceptTransferRequest, ...) (RecipientTransfersClientValidateResponse, error)
- type RecipientTransfersClientAcceptOptions
- type RecipientTransfersClientAcceptResponse
- type RecipientTransfersClientDeclineOptions
- type RecipientTransfersClientDeclineResponse
- type RecipientTransfersClientGetOptions
- type RecipientTransfersClientGetResponse
- type RecipientTransfersClientListOptions
- type RecipientTransfersClientListResponse
- type RecipientTransfersClientValidateOptions
- type RecipientTransfersClientValidateResponse
- type RefundDetailsSummary
- type RefundDetailsSummaryAmountRefunded
- type RefundDetailsSummaryAmountRequested
- type RefundReasonCode
- type RefundStatus
- type RefundTransactionDetails
- type RefundTransactionDetailsAmountRefunded
- type RefundTransactionDetailsAmountRequested
- type RegistrationNumber
- type RenewProperties
- type RenewPropertiesResponse
- type RenewalTermDetails
- type Request
- type RequestListResult
- type RequestProperties
- type RequestPropertiesCreatedBy
- type RequestPropertiesLastUpdatedBy
- type RequestPropertiesReviewedBy
- type RequestsClient
- func (client *RequestsClient) BeginCreateOrUpdate(ctx context.Context, billingRequestName string, parameters Request, ...) (*runtime.Poller[RequestsClientCreateOrUpdateResponse], error)
- func (client *RequestsClient) Get(ctx context.Context, billingRequestName string, ...) (RequestsClientGetResponse, error)
- func (client *RequestsClient) NewListByBillingAccountPager(billingAccountName string, options *RequestsClientListByBillingAccountOptions) *runtime.Pager[RequestsClientListByBillingAccountResponse]
- func (client *RequestsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[RequestsClientListByBillingProfileResponse]
- func (client *RequestsClient) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, ...) *runtime.Pager[RequestsClientListByCustomerResponse]
- func (client *RequestsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[RequestsClientListByInvoiceSectionResponse]
- func (client *RequestsClient) NewListByUserPager(options *RequestsClientListByUserOptions) *runtime.Pager[RequestsClientListByUserResponse]
- type RequestsClientBeginCreateOrUpdateOptions
- type RequestsClientCreateOrUpdateResponse
- type RequestsClientGetOptions
- type RequestsClientGetResponse
- type RequestsClientListByBillingAccountOptions
- type RequestsClientListByBillingAccountResponse
- type RequestsClientListByBillingProfileOptions
- type RequestsClientListByBillingProfileResponse
- type RequestsClientListByCustomerOptions
- type RequestsClientListByCustomerResponse
- type RequestsClientListByInvoiceSectionOptions
- type RequestsClientListByInvoiceSectionResponse
- type RequestsClientListByUserOptions
- type RequestsClientListByUserResponse
- type Reseller
- type Reservation
- type ReservationAppliedScopeProperties
- type ReservationBillingPlan
- type ReservationExtendedStatusInfo
- type ReservationList
- type ReservationMergeProperties
- type ReservationOrder
- type ReservationOrderBillingPlanInformation
- type ReservationOrderList
- type ReservationOrderProperty
- type ReservationOrdersClient
- func (client *ReservationOrdersClient) GetByBillingAccount(ctx context.Context, billingAccountName string, reservationOrderID string, ...) (ReservationOrdersClientGetByBillingAccountResponse, error)
- func (client *ReservationOrdersClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[ReservationOrdersClientListByBillingAccountResponse]
- type ReservationOrdersClientGetByBillingAccountOptions
- type ReservationOrdersClientGetByBillingAccountResponse
- type ReservationOrdersClientListByBillingAccountOptions
- type ReservationOrdersClientListByBillingAccountResponse
- type ReservationPaymentDetail
- type ReservationProperty
- type ReservationPropertyUtilization
- type ReservationPurchaseRequest
- type ReservationPurchaseRequestProperties
- type ReservationPurchaseRequestPropertiesReservedResourceProperties
- type ReservationPurchasesPolicy
- type ReservationSKUProperty
- type ReservationSplitProperties
- type ReservationStatusCode
- type ReservationSummary
- type ReservationSwapProperties
- type ReservationUtilizationAggregates
- type ReservationsClient
- func (client *ReservationsClient) BeginUpdateByBillingAccount(ctx context.Context, billingAccountName string, reservationOrderID string, ...) (*runtime.Poller[ReservationsClientUpdateByBillingAccountResponse], error)
- func (client *ReservationsClient) GetByReservationOrder(ctx context.Context, billingAccountName string, reservationOrderID string, ...) (ReservationsClientGetByReservationOrderResponse, error)
- func (client *ReservationsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[ReservationsClientListByBillingAccountResponse]
- func (client *ReservationsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[ReservationsClientListByBillingProfileResponse]
- func (client *ReservationsClient) NewListByReservationOrderPager(billingAccountName string, reservationOrderID string, ...) *runtime.Pager[ReservationsClientListByReservationOrderResponse]
- type ReservationsClientBeginUpdateByBillingAccountOptions
- type ReservationsClientGetByReservationOrderOptions
- type ReservationsClientGetByReservationOrderResponse
- type ReservationsClientListByBillingAccountOptions
- type ReservationsClientListByBillingAccountResponse
- type ReservationsClientListByBillingProfileOptions
- type ReservationsClientListByBillingProfileResponse
- type ReservationsClientListByReservationOrderOptions
- type ReservationsClientListByReservationOrderResponse
- type ReservationsClientUpdateByBillingAccountResponse
- type ReservationsListResult
- type Resource
- type RoleAssignment
- type RoleAssignmentListResult
- type RoleAssignmentProperties
- type RoleAssignmentsClient
- func (client *RoleAssignmentsClient) BeginCreateByBillingAccount(ctx context.Context, billingAccountName string, ...) (*runtime.Poller[RoleAssignmentsClientCreateByBillingAccountResponse], error)
- func (client *RoleAssignmentsClient) BeginCreateByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[RoleAssignmentsClientCreateByBillingProfileResponse], error)
- func (client *RoleAssignmentsClient) BeginCreateByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[RoleAssignmentsClientCreateByCustomerResponse], error)
- func (client *RoleAssignmentsClient) BeginCreateByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[RoleAssignmentsClientCreateByInvoiceSectionResponse], error)
- func (client *RoleAssignmentsClient) BeginCreateOrUpdateByBillingAccount(ctx context.Context, billingAccountName string, ...) (*runtime.Poller[RoleAssignmentsClientCreateOrUpdateByBillingAccountResponse], ...)
- func (client *RoleAssignmentsClient) BeginCreateOrUpdateByDepartment(ctx context.Context, billingAccountName string, departmentName string, ...) (*runtime.Poller[RoleAssignmentsClientCreateOrUpdateByDepartmentResponse], ...)
- func (client *RoleAssignmentsClient) BeginCreateOrUpdateByEnrollmentAccount(ctx context.Context, billingAccountName string, enrollmentAccountName string, ...) (...)
- func (client *RoleAssignmentsClient) BeginResolveByBillingAccount(ctx context.Context, billingAccountName string, ...) (*runtime.Poller[RoleAssignmentsClientResolveByBillingAccountResponse], error)
- func (client *RoleAssignmentsClient) BeginResolveByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[RoleAssignmentsClientResolveByBillingProfileResponse], error)
- func (client *RoleAssignmentsClient) BeginResolveByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[RoleAssignmentsClientResolveByCustomerResponse], error)
- func (client *RoleAssignmentsClient) BeginResolveByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, ...) (*runtime.Poller[RoleAssignmentsClientResolveByInvoiceSectionResponse], error)
- 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) DeleteByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleAssignmentsClientDeleteByCustomerResponse, error)
- func (client *RoleAssignmentsClient) DeleteByDepartment(ctx context.Context, billingAccountName string, departmentName string, ...) (RoleAssignmentsClientDeleteByDepartmentResponse, error)
- func (client *RoleAssignmentsClient) DeleteByEnrollmentAccount(ctx context.Context, billingAccountName string, enrollmentAccountName string, ...) (RoleAssignmentsClientDeleteByEnrollmentAccountResponse, 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) GetByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleAssignmentsClientGetByCustomerResponse, error)
- func (client *RoleAssignmentsClient) GetByDepartment(ctx context.Context, billingAccountName string, departmentName string, ...) (RoleAssignmentsClientGetByDepartmentResponse, error)
- func (client *RoleAssignmentsClient) GetByEnrollmentAccount(ctx context.Context, billingAccountName string, enrollmentAccountName string, ...) (RoleAssignmentsClientGetByEnrollmentAccountResponse, 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) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, ...) *runtime.Pager[RoleAssignmentsClientListByCustomerResponse]
- func (client *RoleAssignmentsClient) NewListByDepartmentPager(billingAccountName string, departmentName string, ...) *runtime.Pager[RoleAssignmentsClientListByDepartmentResponse]
- func (client *RoleAssignmentsClient) NewListByEnrollmentAccountPager(billingAccountName string, enrollmentAccountName string, ...) *runtime.Pager[RoleAssignmentsClientListByEnrollmentAccountResponse]
- func (client *RoleAssignmentsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[RoleAssignmentsClientListByInvoiceSectionResponse]
- type RoleAssignmentsClientBeginCreateByBillingAccountOptions
- type RoleAssignmentsClientBeginCreateByBillingProfileOptions
- type RoleAssignmentsClientBeginCreateByCustomerOptions
- type RoleAssignmentsClientBeginCreateByInvoiceSectionOptions
- type RoleAssignmentsClientBeginCreateOrUpdateByBillingAccountOptions
- type RoleAssignmentsClientBeginCreateOrUpdateByDepartmentOptions
- type RoleAssignmentsClientBeginCreateOrUpdateByEnrollmentAccountOptions
- type RoleAssignmentsClientBeginResolveByBillingAccountOptions
- type RoleAssignmentsClientBeginResolveByBillingProfileOptions
- type RoleAssignmentsClientBeginResolveByCustomerOptions
- type RoleAssignmentsClientBeginResolveByInvoiceSectionOptions
- type RoleAssignmentsClientCreateByBillingAccountResponse
- type RoleAssignmentsClientCreateByBillingProfileResponse
- type RoleAssignmentsClientCreateByCustomerResponse
- type RoleAssignmentsClientCreateByInvoiceSectionResponse
- type RoleAssignmentsClientCreateOrUpdateByBillingAccountResponse
- type RoleAssignmentsClientCreateOrUpdateByDepartmentResponse
- type RoleAssignmentsClientCreateOrUpdateByEnrollmentAccountResponse
- type RoleAssignmentsClientDeleteByBillingAccountOptions
- type RoleAssignmentsClientDeleteByBillingAccountResponse
- type RoleAssignmentsClientDeleteByBillingProfileOptions
- type RoleAssignmentsClientDeleteByBillingProfileResponse
- type RoleAssignmentsClientDeleteByCustomerOptions
- type RoleAssignmentsClientDeleteByCustomerResponse
- type RoleAssignmentsClientDeleteByDepartmentOptions
- type RoleAssignmentsClientDeleteByDepartmentResponse
- type RoleAssignmentsClientDeleteByEnrollmentAccountOptions
- type RoleAssignmentsClientDeleteByEnrollmentAccountResponse
- type RoleAssignmentsClientDeleteByInvoiceSectionOptions
- type RoleAssignmentsClientDeleteByInvoiceSectionResponse
- type RoleAssignmentsClientGetByBillingAccountOptions
- type RoleAssignmentsClientGetByBillingAccountResponse
- type RoleAssignmentsClientGetByBillingProfileOptions
- type RoleAssignmentsClientGetByBillingProfileResponse
- type RoleAssignmentsClientGetByCustomerOptions
- type RoleAssignmentsClientGetByCustomerResponse
- type RoleAssignmentsClientGetByDepartmentOptions
- type RoleAssignmentsClientGetByDepartmentResponse
- type RoleAssignmentsClientGetByEnrollmentAccountOptions
- type RoleAssignmentsClientGetByEnrollmentAccountResponse
- type RoleAssignmentsClientGetByInvoiceSectionOptions
- type RoleAssignmentsClientGetByInvoiceSectionResponse
- type RoleAssignmentsClientListByBillingAccountOptions
- type RoleAssignmentsClientListByBillingAccountResponse
- type RoleAssignmentsClientListByBillingProfileOptions
- type RoleAssignmentsClientListByBillingProfileResponse
- type RoleAssignmentsClientListByCustomerOptions
- type RoleAssignmentsClientListByCustomerResponse
- type RoleAssignmentsClientListByDepartmentOptions
- type RoleAssignmentsClientListByDepartmentResponse
- type RoleAssignmentsClientListByEnrollmentAccountOptions
- type RoleAssignmentsClientListByEnrollmentAccountResponse
- type RoleAssignmentsClientListByInvoiceSectionOptions
- type RoleAssignmentsClientListByInvoiceSectionResponse
- type RoleAssignmentsClientResolveByBillingAccountResponse
- type RoleAssignmentsClientResolveByBillingProfileResponse
- type RoleAssignmentsClientResolveByCustomerResponse
- type RoleAssignmentsClientResolveByInvoiceSectionResponse
- type RoleDefinition
- type RoleDefinitionClient
- func (client *RoleDefinitionClient) GetByBillingAccount(ctx context.Context, billingAccountName string, roleDefinitionName string, ...) (RoleDefinitionClientGetByBillingAccountResponse, error)
- func (client *RoleDefinitionClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleDefinitionClientGetByBillingProfileResponse, error)
- func (client *RoleDefinitionClient) GetByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleDefinitionClientGetByCustomerResponse, error)
- func (client *RoleDefinitionClient) GetByDepartment(ctx context.Context, billingAccountName string, departmentName string, ...) (RoleDefinitionClientGetByDepartmentResponse, error)
- func (client *RoleDefinitionClient) GetByEnrollmentAccount(ctx context.Context, billingAccountName string, enrollmentAccountName string, ...) (RoleDefinitionClientGetByEnrollmentAccountResponse, error)
- func (client *RoleDefinitionClient) GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, ...) (RoleDefinitionClientGetByInvoiceSectionResponse, error)
- func (client *RoleDefinitionClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[RoleDefinitionClientListByBillingAccountResponse]
- func (client *RoleDefinitionClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[RoleDefinitionClientListByBillingProfileResponse]
- func (client *RoleDefinitionClient) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, ...) *runtime.Pager[RoleDefinitionClientListByCustomerResponse]
- func (client *RoleDefinitionClient) NewListByDepartmentPager(billingAccountName string, departmentName string, ...) *runtime.Pager[RoleDefinitionClientListByDepartmentResponse]
- func (client *RoleDefinitionClient) NewListByEnrollmentAccountPager(billingAccountName string, enrollmentAccountName string, ...) *runtime.Pager[RoleDefinitionClientListByEnrollmentAccountResponse]
- func (client *RoleDefinitionClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[RoleDefinitionClientListByInvoiceSectionResponse]
- type RoleDefinitionClientGetByBillingAccountOptions
- type RoleDefinitionClientGetByBillingAccountResponse
- type RoleDefinitionClientGetByBillingProfileOptions
- type RoleDefinitionClientGetByBillingProfileResponse
- type RoleDefinitionClientGetByCustomerOptions
- type RoleDefinitionClientGetByCustomerResponse
- type RoleDefinitionClientGetByDepartmentOptions
- type RoleDefinitionClientGetByDepartmentResponse
- type RoleDefinitionClientGetByEnrollmentAccountOptions
- type RoleDefinitionClientGetByEnrollmentAccountResponse
- type RoleDefinitionClientGetByInvoiceSectionOptions
- type RoleDefinitionClientGetByInvoiceSectionResponse
- type RoleDefinitionClientListByBillingAccountOptions
- type RoleDefinitionClientListByBillingAccountResponse
- type RoleDefinitionClientListByBillingProfileOptions
- type RoleDefinitionClientListByBillingProfileResponse
- type RoleDefinitionClientListByCustomerOptions
- type RoleDefinitionClientListByCustomerResponse
- type RoleDefinitionClientListByDepartmentOptions
- type RoleDefinitionClientListByDepartmentResponse
- type RoleDefinitionClientListByEnrollmentAccountOptions
- type RoleDefinitionClientListByEnrollmentAccountResponse
- type RoleDefinitionClientListByInvoiceSectionOptions
- type RoleDefinitionClientListByInvoiceSectionResponse
- type RoleDefinitionListResult
- type RoleDefinitionProperties
- type SKU
- type SKUName
- type SavingsPlanModel
- type SavingsPlanModelList
- type SavingsPlanModelListResult
- type SavingsPlanModelProperties
- type SavingsPlanOrderModel
- type SavingsPlanOrderModelList
- type SavingsPlanOrderModelProperties
- type SavingsPlanOrdersClient
- func (client *SavingsPlanOrdersClient) GetByBillingAccount(ctx context.Context, billingAccountName string, savingsPlanOrderID string, ...) (SavingsPlanOrdersClientGetByBillingAccountResponse, error)
- func (client *SavingsPlanOrdersClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[SavingsPlanOrdersClientListByBillingAccountResponse]
- type SavingsPlanOrdersClientGetByBillingAccountOptions
- type SavingsPlanOrdersClientGetByBillingAccountResponse
- type SavingsPlanOrdersClientListByBillingAccountOptions
- type SavingsPlanOrdersClientListByBillingAccountResponse
- type SavingsPlanPurchasesPolicy
- type SavingsPlanSummaryCount
- type SavingsPlanTerm
- type SavingsPlanUpdateRequest
- type SavingsPlanUpdateRequestProperties
- type SavingsPlanUpdateValidateRequest
- type SavingsPlanValidResponseProperty
- type SavingsPlanValidateResponse
- type SavingsPlansClient
- func (client *SavingsPlansClient) BeginUpdateByBillingAccount(ctx context.Context, billingAccountName string, savingsPlanOrderID string, ...) (*runtime.Poller[SavingsPlansClientUpdateByBillingAccountResponse], error)
- func (client *SavingsPlansClient) GetByBillingAccount(ctx context.Context, billingAccountName string, savingsPlanOrderID string, ...) (SavingsPlansClientGetByBillingAccountResponse, error)
- func (client *SavingsPlansClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[SavingsPlansClientListByBillingAccountResponse]
- func (client *SavingsPlansClient) NewListBySavingsPlanOrderPager(billingAccountName string, savingsPlanOrderID string, ...) *runtime.Pager[SavingsPlansClientListBySavingsPlanOrderResponse]
- func (client *SavingsPlansClient) ValidateUpdateByBillingAccount(ctx context.Context, billingAccountName string, savingsPlanOrderID string, ...) (SavingsPlansClientValidateUpdateByBillingAccountResponse, error)
- type SavingsPlansClientBeginUpdateByBillingAccountOptions
- type SavingsPlansClientGetByBillingAccountOptions
- type SavingsPlansClientGetByBillingAccountResponse
- type SavingsPlansClientListByBillingAccountOptions
- type SavingsPlansClientListByBillingAccountResponse
- type SavingsPlansClientListBySavingsPlanOrderOptions
- type SavingsPlansClientListBySavingsPlanOrderResponse
- type SavingsPlansClientUpdateByBillingAccountResponse
- type SavingsPlansClientValidateUpdateByBillingAccountOptions
- type SavingsPlansClientValidateUpdateByBillingAccountResponse
- type ServiceDefinedResourceName
- type SpecialTaxationType
- type SpendingLimit
- type SpendingLimitDetails
- type SpendingLimitStatus
- type SpendingLimitType
- type Subscription
- type SubscriptionAlias
- type SubscriptionAliasListResult
- type SubscriptionAliasProperties
- type SubscriptionBillingType
- type SubscriptionEnrollmentAccountStatus
- type SubscriptionEnrollmentDetails
- type SubscriptionListResult
- type SubscriptionMergeRequest
- type SubscriptionPatch
- type SubscriptionPolicy
- type SubscriptionPolicyProperties
- type SubscriptionProperties
- type SubscriptionSplitRequest
- type SubscriptionStatusDetails
- type SubscriptionStatusReason
- type SubscriptionTransferValidationErrorCode
- type SubscriptionWorkloadType
- type SubscriptionsAliasesClient
- func (client *SubscriptionsAliasesClient) BeginCreateOrUpdate(ctx context.Context, billingAccountName string, aliasName string, ...) (*runtime.Poller[SubscriptionsAliasesClientCreateOrUpdateResponse], error)
- func (client *SubscriptionsAliasesClient) Get(ctx context.Context, billingAccountName string, aliasName string, ...) (SubscriptionsAliasesClientGetResponse, error)
- func (client *SubscriptionsAliasesClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[SubscriptionsAliasesClientListByBillingAccountResponse]
- type SubscriptionsAliasesClientBeginCreateOrUpdateOptions
- type SubscriptionsAliasesClientCreateOrUpdateResponse
- type SubscriptionsAliasesClientGetOptions
- type SubscriptionsAliasesClientGetResponse
- type SubscriptionsAliasesClientListByBillingAccountOptions
- type SubscriptionsAliasesClientListByBillingAccountResponse
- type SubscriptionsClient
- func (client *SubscriptionsClient) BeginCancel(ctx context.Context, billingAccountName string, billingSubscriptionName string, ...) (*runtime.Poller[SubscriptionsClientCancelResponse], error)
- func (client *SubscriptionsClient) BeginDelete(ctx context.Context, billingAccountName string, billingSubscriptionName string, ...) (*runtime.Poller[SubscriptionsClientDeleteResponse], error)
- func (client *SubscriptionsClient) BeginMerge(ctx context.Context, billingAccountName string, billingSubscriptionName string, ...) (*runtime.Poller[SubscriptionsClientMergeResponse], error)
- func (client *SubscriptionsClient) BeginMove(ctx context.Context, billingAccountName string, billingSubscriptionName string, ...) (*runtime.Poller[SubscriptionsClientMoveResponse], error)
- func (client *SubscriptionsClient) BeginSplit(ctx context.Context, billingAccountName string, billingSubscriptionName string, ...) (*runtime.Poller[SubscriptionsClientSplitResponse], error)
- func (client *SubscriptionsClient) BeginUpdate(ctx context.Context, billingAccountName string, billingSubscriptionName string, ...) (*runtime.Poller[SubscriptionsClientUpdateResponse], error)
- func (client *SubscriptionsClient) Get(ctx context.Context, billingAccountName string, billingSubscriptionName string, ...) (SubscriptionsClientGetResponse, error)
- func (client *SubscriptionsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, ...) (SubscriptionsClientGetByBillingProfileResponse, error)
- func (client *SubscriptionsClient) NewListByBillingAccountPager(billingAccountName string, ...) *runtime.Pager[SubscriptionsClientListByBillingAccountResponse]
- func (client *SubscriptionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[SubscriptionsClientListByBillingProfileResponse]
- func (client *SubscriptionsClient) NewListByCustomerAtBillingAccountPager(billingAccountName string, customerName string, ...) *runtime.Pager[SubscriptionsClientListByCustomerAtBillingAccountResponse]
- func (client *SubscriptionsClient) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, ...) *runtime.Pager[SubscriptionsClientListByCustomerResponse]
- func (client *SubscriptionsClient) NewListByEnrollmentAccountPager(billingAccountName string, enrollmentAccountName string, ...) *runtime.Pager[SubscriptionsClientListByEnrollmentAccountResponse]
- func (client *SubscriptionsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[SubscriptionsClientListByInvoiceSectionResponse]
- func (client *SubscriptionsClient) ValidateMoveEligibility(ctx context.Context, billingAccountName string, billingSubscriptionName string, ...) (SubscriptionsClientValidateMoveEligibilityResponse, error)
- type SubscriptionsClientBeginCancelOptions
- type SubscriptionsClientBeginDeleteOptions
- type SubscriptionsClientBeginMergeOptions
- type SubscriptionsClientBeginMoveOptions
- type SubscriptionsClientBeginSplitOptions
- type SubscriptionsClientBeginUpdateOptions
- type SubscriptionsClientCancelResponse
- type SubscriptionsClientDeleteResponse
- type SubscriptionsClientGetByBillingProfileOptions
- type SubscriptionsClientGetByBillingProfileResponse
- type SubscriptionsClientGetOptions
- type SubscriptionsClientGetResponse
- type SubscriptionsClientListByBillingAccountOptions
- type SubscriptionsClientListByBillingAccountResponse
- type SubscriptionsClientListByBillingProfileOptions
- type SubscriptionsClientListByBillingProfileResponse
- type SubscriptionsClientListByCustomerAtBillingAccountOptions
- type SubscriptionsClientListByCustomerAtBillingAccountResponse
- type SubscriptionsClientListByCustomerOptions
- type SubscriptionsClientListByCustomerResponse
- type SubscriptionsClientListByEnrollmentAccountOptions
- type SubscriptionsClientListByEnrollmentAccountResponse
- type SubscriptionsClientListByInvoiceSectionOptions
- type SubscriptionsClientListByInvoiceSectionResponse
- type SubscriptionsClientMergeResponse
- type SubscriptionsClientMoveResponse
- type SubscriptionsClientSplitResponse
- type SubscriptionsClientUpdateResponse
- type SubscriptionsClientValidateMoveEligibilityOptions
- type SubscriptionsClientValidateMoveEligibilityResponse
- type SupportLevel
- type SupportedAccountType
- type SystemData
- type SystemOverrides
- type TaxIdentifier
- type TaxIdentifierStatus
- type TaxIdentifierType
- type Transaction
- type TransactionKind
- type TransactionListResult
- type TransactionProperties
- type TransactionPropertiesAzureCreditApplied
- type TransactionPropertiesConsumptionCommitmentDecremented
- type TransactionPropertiesEffectivePrice
- type TransactionPropertiesMarketPrice
- type TransactionPropertiesRefundTransactionDetails
- type TransactionPropertiesSubTotal
- type TransactionPropertiesTax
- type TransactionPropertiesTransactionAmount
- type TransactionSummary
- type TransactionType
- type TransactionsClient
- func (client *TransactionsClient) BeginTransactionsDownloadByInvoice(ctx context.Context, billingAccountName string, invoiceName string, ...) (*runtime.Poller[TransactionsClientTransactionsDownloadByInvoiceResponse], ...)
- func (client *TransactionsClient) GetTransactionSummaryByInvoice(ctx context.Context, billingAccountName string, invoiceName string, ...) (TransactionsClientGetTransactionSummaryByInvoiceResponse, error)
- func (client *TransactionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[TransactionsClientListByBillingProfileResponse]
- func (client *TransactionsClient) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, ...) *runtime.Pager[TransactionsClientListByCustomerResponse]
- func (client *TransactionsClient) NewListByInvoicePager(billingAccountName string, invoiceName string, ...) *runtime.Pager[TransactionsClientListByInvoiceResponse]
- func (client *TransactionsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[TransactionsClientListByInvoiceSectionResponse]
- type TransactionsClientBeginTransactionsDownloadByInvoiceOptions
- type TransactionsClientGetTransactionSummaryByInvoiceOptions
- type TransactionsClientGetTransactionSummaryByInvoiceResponse
- type TransactionsClientListByBillingProfileOptions
- type TransactionsClientListByBillingProfileResponse
- type TransactionsClientListByCustomerOptions
- type TransactionsClientListByCustomerResponse
- type TransactionsClientListByInvoiceOptions
- type TransactionsClientListByInvoiceResponse
- type TransactionsClientListByInvoiceSectionOptions
- type TransactionsClientListByInvoiceSectionResponse
- type TransactionsClientTransactionsDownloadByInvoiceResponse
- type TransferDetails
- type TransferDetailsListResult
- type TransferError
- type TransferItemQueryParameter
- type TransferProperties
- type TransferStatus
- type TransfersClient
- func (client *TransfersClient) Cancel(ctx context.Context, billingAccountName string, billingProfileName string, ...) (TransfersClientCancelResponse, error)
- func (client *TransfersClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, ...) (TransfersClientGetResponse, error)
- func (client *TransfersClient) Initiate(ctx context.Context, billingAccountName string, billingProfileName string, ...) (TransfersClientInitiateResponse, error)
- func (client *TransfersClient) NewListPager(billingAccountName string, billingProfileName string, ...) *runtime.Pager[TransfersClientListResponse]
- type TransfersClientCancelOptions
- type TransfersClientCancelResponse
- type TransfersClientGetOptions
- type TransfersClientGetResponse
- type TransfersClientInitiateOptions
- type TransfersClientInitiateResponse
- type TransfersClientListOptions
- type TransfersClientListResponse
- type TransitionDetails
- type Utilization
- type UtilizationAggregates
- type ValidateTransferListResponse
- type ValidateTransferResponse
- type ValidateTransferResponseProperties
- type ValidationResultProperties
- type ViewChargesPolicy
Examples ¶
- AccountsClient.BeginAddPaymentTerms
- AccountsClient.BeginCancelPaymentTerms
- AccountsClient.BeginUpdate (BillingAccountUpdateWithPoNumber)
- AccountsClient.BeginUpdate (BillingAccountsUpdate)
- AccountsClient.ConfirmTransition
- AccountsClient.Get (BillingAccountWithExpandForPoNumber)
- AccountsClient.Get (BillingAccountWithRegistrationNumberWithDefaultType)
- AccountsClient.Get (BillingAccountWithRegistrationNumberWithType)
- AccountsClient.Get (BillingAccountsGet)
- AccountsClient.Get (BillingAccountsGetEa)
- AccountsClient.Get (BillingAccountsGetWithExpand)
- AccountsClient.NewListInvoiceSectionsByCreateSubscriptionPermissionPager
- AccountsClient.NewListPager (BillingAccountForLegacyAccountDetails)
- AccountsClient.NewListPager (BillingAccountsList)
- AccountsClient.NewListPager (BillingAccountsListWithExpandForPoNumber)
- AccountsClient.ValidatePaymentTerms (PaymentTermInvalid)
- AccountsClient.ValidatePaymentTerms (PaymentTermValid)
- AddressClient.Validate (AddressValidateInvalid)
- AddressClient.Validate (AddressValidateValid)
- AgreementsClient.Get
- AgreementsClient.NewListByBillingAccountPager
- AssociatedTenantsClient.BeginCreateOrUpdate
- AssociatedTenantsClient.BeginDelete
- AssociatedTenantsClient.Get
- AssociatedTenantsClient.NewListByBillingAccountPager
- AvailableBalancesClient.GetByBillingAccount
- AvailableBalancesClient.GetByBillingProfile
- CustomersClient.Get
- CustomersClient.GetByBillingAccount
- CustomersClient.NewListByBillingAccountPager (CustomersListByBillingAccount)
- CustomersClient.NewListByBillingAccountPager (CustomersListByBillingAccountWithExpand)
- CustomersClient.NewListByBillingProfilePager
- DepartmentsClient.Get
- DepartmentsClient.NewListByBillingAccountPager
- EnrollmentAccountsClient.Get
- EnrollmentAccountsClient.GetByDepartment
- EnrollmentAccountsClient.NewListByBillingAccountPager
- EnrollmentAccountsClient.NewListByDepartmentPager
- InvoiceSectionsClient.BeginCreateOrUpdate
- InvoiceSectionsClient.BeginDelete
- InvoiceSectionsClient.Get
- InvoiceSectionsClient.NewListByBillingProfilePager
- InvoiceSectionsClient.ValidateDeleteEligibility (InvoiceSectionsValidateDeleteEligibilityFailure)
- InvoiceSectionsClient.ValidateDeleteEligibility (InvoiceSectionsValidateDeleteEligibilitySuccess)
- InvoicesClient.BeginAmend
- InvoicesClient.BeginDownloadByBillingAccount
- InvoicesClient.BeginDownloadByBillingSubscription
- InvoicesClient.BeginDownloadDocumentsByBillingAccount
- InvoicesClient.BeginDownloadDocumentsByBillingSubscription
- InvoicesClient.BeginDownloadSummaryByBillingAccount
- InvoicesClient.Get
- InvoicesClient.GetByBillingAccount
- InvoicesClient.GetByBillingSubscription
- InvoicesClient.NewListByBillingAccountPager
- InvoicesClient.NewListByBillingProfilePager
- InvoicesClient.NewListByBillingSubscriptionPager
- OperationsClient.NewListPager
- PartnerTransfersClient.Cancel
- PartnerTransfersClient.Get
- PartnerTransfersClient.Initiate
- PartnerTransfersClient.NewListPager
- PaymentMethodsClient.DeleteByUser
- PaymentMethodsClient.GetByBillingAccount
- PaymentMethodsClient.GetByBillingProfile
- PaymentMethodsClient.GetByUser
- PaymentMethodsClient.NewListByBillingAccountPager
- PaymentMethodsClient.NewListByBillingProfilePager
- PaymentMethodsClient.NewListByUserPager
- PermissionsClient.CheckAccessByBillingAccount
- PermissionsClient.CheckAccessByBillingProfile
- PermissionsClient.CheckAccessByCustomer
- PermissionsClient.CheckAccessByDepartment
- PermissionsClient.CheckAccessByEnrollmentAccount
- PermissionsClient.CheckAccessByInvoiceSection
- PermissionsClient.NewListByBillingAccountPager
- PermissionsClient.NewListByBillingProfilePager
- PermissionsClient.NewListByCustomerAtBillingAccountPager
- PermissionsClient.NewListByCustomerPager
- PermissionsClient.NewListByDepartmentPager
- PermissionsClient.NewListByEnrollmentAccountPager
- PermissionsClient.NewListByInvoiceSectionPager
- PoliciesClient.BeginCreateOrUpdateByBillingAccount
- PoliciesClient.BeginCreateOrUpdateByBillingProfile
- PoliciesClient.BeginCreateOrUpdateByCustomer
- PoliciesClient.BeginCreateOrUpdateByCustomerAtBillingAccount
- PoliciesClient.GetByBillingAccount
- PoliciesClient.GetByBillingProfile
- PoliciesClient.GetByCustomer
- PoliciesClient.GetByCustomerAtBillingAccount
- PoliciesClient.GetBySubscription
- ProductsClient.BeginMove
- ProductsClient.Get
- ProductsClient.NewListByBillingAccountPager
- ProductsClient.NewListByBillingProfilePager
- ProductsClient.NewListByCustomerPager
- ProductsClient.NewListByInvoiceSectionPager
- ProductsClient.Update
- ProductsClient.ValidateMoveEligibility (ProductValidateMoveFailure)
- ProductsClient.ValidateMoveEligibility (ProductValidateMoveSuccess)
- ProfilesClient.BeginCreateOrUpdate
- ProfilesClient.BeginDelete
- ProfilesClient.Get
- ProfilesClient.NewListByBillingAccountPager
- ProfilesClient.ValidateDeleteEligibility (BillingProfilesValidateDeleteEligibilityFailure)
- ProfilesClient.ValidateDeleteEligibility (BillingProfilesValidateDeleteEligibilitySuccess)
- PropertyClient.Get (BillingPropertyGetMca)
- PropertyClient.Get (BillingPropertyGetMosp)
- PropertyClient.Get (BillingPropertyGetMpa)
- PropertyClient.Update (BillingPropertyPatchCostCenter)
- PropertyClient.Update (BillingPropertyPatchSubscriptionServiceUsageAddress)
- RecipientTransfersClient.Accept
- RecipientTransfersClient.Decline
- RecipientTransfersClient.Get
- RecipientTransfersClient.NewListPager
- RecipientTransfersClient.Validate
- RequestsClient.BeginCreateOrUpdate
- RequestsClient.Get
- RequestsClient.NewListByBillingAccountPager
- RequestsClient.NewListByBillingProfilePager
- RequestsClient.NewListByCustomerPager
- RequestsClient.NewListByInvoiceSectionPager
- RequestsClient.NewListByUserPager (BillingRequestsListByUser)
- RequestsClient.NewListByUserPager (BillingRequestsListByUserWithFilter)
- ReservationOrdersClient.GetByBillingAccount (ReservationOrderGetByBillingAccount)
- ReservationOrdersClient.GetByBillingAccount (ReservationOrderGetByBillingAccountWithExpandPlanInformation)
- ReservationOrdersClient.NewListByBillingAccountPager
- ReservationsClient.BeginUpdateByBillingAccount
- ReservationsClient.GetByReservationOrder (ReservationGetByBillingAccount)
- ReservationsClient.GetByReservationOrder (ReservationGetByBillingAccountManagementGroup)
- ReservationsClient.GetByReservationOrder (ReservationGetByBillingAccountSingleResourceGroup)
- ReservationsClient.GetByReservationOrder (ReservationGetByBillingAccountSingleScope)
- ReservationsClient.NewListByBillingAccountPager
- ReservationsClient.NewListByBillingProfilePager
- ReservationsClient.NewListByReservationOrderPager
- RoleAssignmentsClient.BeginCreateByBillingAccount
- RoleAssignmentsClient.BeginCreateByBillingProfile
- RoleAssignmentsClient.BeginCreateByCustomer
- RoleAssignmentsClient.BeginCreateByInvoiceSection
- RoleAssignmentsClient.BeginCreateOrUpdateByBillingAccount
- RoleAssignmentsClient.BeginCreateOrUpdateByDepartment
- RoleAssignmentsClient.BeginCreateOrUpdateByEnrollmentAccount
- RoleAssignmentsClient.BeginResolveByBillingAccount
- RoleAssignmentsClient.BeginResolveByBillingProfile
- RoleAssignmentsClient.BeginResolveByCustomer
- RoleAssignmentsClient.BeginResolveByInvoiceSection
- RoleAssignmentsClient.DeleteByBillingAccount
- RoleAssignmentsClient.DeleteByBillingProfile
- RoleAssignmentsClient.DeleteByCustomer
- RoleAssignmentsClient.DeleteByDepartment
- RoleAssignmentsClient.DeleteByEnrollmentAccount
- RoleAssignmentsClient.DeleteByInvoiceSection
- RoleAssignmentsClient.GetByBillingAccount
- RoleAssignmentsClient.GetByBillingProfile
- RoleAssignmentsClient.GetByCustomer
- RoleAssignmentsClient.GetByDepartment
- RoleAssignmentsClient.GetByEnrollmentAccount
- RoleAssignmentsClient.GetByInvoiceSection
- RoleAssignmentsClient.NewListByBillingAccountPager
- RoleAssignmentsClient.NewListByBillingProfilePager
- RoleAssignmentsClient.NewListByCustomerPager
- RoleAssignmentsClient.NewListByDepartmentPager
- RoleAssignmentsClient.NewListByEnrollmentAccountPager
- RoleAssignmentsClient.NewListByInvoiceSectionPager
- RoleDefinitionClient.GetByBillingAccount
- RoleDefinitionClient.GetByBillingProfile
- RoleDefinitionClient.GetByCustomer
- RoleDefinitionClient.GetByDepartment
- RoleDefinitionClient.GetByEnrollmentAccount
- RoleDefinitionClient.GetByInvoiceSection
- RoleDefinitionClient.NewListByBillingAccountPager
- RoleDefinitionClient.NewListByBillingProfilePager
- RoleDefinitionClient.NewListByCustomerPager
- RoleDefinitionClient.NewListByDepartmentPager
- RoleDefinitionClient.NewListByEnrollmentAccountPager
- RoleDefinitionClient.NewListByInvoiceSectionPager
- SavingsPlanOrdersClient.GetByBillingAccount (SavingsPlanOrderGet)
- SavingsPlanOrdersClient.GetByBillingAccount (SavingsPlanOrderWithExpandedPaymentsGet)
- SavingsPlanOrdersClient.NewListByBillingAccountPager
- SavingsPlansClient.BeginUpdateByBillingAccount
- SavingsPlansClient.GetByBillingAccount (SavingsPlanGet)
- SavingsPlansClient.GetByBillingAccount (SavingsPlanGetExpandRenewProperties)
- SavingsPlansClient.NewListByBillingAccountPager
- SavingsPlansClient.NewListBySavingsPlanOrderPager
- SavingsPlansClient.ValidateUpdateByBillingAccount
- SubscriptionsAliasesClient.BeginCreateOrUpdate
- SubscriptionsAliasesClient.Get
- SubscriptionsAliasesClient.NewListByBillingAccountPager
- SubscriptionsClient.BeginCancel
- SubscriptionsClient.BeginDelete
- SubscriptionsClient.BeginMerge
- SubscriptionsClient.BeginMove
- SubscriptionsClient.BeginSplit
- SubscriptionsClient.BeginUpdate
- SubscriptionsClient.Get
- SubscriptionsClient.GetByBillingProfile
- SubscriptionsClient.NewListByBillingAccountPager
- SubscriptionsClient.NewListByBillingProfilePager (BillingSubscriptionsListByBillingProfileEa)
- SubscriptionsClient.NewListByBillingProfilePager (BillingSubscriptionsListByBillingProfileMca)
- SubscriptionsClient.NewListByCustomerAtBillingAccountPager
- SubscriptionsClient.NewListByCustomerPager
- SubscriptionsClient.NewListByEnrollmentAccountPager
- SubscriptionsClient.NewListByInvoiceSectionPager
- SubscriptionsClient.ValidateMoveEligibility (BillingSubscriptionValidateMoveFailure)
- SubscriptionsClient.ValidateMoveEligibility (BillingSubscriptionValidateMoveSuccess)
- TransactionsClient.BeginTransactionsDownloadByInvoice
- TransactionsClient.GetTransactionSummaryByInvoice
- TransactionsClient.NewListByBillingProfilePager
- TransactionsClient.NewListByCustomerPager
- TransactionsClient.NewListByInvoicePager
- TransactionsClient.NewListByInvoiceSectionPager
- TransfersClient.Cancel
- TransfersClient.Get
- TransfersClient.Initiate
- TransfersClient.NewListPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptTransferProperties ¶ added in v1.0.0
type AcceptTransferProperties struct { // Request parameters to accept transfer. ProductDetails []*ProductDetails }
AcceptTransferProperties - Request parameters to accept transfer.
func (AcceptTransferProperties) MarshalJSON ¶ added in v1.0.0
func (a AcceptTransferProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AcceptTransferProperties.
func (*AcceptTransferProperties) UnmarshalJSON ¶ added in v1.0.0
func (a *AcceptTransferProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AcceptTransferProperties.
type AcceptTransferRequest ¶ added in v1.0.0
type AcceptTransferRequest struct { // Request parameters to accept transfer. Properties *AcceptTransferProperties }
AcceptTransferRequest - Request parameters to accept transfer.
func (AcceptTransferRequest) MarshalJSON ¶ added in v1.0.0
func (a AcceptTransferRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AcceptTransferRequest.
func (*AcceptTransferRequest) UnmarshalJSON ¶ added in v1.0.0
func (a *AcceptTransferRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AcceptTransferRequest.
type AcceptanceMode ¶
type AcceptanceMode string
AcceptanceMode - The mode of acceptance for an agreement.
const ( AcceptanceModeClickToAccept AcceptanceMode = "ClickToAccept" AcceptanceModeESignEmbedded AcceptanceMode = "ESignEmbedded" AcceptanceModeESignOffline AcceptanceMode = "ESignOffline" AcceptanceModeImplicit AcceptanceMode = "Implicit" AcceptanceModeOffline AcceptanceMode = "Offline" AcceptanceModeOther AcceptanceMode = "Other" AcceptanceModePhysicalSign AcceptanceMode = "PhysicalSign" )
func PossibleAcceptanceModeValues ¶
func PossibleAcceptanceModeValues() []AcceptanceMode
PossibleAcceptanceModeValues returns the possible values for the AcceptanceMode const type.
type AccessDecision ¶ added in v1.0.0
type AccessDecision string
AccessDecision - Access Decision, specifies access is allowed or not.
const ( AccessDecisionAllowed AccessDecision = "Allowed" AccessDecisionNotAllowed AccessDecision = "NotAllowed" AccessDecisionOther AccessDecision = "Other" )
func PossibleAccessDecisionValues ¶ added in v1.0.0
func PossibleAccessDecisionValues() []AccessDecision
PossibleAccessDecisionValues returns the possible values for the AccessDecision const type.
type Account ¶ added in v0.2.0
type Account struct { // A billing account. Properties *AccountProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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 resources. Value []*Account }
AccountListResult - A container for a list of resources
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 AccountPatch ¶ added in v1.0.0
type AccountPatch struct { // A billing account. Properties *AccountProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
AccountPatch - A billing account.
func (AccountPatch) MarshalJSON ¶ added in v1.0.0
func (a AccountPatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccountPatch.
func (*AccountPatch) UnmarshalJSON ¶ added in v1.0.0
func (a *AccountPatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccountPatch.
type AccountPolicy ¶ added in v1.0.0
type AccountPolicy struct { // A policy at billing account scope. Properties *AccountPolicyProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
AccountPolicy - A policy at billing account scope.
func (AccountPolicy) MarshalJSON ¶ added in v1.0.0
func (a AccountPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccountPolicy.
func (*AccountPolicy) UnmarshalJSON ¶ added in v1.0.0
func (a *AccountPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccountPolicy.
type AccountPolicyProperties ¶ added in v1.0.0
type AccountPolicyProperties struct { // The policies for Enterprise Agreement enrollments. EnterpriseAgreementPolicies *AccountPolicyPropertiesEnterpriseAgreementPolicies // The policy that controls whether Azure marketplace purchases are allowed. MarketplacePurchases *MarketplacePurchasesPolicy // List of all policies defined at the billing scope. Policies []*PolicySummary // The policy that controls whether Azure reservation purchases are allowed. ReservationPurchases *ReservationPurchasesPolicy // The policy that controls whether users with Azure savings plan purchase are allowed. SavingsPlanPurchases *SavingsPlanPurchasesPolicy // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState }
AccountPolicyProperties - A policy at billing account scope.
func (AccountPolicyProperties) MarshalJSON ¶ added in v1.0.0
func (a AccountPolicyProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccountPolicyProperties.
func (*AccountPolicyProperties) UnmarshalJSON ¶ added in v1.0.0
func (a *AccountPolicyProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccountPolicyProperties.
type AccountPolicyPropertiesEnterpriseAgreementPolicies ¶ added in v1.0.0
type AccountPolicyPropertiesEnterpriseAgreementPolicies struct { // The policy that controls whether account owner can view charges. AccountOwnerViewCharges *EnrollmentAccountOwnerViewCharges // The state showing the enrollment auth level. AuthenticationType *EnrollmentAuthLevelState // The policy that controls whether department admin can view charges. DepartmentAdminViewCharges *EnrollmentDepartmentAdminViewCharges }
AccountPolicyPropertiesEnterpriseAgreementPolicies - The policies for Enterprise Agreement enrollments.
func (AccountPolicyPropertiesEnterpriseAgreementPolicies) MarshalJSON ¶ added in v1.0.0
func (a AccountPolicyPropertiesEnterpriseAgreementPolicies) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccountPolicyPropertiesEnterpriseAgreementPolicies.
func (*AccountPolicyPropertiesEnterpriseAgreementPolicies) UnmarshalJSON ¶ added in v1.0.0
func (a *AccountPolicyPropertiesEnterpriseAgreementPolicies) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccountPolicyPropertiesEnterpriseAgreementPolicies.
type AccountProperties ¶ added in v0.2.0
type AccountProperties struct { // The billing account name. DisplayName *string // The properties of an enrollment. EnrollmentDetails *AccountPropertiesEnrollmentDetails // Indicates whether or not the billing account has any billing profiles. HasNoBillingProfiles *bool // Indicates whether user has read access to the billing account. HasReadAccess *bool // Notification email address for legacy account. Available for agreement type Microsoft Online Services Program. NotificationEmailAddress *string // The tenant that was used to set up the billing account. By default, only users from this tenant can get role assignments // on the billing account and all purchases are provisioned in this tenant. PrimaryBillingTenantID *string // Describes the registration number of the organization linked with the billing account. RegistrationNumber *AccountPropertiesRegistrationNumber // The address of the individual or organization that is responsible for the billing account. SoldTo *AccountPropertiesSoldTo // A list of tax identifiers for the billing account. TaxIDs []*TaxIdentifier // READ-ONLY; The current status of the billing account. AccountStatus *AccountStatus // READ-ONLY; Reason for the specified billing account status. AccountStatusReasonCode *BillingAccountStatusReasonCode // READ-ONLY; The tier of the account. AccountSubType *AccountSubType // READ-ONLY; The type of customer. AccountType *AccountType // READ-ONLY; The type of agreement. AgreementType *AgreementType // READ-ONLY; Identifies the billing relationships represented by a billing account. The billing relationship may be between // Microsoft, the customer, and/or a third-party. BillingRelationshipTypes []*BillingRelationshipType // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState // READ-ONLY; Qualifications for pricing on a billing account. Values may be Commercial, Education, Charity or Government. Qualifications []*string }
AccountProperties - A 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 AccountPropertiesEnrollmentDetails ¶ added in v1.0.0
type AccountPropertiesEnrollmentDetails struct { // The end date of the enrollment. EndDate *time.Time // The properties of an enrollment which are applicable only for indirect enrollments. IndirectRelationshipInfo *EnrollmentDetailsIndirectRelationshipInfo // The purchase order number of the enrollment. PoNumber *string // 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 cloud of the enrollment. Cloud *string // READ-ONLY; The country code of the enrollment. CountryCode *string // READ-ONLY; The billing currency for the enrollment. Currency *string // READ-ONLY; The billing account extension opted by the company. ExtendedTermOption *ExtendedTermOption // READ-ONLY; The contact who receives invoices of the enrollment. InvoiceRecipient *string // READ-ONLY; The language for the enrollment. Language *string // READ-ONLY; Markup status of enrollment, applicable only for indirect enrollments. MarkupStatus *MarkupStatus // READ-ONLY; The support coverage period for the enrollment. SupportCoverage *string // READ-ONLY; The support level offer associated with an enrollment. SupportLevel *SupportLevel }
AccountPropertiesEnrollmentDetails - The properties of an enrollment.
func (AccountPropertiesEnrollmentDetails) MarshalJSON ¶ added in v1.0.0
func (a AccountPropertiesEnrollmentDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccountPropertiesEnrollmentDetails.
func (*AccountPropertiesEnrollmentDetails) UnmarshalJSON ¶ added in v1.0.0
func (a *AccountPropertiesEnrollmentDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccountPropertiesEnrollmentDetails.
type AccountPropertiesRegistrationNumber ¶ added in v1.0.0
type AccountPropertiesRegistrationNumber struct { // The unique identification number of the organization linked with the billing account. ID *string // READ-ONLY; Identifies if the registration number is required for the billing account. Required *bool // READ-ONLY; The types of registration number allowed based on the country of the billing account. Type []*string }
AccountPropertiesRegistrationNumber - Describes the registration number of the organization linked with the billing account.
func (AccountPropertiesRegistrationNumber) MarshalJSON ¶ added in v1.0.0
func (a AccountPropertiesRegistrationNumber) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccountPropertiesRegistrationNumber.
func (*AccountPropertiesRegistrationNumber) UnmarshalJSON ¶ added in v1.0.0
func (a *AccountPropertiesRegistrationNumber) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccountPropertiesRegistrationNumber.
type AccountPropertiesSoldTo ¶ added in v1.0.0
type AccountPropertiesSoldTo struct { // REQUIRED; Address line 1. AddressLine1 *string // REQUIRED; Country code uses ISO 3166-1 Alpha-2 format. Country *string // Address line 2. AddressLine2 *string // Address line 3. AddressLine3 *string // Address city. City *string // Company name. Optional for MCA Individual (Pay-as-you-go). CompanyName *string // Address district. District *string // Email address. Email *string // First name. Optional for MCA Enterprise. FirstName *string // Indicates if the address is incomplete. IsValidAddress *bool // Last name. Optional for MCA Enterprise. LastName *string // Middle name. MiddleName *string // Phone number. PhoneNumber *string // Postal code. PostalCode *string // Address region. Region *string }
AccountPropertiesSoldTo - The address of the individual or organization that is responsible for the billing account.
func (AccountPropertiesSoldTo) MarshalJSON ¶ added in v1.0.0
func (a AccountPropertiesSoldTo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccountPropertiesSoldTo.
func (*AccountPropertiesSoldTo) UnmarshalJSON ¶ added in v1.0.0
func (a *AccountPropertiesSoldTo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccountPropertiesSoldTo.
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" AccountStatusNew AccountStatus = "New" AccountStatusOther AccountStatus = "Other" AccountStatusPending AccountStatus = "Pending" AccountStatusTerminated AccountStatus = "Terminated" AccountStatusTransferred AccountStatus = "Transferred" AccountStatusUnderReview AccountStatus = "UnderReview" )
func PossibleAccountStatusValues ¶
func PossibleAccountStatusValues() []AccountStatus
PossibleAccountStatusValues returns the possible values for the AccountStatus const type.
type AccountSubType ¶ added in v1.0.0
type AccountSubType string
AccountSubType - The tier of the account.
const ( AccountSubTypeEnterprise AccountSubType = "Enterprise" AccountSubTypeIndividual AccountSubType = "Individual" AccountSubTypeNone AccountSubType = "None" AccountSubTypeOther AccountSubType = "Other" AccountSubTypeProfessional AccountSubType = "Professional" )
func PossibleAccountSubTypeValues ¶ added in v1.0.0
func PossibleAccountSubTypeValues() []AccountSubType
PossibleAccountSubTypeValues returns the possible values for the AccountSubType const type.
type AccountType ¶
type AccountType string
AccountType - The type of customer.
const ( AccountTypeBusiness AccountType = "Business" AccountTypeClassicPartner AccountType = "ClassicPartner" AccountTypeEnterprise AccountType = "Enterprise" AccountTypeIndividual AccountType = "Individual" AccountTypeInternal AccountType = "Internal" AccountTypeOther AccountType = "Other" AccountTypePartner AccountType = "Partner" AccountTypeReseller AccountType = "Reseller" AccountTypeTenant AccountType = "Tenant" )
func PossibleAccountTypeValues ¶
func PossibleAccountTypeValues() []AccountType
PossibleAccountTypeValues returns the possible values for the AccountType const type.
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) BeginAddPaymentTerms ¶ added in v1.0.0
func (client *AccountsClient) BeginAddPaymentTerms(ctx context.Context, billingAccountName string, parameters []*PaymentTerm, options *AccountsClientBeginAddPaymentTermsOptions) (*runtime.Poller[AccountsClientAddPaymentTermsResponse], error)
BeginAddPaymentTerms - Adds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - The properties of payment term.
- options - AccountsClientBeginAddPaymentTermsOptions contains the optional parameters for the AccountsClient.BeginAddPaymentTerms method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsAdd.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) } poller, err := clientFactory.NewAccountsClient().BeginAddPaymentTerms(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", []*armbilling.PaymentTerm{ { EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-25T22:39:34.260Z"); return t }()), StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t }()), Term: to.Ptr("net10"), }}, 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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/010000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeEnterprise), // AccountType: to.Ptr(armbilling.AccountTypeBusiness), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Premier Business Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // }, // } }
Output:
func (*AccountsClient) BeginCancelPaymentTerms ¶ added in v1.0.0
func (client *AccountsClient) BeginCancelPaymentTerms(ctx context.Context, billingAccountName string, parameters time.Time, options *AccountsClientBeginCancelPaymentTermsOptions) (*runtime.Poller[AccountsClientCancelPaymentTermsResponse], error)
BeginCancelPaymentTerms - Cancels all the payment terms on billing account that falls after the cancellation date in the request. Currently, cancel payment terms is only served by admin actions and is not a self-serve action. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - Date after which any payment terms that needs to be cancelled.
- options - AccountsClientBeginCancelPaymentTermsOptions contains the optional parameters for the AccountsClient.BeginCancelPaymentTerms method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsCancel.json
package main import ( "context" "log" "time" "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().BeginCancelPaymentTerms(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t }(), 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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/010000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeEnterprise), // AccountType: to.Ptr(armbilling.AccountTypeBusiness), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Premier Business Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // }, // } }
Output:
func (*AccountsClient) BeginUpdate ¶ added in v0.2.0
func (client *AccountsClient) BeginUpdate(ctx context.Context, billingAccountName string, parameters AccountPatch, options *AccountsClientBeginUpdateOptions) (*runtime.Poller[AccountsClientUpdateResponse], error)
BeginUpdate - Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - A billing account.
- options - AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method.
Example (BillingAccountUpdateWithPoNumber) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountUpdateWithPONumber.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, "6575495", armbilling.AccountPatch{ Properties: &armbilling.AccountProperties{ EnrollmentDetails: &armbilling.AccountPropertiesEnrollmentDetails{ PoNumber: to.Ptr("poNumber123"), }, }, }, 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("6575495"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6575495"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeNone), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeEnterpriseAgreement), // DisplayName: to.Ptr("Enterprise Account"), // EnrollmentDetails: &armbilling.AccountPropertiesEnrollmentDetails{ // BillingCycle: to.Ptr("Monthly"), // Channel: to.Ptr("EaDirect"), // Cloud: to.Ptr("Azure Commercial"), // 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}()), // ExtendedTermOption: to.Ptr(armbilling.ExtendedTermOptionOptedOut), // PoNumber: to.Ptr("poNumber123"), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // SupportCoverage: to.Ptr("1/26/2021 - 6/30/2021"), // SupportLevel: to.Ptr(armbilling.SupportLevelStandard), // Language: to.Ptr("en"), // }, // HasReadAccess: to.Ptr(true), // SoldTo: &armbilling.AccountPropertiesSoldTo{ // 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:
Example (BillingAccountsUpdate) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsUpdate.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, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", armbilling.AccountPatch{ Properties: &armbilling.AccountProperties{ DisplayName: to.Ptr("Test Account"), SoldTo: &armbilling.AccountPropertiesSoldTo{ AddressLine1: to.Ptr("1 Microsoft Way"), City: to.Ptr("Redmond"), CompanyName: to.Ptr("Contoso"), Country: to.Ptr("US"), PostalCode: to.Ptr("98052-8300"), 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("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeEnterprise), // AccountType: to.Ptr(armbilling.AccountTypeBusiness), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Premier Business Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // SoldTo: &armbilling.AccountPropertiesSoldTo{ // AddressLine1: to.Ptr("1 Microsoft Way"), // City: to.Ptr("Redmond"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // IsValidAddress: to.Ptr(true), // PostalCode: to.Ptr("98052-8300"), // Region: to.Ptr("WA"), // }, // }, // } }
Output:
func (*AccountsClient) ConfirmTransition ¶ added in v1.0.0
func (client *AccountsClient) ConfirmTransition(ctx context.Context, billingAccountName string, options *AccountsClientConfirmTransitionOptions) (AccountsClientConfirmTransitionResponse, error)
ConfirmTransition - Gets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - AccountsClientConfirmTransitionOptions contains the optional parameters for the AccountsClient.ConfirmTransition method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsConfirmTransition.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().ConfirmTransition(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", 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.TransitionDetails = armbilling.TransitionDetails{ // AnniversaryDay: to.Ptr[int32](12), // TransitionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-17T00:00:00.000Z"); return t}()), // } }
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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method.
Example (BillingAccountWithExpandForPoNumber) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithExpandForPONumber.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, "8608480", 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("6564892"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6564892"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeEnterpriseAgreement), // DisplayName: to.Ptr("Enterprise Account"), // EnrollmentDetails: &armbilling.AccountPropertiesEnrollmentDetails{ // BillingCycle: to.Ptr("Monthly"), // Channel: to.Ptr("EaDirect"), // Cloud: to.Ptr("Azure Commercial"), // 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}()), // ExtendedTermOption: to.Ptr(armbilling.ExtendedTermOptionOptedOut), // PoNumber: to.Ptr("poNumber123"), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // SupportCoverage: to.Ptr("1/26/2021 - 6/30/2021"), // SupportLevel: to.Ptr(armbilling.SupportLevelStandard), // Language: to.Ptr("en"), // }, // HasReadAccess: to.Ptr(true), // }, // } }
Output:
Example (BillingAccountWithRegistrationNumberWithDefaultType) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithRegistrationNumberWithDefaultType.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, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", 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("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeEnterprise), // AccountType: to.Ptr(armbilling.AccountTypeBusiness), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Premier Business Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // RegistrationNumber: &armbilling.AccountPropertiesRegistrationNumber{ // Type: []*string{ // to.Ptr("RegistrationNumber")}, // ID: to.Ptr("RegistrationId"), // }, // }, // } }
Output:
Example (BillingAccountWithRegistrationNumberWithType) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithRegistrationNumberWithType.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, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", 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("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeEnterprise), // AccountType: to.Ptr(armbilling.AccountTypeBusiness), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Premier Business Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // RegistrationNumber: &armbilling.AccountPropertiesRegistrationNumber{ // Type: []*string{ // to.Ptr("TIN")}, // ID: to.Ptr("SomeRegistrationId"), // Required: to.Ptr(true), // }, // }, // } }
Output:
Example (BillingAccountsGet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGet.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, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", 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("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeEnterprise), // AccountType: to.Ptr(armbilling.AccountTypeBusiness), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Premier Business Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // }, // } }
Output:
Example (BillingAccountsGetEa) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGetEA.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, "6575495", 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("6575495"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6575495"), // Properties: &armbilling.AccountProperties{ // AgreementType: to.Ptr(armbilling.AgreementTypeEnterpriseAgreement), // EnrollmentDetails: &armbilling.AccountPropertiesEnrollmentDetails{ // BillingCycle: to.Ptr("Monthly"), // Channel: to.Ptr("EaDirect"), // Cloud: to.Ptr("Azure Commercial"), // 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}()), // ExtendedTermOption: to.Ptr(armbilling.ExtendedTermOptionOptedOut), // IndirectRelationshipInfo: &armbilling.EnrollmentDetailsIndirectRelationshipInfo{ // BillingAccountName: to.Ptr("pcn.12345"), // BillingProfileName: to.Ptr(""), // DisplayName: to.Ptr("Test partner"), // }, // InvoiceRecipient: to.Ptr("abc@contoso.com"), // MarkupStatus: to.Ptr(armbilling.MarkupStatusPublished), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // SupportCoverage: to.Ptr("1/26/2021 - 6/30/2021"), // SupportLevel: to.Ptr(armbilling.SupportLevelStandard), // Language: to.Ptr("en"), // }, // SoldTo: &armbilling.AccountPropertiesSoldTo{ // 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:
Example (BillingAccountsGetWithExpand) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGetWithExpand.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, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", 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("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeEnterprise), // AccountType: to.Ptr(armbilling.AccountTypeBusiness), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Premier Business Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // SoldTo: &armbilling.AccountPropertiesSoldTo{ // AddressLine1: to.Ptr("1 Microsoft Way"), // City: to.Ptr("Redmond"), // CompanyName: to.Ptr("Contoso"), // Country: to.Ptr("US"), // IsValidAddress: to.Ptr(true), // PostalCode: to.Ptr("98052-8300"), // Region: to.Ptr("WA"), // }, // }, // } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsWithCreateSubscriptionPermissionList.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("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionOptions{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.InvoiceSectionWithCreateSubPermissionListResult = armbilling.InvoiceSectionWithCreateSubPermissionListResult{ // Value: []*armbilling.InvoiceSectionWithCreateSubPermission{ // { // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileSpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // BillingProfileStatus: to.Ptr(armbilling.BillingProfileStatusWarned), // BillingProfileStatusReasonCode: to.Ptr(armbilling.BillingProfileStatusReasonCodePastDue), // BillingProfileSystemID: to.Ptr("33000000-0000-0000-0000-000000000000"), // 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("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionSystemID: to.Ptr("22000000-0000-0000-0000-000000000000"), // }}, // } } }
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 2024-04-01
- options - AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method.
Example (BillingAccountForLegacyAccountDetails) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountForLegacyAccountDetails.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{IncludeAll: nil, IncludeAllWithoutBillingProfiles: nil, IncludeDeleted: nil, IncludePendingAgreement: nil, IncludeResellee: nil, LegalOwnerTID: nil, LegalOwnerOID: nil, Filter: nil, Expand: nil, Top: nil, Skip: nil, Search: 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("20000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-0000-0000-0000-000000000001"), // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountType: to.Ptr(armbilling.AccountTypeIndividual), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftOnlineServicesProgram), // DisplayName: to.Ptr("Individual Account 2"), // HasReadAccess: to.Ptr(true), // NotificationEmailAddress: to.Ptr("individual@domain.com"), // }, // }}, // } } }
Output:
Example (BillingAccountsList) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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{IncludeAll: nil, IncludeAllWithoutBillingProfiles: nil, IncludeDeleted: nil, IncludePendingAgreement: nil, IncludeResellee: nil, LegalOwnerTID: nil, LegalOwnerOID: nil, Filter: nil, Expand: nil, Top: nil, Skip: nil, Search: 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("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeEnterprise), // AccountType: to.Ptr(armbilling.AccountTypeBusiness), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Premier Business Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // }, // }, // { // Name: to.Ptr("20000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeProfessional), // AccountType: to.Ptr(armbilling.AccountTypeBusiness), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Standard Business Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // }, // }, // { // Name: to.Ptr("30000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/30000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeIndividual), // AccountType: to.Ptr(armbilling.AccountTypeIndividual), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // DisplayName: to.Ptr("Individual Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // }, // }, // { // Name: to.Ptr("40000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/40000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeEnterprise), // AccountType: to.Ptr(armbilling.AccountTypeBusiness), // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftPartnerAgreement), // DisplayName: to.Ptr("Premier Business Account"), // HasReadAccess: to.Ptr(true), // PrimaryBillingTenantID: to.Ptr("20000000-0000-0000-0000-000000000001"), // }, // }}, // } } }
Output:
Example (BillingAccountsListWithExpandForPoNumber) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsListWithExpandForPONumber.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{IncludeAll: nil, IncludeAllWithoutBillingProfiles: nil, IncludeDeleted: nil, IncludePendingAgreement: nil, IncludeResellee: nil, LegalOwnerTID: nil, LegalOwnerOID: nil, Filter: nil, Expand: to.Ptr("soldTo,enrollmentDetails/poNumber"), Top: nil, Skip: nil, Search: 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("6564892"), // Type: to.Ptr("Microsoft.Billing/billingAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6564892"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.AccountProperties{ // AccountStatus: to.Ptr(armbilling.AccountStatusActive), // AccountSubType: to.Ptr(armbilling.AccountSubTypeNone), // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), // AgreementType: to.Ptr(armbilling.AgreementTypeEnterpriseAgreement), // DisplayName: to.Ptr("Enterprise Account"), // EnrollmentDetails: &armbilling.AccountPropertiesEnrollmentDetails{ // BillingCycle: to.Ptr("Monthly"), // Channel: to.Ptr("EaDirect"), // Cloud: to.Ptr("Azure Commercial"), // 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}()), // ExtendedTermOption: to.Ptr(armbilling.ExtendedTermOptionOptedOut), // PoNumber: to.Ptr("poNumber123"), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // SupportCoverage: to.Ptr("1/26/2021 - 6/30/2021"), // SupportLevel: to.Ptr(armbilling.SupportLevelStandard), // Language: to.Ptr("en"), // }, // HasReadAccess: to.Ptr(true), // SoldTo: &armbilling.AccountPropertiesSoldTo{ // AddressLine1: to.Ptr("Test Address"), // City: to.Ptr("City"), // CompanyName: to.Ptr("Enterprise Company"), // Country: to.Ptr("US"), // PostalCode: to.Ptr("00000-1111"), // Region: to.Ptr("WA"), // }, // }, // }}, // } } }
Output:
func (*AccountsClient) ValidatePaymentTerms ¶ added in v1.0.0
func (client *AccountsClient) ValidatePaymentTerms(ctx context.Context, billingAccountName string, parameters []*PaymentTerm, options *AccountsClientValidatePaymentTermsOptions) (AccountsClientValidatePaymentTermsResponse, error)
ValidatePaymentTerms - Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - The properties of payment term.
- options - AccountsClientValidatePaymentTermsOptions contains the optional parameters for the AccountsClient.ValidatePaymentTerms method.
Example (PaymentTermInvalid) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermInvalid.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.NewAccountsClient().ValidatePaymentTerms(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", []*armbilling.PaymentTerm{ { EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-25T22:39:34.260Z"); return t }()), StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t }()), Term: to.Ptr("net10"), }}, 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.PaymentTermsEligibilityResult = armbilling.PaymentTermsEligibilityResult{ // EligibilityDetails: []*armbilling.PaymentTermsEligibilityDetail{ // { // Code: to.Ptr(armbilling.PaymentTermsEligibilityCodeInvalidDateRange), // Message: to.Ptr("The date range is invalid. The start date must be before the end date."), // }}, // EligibilityStatus: to.Ptr(armbilling.PaymentTermsEligibilityStatusInvalid), // } }
Output:
Example (PaymentTermValid) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermValid.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.NewAccountsClient().ValidatePaymentTerms(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", []*armbilling.PaymentTerm{ { EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-25T22:39:34.260Z"); return t }()), StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t }()), Term: to.Ptr("net10"), }}, 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.PaymentTermsEligibilityResult = armbilling.PaymentTermsEligibilityResult{ // EligibilityStatus: to.Ptr(armbilling.PaymentTermsEligibilityStatusValid), // } }
Output:
type AccountsClientAddPaymentTermsResponse ¶ added in v1.0.0
type AccountsClientAddPaymentTermsResponse struct { // A billing account. Account }
AccountsClientAddPaymentTermsResponse contains the response from method AccountsClient.BeginAddPaymentTerms.
type AccountsClientBeginAddPaymentTermsOptions ¶ added in v1.0.0
type AccountsClientBeginAddPaymentTermsOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
AccountsClientBeginAddPaymentTermsOptions contains the optional parameters for the AccountsClient.BeginAddPaymentTerms method.
type AccountsClientBeginCancelPaymentTermsOptions ¶ added in v1.0.0
type AccountsClientBeginCancelPaymentTermsOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
AccountsClientBeginCancelPaymentTermsOptions contains the optional parameters for the AccountsClient.BeginCancelPaymentTerms method.
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 AccountsClientCancelPaymentTermsResponse ¶ added in v1.0.0
type AccountsClientCancelPaymentTermsResponse struct { // A billing account. Account }
AccountsClientCancelPaymentTermsResponse contains the response from method AccountsClient.BeginCancelPaymentTerms.
type AccountsClientConfirmTransitionOptions ¶ added in v1.0.0
type AccountsClientConfirmTransitionOptions struct { }
AccountsClientConfirmTransitionOptions contains the optional parameters for the AccountsClient.ConfirmTransition method.
type AccountsClientConfirmTransitionResponse ¶ added in v1.0.0
type AccountsClientConfirmTransitionResponse struct { // The details for a billing account transitioned from agreement type Microsoft Online Services Program to agreement type // Microsoft Customer Agreement. TransitionDetails }
AccountsClientConfirmTransitionResponse contains the response from method AccountsClient.ConfirmTransition.
type AccountsClientGetOptions ¶ added in v0.2.0
type AccountsClientGetOptions struct { }
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 { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string }
AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionOptions contains the optional parameters for the AccountsClient.NewListInvoiceSectionsByCreateSubscriptionPermissionPager method.
type AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionResponse ¶ added in v0.2.0
type AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionResponse struct { // A container for a list of resources InvoiceSectionWithCreateSubPermissionListResult }
AccountsClientListInvoiceSectionsByCreateSubscriptionPermissionResponse contains the response from method AccountsClient.NewListInvoiceSectionsByCreateSubscriptionPermissionPager.
type AccountsClientListOptions ¶ added in v0.2.0
type AccountsClientListOptions struct { // Expand is allowed for SoldTo and EnrollmentDetails/PONumber. Expand *string // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // When true, results will include Billing Accounts that the user does not have a direct role assignment on if the user has // one of the following AAD roles: Global Administrator, Global Reader, Billing // Administrator. IncludeAll *bool // When true, results will include Billing Accounts that are not fully created if the user has one of the following AAD roles: // Global Administrator, Global Reader, Billing Administrator. IncludeAllWithoutBillingProfiles *bool // When true, results will include any billing accounts in a deleted state. IncludeDeleted *bool // Includes billing accounts with agreement pending signature that the user has access to. IncludePendingAgreement *bool // Includes the customer's billing account of Microsoft Partner Agreement that the user has access to. IncludeResellee *bool // Must be combined with legalOwnerTID, results will only include Billing Accounts for whom is legally responsible for the // Billing Accounts. Optional. LegalOwnerOID *string // Must be combined with legalOwnerOID, results will only include Billing Accounts for whom is legally responsible for the // Billing Accounts. Optional. LegalOwnerTID *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method.
type AccountsClientListResponse ¶ added in v0.2.0
type AccountsClientListResponse struct { // A container for a list of resources 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 AccountsClientValidatePaymentTermsOptions ¶ added in v1.0.0
type AccountsClientValidatePaymentTermsOptions struct { }
AccountsClientValidatePaymentTermsOptions contains the optional parameters for the AccountsClient.ValidatePaymentTerms method.
type AccountsClientValidatePaymentTermsResponse ¶ added in v1.0.0
type AccountsClientValidatePaymentTermsResponse struct { // Result of the payment terms eligibility. PaymentTermsEligibilityResult }
AccountsClientValidatePaymentTermsResponse contains the response from method AccountsClient.ValidatePaymentTerms.
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, parameters 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 2024-04-01
- parameters - Address details.
- options - AddressClientValidateOptions contains the optional parameters for the AddressClient.Validate method.
Example (AddressValidateInvalid) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/addressValidateInvalid.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.AddressValidationResponse = armbilling.AddressValidationResponse{ // 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 (AddressValidateValid) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/addressValidateValid.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.AddressValidationResponse = armbilling.AddressValidationResponse{ // Status: to.Ptr(armbilling.AddressValidationStatusValid), // } }
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. AddressValidationResponse }
AddressClientValidateResponse contains the response from method AddressClient.Validate.
type AddressDetails ¶
type AddressDetails struct { // REQUIRED; Address line 1. AddressLine1 *string // REQUIRED; Country code uses ISO 3166-1 Alpha-2 format. Country *string // Address line 2. AddressLine2 *string // Address line 3. AddressLine3 *string // Address city. City *string // Company name. Optional for MCA Individual (Pay-as-you-go). CompanyName *string // Address district. District *string // Email address. Email *string // First name. Optional for MCA Enterprise. FirstName *string // Indicates if the address is incomplete. IsValidAddress *bool // Last name. Optional for MCA Enterprise. 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 AddressValidationResponse ¶ added in v1.0.0
type AddressValidationResponse struct { // READ-ONLY; Status of the address validation. Status *AddressValidationStatus // READ-ONLY; The list of suggested addresses. SuggestedAddresses []*AddressDetails // READ-ONLY; Validation error message. ValidationMessage *string }
AddressValidationResponse - Result of the address validation.
func (AddressValidationResponse) MarshalJSON ¶ added in v1.0.0
func (a AddressValidationResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AddressValidationResponse.
func (*AddressValidationResponse) UnmarshalJSON ¶ added in v1.0.0
func (a *AddressValidationResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AddressValidationResponse.
type AddressValidationStatus ¶
type AddressValidationStatus string
AddressValidationStatus - Status of the address validation.
const ( AddressValidationStatusInvalid AddressValidationStatus = "Invalid" AddressValidationStatusOther AddressValidationStatus = "Other" AddressValidationStatusValid AddressValidationStatus = "Valid" )
func PossibleAddressValidationStatusValues ¶
func PossibleAddressValidationStatusValues() []AddressValidationStatus
PossibleAddressValidationStatusValues returns the possible values for the AddressValidationStatus const type.
type Agreement ¶
type Agreement struct { // An agreement. Properties *AgreementProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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 resources. Value []*Agreement }
AgreementListResult - A container for a list of resources
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 { // 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. Category *Category // READ-ONLY; The name of the agreement signed by a customer. DisplayName *string // 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 ID of the lead billing account if this agreement is part of the Customer Affiliate Purchase Terms. LeadBillingAccountName *string // READ-ONLY; The list of participants that participates in acceptance of an agreement. Participants []*Participant // READ-ONLY; The current status of the agreement. Status *string }
AgreementProperties - 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" AgreementTypeOther AgreementType = "Other" )
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "ABC123", 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("ABC123"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/agreements"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/agreements/ABC123"), // Properties: &armbilling.AgreementProperties{ // AcceptanceMode: to.Ptr(armbilling.AcceptanceModeClickToAccept), // AgreementLink: to.Ptr("https://contoso.com"), // DisplayName: to.Ptr("Microsoft Customer Agreement"), // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-01T00:00:00.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-01T00:00:00.000Z"); return t}()), // LeadBillingAccountName: to.Ptr("20000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Status: to.Ptr("Active"), // }, // } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementsListByBillingAccount.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.NewAgreementsClient().NewListByBillingAccountPager("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.AgreementsClientListByBillingAccountOptions{Expand: to.Ptr("Participants")}) 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("ABC123"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/agreements"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/agreements/ABC123"), // Properties: &armbilling.AgreementProperties{ // AcceptanceMode: to.Ptr(armbilling.AcceptanceModeClickToAccept), // AgreementLink: to.Ptr("https://contoso.com"), // DisplayName: to.Ptr("Microsoft Customer Agreement"), // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-01T00:00:00.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-01T00:00:00.000Z"); return t}()), // LeadBillingAccountName: to.Ptr("20000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Participants: []*armbilling.Participant{ // { // 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("Active"), // }, // }, // { // Name: to.Ptr("DEF456"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/agreements"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/agreements/DEF456"), // Properties: &armbilling.AgreementProperties{ // AcceptanceMode: to.Ptr(armbilling.AcceptanceModeESignEmbedded), // AgreementLink: to.Ptr("https://contoso.com"), // DisplayName: to.Ptr("Microsoft Customer Agreement"), // 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, "2019-12-05T00:00:00.000Z"); return t}()), // LeadBillingAccountName: to.Ptr("20000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // Participants: []*armbilling.Participant{ // { // Email: to.Ptr("abc@contoso.com"), // Status: to.Ptr("Pending"), // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00.000Z"); return t}()), // }}, // Status: to.Ptr("PendingSignature"), // }, // }}, // } } }
Output:
type AgreementsClientGetOptions ¶ added in v0.2.0
type AgreementsClientGetOptions struct { }
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 { // A container for a list of resources AgreementListResult }
AgreementsClientListByBillingAccountResponse contains the response from method AgreementsClient.NewListByBillingAccountPager.
type Amount ¶
type Amount struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
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 AppliedScopeProperties ¶ added in v1.0.0
type AppliedScopeProperties struct { // Display name DisplayName *string // Fully-qualified identifier of the management group where the benefit is applied. ManagementGroupID *string // Fully-qualified identifier of the resource group where the benefit is applied. ResourceGroupID *string // Fully-qualified identifier of the subscription where the benefit is applied. SubscriptionID *string // Tenant ID where the savings plan where the benefit is applied. TenantID *string }
AppliedScopeProperties - Properties specific to applied scope type. Not required if not applicable.
func (AppliedScopeProperties) MarshalJSON ¶ added in v1.0.0
func (a AppliedScopeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AppliedScopeProperties.
func (*AppliedScopeProperties) UnmarshalJSON ¶ added in v1.0.0
func (a *AppliedScopeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AppliedScopeProperties.
type AppliedScopeType ¶ added in v1.0.0
type AppliedScopeType string
AppliedScopeType - Type of the Applied Scope.
const ( AppliedScopeTypeManagementGroup AppliedScopeType = "ManagementGroup" AppliedScopeTypeSingle AppliedScopeType = "Single" )
func PossibleAppliedScopeTypeValues ¶ added in v1.0.0
func PossibleAppliedScopeTypeValues() []AppliedScopeType
PossibleAppliedScopeTypeValues returns the possible values for the AppliedScopeType const type.
type AssociatedTenant ¶ added in v1.0.0
type AssociatedTenant struct { // An associated tenant. Properties *AssociatedTenantProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
AssociatedTenant - An associated tenant.
func (AssociatedTenant) MarshalJSON ¶ added in v1.0.0
func (a AssociatedTenant) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssociatedTenant.
func (*AssociatedTenant) UnmarshalJSON ¶ added in v1.0.0
func (a *AssociatedTenant) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssociatedTenant.
type AssociatedTenantListResult ¶ added in v1.0.0
type AssociatedTenantListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*AssociatedTenant }
AssociatedTenantListResult - A container for a list of resources
func (AssociatedTenantListResult) MarshalJSON ¶ added in v1.0.0
func (a AssociatedTenantListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssociatedTenantListResult.
func (*AssociatedTenantListResult) UnmarshalJSON ¶ added in v1.0.0
func (a *AssociatedTenantListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssociatedTenantListResult.
type AssociatedTenantProperties ¶ added in v1.0.0
type AssociatedTenantProperties struct { // The state determines whether users from the associated tenant can be assigned roles for commerce activities like viewing // and downloading invoices, managing payments, and making purchases. BillingManagementState *BillingManagementTenantState // The name of the associated tenant. DisplayName *string // The state determines whether subscriptions and licenses can be provisioned in the associated tenant. It can be set to 'Pending' // to initiate a billing request. ProvisioningManagementState *ProvisioningTenantState // The ID that uniquely identifies a tenant. TenantID *string // READ-ONLY; The unique identifier for the billing request that is created when enabling provisioning for an associated tenant. ProvisioningBillingRequestID *string // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState }
AssociatedTenantProperties - An associated tenant.
func (AssociatedTenantProperties) MarshalJSON ¶ added in v1.0.0
func (a AssociatedTenantProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssociatedTenantProperties.
func (*AssociatedTenantProperties) UnmarshalJSON ¶ added in v1.0.0
func (a *AssociatedTenantProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssociatedTenantProperties.
type AssociatedTenantsClient ¶ added in v1.0.0
type AssociatedTenantsClient struct {
// contains filtered or unexported fields
}
AssociatedTenantsClient contains the methods for the AssociatedTenants group. Don't use this type directly, use NewAssociatedTenantsClient() instead.
func NewAssociatedTenantsClient ¶ added in v1.0.0
func NewAssociatedTenantsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AssociatedTenantsClient, error)
NewAssociatedTenantsClient creates a new instance of AssociatedTenantsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*AssociatedTenantsClient) BeginCreateOrUpdate ¶ added in v1.0.0
func (client *AssociatedTenantsClient) BeginCreateOrUpdate(ctx context.Context, billingAccountName string, associatedTenantName string, parameters AssociatedTenant, options *AssociatedTenantsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AssociatedTenantsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update an associated tenant for the billing account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- associatedTenantName - The ID that uniquely identifies a tenant.
- parameters - An associated tenant.
- options - AssociatedTenantsClientBeginCreateOrUpdateOptions contains the optional parameters for the AssociatedTenantsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsCreateOrUpdate.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.NewAssociatedTenantsClient().BeginCreateOrUpdate(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", armbilling.AssociatedTenant{ Properties: &armbilling.AssociatedTenantProperties{ BillingManagementState: to.Ptr(armbilling.BillingManagementTenantStateActive), DisplayName: to.Ptr("Contoso Finance"), ProvisioningManagementState: to.Ptr(armbilling.ProvisioningTenantStatePending), }, }, 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.AssociatedTenant = armbilling.AssociatedTenant{ // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/associatedTenants"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/associatedTenants/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.AssociatedTenantProperties{ // BillingManagementState: to.Ptr(armbilling.BillingManagementTenantStateActive), // DisplayName: to.Ptr("Contoso Finance"), // ProvisioningBillingRequestID: to.Ptr("/providers/Microsoft.Billing/billingRequests/22222222-2222-2222-2222-222222222222"), // ProvisioningManagementState: to.Ptr(armbilling.ProvisioningTenantStatePending), // TenantID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // } }
Output:
func (*AssociatedTenantsClient) BeginDelete ¶ added in v1.0.0
func (client *AssociatedTenantsClient) BeginDelete(ctx context.Context, billingAccountName string, associatedTenantName string, options *AssociatedTenantsClientBeginDeleteOptions) (*runtime.Poller[AssociatedTenantsClientDeleteResponse], error)
BeginDelete - Deletes an associated tenant for a billing account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- associatedTenantName - The ID that uniquely identifies a tenant.
- options - AssociatedTenantsClientBeginDeleteOptions contains the optional parameters for the AssociatedTenantsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsDelete.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.NewAssociatedTenantsClient().BeginDelete(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*AssociatedTenantsClient) Get ¶ added in v1.0.0
func (client *AssociatedTenantsClient) Get(ctx context.Context, billingAccountName string, associatedTenantName string, options *AssociatedTenantsClientGetOptions) (AssociatedTenantsClientGetResponse, error)
Get - Gets an associated tenant by ID. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- associatedTenantName - The ID that uniquely identifies a tenant.
- options - AssociatedTenantsClientGetOptions contains the optional parameters for the AssociatedTenantsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsGet.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.NewAssociatedTenantsClient().Get(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", 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.AssociatedTenant = armbilling.AssociatedTenant{ // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/associatedTenants"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/associatedTenants/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.AssociatedTenantProperties{ // BillingManagementState: to.Ptr(armbilling.BillingManagementTenantStateActive), // DisplayName: to.Ptr("Contoso Finance"), // ProvisioningBillingRequestID: to.Ptr("/providers/Microsoft.Billing/billingRequests/22222222-2222-2222-2222-222222222222"), // ProvisioningManagementState: to.Ptr(armbilling.ProvisioningTenantStatePending), // TenantID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // } }
Output:
func (*AssociatedTenantsClient) NewListByBillingAccountPager ¶ added in v1.0.0
func (client *AssociatedTenantsClient) NewListByBillingAccountPager(billingAccountName string, options *AssociatedTenantsClientListByBillingAccountOptions) *runtime.Pager[AssociatedTenantsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the associated tenants that can collaborate with the billing account on commerce activities like viewing and downloading invoices, managing payments, making purchases, and managing or provisioning licenses.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - AssociatedTenantsClientListByBillingAccountOptions contains the optional parameters for the AssociatedTenantsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsListByBillingAccount.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.NewAssociatedTenantsClient().NewListByBillingAccountPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.AssociatedTenantsClientListByBillingAccountOptions{IncludeRevoked: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.AssociatedTenantListResult = armbilling.AssociatedTenantListResult{ // Value: []*armbilling.AssociatedTenant{ // { // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/associatedTenants"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-000000000000:00000000-0000-0000-000000000000_2019-05-31/associatedTenants/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.AssociatedTenantProperties{ // BillingManagementState: to.Ptr(armbilling.BillingManagementTenantStateActive), // DisplayName: to.Ptr("Contoso Finance"), // ProvisioningManagementState: to.Ptr(armbilling.ProvisioningTenantStateNotRequested), // TenantID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // }, // { // Name: to.Ptr("22222222-2222-2222-2222-222222222222"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/associatedTenants"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-000000000000:00000000-0000-0000-000000000000_2019-05-31/associatedTenants/22222222-2222-2222-2222-222222222222"), // Properties: &armbilling.AssociatedTenantProperties{ // BillingManagementState: to.Ptr(armbilling.BillingManagementTenantStateNotAllowed), // DisplayName: to.Ptr("Contoso Engineering"), // ProvisioningBillingRequestID: to.Ptr("/providers/Microsoft.Billing/billingRequests/22222222-2222-2222-2222-222222222222"), // ProvisioningManagementState: to.Ptr(armbilling.ProvisioningTenantStatePending), // TenantID: to.Ptr("22222222-2222-2222-2222-222222222222"), // }, // }}, // } } }
Output:
type AssociatedTenantsClientBeginCreateOrUpdateOptions ¶ added in v1.0.0
type AssociatedTenantsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
AssociatedTenantsClientBeginCreateOrUpdateOptions contains the optional parameters for the AssociatedTenantsClient.BeginCreateOrUpdate method.
type AssociatedTenantsClientBeginDeleteOptions ¶ added in v1.0.0
type AssociatedTenantsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
AssociatedTenantsClientBeginDeleteOptions contains the optional parameters for the AssociatedTenantsClient.BeginDelete method.
type AssociatedTenantsClientCreateOrUpdateResponse ¶ added in v1.0.0
type AssociatedTenantsClientCreateOrUpdateResponse struct { // An associated tenant. AssociatedTenant }
AssociatedTenantsClientCreateOrUpdateResponse contains the response from method AssociatedTenantsClient.BeginCreateOrUpdate.
type AssociatedTenantsClientDeleteResponse ¶ added in v1.0.0
type AssociatedTenantsClientDeleteResponse struct { }
AssociatedTenantsClientDeleteResponse contains the response from method AssociatedTenantsClient.BeginDelete.
type AssociatedTenantsClientGetOptions ¶ added in v1.0.0
type AssociatedTenantsClientGetOptions struct { }
AssociatedTenantsClientGetOptions contains the optional parameters for the AssociatedTenantsClient.Get method.
type AssociatedTenantsClientGetResponse ¶ added in v1.0.0
type AssociatedTenantsClientGetResponse struct { // An associated tenant. AssociatedTenant }
AssociatedTenantsClientGetResponse contains the response from method AssociatedTenantsClient.Get.
type AssociatedTenantsClientListByBillingAccountOptions ¶ added in v1.0.0
type AssociatedTenantsClientListByBillingAccountOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Can be used to get revoked associated tenants. IncludeRevoked *bool // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
AssociatedTenantsClientListByBillingAccountOptions contains the optional parameters for the AssociatedTenantsClient.NewListByBillingAccountPager method.
type AssociatedTenantsClientListByBillingAccountResponse ¶ added in v1.0.0
type AssociatedTenantsClientListByBillingAccountResponse struct { // A container for a list of resources AssociatedTenantListResult }
AssociatedTenantsClientListByBillingAccountResponse contains the response from method AssociatedTenantsClient.NewListByBillingAccountPager.
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 Available Credit or Payment on Account Balance. The credit balance can be used to settle due or past due invoices. Properties *AvailableBalanceProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
AvailableBalance - The Available Credit or Payment on Account Balance. The credit balance can be used to settle due or past due invoices.
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 { // Credit amount for immediate payment. Amount *AvailableBalancePropertiesAmount // Total amount of payments on accounts. TotalPaymentsOnAccount *AvailableBalancePropertiesTotalPaymentsOnAccount // READ-ONLY; The list of payments on accounts. PaymentsOnAccount []*PaymentOnAccount }
AvailableBalanceProperties - The Available Credit or Payment on Account Balance. The credit balance can be used to settle due or past due invoices.
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 AvailableBalancePropertiesAmount ¶ added in v1.0.0
type AvailableBalancePropertiesAmount struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
AvailableBalancePropertiesAmount - Credit amount for immediate payment.
func (AvailableBalancePropertiesAmount) MarshalJSON ¶ added in v1.0.0
func (a AvailableBalancePropertiesAmount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AvailableBalancePropertiesAmount.
func (*AvailableBalancePropertiesAmount) UnmarshalJSON ¶ added in v1.0.0
func (a *AvailableBalancePropertiesAmount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AvailableBalancePropertiesAmount.
type AvailableBalancePropertiesTotalPaymentsOnAccount ¶ added in v1.0.0
type AvailableBalancePropertiesTotalPaymentsOnAccount struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
AvailableBalancePropertiesTotalPaymentsOnAccount - Total amount of payments on accounts.
func (AvailableBalancePropertiesTotalPaymentsOnAccount) MarshalJSON ¶ added in v1.0.0
func (a AvailableBalancePropertiesTotalPaymentsOnAccount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AvailableBalancePropertiesTotalPaymentsOnAccount.
func (*AvailableBalancePropertiesTotalPaymentsOnAccount) UnmarshalJSON ¶ added in v1.0.0
func (a *AvailableBalancePropertiesTotalPaymentsOnAccount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AvailableBalancePropertiesTotalPaymentsOnAccount.
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) GetByBillingAccount ¶ added in v1.0.0
func (client *AvailableBalancesClient) GetByBillingAccount(ctx context.Context, billingAccountName string, options *AvailableBalancesClientGetByBillingAccountOptions) (AvailableBalancesClientGetByBillingAccountResponse, error)
GetByBillingAccount - The Available Credit or Payment on Account Balance for a billing account. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Online Services Program. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - AvailableBalancesClientGetByBillingAccountOptions contains the optional parameters for the AvailableBalancesClient.GetByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingAccount.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().GetByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", 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/availableBalance"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/availableBalance/default"), // Properties: &armbilling.AvailableBalanceProperties{ // Amount: &armbilling.AvailableBalancePropertiesAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](500), // }, // PaymentsOnAccount: []*armbilling.PaymentOnAccount{ // { // Amount: &armbilling.PaymentOnAccountAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // BillingProfileDisplayName: to.Ptr("Contoso Finance"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T00:00:00.000Z"); return t}()), // InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"), // InvoiceName: to.Ptr("G123456789"), // PaymentMethodType: to.Ptr(armbilling.PaymentMethodFamilyCheckWire), // }, // { // Amount: &armbilling.PaymentOnAccountAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](150), // }, // BillingProfileDisplayName: to.Ptr("Contoso Engineering"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/yyyy-yyyy-yyy-yyy"), // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-01T00:00:00.000Z"); return t}()), // InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G987654321"), // InvoiceName: to.Ptr("G987654321"), // PaymentMethodType: to.Ptr(armbilling.PaymentMethodFamilyCheckWire), // }}, // TotalPaymentsOnAccount: &armbilling.AvailableBalancePropertiesTotalPaymentsOnAccount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](200), // }, // }, // } }
Output:
func (*AvailableBalancesClient) GetByBillingProfile ¶ added in v1.0.0
func (client *AvailableBalancesClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, options *AvailableBalancesClientGetByBillingProfileOptions) (AvailableBalancesClientGetByBillingProfileResponse, error)
GetByBillingProfile - The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - AvailableBalancesClientGetByBillingProfileOptions contains the optional parameters for the AvailableBalancesClient.GetByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingProfile.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().GetByBillingProfile(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/availableBalance/default"), // Properties: &armbilling.AvailableBalanceProperties{ // Amount: &armbilling.AvailableBalancePropertiesAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](500), // }, // PaymentsOnAccount: []*armbilling.PaymentOnAccount{ // { // Amount: &armbilling.PaymentOnAccountAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // BillingProfileDisplayName: to.Ptr("Contoso Finance"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T00:00:00.000Z"); return t}()), // InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"), // InvoiceName: to.Ptr("G123456789"), // PaymentMethodType: to.Ptr(armbilling.PaymentMethodFamilyCheckWire), // }}, // TotalPaymentsOnAccount: &armbilling.AvailableBalancePropertiesTotalPaymentsOnAccount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](200), // }, // }, // } }
Output:
type AvailableBalancesClientGetByBillingAccountOptions ¶ added in v1.0.0
type AvailableBalancesClientGetByBillingAccountOptions struct { }
AvailableBalancesClientGetByBillingAccountOptions contains the optional parameters for the AvailableBalancesClient.GetByBillingAccount method.
type AvailableBalancesClientGetByBillingAccountResponse ¶ added in v1.0.0
type AvailableBalancesClientGetByBillingAccountResponse struct { // The Available Credit or Payment on Account Balance. The credit balance can be used to settle due or past due invoices. AvailableBalance }
AvailableBalancesClientGetByBillingAccountResponse contains the response from method AvailableBalancesClient.GetByBillingAccount.
type AvailableBalancesClientGetByBillingProfileOptions ¶ added in v1.0.0
type AvailableBalancesClientGetByBillingProfileOptions struct { }
AvailableBalancesClientGetByBillingProfileOptions contains the optional parameters for the AvailableBalancesClient.GetByBillingProfile method.
type AvailableBalancesClientGetByBillingProfileResponse ¶ added in v1.0.0
type AvailableBalancesClientGetByBillingProfileResponse struct { // The Available Credit or Payment on Account Balance. The credit balance can be used to settle due or past due invoices. AvailableBalance }
AvailableBalancesClientGetByBillingProfileResponse contains the response from method AvailableBalancesClient.GetByBillingProfile.
type AzurePlan ¶
type AzurePlan struct { // The ID that uniquely identifies a product. ProductID *string // The sku description. SKUDescription *string // The ID that uniquely identifies a sku. SKUID *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 Beneficiary ¶ added in v1.0.0
type Beneficiary struct { // The ID that uniquely identifies a user in a tenant. ObjectID *string // The ID that uniquely identifies a tenant. TenantID *string }
Beneficiary - Details of the beneficiary.
func (Beneficiary) MarshalJSON ¶ added in v1.0.0
func (b Beneficiary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Beneficiary.
func (*Beneficiary) UnmarshalJSON ¶ added in v1.0.0
func (b *Beneficiary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Beneficiary.
type BillingAccountStatusReasonCode ¶ added in v1.0.0
type BillingAccountStatusReasonCode string
BillingAccountStatusReasonCode - Reason for the specified billing account status.
const ( BillingAccountStatusReasonCodeExpired BillingAccountStatusReasonCode = "Expired" BillingAccountStatusReasonCodeManuallyTerminated BillingAccountStatusReasonCode = "ManuallyTerminated" BillingAccountStatusReasonCodeOther BillingAccountStatusReasonCode = "Other" BillingAccountStatusReasonCodeTerminateProcessing BillingAccountStatusReasonCode = "TerminateProcessing" BillingAccountStatusReasonCodeTransferred BillingAccountStatusReasonCode = "Transferred" BillingAccountStatusReasonCodeUnusualActivity BillingAccountStatusReasonCode = "UnusualActivity" )
func PossibleBillingAccountStatusReasonCodeValues ¶ added in v1.0.0
func PossibleBillingAccountStatusReasonCodeValues() []BillingAccountStatusReasonCode
PossibleBillingAccountStatusReasonCodeValues returns the possible values for the BillingAccountStatusReasonCode const type.
type BillingManagementTenantState ¶ added in v1.0.0
type BillingManagementTenantState string
BillingManagementTenantState - The state determines whether users from the associated tenant can be assigned roles for commerce activities like viewing and downloading invoices, managing payments, and making purchases.
const ( BillingManagementTenantStateActive BillingManagementTenantState = "Active" BillingManagementTenantStateNotAllowed BillingManagementTenantState = "NotAllowed" BillingManagementTenantStateOther BillingManagementTenantState = "Other" BillingManagementTenantStateRevoked BillingManagementTenantState = "Revoked" )
func PossibleBillingManagementTenantStateValues ¶ added in v1.0.0
func PossibleBillingManagementTenantStateValues() []BillingManagementTenantState
PossibleBillingManagementTenantStateValues returns the possible values for the BillingManagementTenantState const type.
type BillingPlan ¶ added in v1.0.0
type BillingPlan string
BillingPlan - Represents the billing plan in ISO 8601 format. Required only for monthly purchases.
const (
BillingPlanP1M BillingPlan = "P1M"
)
func PossibleBillingPlanValues ¶ added in v1.0.0
func PossibleBillingPlanValues() []BillingPlan
PossibleBillingPlanValues returns the possible values for the BillingPlan const type.
type BillingProfileStatus ¶
type BillingProfileStatus string
BillingProfileStatus - The status of the billing profile.
const ( BillingProfileStatusActive BillingProfileStatus = "Active" BillingProfileStatusDeleted BillingProfileStatus = "Deleted" BillingProfileStatusDisabled BillingProfileStatus = "Disabled" BillingProfileStatusOther BillingProfileStatus = "Other" BillingProfileStatusUnderReview BillingProfileStatus = "UnderReview" 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 ( BillingProfileStatusReasonCodeOther BillingProfileStatusReasonCode = "Other" BillingProfileStatusReasonCodePastDue BillingProfileStatusReasonCode = "PastDue" BillingProfileStatusReasonCodeSpendingLimitExpired BillingProfileStatusReasonCode = "SpendingLimitExpired" BillingProfileStatusReasonCodeSpendingLimitReached BillingProfileStatusReasonCode = "SpendingLimitReached" BillingProfileStatusReasonCodeUnusualActivity BillingProfileStatusReasonCode = "UnusualActivity" )
func PossibleBillingProfileStatusReasonCodeValues ¶
func PossibleBillingProfileStatusReasonCodeValues() []BillingProfileStatusReasonCode
PossibleBillingProfileStatusReasonCodeValues returns the possible values for the BillingProfileStatusReasonCode const type.
type BillingRelationshipType ¶
type BillingRelationshipType string
BillingRelationshipType - Identifies the billing relationships represented by a billing account or billing profile. The billing relationship may be between Microsoft, the customer, and/or a third-party.
const ( BillingRelationshipTypeCSPCustomer BillingRelationshipType = "CSPCustomer" BillingRelationshipTypeCSPPartner BillingRelationshipType = "CSPPartner" BillingRelationshipTypeDirect BillingRelationshipType = "Direct" BillingRelationshipTypeIndirectCustomer BillingRelationshipType = "IndirectCustomer" BillingRelationshipTypeIndirectPartner BillingRelationshipType = "IndirectPartner" BillingRelationshipTypeOther BillingRelationshipType = "Other" )
func PossibleBillingRelationshipTypeValues ¶
func PossibleBillingRelationshipTypeValues() []BillingRelationshipType
PossibleBillingRelationshipTypeValues returns the possible values for the BillingRelationshipType const type.
type BillingRequestStatus ¶ added in v1.0.0
type BillingRequestStatus string
BillingRequestStatus - Status of billing request.
const ( BillingRequestStatusApproved BillingRequestStatus = "Approved" BillingRequestStatusCancelled BillingRequestStatus = "Cancelled" BillingRequestStatusCompleted BillingRequestStatus = "Completed" BillingRequestStatusDeclined BillingRequestStatus = "Declined" BillingRequestStatusExpired BillingRequestStatus = "Expired" BillingRequestStatusOther BillingRequestStatus = "Other" BillingRequestStatusPending BillingRequestStatus = "Pending" )
func PossibleBillingRequestStatusValues ¶ added in v1.0.0
func PossibleBillingRequestStatusValues() []BillingRequestStatus
PossibleBillingRequestStatusValues returns the possible values for the BillingRequestStatus const type.
type BillingRequestType ¶ added in v1.0.0
type BillingRequestType string
BillingRequestType - Type of billing request.
const ( BillingRequestTypeInvoiceAccess BillingRequestType = "InvoiceAccess" BillingRequestTypeOther BillingRequestType = "Other" BillingRequestTypeProvisioningAccess BillingRequestType = "ProvisioningAccess" BillingRequestTypeRoleAssignment BillingRequestType = "RoleAssignment" BillingRequestTypeUpdateBillingPolicy BillingRequestType = "UpdateBillingPolicy" )
func PossibleBillingRequestTypeValues ¶ added in v1.0.0
func PossibleBillingRequestTypeValues() []BillingRequestType
PossibleBillingRequestTypeValues returns the possible values for the BillingRequestType const type.
type BillingSubscriptionOperationStatus ¶ added in v1.0.0
type BillingSubscriptionOperationStatus string
BillingSubscriptionOperationStatus - The status of an operation on the subscription. When None, there is no ongoing operation. When LockedForUpdate, write operations will be blocked on the Billing Subscription. Other is the default value and you may need to refer to the latest API version for more details.
const ( BillingSubscriptionOperationStatusLockedForUpdate BillingSubscriptionOperationStatus = "LockedForUpdate" BillingSubscriptionOperationStatusNone BillingSubscriptionOperationStatus = "None" BillingSubscriptionOperationStatusOther BillingSubscriptionOperationStatus = "Other" )
func PossibleBillingSubscriptionOperationStatusValues ¶ added in v1.0.0
func PossibleBillingSubscriptionOperationStatusValues() []BillingSubscriptionOperationStatus
PossibleBillingSubscriptionOperationStatusValues returns the possible values for the BillingSubscriptionOperationStatus const type.
type BillingSubscriptionStatus ¶ added in v1.0.0
type BillingSubscriptionStatus string
BillingSubscriptionStatus - The subscription status.
const ( BillingSubscriptionStatusActive BillingSubscriptionStatus = "Active" BillingSubscriptionStatusAutoRenew BillingSubscriptionStatus = "AutoRenew" BillingSubscriptionStatusCancelled BillingSubscriptionStatus = "Cancelled" BillingSubscriptionStatusDeleted BillingSubscriptionStatus = "Deleted" BillingSubscriptionStatusDisabled BillingSubscriptionStatus = "Disabled" BillingSubscriptionStatusExpired BillingSubscriptionStatus = "Expired" BillingSubscriptionStatusExpiring BillingSubscriptionStatus = "Expiring" BillingSubscriptionStatusFailed BillingSubscriptionStatus = "Failed" BillingSubscriptionStatusOther BillingSubscriptionStatus = "Other" BillingSubscriptionStatusSuspended BillingSubscriptionStatus = "Suspended" BillingSubscriptionStatusUnknown BillingSubscriptionStatus = "Unknown" BillingSubscriptionStatusWarned BillingSubscriptionStatus = "Warned" )
func PossibleBillingSubscriptionStatusValues ¶ added in v1.0.0
func PossibleBillingSubscriptionStatusValues() []BillingSubscriptionStatus
PossibleBillingSubscriptionStatusValues returns the possible values for the BillingSubscriptionStatus const type.
type CancelSubscriptionRequest ¶ added in v1.0.0
type CancelSubscriptionRequest struct { // REQUIRED; Cancellation reason. CancellationReason *CancellationReason // The fully qualified ID that uniquely identifies a customer. CustomerID *string }
CancelSubscriptionRequest - Request parameters for cancel customer subscription.
func (CancelSubscriptionRequest) MarshalJSON ¶ added in v1.0.0
func (c CancelSubscriptionRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CancelSubscriptionRequest.
func (*CancelSubscriptionRequest) UnmarshalJSON ¶ added in v1.0.0
func (c *CancelSubscriptionRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CancelSubscriptionRequest.
type Cancellation ¶ added in v1.0.0
type Cancellation string
Cancellation - The policy override for the subscription indicates whether the self-serve cancellation or seat reduction is allowed.
const ( CancellationAllowed Cancellation = "Allowed" CancellationNotAllowed Cancellation = "NotAllowed" )
func PossibleCancellationValues ¶ added in v1.0.0
func PossibleCancellationValues() []Cancellation
PossibleCancellationValues returns the possible values for the Cancellation const type.
type CancellationReason ¶ added in v1.0.0
type CancellationReason string
CancellationReason - Cancellation reason.
const ( CancellationReasonCompromise CancellationReason = "Compromise" CancellationReasonDispute CancellationReason = "Dispute" CancellationReasonOther CancellationReason = "Other" )
func PossibleCancellationReasonValues ¶ added in v1.0.0
func PossibleCancellationReasonValues() []CancellationReason
PossibleCancellationReasonValues returns the possible values for the CancellationReason const type.
type Category ¶
type Category string
Category - The category of the agreement.
const ( CategoryAffiliatePurchaseTerms Category = "AffiliatePurchaseTerms" CategoryIndirectForGovernmentAgreement Category = "IndirectForGovernmentAgreement" CategoryMicrosoftCustomerAgreement Category = "MicrosoftCustomerAgreement" CategoryMicrosoftPartnerAgreement Category = "MicrosoftPartnerAgreement" CategoryOther Category = "Other" CategoryUKCloudComputeFramework Category = "UKCloudComputeFramework" )
func PossibleCategoryValues ¶
func PossibleCategoryValues() []Category
PossibleCategoryValues returns the possible values for the Category const type.
type CheckAccessRequest ¶ added in v1.0.0
type CheckAccessRequest struct { // List of actions passed in the request body against which the permissions will be checked. Actions []*string }
CheckAccessRequest - Request to check access.
func (CheckAccessRequest) MarshalJSON ¶ added in v1.0.0
func (c CheckAccessRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CheckAccessRequest.
func (*CheckAccessRequest) UnmarshalJSON ¶ added in v1.0.0
func (c *CheckAccessRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CheckAccessRequest.
type CheckAccessResponse ¶ added in v1.0.0
type CheckAccessResponse struct { // READ-ONLY; Access Decision, specifies access is allowed or not. AccessDecision *AccessDecision // READ-ONLY; Gets or sets an action. Action *string }
CheckAccessResponse - The properties of a check access response.
func (CheckAccessResponse) MarshalJSON ¶ added in v1.0.0
func (c CheckAccessResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CheckAccessResponse.
func (*CheckAccessResponse) UnmarshalJSON ¶ added in v1.0.0
func (c *CheckAccessResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CheckAccessResponse.
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 a billing 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) NewAssociatedTenantsClient ¶ added in v1.0.0
func (c *ClientFactory) NewAssociatedTenantsClient() *AssociatedTenantsClient
NewAssociatedTenantsClient creates a new instance of AssociatedTenantsClient.
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) NewDepartmentsClient ¶ added in v1.0.0
func (c *ClientFactory) NewDepartmentsClient() *DepartmentsClient
NewDepartmentsClient creates a new instance of DepartmentsClient.
func (*ClientFactory) NewEnrollmentAccountsClient ¶ added in v0.6.0
func (c *ClientFactory) NewEnrollmentAccountsClient() *EnrollmentAccountsClient
NewEnrollmentAccountsClient creates a new instance of EnrollmentAccountsClient.
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) NewPartnerTransfersClient ¶ added in v1.0.0
func (c *ClientFactory) NewPartnerTransfersClient() *PartnerTransfersClient
NewPartnerTransfersClient creates a new instance of PartnerTransfersClient.
func (*ClientFactory) NewPaymentMethodsClient ¶ added in v1.0.0
func (c *ClientFactory) NewPaymentMethodsClient() *PaymentMethodsClient
NewPaymentMethodsClient creates a new instance of PaymentMethodsClient.
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) NewRecipientTransfersClient ¶ added in v1.0.0
func (c *ClientFactory) NewRecipientTransfersClient() *RecipientTransfersClient
NewRecipientTransfersClient creates a new instance of RecipientTransfersClient.
func (*ClientFactory) NewRequestsClient ¶ added in v1.0.0
func (c *ClientFactory) NewRequestsClient() *RequestsClient
NewRequestsClient creates a new instance of RequestsClient.
func (*ClientFactory) NewReservationOrdersClient ¶ added in v1.0.0
func (c *ClientFactory) NewReservationOrdersClient() *ReservationOrdersClient
NewReservationOrdersClient creates a new instance of ReservationOrdersClient.
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) NewRoleDefinitionClient ¶ added in v1.0.0
func (c *ClientFactory) NewRoleDefinitionClient() *RoleDefinitionClient
NewRoleDefinitionClient creates a new instance of RoleDefinitionClient.
func (*ClientFactory) NewSavingsPlanOrdersClient ¶ added in v1.0.0
func (c *ClientFactory) NewSavingsPlanOrdersClient() *SavingsPlanOrdersClient
NewSavingsPlanOrdersClient creates a new instance of SavingsPlanOrdersClient.
func (*ClientFactory) NewSavingsPlansClient ¶ added in v1.0.0
func (c *ClientFactory) NewSavingsPlansClient() *SavingsPlansClient
NewSavingsPlansClient creates a new instance of SavingsPlansClient.
func (*ClientFactory) NewSubscriptionsAliasesClient ¶ added in v1.0.0
func (c *ClientFactory) NewSubscriptionsAliasesClient() *SubscriptionsAliasesClient
NewSubscriptionsAliasesClient creates a new instance of SubscriptionsAliasesClient.
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.
func (*ClientFactory) NewTransfersClient ¶ added in v1.0.0
func (c *ClientFactory) NewTransfersClient() *TransfersClient
NewTransfersClient creates a new instance of TransfersClient.
type Commitment ¶ added in v1.0.0
type Commitment struct { Amount *float64 // The ISO 4217 3-letter currency code for the currency used by this purchase record. CurrencyCode *string // Commitment grain. Grain *CommitmentGrain }
Commitment towards the benefit.
func (Commitment) MarshalJSON ¶ added in v1.0.0
func (c Commitment) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Commitment.
func (*Commitment) UnmarshalJSON ¶ added in v1.0.0
func (c *Commitment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Commitment.
type CommitmentGrain ¶ added in v1.0.0
type CommitmentGrain string
CommitmentGrain - Commitment grain.
const (
CommitmentGrainHourly CommitmentGrain = "Hourly"
)
func PossibleCommitmentGrainValues ¶ added in v1.0.0
func PossibleCommitmentGrainValues() []CommitmentGrain
PossibleCommitmentGrainValues returns the possible values for the CommitmentGrain const type.
type CreatedByType ¶ added in v1.0.0
type CreatedByType string
CreatedByType - The type of identity that created the resource.
const ( CreatedByTypeApplication CreatedByType = "Application" CreatedByTypeKey CreatedByType = "Key" CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" CreatedByTypeUser CreatedByType = "User" )
func PossibleCreatedByTypeValues ¶ added in v1.0.0
func PossibleCreatedByTypeValues() []CreatedByType
PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
type CreditType ¶ added in v1.0.0
type CreditType string
CreditType - The credit type of the transaction. Applies only to credited transactions.
const ( CreditTypeAzureCreditOffer CreditType = "AzureCreditOffer" CreditTypeAzureFreeCredit CreditType = "AzureFreeCredit" CreditTypeOther CreditType = "Other" CreditTypeRefund CreditType = "Refund" CreditTypeServiceInterruption CreditType = "ServiceInterruption" )
func PossibleCreditTypeValues ¶ added in v1.0.0
func PossibleCreditTypeValues() []CreditType
PossibleCreditTypeValues returns the possible values for the CreditType const type.
type Customer ¶
type Customer struct { // A partner's customer. Properties *CustomerProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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; The list of resources. Value []*Customer }
CustomerListResult - A container for a list of resources
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 { // A policy at customer scope. Properties *CustomerPolicyProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
CustomerPolicy - A policy at customer scope.
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 { // REQUIRED; The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. ViewCharges *ViewChargesPolicy // List of all policies defined at the billing scope. Policies []*PolicySummary // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState }
CustomerPolicyProperties - A policy at customer scope.
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 { // Azure plans enabled for the customer. EnabledAzurePlans []*AzurePlan // The list of resellers for which an Azure plan is enabled for the customer. Resellers []*Reseller // Dictionary of metadata associated with the resource. 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; The name of the billing profile. BillingProfileDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a billing profile. BillingProfileID *string // READ-ONLY; The name of the customer. DisplayName *string // READ-ONLY; Identifies the status of an customer. This is an upcoming property that will be populated in the future. Status *CustomerStatus // READ-ONLY; The system generated unique identifier for a customer. SystemID *string }
CustomerProperties - A partner's 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 CustomerStatus ¶ added in v1.0.0
type CustomerStatus string
CustomerStatus - Identifies the status of an customer. This is an upcoming property that will be populated in the future.
const ( CustomerStatusActive CustomerStatus = "Active" CustomerStatusDeleted CustomerStatus = "Deleted" CustomerStatusDisabled CustomerStatus = "Disabled" CustomerStatusOther CustomerStatus = "Other" CustomerStatusPending CustomerStatus = "Pending" CustomerStatusUnderReview CustomerStatus = "UnderReview" CustomerStatusWarned CustomerStatus = "Warned" )
func PossibleCustomerStatusValues ¶ added in v1.0.0
func PossibleCustomerStatusValues() []CustomerStatus
PossibleCustomerStatusValues returns the possible values for the CustomerStatus const type.
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, billingProfileName 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- options - CustomersClientGetOptions contains the optional parameters for the CustomersClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGet.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "11111111-1111-1111-1111-111111111111", 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("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("customer1"), // 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"), // }}, // Status: to.Ptr(armbilling.CustomerStatusActive), // SystemID: to.Ptr("yyyy-yyyy-yyy-yyy"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // }, // } }
Output:
func (*CustomersClient) GetByBillingAccount ¶ added in v1.0.0
func (client *CustomersClient) GetByBillingAccount(ctx context.Context, billingAccountName string, customerName string, options *CustomersClientGetByBillingAccountOptions) (CustomersClientGetByBillingAccountResponse, error)
GetByBillingAccount - Gets a customer by its ID at billing account level. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- options - CustomersClientGetByBillingAccountOptions contains the optional parameters for the CustomersClient.GetByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGetByBillingAccount.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().GetByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", 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("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("customer1"), // 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"), // }}, // Status: to.Ptr(armbilling.CustomerStatusActive), // SystemID: to.Ptr("yyyy-yyyy-yyy-yyy"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // }, // } }
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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - CustomersClientListByBillingAccountOptions contains the optional parameters for the CustomersClient.NewListByBillingAccountPager method.
Example (CustomersListByBillingAccount) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.CustomersClientListByBillingAccountOptions{Expand: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("customer1"), // Status: to.Ptr(armbilling.CustomerStatusActive), // SystemID: to.Ptr("yyyy-yyyy-yyy-yyy"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // }, // }, // { // Name: to.Ptr("22222222-2222-2222-2222-222222222222"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/22222222-2222-2222-2222-222222222222"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("customer2"), // Status: to.Ptr(armbilling.CustomerStatusActive), // SystemID: to.Ptr("zzzz-zzzz-zzz-zzz"), // }, // }}, // } } }
Output:
Example (CustomersListByBillingAccountWithExpand) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingAccountWithExpand.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.NewCustomersClient().NewListByBillingAccountPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.CustomersClientListByBillingAccountOptions{Expand: to.Ptr("enabledAzurePlans,resellers"), Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("customer1"), // 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"), // }}, // Status: to.Ptr(armbilling.CustomerStatusActive), // SystemID: to.Ptr("yyyy-yyyy-yyy-yyy"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // }, // }}, // } } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", &armbilling.CustomersClientListByBillingProfileOptions{Expand: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("customer1"), // Status: to.Ptr(armbilling.CustomerStatusActive), // SystemID: to.Ptr("yyyy-yyyy-yyy-yyy"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // }, // }, // { // Name: to.Ptr("22222222-2222-2222-2222-222222222222"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/22222222-2222-2222-2222-222222222222"), // Properties: &armbilling.CustomerProperties{ // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("customer2"), // Status: to.Ptr(armbilling.CustomerStatusActive), // SystemID: to.Ptr("zzzz-zzzz-zzz-zzz"), // }, // }}, // } } }
Output:
type CustomersClientGetByBillingAccountOptions ¶ added in v1.0.0
type CustomersClientGetByBillingAccountOptions struct { }
CustomersClientGetByBillingAccountOptions contains the optional parameters for the CustomersClient.GetByBillingAccount method.
type CustomersClientGetByBillingAccountResponse ¶ added in v1.0.0
type CustomersClientGetByBillingAccountResponse struct { // A partner's customer. Customer }
CustomersClientGetByBillingAccountResponse contains the response from method CustomersClient.GetByBillingAccount.
type CustomersClientGetOptions ¶ added in v0.2.0
type CustomersClientGetOptions struct { }
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 { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // May be used to expand enabledAzurePlans and resellers Expand *string // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
CustomersClientListByBillingAccountOptions contains the optional parameters for the CustomersClient.NewListByBillingAccountPager method.
type CustomersClientListByBillingAccountResponse ¶ added in v0.2.0
type CustomersClientListByBillingAccountResponse struct { // A container for a list of resources CustomerListResult }
CustomersClientListByBillingAccountResponse contains the response from method CustomersClient.NewListByBillingAccountPager.
type CustomersClientListByBillingProfileOptions ¶ added in v0.2.0
type CustomersClientListByBillingProfileOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // May be used to expand enabledAzurePlans and resellers Expand *string // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
CustomersClientListByBillingProfileOptions contains the optional parameters for the CustomersClient.NewListByBillingProfilePager method.
type CustomersClientListByBillingProfileResponse ¶ added in v0.2.0
type CustomersClientListByBillingProfileResponse struct { // A container for a list of resources CustomerListResult }
CustomersClientListByBillingProfileResponse contains the response from method CustomersClient.NewListByBillingProfilePager.
type DeleteBillingProfileEligibilityCode ¶ added in v1.0.0
type DeleteBillingProfileEligibilityCode string
DeleteBillingProfileEligibilityCode - Code of the delete invoice section eligibility response.
const ( DeleteBillingProfileEligibilityCodeActiveBillingSubscriptions DeleteBillingProfileEligibilityCode = "ActiveBillingSubscriptions" DeleteBillingProfileEligibilityCodeActiveCreditCard DeleteBillingProfileEligibilityCode = "ActiveCreditCard" DeleteBillingProfileEligibilityCodeActiveCredits DeleteBillingProfileEligibilityCode = "ActiveCredits" DeleteBillingProfileEligibilityCodeLastBillingProfile DeleteBillingProfileEligibilityCode = "LastBillingProfile" DeleteBillingProfileEligibilityCodeNone DeleteBillingProfileEligibilityCode = "None" DeleteBillingProfileEligibilityCodeNotSupported DeleteBillingProfileEligibilityCode = "NotSupported" DeleteBillingProfileEligibilityCodeOutstandingCharges DeleteBillingProfileEligibilityCode = "OutstandingCharges" DeleteBillingProfileEligibilityCodePendingCharges DeleteBillingProfileEligibilityCode = "PendingCharges" DeleteBillingProfileEligibilityCodeReservedInstances DeleteBillingProfileEligibilityCode = "ReservedInstances" )
func PossibleDeleteBillingProfileEligibilityCodeValues ¶ added in v1.0.0
func PossibleDeleteBillingProfileEligibilityCodeValues() []DeleteBillingProfileEligibilityCode
PossibleDeleteBillingProfileEligibilityCodeValues returns the possible values for the DeleteBillingProfileEligibilityCode const type.
type DeleteBillingProfileEligibilityDetail ¶ added in v1.0.0
type DeleteBillingProfileEligibilityDetail struct { // Code of the delete invoice section eligibility response. Code *DeleteBillingProfileEligibilityCode // Validation message. Message *string }
DeleteBillingProfileEligibilityDetail - Validation details of delete billing profile eligibility.
func (DeleteBillingProfileEligibilityDetail) MarshalJSON ¶ added in v1.0.0
func (d DeleteBillingProfileEligibilityDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeleteBillingProfileEligibilityDetail.
func (*DeleteBillingProfileEligibilityDetail) UnmarshalJSON ¶ added in v1.0.0
func (d *DeleteBillingProfileEligibilityDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeleteBillingProfileEligibilityDetail.
type DeleteBillingProfileEligibilityResult ¶ added in v1.0.0
type DeleteBillingProfileEligibilityResult struct { // Validation details of delete billing profile eligibility. EligibilityDetails []*DeleteBillingProfileEligibilityDetail // Status describing if billing profile is eligible to be deleted. EligibilityStatus *DeleteBillingProfileEligibilityStatus }
DeleteBillingProfileEligibilityResult - Eligibility to delete a billing profile result.
func (DeleteBillingProfileEligibilityResult) MarshalJSON ¶ added in v1.0.0
func (d DeleteBillingProfileEligibilityResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeleteBillingProfileEligibilityResult.
func (*DeleteBillingProfileEligibilityResult) UnmarshalJSON ¶ added in v1.0.0
func (d *DeleteBillingProfileEligibilityResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeleteBillingProfileEligibilityResult.
type DeleteBillingProfileEligibilityStatus ¶ added in v1.0.0
type DeleteBillingProfileEligibilityStatus string
DeleteBillingProfileEligibilityStatus - Status describing if billing profile is eligible to be deleted.
const ( DeleteBillingProfileEligibilityStatusAllowed DeleteBillingProfileEligibilityStatus = "Allowed" DeleteBillingProfileEligibilityStatusNotAllowed DeleteBillingProfileEligibilityStatus = "NotAllowed" )
func PossibleDeleteBillingProfileEligibilityStatusValues ¶ added in v1.0.0
func PossibleDeleteBillingProfileEligibilityStatusValues() []DeleteBillingProfileEligibilityStatus
PossibleDeleteBillingProfileEligibilityStatusValues returns the possible values for the DeleteBillingProfileEligibilityStatus const type.
type DeleteInvoiceSectionEligibilityCode ¶ added in v1.0.0
type DeleteInvoiceSectionEligibilityCode string
DeleteInvoiceSectionEligibilityCode - Code for the delete invoice section validation.
const ( DeleteInvoiceSectionEligibilityCodeActiveAzurePlans DeleteInvoiceSectionEligibilityCode = "ActiveAzurePlans" DeleteInvoiceSectionEligibilityCodeActiveBillingSubscriptions DeleteInvoiceSectionEligibilityCode = "ActiveBillingSubscriptions" DeleteInvoiceSectionEligibilityCodeLastInvoiceSection DeleteInvoiceSectionEligibilityCode = "LastInvoiceSection" DeleteInvoiceSectionEligibilityCodeOther DeleteInvoiceSectionEligibilityCode = "Other" DeleteInvoiceSectionEligibilityCodeReservedInstances DeleteInvoiceSectionEligibilityCode = "ReservedInstances" )
func PossibleDeleteInvoiceSectionEligibilityCodeValues ¶ added in v1.0.0
func PossibleDeleteInvoiceSectionEligibilityCodeValues() []DeleteInvoiceSectionEligibilityCode
PossibleDeleteInvoiceSectionEligibilityCodeValues returns the possible values for the DeleteInvoiceSectionEligibilityCode const type.
type DeleteInvoiceSectionEligibilityDetail ¶ added in v1.0.0
type DeleteInvoiceSectionEligibilityDetail struct { // Code for the delete invoice section validation. Code *DeleteInvoiceSectionEligibilityCode // Validation message. Message *string }
DeleteInvoiceSectionEligibilityDetail - The details of delete invoice section eligibility result.
func (DeleteInvoiceSectionEligibilityDetail) MarshalJSON ¶ added in v1.0.0
func (d DeleteInvoiceSectionEligibilityDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeleteInvoiceSectionEligibilityDetail.
func (*DeleteInvoiceSectionEligibilityDetail) UnmarshalJSON ¶ added in v1.0.0
func (d *DeleteInvoiceSectionEligibilityDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeleteInvoiceSectionEligibilityDetail.
type DeleteInvoiceSectionEligibilityResult ¶ added in v1.0.0
type DeleteInvoiceSectionEligibilityResult struct { // A list of delete invoice section eligibility result details. EligibilityDetails []*DeleteInvoiceSectionEligibilityDetail // Status describing if invoice section is eligible to be deleted. EligibilityStatus *DeleteInvoiceSectionEligibilityStatus }
DeleteInvoiceSectionEligibilityResult - Eligibility to delete an invoice section result.
func (DeleteInvoiceSectionEligibilityResult) MarshalJSON ¶ added in v1.0.0
func (d DeleteInvoiceSectionEligibilityResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeleteInvoiceSectionEligibilityResult.
func (*DeleteInvoiceSectionEligibilityResult) UnmarshalJSON ¶ added in v1.0.0
func (d *DeleteInvoiceSectionEligibilityResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeleteInvoiceSectionEligibilityResult.
type DeleteInvoiceSectionEligibilityStatus ¶ added in v1.0.0
type DeleteInvoiceSectionEligibilityStatus string
DeleteInvoiceSectionEligibilityStatus - Status describing if invoice section is eligible to be deleted.
const ( DeleteInvoiceSectionEligibilityStatusAllowed DeleteInvoiceSectionEligibilityStatus = "Allowed" DeleteInvoiceSectionEligibilityStatusNotAllowed DeleteInvoiceSectionEligibilityStatus = "NotAllowed" )
func PossibleDeleteInvoiceSectionEligibilityStatusValues ¶ added in v1.0.0
func PossibleDeleteInvoiceSectionEligibilityStatusValues() []DeleteInvoiceSectionEligibilityStatus
PossibleDeleteInvoiceSectionEligibilityStatusValues returns the possible values for the DeleteInvoiceSectionEligibilityStatus const type.
type Department ¶
type Department struct { // Optional grouping of enrollment accounts to segment costs into logical groupings and set budgets. Properties *DepartmentProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
Department - Optional grouping of enrollment accounts to segment costs into logical groupings and set budgets.
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 DepartmentListResult ¶ added in v1.0.0
type DepartmentListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*Department }
DepartmentListResult - A container for a list of resources
func (DepartmentListResult) MarshalJSON ¶ added in v1.0.0
func (d DepartmentListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DepartmentListResult.
func (*DepartmentListResult) UnmarshalJSON ¶ added in v1.0.0
func (d *DepartmentListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DepartmentListResult.
type DepartmentProperties ¶
type DepartmentProperties struct { // The cost center associated with the department. CostCenter *string // The name of the department. DisplayName *string // READ-ONLY; The ID that uniquely identifies the department. ID *string // READ-ONLY; The status of the department. Status *string }
DepartmentProperties - Optional grouping of enrollment accounts to segment costs into logical groupings and set budgets.
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 DepartmentsClient ¶ added in v1.0.0
type DepartmentsClient struct {
// contains filtered or unexported fields
}
DepartmentsClient contains the methods for the Departments group. Don't use this type directly, use NewDepartmentsClient() instead.
func NewDepartmentsClient ¶ added in v1.0.0
func NewDepartmentsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*DepartmentsClient, error)
NewDepartmentsClient creates a new instance of DepartmentsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*DepartmentsClient) Get ¶ added in v1.0.0
func (client *DepartmentsClient) Get(ctx context.Context, billingAccountName string, departmentName string, options *DepartmentsClientGetOptions) (DepartmentsClientGetResponse, error)
Get - Gets a department by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- options - DepartmentsClientGetOptions contains the optional parameters for the DepartmentsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentGet.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.NewDepartmentsClient().Get(ctx, "456598", "164821", 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.Department = armbilling.Department{ // Name: to.Ptr("164821"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/456598/departments/164821"), // Properties: &armbilling.DepartmentProperties{ // CostCenter: to.Ptr("C1"), // DisplayName: to.Ptr("Test department"), // Status: to.Ptr("Active"), // }, // } }
Output:
func (*DepartmentsClient) NewListByBillingAccountPager ¶ added in v1.0.0
func (client *DepartmentsClient) NewListByBillingAccountPager(billingAccountName string, options *DepartmentsClientListByBillingAccountOptions) *runtime.Pager[DepartmentsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the departments that a user has access to. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - DepartmentsClientListByBillingAccountOptions contains the optional parameters for the DepartmentsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentsListByBillingAccount.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.NewDepartmentsClient().NewListByBillingAccountPager("456598", &armbilling.DepartmentsClientListByBillingAccountOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Search: 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.DepartmentListResult = armbilling.DepartmentListResult{ // Value: []*armbilling.Department{ // { // Name: to.Ptr("164821"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/456598/departments/164821"), // Properties: &armbilling.DepartmentProperties{ // CostCenter: to.Ptr("C1"), // DisplayName: to.Ptr("departmentName1"), // Status: to.Ptr("Active"), // }, // }, // { // Name: to.Ptr("164822"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/456598/departments/164822"), // Properties: &armbilling.DepartmentProperties{ // CostCenter: to.Ptr("C4"), // DisplayName: to.Ptr("departmentName2"), // Status: to.Ptr("Active"), // }, // }}, // } } }
Output:
type DepartmentsClientGetOptions ¶ added in v1.0.0
type DepartmentsClientGetOptions struct { }
DepartmentsClientGetOptions contains the optional parameters for the DepartmentsClient.Get method.
type DepartmentsClientGetResponse ¶ added in v1.0.0
type DepartmentsClientGetResponse struct { // Optional grouping of enrollment accounts to segment costs into logical groupings and set budgets. Department }
DepartmentsClientGetResponse contains the response from method DepartmentsClient.Get.
type DepartmentsClientListByBillingAccountOptions ¶ added in v1.0.0
type DepartmentsClientListByBillingAccountOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
DepartmentsClientListByBillingAccountOptions contains the optional parameters for the DepartmentsClient.NewListByBillingAccountPager method.
type DepartmentsClientListByBillingAccountResponse ¶ added in v1.0.0
type DepartmentsClientListByBillingAccountResponse struct { // A container for a list of resources DepartmentListResult }
DepartmentsClientListByBillingAccountResponse contains the response from method DepartmentsClient.NewListByBillingAccountPager.
type DetailedTransferStatus ¶ added in v1.0.0
type DetailedTransferStatus struct { // Error details for transfer execution. ErrorDetails *TransferError // READ-ONLY; The ID of the product that is transferred. ProductID *string // READ-ONLY; The name of the product that is transferred. ProductName *string // READ-ONLY; Type of product that is transferred. ProductType *ProductType // READ-ONLY; The SKU of the product that is transferred. SKUDescription *string // READ-ONLY; Transfer status. TransferStatus *ProductTransferStatus }
DetailedTransferStatus - Detailed transfer status.
func (DetailedTransferStatus) MarshalJSON ¶ added in v1.0.0
func (d DetailedTransferStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DetailedTransferStatus.
func (*DetailedTransferStatus) UnmarshalJSON ¶ added in v1.0.0
func (d *DetailedTransferStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DetailedTransferStatus.
type DocumentDownloadRequest ¶ added in v1.0.0
type DocumentDownloadRequest struct { // The ID that uniquely identifies an invoice document. This ID may be an identifier for an invoice PDF, a credit note, or // a tax receipt. If omitted, the most recent invoice PDF for the invoice will be // returned. DocumentName *string // The ID that uniquely identifies an invoice. InvoiceName *string }
DocumentDownloadRequest - A list of download details for individual documents.
func (DocumentDownloadRequest) MarshalJSON ¶ added in v1.0.0
func (d DocumentDownloadRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DocumentDownloadRequest.
func (*DocumentDownloadRequest) UnmarshalJSON ¶ added in v1.0.0
func (d *DocumentDownloadRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DocumentDownloadRequest.
type DocumentDownloadResult ¶ added in v1.0.0
type DocumentDownloadResult struct { // READ-ONLY; The time in UTC when the download URL will expire. ExpiryTime *string // READ-ONLY; The URL to the PDF or .zip file. URL *string }
DocumentDownloadResult - A secure URL that can be used to download a an entity until the URL expires.
func (DocumentDownloadResult) MarshalJSON ¶ added in v1.0.0
func (d DocumentDownloadResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DocumentDownloadResult.
func (*DocumentDownloadResult) UnmarshalJSON ¶ added in v1.0.0
func (d *DocumentDownloadResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DocumentDownloadResult.
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" DocumentSourceOther DocumentSource = "Other" )
func PossibleDocumentSourceValues ¶
func PossibleDocumentSourceValues() []DocumentSource
PossibleDocumentSourceValues returns the possible values for the DocumentSource const type.
type EligibleProductType ¶ added in v1.0.0
type EligibleProductType string
EligibleProductType - Type of the products that can be transferred.
const ( EligibleProductTypeAzureReservation EligibleProductType = "AzureReservation" EligibleProductTypeDevTestAzureSubscription EligibleProductType = "DevTestAzureSubscription" EligibleProductTypeStandardAzureSubscription EligibleProductType = "StandardAzureSubscription" )
func PossibleEligibleProductTypeValues ¶ added in v1.0.0
func PossibleEligibleProductTypeValues() []EligibleProductType
PossibleEligibleProductTypeValues returns the possible values for the EligibleProductType const type.
type EnrollmentAccount ¶
type EnrollmentAccount struct { // It is an organizational hierarchy within a billing account to administer and manage azure costs. Properties *EnrollmentAccountProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
EnrollmentAccount - It is an organizational hierarchy within a billing account to administer and manage azure costs.
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 EnrollmentAccountListResult ¶
type EnrollmentAccountListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*EnrollmentAccount }
EnrollmentAccountListResult - A container for a list of resources
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 EnrollmentAccountOwnerViewCharges ¶ added in v1.0.0
type EnrollmentAccountOwnerViewCharges string
EnrollmentAccountOwnerViewCharges - The policy that controls whether account owner can view charges.
const ( EnrollmentAccountOwnerViewChargesAllowed EnrollmentAccountOwnerViewCharges = "Allowed" EnrollmentAccountOwnerViewChargesDisabled EnrollmentAccountOwnerViewCharges = "Disabled" EnrollmentAccountOwnerViewChargesNotAllowed EnrollmentAccountOwnerViewCharges = "NotAllowed" EnrollmentAccountOwnerViewChargesOther EnrollmentAccountOwnerViewCharges = "Other" )
func PossibleEnrollmentAccountOwnerViewChargesValues ¶ added in v1.0.0
func PossibleEnrollmentAccountOwnerViewChargesValues() []EnrollmentAccountOwnerViewCharges
PossibleEnrollmentAccountOwnerViewChargesValues returns the possible values for the EnrollmentAccountOwnerViewCharges const type.
type EnrollmentAccountProperties ¶
type EnrollmentAccountProperties struct { // The cost center associated with the enrollment account. CostCenter *string // The name of the enrollment account. DisplayName *string // Boolean flag which enables subscribers to run development and testing workloads on Azure at special Dev/Test rates. IsDevTestEnabled *bool // READ-ONLY; The owner of the enrollment account. AccountOwner *string // READ-ONLY; The authorization type of the enrollment account. AuthType *string // READ-ONLY; The name of the department under which the enrollment account exists. DepartmentDisplayName *string // READ-ONLY; The ID that uniquely identifies the department. DepartmentID *string // READ-ONLY; The date of expiration of the enrollment account. EndDate *time.Time // READ-ONLY; The date from which the enrollment account became valid and functional. StartDate *time.Time // READ-ONLY; The status of the enrollment account. Status *string }
EnrollmentAccountProperties - It is an organizational hierarchy within a billing account to administer and manage azure costs.
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 EnrollmentAccountSubscriptionDetails ¶ added in v1.0.0
type EnrollmentAccountSubscriptionDetails struct { // READ-ONLY; The enrollment Account and the subscription association start date. This field is available only for the Enterprise // Agreement Type. EnrollmentAccountStartDate *time.Time // READ-ONLY; The current enrollment account status of the subscription. This field is available only for the Enterprise Agreement // Type. SubscriptionEnrollmentAccountStatus *SubscriptionEnrollmentAccountStatus }
EnrollmentAccountSubscriptionDetails - The billing properties that can be modified. Available only for the Enterprise Agreement Type.
func (EnrollmentAccountSubscriptionDetails) MarshalJSON ¶ added in v1.0.0
func (e EnrollmentAccountSubscriptionDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnrollmentAccountSubscriptionDetails.
func (*EnrollmentAccountSubscriptionDetails) UnmarshalJSON ¶ added in v1.0.0
func (e *EnrollmentAccountSubscriptionDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnrollmentAccountSubscriptionDetails.
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, billingAccountName string, enrollmentAccountName string, options *EnrollmentAccountsClientGetOptions) (EnrollmentAccountsClientGetResponse, error)
Get - Gets an enrollment account by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- enrollmentAccountName - The name of the enrollment account.
- 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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountGet.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, "6564892", "257698", 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.EnrollmentAccount = armbilling.EnrollmentAccount{ // Name: to.Ptr("257698"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6564892/enrollmentAccounts/257698"), // Properties: &armbilling.EnrollmentAccountProperties{ // AccountOwner: to.Ptr("account0@contoso.com"), // AuthType: to.Ptr("Organization"), // CostCenter: to.Ptr("C0"), // DepartmentDisplayName: to.Ptr("TestDept123"), // DepartmentID: to.Ptr("234516"), // DisplayName: to.Ptr("AccountName0"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // IsDevTestEnabled: 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"), // }, // } }
Output:
func (*EnrollmentAccountsClient) GetByDepartment ¶ added in v1.0.0
func (client *EnrollmentAccountsClient) GetByDepartment(ctx context.Context, billingAccountName string, departmentName string, enrollmentAccountName string, options *EnrollmentAccountsClientGetByDepartmentOptions) (EnrollmentAccountsClientGetByDepartmentResponse, error)
GetByDepartment - Gets an enrollment account by department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- enrollmentAccountName - The name of the enrollment account.
- options - EnrollmentAccountsClientGetByDepartmentOptions contains the optional parameters for the EnrollmentAccountsClient.GetByDepartment method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountByDepartment.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().GetByDepartment(ctx, "6564892", "164821", "257698", 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.EnrollmentAccount = armbilling.EnrollmentAccount{ // Name: to.Ptr("257698"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6564892/departments/164821/enrollmentAccounts/257698"), // Properties: &armbilling.EnrollmentAccountProperties{ // AccountOwner: to.Ptr("account0@contoso.com"), // AuthType: to.Ptr("MicrosoftAccount"), // CostCenter: to.Ptr("C0"), // DepartmentDisplayName: to.Ptr("TestDept"), // DepartmentID: to.Ptr("164821"), // DisplayName: to.Ptr("AccountName0"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // IsDevTestEnabled: 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"), // }, // } }
Output:
func (*EnrollmentAccountsClient) NewListByBillingAccountPager ¶ added in v1.0.0
func (client *EnrollmentAccountsClient) NewListByBillingAccountPager(billingAccountName string, options *EnrollmentAccountsClientListByBillingAccountOptions) *runtime.Pager[EnrollmentAccountsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the enrollment accounts for a billing account. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - EnrollmentAccountsClientListByBillingAccountOptions contains the optional parameters for the EnrollmentAccountsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByBillingAccount.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().NewListByBillingAccountPager("6564892", &armbilling.EnrollmentAccountsClientListByBillingAccountOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.EnrollmentAccount{ // { // Name: to.Ptr("257698"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6564892/enrollmentAccounts/257698"), // Properties: &armbilling.EnrollmentAccountProperties{ // AccountOwner: to.Ptr("account0@contoso.com"), // AuthType: to.Ptr("Organization"), // CostCenter: to.Ptr("C0"), // DepartmentDisplayName: to.Ptr("TestDept123"), // DepartmentID: to.Ptr("234516"), // DisplayName: to.Ptr("AccountName0"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // IsDevTestEnabled: 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"), // }, // }, // { // Name: to.Ptr("264698"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6564892/enrollmentAccounts/264698"), // Properties: &armbilling.EnrollmentAccountProperties{ // AccountOwner: to.Ptr("account1@contoso.com"), // AuthType: to.Ptr("MicrosoftAccount"), // CostCenter: to.Ptr("C1"), // DepartmentDisplayName: to.Ptr("TestDept1"), // DepartmentID: to.Ptr("234531"), // DisplayName: to.Ptr("AccountName1"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // IsDevTestEnabled: 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"), // }, // }, // { // Name: to.Ptr("276290"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6564892/enrollmentAccounts/276290"), // Properties: &armbilling.EnrollmentAccountProperties{ // AccountOwner: to.Ptr("account2@contoso.com"), // AuthType: to.Ptr("Organization"), // CostCenter: to.Ptr("C2"), // DepartmentDisplayName: to.Ptr("TestDept2"), // DepartmentID: to.Ptr("234512"), // DisplayName: to.Ptr("AccountName2"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // IsDevTestEnabled: 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"), // }, // }}, // } } }
Output:
func (*EnrollmentAccountsClient) NewListByDepartmentPager ¶ added in v1.0.0
func (client *EnrollmentAccountsClient) NewListByDepartmentPager(billingAccountName string, departmentName string, options *EnrollmentAccountsClientListByDepartmentOptions) *runtime.Pager[EnrollmentAccountsClientListByDepartmentResponse]
NewListByDepartmentPager - Lists the enrollment accounts for a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- options - EnrollmentAccountsClientListByDepartmentOptions contains the optional parameters for the EnrollmentAccountsClient.NewListByDepartmentPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByDepartment.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().NewListByDepartmentPager("6564892", "164821", &armbilling.EnrollmentAccountsClientListByDepartmentOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.EnrollmentAccount{ // { // Name: to.Ptr("257698"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6564892/departments/164821/enrollmentAccounts/257698"), // Properties: &armbilling.EnrollmentAccountProperties{ // AccountOwner: to.Ptr("account0@contoso.com"), // AuthType: to.Ptr("MicrosoftAccount"), // CostCenter: to.Ptr("C0"), // DepartmentDisplayName: to.Ptr("TestDept"), // DepartmentID: to.Ptr("164821"), // DisplayName: to.Ptr("AccountName0"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // IsDevTestEnabled: 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"), // }, // }, // { // Name: to.Ptr("264698"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments/enrollmentAccounts"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6564892/departments/164821/enrollmentAccounts/264698"), // Properties: &armbilling.EnrollmentAccountProperties{ // AccountOwner: to.Ptr("account1@contoso.com"), // AuthType: to.Ptr("Organization"), // CostCenter: to.Ptr("C1"), // DepartmentDisplayName: to.Ptr("TestDept"), // DepartmentID: to.Ptr("164821"), // DisplayName: to.Ptr("AccountName1"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28.000Z"); return t}()), // IsDevTestEnabled: to.Ptr(false), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28.000Z"); return t}()), // Status: to.Ptr("Active"), // }, // }}, // } } }
Output:
type EnrollmentAccountsClientGetByDepartmentOptions ¶ added in v1.0.0
type EnrollmentAccountsClientGetByDepartmentOptions struct { }
EnrollmentAccountsClientGetByDepartmentOptions contains the optional parameters for the EnrollmentAccountsClient.GetByDepartment method.
type EnrollmentAccountsClientGetByDepartmentResponse ¶ added in v1.0.0
type EnrollmentAccountsClientGetByDepartmentResponse struct { // It is an organizational hierarchy within a billing account to administer and manage azure costs. EnrollmentAccount }
EnrollmentAccountsClientGetByDepartmentResponse contains the response from method EnrollmentAccountsClient.GetByDepartment.
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 { // It is an organizational hierarchy within a billing account to administer and manage azure costs. EnrollmentAccount }
EnrollmentAccountsClientGetResponse contains the response from method EnrollmentAccountsClient.Get.
type EnrollmentAccountsClientListByBillingAccountOptions ¶ added in v1.0.0
type EnrollmentAccountsClientListByBillingAccountOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
EnrollmentAccountsClientListByBillingAccountOptions contains the optional parameters for the EnrollmentAccountsClient.NewListByBillingAccountPager method.
type EnrollmentAccountsClientListByBillingAccountResponse ¶ added in v1.0.0
type EnrollmentAccountsClientListByBillingAccountResponse struct { // A container for a list of resources EnrollmentAccountListResult }
EnrollmentAccountsClientListByBillingAccountResponse contains the response from method EnrollmentAccountsClient.NewListByBillingAccountPager.
type EnrollmentAccountsClientListByDepartmentOptions ¶ added in v1.0.0
type EnrollmentAccountsClientListByDepartmentOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
EnrollmentAccountsClientListByDepartmentOptions contains the optional parameters for the EnrollmentAccountsClient.NewListByDepartmentPager method.
type EnrollmentAccountsClientListByDepartmentResponse ¶ added in v1.0.0
type EnrollmentAccountsClientListByDepartmentResponse struct { // A container for a list of resources EnrollmentAccountListResult }
EnrollmentAccountsClientListByDepartmentResponse contains the response from method EnrollmentAccountsClient.NewListByDepartmentPager.
type EnrollmentAuthLevelState ¶ added in v1.0.0
type EnrollmentAuthLevelState string
EnrollmentAuthLevelState - The state showing the enrollment auth level.
const ( EnrollmentAuthLevelStateMicrosoftAccountOnly EnrollmentAuthLevelState = "MicrosoftAccountOnly" EnrollmentAuthLevelStateMixedAccount EnrollmentAuthLevelState = "MixedAccount" EnrollmentAuthLevelStateOrganizationalAccountCrossTenant EnrollmentAuthLevelState = "OrganizationalAccountCrossTenant" EnrollmentAuthLevelStateOrganizationalAccountOnly EnrollmentAuthLevelState = "OrganizationalAccountOnly" EnrollmentAuthLevelStateOther EnrollmentAuthLevelState = "Other" )
func PossibleEnrollmentAuthLevelStateValues ¶ added in v1.0.0
func PossibleEnrollmentAuthLevelStateValues() []EnrollmentAuthLevelState
PossibleEnrollmentAuthLevelStateValues returns the possible values for the EnrollmentAuthLevelState const type.
type EnrollmentDepartmentAdminViewCharges ¶ added in v1.0.0
type EnrollmentDepartmentAdminViewCharges string
EnrollmentDepartmentAdminViewCharges - The policy that controls whether department admin can view charges.
const ( EnrollmentDepartmentAdminViewChargesAllowed EnrollmentDepartmentAdminViewCharges = "Allowed" EnrollmentDepartmentAdminViewChargesDisabled EnrollmentDepartmentAdminViewCharges = "Disabled" EnrollmentDepartmentAdminViewChargesNotAllowed EnrollmentDepartmentAdminViewCharges = "NotAllowed" EnrollmentDepartmentAdminViewChargesOther EnrollmentDepartmentAdminViewCharges = "Other" )
func PossibleEnrollmentDepartmentAdminViewChargesValues ¶ added in v1.0.0
func PossibleEnrollmentDepartmentAdminViewChargesValues() []EnrollmentDepartmentAdminViewCharges
PossibleEnrollmentDepartmentAdminViewChargesValues returns the possible values for the EnrollmentDepartmentAdminViewCharges const type.
type EnrollmentDetails ¶ added in v1.0.0
type EnrollmentDetails struct { // The end date of the enrollment. EndDate *time.Time // The properties of an enrollment which are applicable only for indirect enrollments. IndirectRelationshipInfo *EnrollmentDetailsIndirectRelationshipInfo // The purchase order number of the enrollment. PoNumber *string // 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 cloud of the enrollment. Cloud *string // READ-ONLY; The country code of the enrollment. CountryCode *string // READ-ONLY; The billing currency for the enrollment. Currency *string // READ-ONLY; The billing account extension opted by the company. ExtendedTermOption *ExtendedTermOption // READ-ONLY; The contact who receives invoices of the enrollment. InvoiceRecipient *string // READ-ONLY; The language for the enrollment. Language *string // READ-ONLY; Markup status of enrollment, applicable only for indirect enrollments. MarkupStatus *MarkupStatus // READ-ONLY; The support coverage period for the enrollment. SupportCoverage *string // READ-ONLY; The support level offer associated with an enrollment. SupportLevel *SupportLevel }
EnrollmentDetails - The properties of an enrollment.
func (EnrollmentDetails) MarshalJSON ¶ added in v1.0.0
func (e EnrollmentDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnrollmentDetails.
func (*EnrollmentDetails) UnmarshalJSON ¶ added in v1.0.0
func (e *EnrollmentDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnrollmentDetails.
type EnrollmentDetailsIndirectRelationshipInfo ¶ added in v1.0.0
type EnrollmentDetailsIndirectRelationshipInfo 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 }
EnrollmentDetailsIndirectRelationshipInfo - The properties of an enrollment which are applicable only for indirect enrollments.
func (EnrollmentDetailsIndirectRelationshipInfo) MarshalJSON ¶ added in v1.0.0
func (e EnrollmentDetailsIndirectRelationshipInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnrollmentDetailsIndirectRelationshipInfo.
func (*EnrollmentDetailsIndirectRelationshipInfo) UnmarshalJSON ¶ added in v1.0.0
func (e *EnrollmentDetailsIndirectRelationshipInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnrollmentDetailsIndirectRelationshipInfo.
type EnterpriseAgreementPolicies ¶ added in v1.0.0
type EnterpriseAgreementPolicies struct { // The policy that controls whether account owner can view charges. AccountOwnerViewCharges *EnrollmentAccountOwnerViewCharges // The state showing the enrollment auth level. AuthenticationType *EnrollmentAuthLevelState // The policy that controls whether department admin can view charges. DepartmentAdminViewCharges *EnrollmentDepartmentAdminViewCharges }
EnterpriseAgreementPolicies - The policies for Enterprise Agreement enrollments.
func (EnterpriseAgreementPolicies) MarshalJSON ¶ added in v1.0.0
func (e EnterpriseAgreementPolicies) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnterpriseAgreementPolicies.
func (*EnterpriseAgreementPolicies) UnmarshalJSON ¶ added in v1.0.0
func (e *EnterpriseAgreementPolicies) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnterpriseAgreementPolicies.
type ErrorAdditionalInfo ¶ added in v1.0.0
type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. Info any // READ-ONLY; The additional info type. Type *string }
ErrorAdditionalInfo - The resource management error additional info.
func (ErrorAdditionalInfo) MarshalJSON ¶ added in v1.0.0
func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.
func (*ErrorAdditionalInfo) UnmarshalJSON ¶ added in v1.0.0
func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.
type ErrorDetail ¶ added in v1.0.0
type ErrorDetail struct { // READ-ONLY; The error additional info. AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. Code *string // READ-ONLY; The error details. Details []*ErrorDetail // READ-ONLY; The error message. Message *string // READ-ONLY; The error target. Target *string }
ErrorDetail - The error detail.
func (ErrorDetail) MarshalJSON ¶ added in v1.0.0
func (e ErrorDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorDetail.
func (*ErrorDetail) UnmarshalJSON ¶ added in v1.0.0
func (e *ErrorDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.
type ErrorResponse ¶
type ErrorResponse struct { // The error object. Error *ErrorDetail }
ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
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 ExtendedStatusDefinitionProperties ¶ added in v1.0.0
type ExtendedStatusDefinitionProperties struct { // Subscription Id SubscriptionID *string }
ExtendedStatusDefinitionProperties - Extended status definition properties
func (ExtendedStatusDefinitionProperties) MarshalJSON ¶ added in v1.0.0
func (e ExtendedStatusDefinitionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExtendedStatusDefinitionProperties.
func (*ExtendedStatusDefinitionProperties) UnmarshalJSON ¶ added in v1.0.0
func (e *ExtendedStatusDefinitionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedStatusDefinitionProperties.
type ExtendedStatusInfo ¶ added in v1.0.0
type ExtendedStatusInfo struct { // The message giving detailed information about the status code. Message *string // Properties specific to credit line check failure Properties *ExtendedStatusInfoProperties // Status code providing additional information. StatusCode *string }
ExtendedStatusInfo - Extended status information
func (ExtendedStatusInfo) MarshalJSON ¶ added in v1.0.0
func (e ExtendedStatusInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExtendedStatusInfo.
func (*ExtendedStatusInfo) UnmarshalJSON ¶ added in v1.0.0
func (e *ExtendedStatusInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedStatusInfo.
type ExtendedStatusInfoProperties ¶ added in v1.0.0
type ExtendedStatusInfoProperties struct { // The subscription that has failed credit line check. SubscriptionID *string }
ExtendedStatusInfoProperties - Properties specific to credit line check failure
func (ExtendedStatusInfoProperties) MarshalJSON ¶ added in v1.0.0
func (e ExtendedStatusInfoProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExtendedStatusInfoProperties.
func (*ExtendedStatusInfoProperties) UnmarshalJSON ¶ added in v1.0.0
func (e *ExtendedStatusInfoProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedStatusInfoProperties.
type ExtendedTermOption ¶ added in v1.0.0
type ExtendedTermOption string
ExtendedTermOption - The billing account extension opted by the company.
const ( ExtendedTermOptionOptedIn ExtendedTermOption = "Opted-In" ExtendedTermOptionOptedOut ExtendedTermOption = "Opted-Out" ExtendedTermOptionOther ExtendedTermOption = "Other" )
func PossibleExtendedTermOptionValues ¶ added in v1.0.0
func PossibleExtendedTermOptionValues() []ExtendedTermOption
PossibleExtendedTermOptionValues returns the possible values for the ExtendedTermOption const type.
type ExternalReference ¶ added in v1.0.0
type ExternalReference struct { // READ-ONLY; The ID that uniquely identifies an external reference. ID *string // READ-ONLY; The URL of the external reference. URL *string }
ExternalReference - An external reference.
func (ExternalReference) MarshalJSON ¶ added in v1.0.0
func (e ExternalReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExternalReference.
func (*ExternalReference) UnmarshalJSON ¶ added in v1.0.0
func (e *ExternalReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExternalReference.
type FailedPayment ¶ added in v1.0.0
type FailedPayment struct { // READ-ONLY; The date when the payment was attempted. Date *time.Time // READ-ONLY; The reason that the payment failed. FailedPaymentReason *FailedPaymentReason }
FailedPayment - A failed payment.
func (FailedPayment) MarshalJSON ¶ added in v1.0.0
func (f FailedPayment) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FailedPayment.
func (*FailedPayment) UnmarshalJSON ¶ added in v1.0.0
func (f *FailedPayment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FailedPayment.
type FailedPaymentReason ¶ added in v1.0.0
type FailedPaymentReason string
FailedPaymentReason - The reason that the payment failed.
const ( FailedPaymentReasonBankDeclined FailedPaymentReason = "BankDeclined" FailedPaymentReasonCardExpired FailedPaymentReason = "CardExpired" FailedPaymentReasonIncorrectCardDetails FailedPaymentReason = "IncorrectCardDetails" FailedPaymentReasonOther FailedPaymentReason = "Other" )
func PossibleFailedPaymentReasonValues ¶ added in v1.0.0
func PossibleFailedPaymentReasonValues() []FailedPaymentReason
PossibleFailedPaymentReasonValues returns the possible values for the FailedPaymentReason const type.
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 - Identifies the billing profile that is linked to another billing profile in indirect purchase 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 InitiateTransferProperties ¶ added in v1.0.0
type InitiateTransferProperties struct { // The email ID of the recipient to whom the transfer request is sent. RecipientEmailID *string }
InitiateTransferProperties - Request parameters to initiate transfer.
func (InitiateTransferProperties) MarshalJSON ¶ added in v1.0.0
func (i InitiateTransferProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InitiateTransferProperties.
func (*InitiateTransferProperties) UnmarshalJSON ¶ added in v1.0.0
func (i *InitiateTransferProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InitiateTransferProperties.
type InitiateTransferRequest ¶ added in v1.0.0
type InitiateTransferRequest struct { // Request parameters to initiate transfer. Properties *InitiateTransferProperties }
InitiateTransferRequest - Request parameters to initiate transfer.
func (InitiateTransferRequest) MarshalJSON ¶ added in v1.0.0
func (i InitiateTransferRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InitiateTransferRequest.
func (*InitiateTransferRequest) UnmarshalJSON ¶ added in v1.0.0
func (i *InitiateTransferRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InitiateTransferRequest.
type InitiatorCustomerType ¶ added in v1.0.0
type InitiatorCustomerType string
InitiatorCustomerType - The type of customer of the transfer initiator.
const ( InitiatorCustomerTypeEA InitiatorCustomerType = "EA" InitiatorCustomerTypePartner InitiatorCustomerType = "Partner" )
func PossibleInitiatorCustomerTypeValues ¶ added in v1.0.0
func PossibleInitiatorCustomerTypeValues() []InitiatorCustomerType
PossibleInitiatorCustomerTypeValues returns the possible values for the InitiatorCustomerType const type.
type InstanceFlexibility ¶ added in v1.0.0
type InstanceFlexibility string
InstanceFlexibility - Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.
const ( InstanceFlexibilityOff InstanceFlexibility = "Off" InstanceFlexibilityOn InstanceFlexibility = "On" )
func PossibleInstanceFlexibilityValues ¶ added in v1.0.0
func PossibleInstanceFlexibilityValues() []InstanceFlexibility
PossibleInstanceFlexibilityValues returns the possible values for the InstanceFlexibility const type.
type Invoice ¶
type Invoice struct { // An invoice. Properties *InvoiceProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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 InvoiceDocument ¶ added in v1.0.0
type InvoiceDocument struct { // READ-ONLY; The document numbers for the invoice document. DocumentNumbers []*string // READ-ONLY; The URL to download the invoice document if the source is external to Microsoft.Billing. ExternalURL *string // READ-ONLY; The type of the document. Kind *InvoiceDocumentType // READ-ONLY; The ID that uniquely identifies an invoice document. This ID may be an identifier for an invoice PDF, a credit // note, or a tax receipt. Name *string // READ-ONLY; The source of the document. ENF for Brazil and DRS for rest of the world. Source *DocumentSource // READ-ONLY; The URL to download the invoice document if the source is internal to Microsoft.Billing. URL *string }
InvoiceDocument - The properties of a document.
func (InvoiceDocument) MarshalJSON ¶ added in v1.0.0
func (i InvoiceDocument) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceDocument.
func (*InvoiceDocument) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoiceDocument) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceDocument.
type InvoiceDocumentType ¶
type InvoiceDocumentType string
InvoiceDocumentType - The type of the document.
const ( InvoiceDocumentTypeCreditNote InvoiceDocumentType = "CreditNote" InvoiceDocumentTypeInvoice InvoiceDocumentType = "Invoice" InvoiceDocumentTypeOther InvoiceDocumentType = "Other" InvoiceDocumentTypeSummary InvoiceDocumentType = "Summary" InvoiceDocumentTypeTaxReceipt InvoiceDocumentType = "TaxReceipt" InvoiceDocumentTypeTransactions InvoiceDocumentType = "Transactions" InvoiceDocumentTypeVoidNote InvoiceDocumentType = "VoidNote" )
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; The list of resources. Value []*Invoice }
InvoiceListResult - A container for a list of resources
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 { // The amount due as of now. AmountDue *InvoicePropertiesAmountDue // The amount of Azure prepayment applied to the charges. This field is applicable to billing accounts with agreement type // Microsoft Customer Agreement. AzurePrepaymentApplied *InvoicePropertiesAzurePrepaymentApplied // The total charges for the invoice billing period. BilledAmount *InvoicePropertiesBilledAmount // 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 *InvoicePropertiesCreditAmount // The amount of free Azure credits applied to the charges. This field is applicable to billing accounts with agreement type // Microsoft Customer Agreement. FreeAzureCreditApplied *InvoicePropertiesFreeAzureCreditApplied // Rebill details for an invoice. RebillDetails *InvoicePropertiesRebillDetails // The details of a refund request. RefundDetails *InvoicePropertiesRefundDetails // The pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. SubTotal *InvoicePropertiesSubTotal // The amount of tax charged for the billing period. This field is applicable to billing accounts with agreement type Microsoft // Customer Agreement. TaxAmount *InvoicePropertiesTaxAmount // The amount due when the invoice was generated. This field is applicable to billing accounts with agreement type Microsoft // Customer Agreement. TotalAmount *InvoicePropertiesTotalAmount // 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 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 and view such as invoice, credit note, or tax receipt. Documents []*InvoiceDocument // READ-ONLY; The due date for the invoice. DueDate *time.Time // READ-ONLY; List of failed payments. FailedPayments []*FailedPayment // 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. The date is in MM-DD-YYYY format. InvoicePeriodEndDate *time.Time // READ-ONLY; The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. 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 []*Payment // READ-ONLY; An optional purchase order number for the invoice. PurchaseOrderNumber *string // READ-ONLY; Identifies the type of tax calculation used for the invoice. The field is applicable only to invoices with special // tax calculation logic. SpecialTaxationType *SpecialTaxationType // READ-ONLY; The current status of the invoice. Status *InvoiceStatus // READ-ONLY; The name of the billing subscription for which the invoice is generated. SubscriptionDisplayName *string // READ-ONLY; The ID of the subscription for which the invoice is generated. SubscriptionID *string }
InvoiceProperties - An 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 InvoicePropertiesAmountDue ¶ added in v1.0.0
type InvoicePropertiesAmountDue struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
InvoicePropertiesAmountDue - The amount due as of now.
func (InvoicePropertiesAmountDue) MarshalJSON ¶ added in v1.0.0
func (i InvoicePropertiesAmountDue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoicePropertiesAmountDue.
func (*InvoicePropertiesAmountDue) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoicePropertiesAmountDue) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoicePropertiesAmountDue.
type InvoicePropertiesAzurePrepaymentApplied ¶ added in v1.0.0
type InvoicePropertiesAzurePrepaymentApplied struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
InvoicePropertiesAzurePrepaymentApplied - The amount of Azure prepayment applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
func (InvoicePropertiesAzurePrepaymentApplied) MarshalJSON ¶ added in v1.0.0
func (i InvoicePropertiesAzurePrepaymentApplied) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoicePropertiesAzurePrepaymentApplied.
func (*InvoicePropertiesAzurePrepaymentApplied) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoicePropertiesAzurePrepaymentApplied) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoicePropertiesAzurePrepaymentApplied.
type InvoicePropertiesBilledAmount ¶ added in v1.0.0
type InvoicePropertiesBilledAmount struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
InvoicePropertiesBilledAmount - The total charges for the invoice billing period.
func (InvoicePropertiesBilledAmount) MarshalJSON ¶ added in v1.0.0
func (i InvoicePropertiesBilledAmount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoicePropertiesBilledAmount.
func (*InvoicePropertiesBilledAmount) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoicePropertiesBilledAmount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoicePropertiesBilledAmount.
type InvoicePropertiesCreditAmount ¶ added in v1.0.0
type InvoicePropertiesCreditAmount struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
InvoicePropertiesCreditAmount - 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.
func (InvoicePropertiesCreditAmount) MarshalJSON ¶ added in v1.0.0
func (i InvoicePropertiesCreditAmount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoicePropertiesCreditAmount.
func (*InvoicePropertiesCreditAmount) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoicePropertiesCreditAmount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoicePropertiesCreditAmount.
type InvoicePropertiesFreeAzureCreditApplied ¶ added in v1.0.0
type InvoicePropertiesFreeAzureCreditApplied struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
InvoicePropertiesFreeAzureCreditApplied - The amount of free Azure credits applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
func (InvoicePropertiesFreeAzureCreditApplied) MarshalJSON ¶ added in v1.0.0
func (i InvoicePropertiesFreeAzureCreditApplied) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoicePropertiesFreeAzureCreditApplied.
func (*InvoicePropertiesFreeAzureCreditApplied) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoicePropertiesFreeAzureCreditApplied) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoicePropertiesFreeAzureCreditApplied.
type InvoicePropertiesRebillDetails ¶ added in v1.0.0
type InvoicePropertiesRebillDetails struct { // READ-ONLY; The ID of credit note. CreditNoteDocumentID *string // READ-ONLY; The ID of invoice. InvoiceDocumentID *string // READ-ONLY; The rebill details of an invoice. RebillDetails *RebillDetails }
InvoicePropertiesRebillDetails - Rebill details for an invoice.
func (InvoicePropertiesRebillDetails) MarshalJSON ¶ added in v1.0.0
func (i InvoicePropertiesRebillDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoicePropertiesRebillDetails.
func (*InvoicePropertiesRebillDetails) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoicePropertiesRebillDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoicePropertiesRebillDetails.
type InvoicePropertiesRefundDetails ¶ added in v1.0.0
type InvoicePropertiesRefundDetails struct { // The amount refunded. AmountRefunded *RefundDetailsSummaryAmountRefunded // The amount of refund requested. AmountRequested *RefundDetailsSummaryAmountRequested // READ-ONLY; Date when the refund was approved. ApprovedOn *time.Time // READ-ONLY; Date when the refund was completed. CompletedOn *time.Time // READ-ONLY; The invoice ID of the rebill invoice for a refund. RebillInvoiceID *string // READ-ONLY; The ID of refund operation. RefundOperationID *string // READ-ONLY; The reason for refund. RefundReason *RefundReasonCode // READ-ONLY; The status of refund request. RefundStatus *RefundStatus // READ-ONLY; Date when the refund was requested. RequestedOn *time.Time // READ-ONLY; The number of transactions refunded. TransactionCount *int32 }
InvoicePropertiesRefundDetails - The details of a refund request.
func (InvoicePropertiesRefundDetails) MarshalJSON ¶ added in v1.0.0
func (i InvoicePropertiesRefundDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoicePropertiesRefundDetails.
func (*InvoicePropertiesRefundDetails) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoicePropertiesRefundDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoicePropertiesRefundDetails.
type InvoicePropertiesSubTotal ¶ added in v1.0.0
type InvoicePropertiesSubTotal struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
InvoicePropertiesSubTotal - The pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
func (InvoicePropertiesSubTotal) MarshalJSON ¶ added in v1.0.0
func (i InvoicePropertiesSubTotal) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoicePropertiesSubTotal.
func (*InvoicePropertiesSubTotal) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoicePropertiesSubTotal) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoicePropertiesSubTotal.
type InvoicePropertiesTaxAmount ¶ added in v1.0.0
type InvoicePropertiesTaxAmount struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
InvoicePropertiesTaxAmount - The amount of tax charged for the billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
func (InvoicePropertiesTaxAmount) MarshalJSON ¶ added in v1.0.0
func (i InvoicePropertiesTaxAmount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoicePropertiesTaxAmount.
func (*InvoicePropertiesTaxAmount) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoicePropertiesTaxAmount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoicePropertiesTaxAmount.
type InvoicePropertiesTotalAmount ¶ added in v1.0.0
type InvoicePropertiesTotalAmount struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
InvoicePropertiesTotalAmount - The amount due when the invoice was generated. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
func (InvoicePropertiesTotalAmount) MarshalJSON ¶ added in v1.0.0
func (i InvoicePropertiesTotalAmount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoicePropertiesTotalAmount.
func (*InvoicePropertiesTotalAmount) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoicePropertiesTotalAmount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoicePropertiesTotalAmount.
type InvoiceSection ¶
type InvoiceSection struct { // An invoice section. Properties *InvoiceSectionProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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 InvoiceSectionLabelManagementPolicy ¶ added in v1.0.0
type InvoiceSectionLabelManagementPolicy string
InvoiceSectionLabelManagementPolicy - The policy that controls invoice section label management at invoice section scope. This is allowed by default.
const ( InvoiceSectionLabelManagementPolicyAllowed InvoiceSectionLabelManagementPolicy = "Allowed" InvoiceSectionLabelManagementPolicyNotAllowed InvoiceSectionLabelManagementPolicy = "NotAllowed" InvoiceSectionLabelManagementPolicyOther InvoiceSectionLabelManagementPolicy = "Other" )
func PossibleInvoiceSectionLabelManagementPolicyValues ¶ added in v1.0.0
func PossibleInvoiceSectionLabelManagementPolicyValues() []InvoiceSectionLabelManagementPolicy
PossibleInvoiceSectionLabelManagementPolicyValues returns the possible values for the InvoiceSectionLabelManagementPolicy const type.
type InvoiceSectionListResult ¶
type InvoiceSectionListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*InvoiceSection }
InvoiceSectionListResult - A container for a list of resources
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 InvoiceSectionProperties ¶
type InvoiceSectionProperties struct { // The name of the invoice section. DisplayName *string // Reason for the specified invoice section status. ReasonCode *InvoiceSectionStateReasonCode // Identifies the status of an invoice section. State *InvoiceSectionState // Dictionary of metadata associated with the resource. Maximum key/value length supported of 256 characters. Keys/value should // not empty value nor null. Keys can not contain < > % & \ ? / Tags map[string]*string // 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 *string // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState // READ-ONLY; The system generated unique identifier for an invoice section. SystemID *string }
InvoiceSectionProperties - 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 status of an invoice section.
const ( InvoiceSectionStateActive InvoiceSectionState = "Active" InvoiceSectionStateDeleted InvoiceSectionState = "Deleted" InvoiceSectionStateDisabled InvoiceSectionState = "Disabled" InvoiceSectionStateOther InvoiceSectionState = "Other" InvoiceSectionStateRestricted InvoiceSectionState = "Restricted" InvoiceSectionStateUnderReview InvoiceSectionState = "UnderReview" InvoiceSectionStateWarned InvoiceSectionState = "Warned" )
func PossibleInvoiceSectionStateValues ¶
func PossibleInvoiceSectionStateValues() []InvoiceSectionState
PossibleInvoiceSectionStateValues returns the possible values for the InvoiceSectionState const type.
type InvoiceSectionStateReasonCode ¶ added in v1.0.0
type InvoiceSectionStateReasonCode string
InvoiceSectionStateReasonCode - Reason for the specified invoice section status.
const ( InvoiceSectionStateReasonCodeOther InvoiceSectionStateReasonCode = "Other" InvoiceSectionStateReasonCodePastDue InvoiceSectionStateReasonCode = "PastDue" InvoiceSectionStateReasonCodeSpendingLimitExpired InvoiceSectionStateReasonCode = "SpendingLimitExpired" InvoiceSectionStateReasonCodeSpendingLimitReached InvoiceSectionStateReasonCode = "SpendingLimitReached" InvoiceSectionStateReasonCodeUnusualActivity InvoiceSectionStateReasonCode = "UnusualActivity" )
func PossibleInvoiceSectionStateReasonCodeValues ¶ added in v1.0.0
func PossibleInvoiceSectionStateReasonCodeValues() []InvoiceSectionStateReasonCode
PossibleInvoiceSectionStateReasonCodeValues returns the possible values for the InvoiceSectionStateReasonCode const type.
type InvoiceSectionWithCreateSubPermission ¶
type InvoiceSectionWithCreateSubPermission struct { // READ-ONLY; The name of the billing profile. BillingProfileDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a billing profile. BillingProfileID *string // READ-ONLY; The billing profile spending limit. BillingProfileSpendingLimit *SpendingLimit // READ-ONLY; The status of the billing profile. BillingProfileStatus *BillingProfileStatus // READ-ONLY; Reason for the specified billing profile status. BillingProfileStatusReasonCode *BillingProfileStatusReasonCode // READ-ONLY; The system generated unique identifier for a billing profile. BillingProfileSystemID *string // READ-ONLY; Enabled azure plans for the associated billing profile. EnabledAzurePlans []*AzurePlan // READ-ONLY; The name of the invoice section. InvoiceSectionDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies an 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 InvoiceSectionWithCreateSubPermissionListResult ¶ added in v1.0.0
type InvoiceSectionWithCreateSubPermissionListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*InvoiceSectionWithCreateSubPermission }
InvoiceSectionWithCreateSubPermissionListResult - A container for a list of resources
func (InvoiceSectionWithCreateSubPermissionListResult) MarshalJSON ¶ added in v1.0.0
func (i InvoiceSectionWithCreateSubPermissionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InvoiceSectionWithCreateSubPermissionListResult.
func (*InvoiceSectionWithCreateSubPermissionListResult) UnmarshalJSON ¶ added in v1.0.0
func (i *InvoiceSectionWithCreateSubPermissionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InvoiceSectionWithCreateSubPermissionListResult.
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 2024-04-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 - An 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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsCreateOrUpdate.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "invoice-section-1", armbilling.InvoiceSection{ Properties: &armbilling.InvoiceSectionProperties{ DisplayName: to.Ptr("Invoice Section 1"), Tags: 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("invoice-section-1"), // 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_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/invoice-section-1"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("Invoice Section 1"), // SystemID: to.Ptr("yyyy-yyyy-yyy-yyy"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // }, // } }
Output:
func (*InvoiceSectionsClient) BeginDelete ¶ added in v1.0.0
func (client *InvoiceSectionsClient) BeginDelete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, options *InvoiceSectionsClientBeginDeleteOptions) (*runtime.Poller[InvoiceSectionsClientDeleteResponse], error)
BeginDelete - Deletes 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 2024-04-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 - InvoiceSectionsClientBeginDeleteOptions contains the optional parameters for the InvoiceSectionsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsDelete.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.NewInvoiceSectionsClient().BeginDelete(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsGet.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", 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("invoice-section-1"), // 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_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/invoice-section-1"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("Invoice Section 1"), // SystemID: to.Ptr("yyyy-yyyy-yyy-yyy"), // 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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsListByBillingProfile.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.NewInvoiceSectionsClient().NewListByBillingProfilePager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", &armbilling.InvoiceSectionsClientListByBillingProfileOptions{IncludeDeleted: to.Ptr(true), Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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("invoice-section-1"), // 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_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/invoice-section-1"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("Invoice Section 1"), // State: to.Ptr(armbilling.InvoiceSectionStateActive), // SystemID: to.Ptr("yyyy-yyyy-yyy-yyy"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // }, // }, // { // Name: to.Ptr("invoice-section-2"), // 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_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/invoice-section-2"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("Invoice Section 2"), // ReasonCode: to.Ptr(armbilling.InvoiceSectionStateReasonCodePastDue), // State: to.Ptr(armbilling.InvoiceSectionStateWarned), // SystemID: to.Ptr("zzzz-zzzz-zzz-zzz"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Marketing"), // "pcCode": to.Ptr("Z345678"), // }, // }, // }, // { // Name: to.Ptr("invoice-section-3"), // 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_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/invoice-section-3"), // Properties: &armbilling.InvoiceSectionProperties{ // DisplayName: to.Ptr("Invoice Section 3"), // State: to.Ptr(armbilling.InvoiceSectionStateDeleted), // SystemID: to.Ptr("aaaa-aaaa-aaa-aaa"), // Tags: map[string]*string{ // "costCategory": to.Ptr("Support"), // "pcCode": to.Ptr("A123456"), // }, // }, // }}, // } } }
Output:
func (*InvoiceSectionsClient) ValidateDeleteEligibility ¶ added in v1.0.0
func (client *InvoiceSectionsClient) ValidateDeleteEligibility(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, options *InvoiceSectionsClientValidateDeleteEligibilityOptions) (InvoiceSectionsClientValidateDeleteEligibilityResponse, error)
ValidateDeleteEligibility - Validates if the invoice section can be deleted. 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 2024-04-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 - InvoiceSectionsClientValidateDeleteEligibilityOptions contains the optional parameters for the InvoiceSectionsClient.ValidateDeleteEligibility method.
Example (InvoiceSectionsValidateDeleteEligibilityFailure) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsValidateDeleteEligibilityFailure.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().ValidateDeleteEligibility(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", 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.DeleteInvoiceSectionEligibilityResult = armbilling.DeleteInvoiceSectionEligibilityResult{ // EligibilityDetails: []*armbilling.DeleteInvoiceSectionEligibilityDetail{ // { // Code: to.Ptr(armbilling.DeleteInvoiceSectionEligibilityCodeActiveBillingSubscriptions), // Message: to.Ptr("There are active or disabled subscriptions assigned to the invoice section. Either move the subscription to another invoice section or delete the subscriptions and then try deleting the invoice section."), // }, // { // Code: to.Ptr(armbilling.DeleteInvoiceSectionEligibilityCodeLastInvoiceSection), // Message: to.Ptr("This is the only invoice section in this billing profile so it can’t be deleted."), // }, // { // Code: to.Ptr(armbilling.DeleteInvoiceSectionEligibilityCodeActiveAzurePlans), // Message: to.Ptr("This is the invoice section that was created when its billing profile was created so it can’t be deleted."), // }, // { // Code: to.Ptr(armbilling.DeleteInvoiceSectionEligibilityCodeReservedInstances), // Message: to.Ptr("The invoice section has the RI asset with a billing plan."), // }}, // EligibilityStatus: to.Ptr(armbilling.DeleteInvoiceSectionEligibilityStatusNotAllowed), // } }
Output:
Example (InvoiceSectionsValidateDeleteEligibilitySuccess) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsValidateDeleteEligibilitySuccess.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().ValidateDeleteEligibility(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", 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.DeleteInvoiceSectionEligibilityResult = armbilling.DeleteInvoiceSectionEligibilityResult{ // } }
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 InvoiceSectionsClientBeginDeleteOptions ¶ added in v1.0.0
type InvoiceSectionsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
InvoiceSectionsClientBeginDeleteOptions contains the optional parameters for the InvoiceSectionsClient.BeginDelete method.
type InvoiceSectionsClientCreateOrUpdateResponse ¶ added in v0.2.0
type InvoiceSectionsClientCreateOrUpdateResponse struct { // An invoice section. InvoiceSection }
InvoiceSectionsClientCreateOrUpdateResponse contains the response from method InvoiceSectionsClient.BeginCreateOrUpdate.
type InvoiceSectionsClientDeleteResponse ¶ added in v1.0.0
type InvoiceSectionsClientDeleteResponse struct { }
InvoiceSectionsClientDeleteResponse contains the response from method InvoiceSectionsClient.BeginDelete.
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 { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Can be used to get deleted invoice sections. IncludeDeleted *bool // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
InvoiceSectionsClientListByBillingProfileOptions contains the optional parameters for the InvoiceSectionsClient.NewListByBillingProfilePager method.
type InvoiceSectionsClientListByBillingProfileResponse ¶ added in v0.2.0
type InvoiceSectionsClientListByBillingProfileResponse struct { // A container for a list of resources InvoiceSectionListResult }
InvoiceSectionsClientListByBillingProfileResponse contains the response from method InvoiceSectionsClient.NewListByBillingProfilePager.
type InvoiceSectionsClientValidateDeleteEligibilityOptions ¶ added in v1.0.0
type InvoiceSectionsClientValidateDeleteEligibilityOptions struct { }
InvoiceSectionsClientValidateDeleteEligibilityOptions contains the optional parameters for the InvoiceSectionsClient.ValidateDeleteEligibility method.
type InvoiceSectionsClientValidateDeleteEligibilityResponse ¶ added in v1.0.0
type InvoiceSectionsClientValidateDeleteEligibilityResponse struct { // Eligibility to delete an invoice section result. DeleteInvoiceSectionEligibilityResult }
InvoiceSectionsClientValidateDeleteEligibilityResponse contains the response from method InvoiceSectionsClient.ValidateDeleteEligibility.
type InvoiceStatus ¶
type InvoiceStatus string
InvoiceStatus - The current status of the invoice.
const ( InvoiceStatusDue InvoiceStatus = "Due" InvoiceStatusLocked InvoiceStatus = "Locked" InvoiceStatusOther InvoiceStatus = "Other" 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" InvoiceTypeAzureServices InvoiceType = "AzureServices" InvoiceTypeAzureSupport InvoiceType = "AzureSupport" InvoiceTypeOther InvoiceType = "Other" )
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 a billing subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*InvoicesClient) BeginAmend ¶ added in v1.0.0
func (client *InvoicesClient) BeginAmend(ctx context.Context, billingAccountName string, invoiceName string, options *InvoicesClientBeginAmendOptions) (*runtime.Poller[InvoicesClientAmendResponse], error)
BeginAmend - Regenerate an invoice by billing account name and invoice name. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- invoiceName - The ID that uniquely identifies an invoice.
- options - InvoicesClientBeginAmendOptions contains the optional parameters for the InvoicesClient.BeginAmend method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesAmend.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().BeginAmend(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "G123456789", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*InvoicesClient) BeginDownloadByBillingAccount ¶ added in v1.0.0
func (client *InvoicesClient) BeginDownloadByBillingAccount(ctx context.Context, billingAccountName string, invoiceName string, options *InvoicesClientBeginDownloadByBillingAccountOptions) (*runtime.Poller[InvoicesClientDownloadByBillingAccountResponse], error)
BeginDownloadByBillingAccount - Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- invoiceName - The ID that uniquely identifies an invoice.
- options - InvoicesClientBeginDownloadByBillingAccountOptions contains the optional parameters for the InvoicesClient.BeginDownloadByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingAccount.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().BeginDownloadByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "G123456789", &armbilling.InvoicesClientBeginDownloadByBillingAccountOptions{DocumentName: to.Ptr("12345678")}) 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.DocumentDownloadResult = armbilling.DocumentDownloadResult{ // ExpiryTime: to.Ptr("2023-02-16T17:32:28Z"), // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"), // } }
Output:
func (*InvoicesClient) BeginDownloadByBillingSubscription ¶ added in v1.0.0
func (client *InvoicesClient) BeginDownloadByBillingSubscription(ctx context.Context, invoiceName string, options *InvoicesClientBeginDownloadByBillingSubscriptionOptions) (*runtime.Poller[InvoicesClientDownloadByBillingSubscriptionResponse], error)
BeginDownloadByBillingSubscription - Gets a URL to download an invoice by billing subscription. 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 2024-04-01
- invoiceName - The ID that uniquely identifies an invoice.
- options - InvoicesClientBeginDownloadByBillingSubscriptionOptions contains the optional parameters for the InvoicesClient.BeginDownloadByBillingSubscription method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingSubscription.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().BeginDownloadByBillingSubscription(ctx, "E123456789", &armbilling.InvoicesClientBeginDownloadByBillingSubscriptionOptions{DocumentName: to.Ptr("12345678")}) 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.DocumentDownloadResult = armbilling.DocumentDownloadResult{ // ExpiryTime: to.Ptr("2023-02-16T17:32:28Z"), // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"), // } }
Output:
func (*InvoicesClient) BeginDownloadDocumentsByBillingAccount ¶ added in v1.0.0
func (client *InvoicesClient) BeginDownloadDocumentsByBillingAccount(ctx context.Context, billingAccountName string, parameters []*DocumentDownloadRequest, options *InvoicesClientBeginDownloadDocumentsByBillingAccountOptions) (*runtime.Poller[InvoicesClientDownloadDocumentsByBillingAccountResponse], error)
BeginDownloadDocumentsByBillingAccount - 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - A list of download details for individual documents.
- options - InvoicesClientBeginDownloadDocumentsByBillingAccountOptions contains the optional parameters for the InvoicesClient.BeginDownloadDocumentsByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingAccount.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().BeginDownloadDocumentsByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", []*armbilling.DocumentDownloadRequest{ { DocumentName: to.Ptr("12345678"), InvoiceName: to.Ptr("G123456789"), }, { DocumentName: to.Ptr("12345678"), InvoiceName: to.Ptr("G987654321"), }}, 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.DocumentDownloadResult = armbilling.DocumentDownloadResult{ // ExpiryTime: to.Ptr("2023-02-16T17:32:28Z"), // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"), // } }
Output:
func (*InvoicesClient) BeginDownloadDocumentsByBillingSubscription ¶ added in v1.0.0
func (client *InvoicesClient) BeginDownloadDocumentsByBillingSubscription(ctx context.Context, parameters []*DocumentDownloadRequest, options *InvoicesClientBeginDownloadDocumentsByBillingSubscriptionOptions) (*runtime.Poller[InvoicesClientDownloadDocumentsByBillingSubscriptionResponse], error)
BeginDownloadDocumentsByBillingSubscription - 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 2024-04-01
- parameters - A list of download details for individual documents.
- options - InvoicesClientBeginDownloadDocumentsByBillingSubscriptionOptions contains the optional parameters for the InvoicesClient.BeginDownloadDocumentsByBillingSubscription method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingSubscription.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().BeginDownloadDocumentsByBillingSubscription(ctx, []*armbilling.DocumentDownloadRequest{ { DocumentName: to.Ptr("12345678"), InvoiceName: to.Ptr("E123456789"), }, { DocumentName: to.Ptr("12345678"), InvoiceName: to.Ptr("E987654321"), }}, 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.DocumentDownloadResult = armbilling.DocumentDownloadResult{ // ExpiryTime: to.Ptr("2023-02-16T17:32:28Z"), // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"), // } }
Output:
func (*InvoicesClient) BeginDownloadSummaryByBillingAccount ¶ added in v1.0.0
func (client *InvoicesClient) BeginDownloadSummaryByBillingAccount(ctx context.Context, billingAccountName string, invoiceName string, options *InvoicesClientBeginDownloadSummaryByBillingAccountOptions) (*runtime.Poller[InvoicesClientDownloadSummaryByBillingAccountResponse], error)
BeginDownloadSummaryByBillingAccount - Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- invoiceName - The ID that uniquely identifies an invoice.
- options - InvoicesClientBeginDownloadSummaryByBillingAccountOptions contains the optional parameters for the InvoicesClient.BeginDownloadSummaryByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadSummaryByBillingAccount.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().BeginDownloadSummaryByBillingAccount(ctx, "123456789", "G123456789", 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.DocumentDownloadResult = armbilling.DocumentDownloadResult{ // ExpiryTime: to.Ptr("2023-02-16T17:32:28Z"), // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724_summary.pdf?sv=2019-02-02&sr=b&sp=r"), // } }
Output:
func (*InvoicesClient) Get ¶
func (client *InvoicesClient) Get(ctx context.Context, invoiceName string, options *InvoicesClientGetOptions) (InvoicesClientGetResponse, error)
Get - 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 2024-04-01
- invoiceName - The ID that uniquely identifies an invoice.
- options - InvoicesClientGetOptions contains the optional parameters for the InvoicesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGet.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, "G123456789", 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("G123456789"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.InvoicePropertiesAmountDue{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // AzurePrepaymentApplied: &armbilling.InvoicePropertiesAzurePrepaymentApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](25.46), // }, // BilledAmount: &armbilling.InvoicePropertiesBilledAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // CreditAmount: &armbilling.InvoicePropertiesCreditAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.InvoiceDocument{ // { // Name: to.Ptr("12345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // }, // { // Name: to.Ptr("22345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeTaxReceipt), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.InvoicePropertiesFreeAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // PurchaseOrderNumber: to.Ptr("123456"), // RebillDetails: &armbilling.InvoicePropertiesRebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote2"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000002"), // RebillDetails: &armbilling.RebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000001"), // }, // }, // SpecialTaxationType: to.Ptr(armbilling.SpecialTaxationTypeSubtotalLevel), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.InvoicePropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.InvoicePropertiesTaxAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // TotalAmount: &armbilling.InvoicePropertiesTotalAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](7.53), // }, // }, // } }
Output:
func (*InvoicesClient) GetByBillingAccount ¶ added in v1.0.0
func (client *InvoicesClient) GetByBillingAccount(ctx context.Context, billingAccountName string, invoiceName string, options *InvoicesClientGetByBillingAccountOptions) (InvoicesClientGetByBillingAccountResponse, error)
GetByBillingAccount - Gets an invoice by billing account name and ID. The operation is supported for all billing account types. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- invoiceName - The ID that uniquely identifies an invoice.
- options - InvoicesClientGetByBillingAccountOptions contains the optional parameters for the InvoicesClient.GetByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingAccount.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().GetByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "G123456789", 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("G123456789"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.InvoicePropertiesAmountDue{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // AzurePrepaymentApplied: &armbilling.InvoicePropertiesAzurePrepaymentApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](25.46), // }, // BilledAmount: &armbilling.InvoicePropertiesBilledAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // CreditAmount: &armbilling.InvoicePropertiesCreditAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.InvoiceDocument{ // { // Name: to.Ptr("12345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // }, // { // Name: to.Ptr("22345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeTaxReceipt), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.InvoicePropertiesFreeAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // PurchaseOrderNumber: to.Ptr("123456"), // RebillDetails: &armbilling.InvoicePropertiesRebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote2"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000002"), // RebillDetails: &armbilling.RebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000001"), // }, // }, // SpecialTaxationType: to.Ptr(armbilling.SpecialTaxationTypeSubtotalLevel), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.InvoicePropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.InvoicePropertiesTaxAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // TotalAmount: &armbilling.InvoicePropertiesTotalAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](7.53), // }, // }, // } }
Output:
func (*InvoicesClient) GetByBillingSubscription ¶ added in v1.0.0
func (client *InvoicesClient) GetByBillingSubscription(ctx context.Context, invoiceName string, options *InvoicesClientGetByBillingSubscriptionOptions) (InvoicesClientGetByBillingSubscriptionResponse, error)
GetByBillingSubscription - Gets an invoice by subscription ID and invoice 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 2024-04-01
- invoiceName - The ID that uniquely identifies an invoice.
- options - InvoicesClientGetByBillingSubscriptionOptions contains the optional parameters for the InvoicesClient.GetByBillingSubscription method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingSubscription.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().GetByBillingSubscription(ctx, "E123456789", 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("E123456789"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/11111111-1111-1111-1111-111111111111/invoices/E123456789"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.InvoicePropertiesAmountDue{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // BilledAmount: &armbilling.InvoicePropertiesBilledAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-16T17:32:28.000Z"); return t}()), // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // InvoiceType: to.Ptr(armbilling.InvoiceTypeAzureServices), // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubscriptionDisplayName: to.Ptr("Contoso Operations Billing"), // SubscriptionID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // } }
Output:
func (*InvoicesClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *InvoicesClient) NewListByBillingAccountPager(billingAccountName 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 all billing account types.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - InvoicesClientListByBillingAccountOptions contains the optional parameters for the InvoicesClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingAccount.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) } pager := clientFactory.NewInvoicesClient().NewListByBillingAccountPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.InvoicesClientListByBillingAccountOptions{PeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-01"); return t }()), PeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-06-30"); return t }()), Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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("G123456789"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.InvoicePropertiesAmountDue{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // AzurePrepaymentApplied: &armbilling.InvoicePropertiesAzurePrepaymentApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](25.46), // }, // BilledAmount: &armbilling.InvoicePropertiesBilledAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // CreditAmount: &armbilling.InvoicePropertiesCreditAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.InvoiceDocument{ // { // Name: to.Ptr("12345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // }, // { // Name: to.Ptr("22345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeTaxReceipt), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.InvoicePropertiesFreeAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // PurchaseOrderNumber: to.Ptr("123456"), // RebillDetails: &armbilling.InvoicePropertiesRebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote2"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000002"), // RebillDetails: &armbilling.RebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000001"), // }, // }, // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.InvoicePropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.InvoicePropertiesTaxAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // TotalAmount: &armbilling.InvoicePropertiesTotalAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](7.53), // }, // }, // }, // { // Name: to.Ptr("G987654321"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G987654321"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.InvoicePropertiesAmountDue{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // AzurePrepaymentApplied: &armbilling.InvoicePropertiesAzurePrepaymentApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](25.46), // }, // BilledAmount: &armbilling.InvoicePropertiesBilledAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // CreditAmount: &armbilling.InvoicePropertiesCreditAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.InvoiceDocument{ // { // Name: to.Ptr("12345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // }, // { // Name: to.Ptr("22345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeTaxReceipt), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.InvoicePropertiesFreeAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.Payment{ // { // Amount: &armbilling.PaymentAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("debited"), // }}, // PurchaseOrderNumber: to.Ptr("123455"), // RebillDetails: &armbilling.InvoicePropertiesRebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote2"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000002"), // RebillDetails: &armbilling.RebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000001"), // }, // }, // Status: to.Ptr(armbilling.InvoiceStatusPaid), // SubTotal: &armbilling.InvoicePropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.InvoicePropertiesTaxAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // TotalAmount: &armbilling.InvoicePropertiesTotalAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](7.53), // }, // }, // }}, // } } }
Output:
func (*InvoicesClient) NewListByBillingProfilePager ¶ added in v0.4.0
func (client *InvoicesClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - InvoicesClientListByBillingProfileOptions contains the optional parameters for the InvoicesClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingProfile.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) } pager := clientFactory.NewInvoicesClient().NewListByBillingProfilePager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", &armbilling.InvoicesClientListByBillingProfileOptions{PeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-01"); return t }()), PeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-06-30"); return t }()), Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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("G123456789"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.InvoicePropertiesAmountDue{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // AzurePrepaymentApplied: &armbilling.InvoicePropertiesAzurePrepaymentApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](25.46), // }, // BilledAmount: &armbilling.InvoicePropertiesBilledAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // CreditAmount: &armbilling.InvoicePropertiesCreditAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.InvoiceDocument{ // { // Name: to.Ptr("12345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // }, // { // Name: to.Ptr("22345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeTaxReceipt), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.InvoicePropertiesFreeAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // PurchaseOrderNumber: to.Ptr("123456"), // RebillDetails: &armbilling.InvoicePropertiesRebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote2"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000002"), // RebillDetails: &armbilling.RebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000001"), // }, // }, // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubTotal: &armbilling.InvoicePropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.InvoicePropertiesTaxAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // TotalAmount: &armbilling.InvoicePropertiesTotalAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](7.53), // }, // }, // }, // { // Name: to.Ptr("G987654321"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G987654321"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.InvoicePropertiesAmountDue{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // AzurePrepaymentApplied: &armbilling.InvoicePropertiesAzurePrepaymentApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](25.46), // }, // BilledAmount: &armbilling.InvoicePropertiesBilledAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // CreditAmount: &armbilling.InvoicePropertiesCreditAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // Documents: []*armbilling.InvoiceDocument{ // { // Name: to.Ptr("12345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // }, // { // Name: to.Ptr("22345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeTaxReceipt), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-16T17:32:28.000Z"); return t}()), // FreeAzureCreditApplied: &armbilling.InvoicePropertiesFreeAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](0), // }, // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-01T17:32:28.000Z"); return t}()), // IsMonthlyInvoice: to.Ptr(false), // Payments: []*armbilling.Payment{ // { // Amount: &armbilling.PaymentAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-14T17:32:28.000Z"); return t}()), // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // PaymentMethodType: to.Ptr("visa"), // PaymentType: to.Ptr("debited"), // }}, // PurchaseOrderNumber: to.Ptr("123455"), // RebillDetails: &armbilling.InvoicePropertiesRebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote2"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000002"), // RebillDetails: &armbilling.RebillDetails{ // CreditNoteDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/CreditNote"), // InvoiceDocumentID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/I000001"), // }, // }, // Status: to.Ptr(armbilling.InvoiceStatusPaid), // SubTotal: &armbilling.InvoicePropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // TaxAmount: &armbilling.InvoicePropertiesTaxAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](1), // }, // TotalAmount: &armbilling.InvoicePropertiesTotalAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](7.53), // }, // }, // }}, // } } }
Output:
func (*InvoicesClient) NewListByBillingSubscriptionPager ¶ added in v0.4.0
func (client *InvoicesClient) NewListByBillingSubscriptionPager(options *InvoicesClientListByBillingSubscriptionOptions) *runtime.Pager[InvoicesClientListByBillingSubscriptionResponse]
NewListByBillingSubscriptionPager - Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
Generated from API version 2024-04-01
- 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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingSubscription.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) } pager := clientFactory.NewInvoicesClient().NewListByBillingSubscriptionPager(&armbilling.InvoicesClientListByBillingSubscriptionOptions{PeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-01"); return t }()), PeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-06-30"); return t }()), Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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("E123456789"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/11111111-1111-1111-1111-111111111111/invoices/E123456789"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.InvoicePropertiesAmountDue{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // BilledAmount: &armbilling.InvoicePropertiesBilledAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-16T17:32:28.000Z"); return t}()), // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // InvoiceType: to.Ptr(armbilling.InvoiceTypeAzureServices), // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubscriptionDisplayName: to.Ptr("Contoso Operations Billing"), // SubscriptionID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // }, // { // Name: to.Ptr("G123456789"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/11111111-1111-1111-1111-111111111111/invoices/G123456789"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.InvoicePropertiesAmountDue{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](15.53), // }, // BilledAmount: &armbilling.InvoicePropertiesBilledAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](55.99), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-16T17:32:28.000Z"); return t}()), // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T17:32:28.000Z"); return t}()), // InvoiceType: to.Ptr(armbilling.InvoiceTypeAzureMarketplace), // PurchaseOrderNumber: to.Ptr("123456"), // Status: to.Ptr(armbilling.InvoiceStatusDue), // SubscriptionDisplayName: to.Ptr("Contoso Operations Billing"), // SubscriptionID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // }, // { // Name: to.Ptr("E987654321"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions/invoices"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/11111111-1111-1111-1111-111111111111/invoices/E987654321"), // Properties: &armbilling.InvoiceProperties{ // AmountDue: &armbilling.InvoicePropertiesAmountDue{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](8.53), // }, // BilledAmount: &armbilling.InvoicePropertiesBilledAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](33.99), // }, // Documents: []*armbilling.InvoiceDocument{ // { // Name: to.Ptr("12345678"), // Kind: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), // }}, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-16T17:32:28.000Z"); return t}()), // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-01T17:32:28.000Z"); return t}()), // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-15T17:32:28.000Z"); return t}()), // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-01T17:32:28.000Z"); return t}()), // InvoiceType: to.Ptr(armbilling.InvoiceTypeAzureSupport), // Payments: []*armbilling.Payment{ // { // Amount: &armbilling.PaymentAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-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), // SubscriptionDisplayName: to.Ptr("Contoso Operations Billing"), // SubscriptionID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // }}, // } } }
Output:
type InvoicesClientAmendResponse ¶ added in v1.0.0
type InvoicesClientAmendResponse struct { }
InvoicesClientAmendResponse contains the response from method InvoicesClient.BeginAmend.
type InvoicesClientBeginAmendOptions ¶ added in v1.0.0
type InvoicesClientBeginAmendOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
InvoicesClientBeginAmendOptions contains the optional parameters for the InvoicesClient.BeginAmend method.
type InvoicesClientBeginDownloadByBillingAccountOptions ¶ added in v1.0.0
type InvoicesClientBeginDownloadByBillingAccountOptions struct { // The ID that uniquely identifies an invoice document. This ID may be an identifier for an invoice PDF, a credit note, or // a tax receipt. DocumentName *string // Resumes the LRO from the provided token. ResumeToken string }
InvoicesClientBeginDownloadByBillingAccountOptions contains the optional parameters for the InvoicesClient.BeginDownloadByBillingAccount method.
type InvoicesClientBeginDownloadByBillingSubscriptionOptions ¶ added in v1.0.0
type InvoicesClientBeginDownloadByBillingSubscriptionOptions struct { // The ID that uniquely identifies an invoice document. This ID may be an identifier for an invoice PDF, a credit note, or // a tax receipt. DocumentName *string // Resumes the LRO from the provided token. ResumeToken string }
InvoicesClientBeginDownloadByBillingSubscriptionOptions contains the optional parameters for the InvoicesClient.BeginDownloadByBillingSubscription method.
type InvoicesClientBeginDownloadDocumentsByBillingAccountOptions ¶ added in v1.0.0
type InvoicesClientBeginDownloadDocumentsByBillingAccountOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
InvoicesClientBeginDownloadDocumentsByBillingAccountOptions contains the optional parameters for the InvoicesClient.BeginDownloadDocumentsByBillingAccount method.
type InvoicesClientBeginDownloadDocumentsByBillingSubscriptionOptions ¶ added in v1.0.0
type InvoicesClientBeginDownloadDocumentsByBillingSubscriptionOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
InvoicesClientBeginDownloadDocumentsByBillingSubscriptionOptions contains the optional parameters for the InvoicesClient.BeginDownloadDocumentsByBillingSubscription method.
type InvoicesClientBeginDownloadSummaryByBillingAccountOptions ¶ added in v1.0.0
type InvoicesClientBeginDownloadSummaryByBillingAccountOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
InvoicesClientBeginDownloadSummaryByBillingAccountOptions contains the optional parameters for the InvoicesClient.BeginDownloadSummaryByBillingAccount method.
type InvoicesClientDownloadByBillingAccountResponse ¶ added in v1.0.0
type InvoicesClientDownloadByBillingAccountResponse struct { // A secure URL that can be used to download a an entity until the URL expires. DocumentDownloadResult }
InvoicesClientDownloadByBillingAccountResponse contains the response from method InvoicesClient.BeginDownloadByBillingAccount.
type InvoicesClientDownloadByBillingSubscriptionResponse ¶ added in v1.0.0
type InvoicesClientDownloadByBillingSubscriptionResponse struct { // A secure URL that can be used to download a an entity until the URL expires. DocumentDownloadResult }
InvoicesClientDownloadByBillingSubscriptionResponse contains the response from method InvoicesClient.BeginDownloadByBillingSubscription.
type InvoicesClientDownloadDocumentsByBillingAccountResponse ¶ added in v1.0.0
type InvoicesClientDownloadDocumentsByBillingAccountResponse struct { // A secure URL that can be used to download a an entity until the URL expires. DocumentDownloadResult }
InvoicesClientDownloadDocumentsByBillingAccountResponse contains the response from method InvoicesClient.BeginDownloadDocumentsByBillingAccount.
type InvoicesClientDownloadDocumentsByBillingSubscriptionResponse ¶ added in v1.0.0
type InvoicesClientDownloadDocumentsByBillingSubscriptionResponse struct { // A secure URL that can be used to download a an entity until the URL expires. DocumentDownloadResult }
InvoicesClientDownloadDocumentsByBillingSubscriptionResponse contains the response from method InvoicesClient.BeginDownloadDocumentsByBillingSubscription.
type InvoicesClientDownloadSummaryByBillingAccountResponse ¶ added in v1.0.0
type InvoicesClientDownloadSummaryByBillingAccountResponse struct { // A secure URL that can be used to download a an entity until the URL expires. DocumentDownloadResult }
InvoicesClientDownloadSummaryByBillingAccountResponse contains the response from method InvoicesClient.BeginDownloadSummaryByBillingAccount.
type InvoicesClientGetByBillingAccountOptions ¶ added in v1.0.0
type InvoicesClientGetByBillingAccountOptions struct { }
InvoicesClientGetByBillingAccountOptions contains the optional parameters for the InvoicesClient.GetByBillingAccount method.
type InvoicesClientGetByBillingAccountResponse ¶ added in v1.0.0
type InvoicesClientGetByBillingAccountResponse struct { // An invoice. Invoice }
InvoicesClientGetByBillingAccountResponse contains the response from method InvoicesClient.GetByBillingAccount.
type InvoicesClientGetByBillingSubscriptionOptions ¶ added in v1.0.0
type InvoicesClientGetByBillingSubscriptionOptions struct { }
InvoicesClientGetByBillingSubscriptionOptions contains the optional parameters for the InvoicesClient.GetByBillingSubscription method.
type InvoicesClientGetByBillingSubscriptionResponse ¶ added in v1.0.0
type InvoicesClientGetByBillingSubscriptionResponse struct { // An invoice. Invoice }
InvoicesClientGetByBillingSubscriptionResponse contains the response from method InvoicesClient.GetByBillingSubscription.
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 { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The end date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. PeriodEndDate *time.Time // The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. PeriodStartDate *time.Time // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
InvoicesClientListByBillingAccountOptions contains the optional parameters for the InvoicesClient.NewListByBillingAccountPager method.
type InvoicesClientListByBillingAccountResponse ¶ added in v0.2.0
type InvoicesClientListByBillingAccountResponse struct { // A container for a list of resources InvoiceListResult }
InvoicesClientListByBillingAccountResponse contains the response from method InvoicesClient.NewListByBillingAccountPager.
type InvoicesClientListByBillingProfileOptions ¶ added in v0.2.0
type InvoicesClientListByBillingProfileOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The end date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. PeriodEndDate *time.Time // The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. PeriodStartDate *time.Time // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
InvoicesClientListByBillingProfileOptions contains the optional parameters for the InvoicesClient.NewListByBillingProfilePager method.
type InvoicesClientListByBillingProfileResponse ¶ added in v0.2.0
type InvoicesClientListByBillingProfileResponse struct { // A container for a list of resources InvoiceListResult }
InvoicesClientListByBillingProfileResponse contains the response from method InvoicesClient.NewListByBillingProfilePager.
type InvoicesClientListByBillingSubscriptionOptions ¶ added in v0.2.0
type InvoicesClientListByBillingSubscriptionOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The end date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. PeriodEndDate *time.Time // The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. PeriodStartDate *time.Time // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
InvoicesClientListByBillingSubscriptionOptions contains the optional parameters for the InvoicesClient.NewListByBillingSubscriptionPager method.
type InvoicesClientListByBillingSubscriptionResponse ¶ added in v0.2.0
type InvoicesClientListByBillingSubscriptionResponse struct { // A container for a list of resources 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.
const ( MarketplacePurchasesPolicyAllAllowed MarketplacePurchasesPolicy = "AllAllowed" MarketplacePurchasesPolicyDisabled MarketplacePurchasesPolicy = "Disabled" MarketplacePurchasesPolicyNotAllowed MarketplacePurchasesPolicy = "NotAllowed" MarketplacePurchasesPolicyOnlyFreeAllowed MarketplacePurchasesPolicy = "OnlyFreeAllowed" MarketplacePurchasesPolicyOther MarketplacePurchasesPolicy = "Other" )
func PossibleMarketplacePurchasesPolicyValues ¶
func PossibleMarketplacePurchasesPolicyValues() []MarketplacePurchasesPolicy
PossibleMarketplacePurchasesPolicyValues returns the possible values for the MarketplacePurchasesPolicy const type.
type MarkupStatus ¶ added in v1.0.0
type MarkupStatus string
MarkupStatus - Markup status of enrollment, applicable only for indirect enrollments.
const ( MarkupStatusDisabled MarkupStatus = "Disabled" MarkupStatusLocked MarkupStatus = "Locked" MarkupStatusOther MarkupStatus = "Other" MarkupStatusPreview MarkupStatus = "Preview" MarkupStatusPublished MarkupStatus = "Published" )
func PossibleMarkupStatusValues ¶ added in v1.0.0
func PossibleMarkupStatusValues() []MarkupStatus
PossibleMarkupStatusValues returns the possible values for the MarkupStatus const type.
type MoveBillingSubscriptionEligibilityResult ¶ added in v1.0.0
type MoveBillingSubscriptionEligibilityResult struct { // Error details of the transfer eligibility validation. ErrorDetails *MoveBillingSubscriptionErrorDetails // READ-ONLY; Specifies whether the subscription is eligible to be transferred. IsMoveEligible *bool }
MoveBillingSubscriptionEligibilityResult - Result of the transfer eligibility validation.
func (MoveBillingSubscriptionEligibilityResult) MarshalJSON ¶ added in v1.0.0
func (m MoveBillingSubscriptionEligibilityResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MoveBillingSubscriptionEligibilityResult.
func (*MoveBillingSubscriptionEligibilityResult) UnmarshalJSON ¶ added in v1.0.0
func (m *MoveBillingSubscriptionEligibilityResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MoveBillingSubscriptionEligibilityResult.
type MoveBillingSubscriptionErrorDetails ¶ added in v1.0.0
type MoveBillingSubscriptionErrorDetails struct { // Error code of the transfer validation response. Code *SubscriptionTransferValidationErrorCode // Detailed error message explaining the error. Details *string // The error message. Message *string }
MoveBillingSubscriptionErrorDetails - Error details of the transfer eligibility validation.
func (MoveBillingSubscriptionErrorDetails) MarshalJSON ¶ added in v1.0.0
func (m MoveBillingSubscriptionErrorDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MoveBillingSubscriptionErrorDetails.
func (*MoveBillingSubscriptionErrorDetails) UnmarshalJSON ¶ added in v1.0.0
func (m *MoveBillingSubscriptionErrorDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MoveBillingSubscriptionErrorDetails.
type MoveBillingSubscriptionRequest ¶ added in v1.0.0
type MoveBillingSubscriptionRequest struct { // The destination enrollment account id. DestinationEnrollmentAccountID *string // The destination invoice section id. DestinationInvoiceSectionID *string }
MoveBillingSubscriptionRequest - Request parameters to transfer billing subscription.
func (MoveBillingSubscriptionRequest) MarshalJSON ¶ added in v1.0.0
func (m MoveBillingSubscriptionRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MoveBillingSubscriptionRequest.
func (*MoveBillingSubscriptionRequest) UnmarshalJSON ¶ added in v1.0.0
func (m *MoveBillingSubscriptionRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MoveBillingSubscriptionRequest.
type MoveProductEligibilityResult ¶ added in v1.0.0
type MoveProductEligibilityResult struct { // Error details of the transfer eligibility validation. ErrorDetails *MoveProductEligibilityResultErrorDetails // Specifies whether the subscription is eligible to be transferred. IsMoveEligible *bool }
MoveProductEligibilityResult - Result of the transfer eligibility validation.
func (MoveProductEligibilityResult) MarshalJSON ¶ added in v1.0.0
func (m MoveProductEligibilityResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MoveProductEligibilityResult.
func (*MoveProductEligibilityResult) UnmarshalJSON ¶ added in v1.0.0
func (m *MoveProductEligibilityResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MoveProductEligibilityResult.
type MoveProductEligibilityResultErrorDetails ¶ added in v1.0.0
type MoveProductEligibilityResultErrorDetails struct { // READ-ONLY; Error code for the product transfer validation. Code *MoveValidationErrorCode // READ-ONLY; Error details of the transfer eligibility validation. Details *string // READ-ONLY; The error message. Message *string }
MoveProductEligibilityResultErrorDetails - Error details of the transfer eligibility validation.
func (MoveProductEligibilityResultErrorDetails) MarshalJSON ¶ added in v1.0.0
func (m MoveProductEligibilityResultErrorDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MoveProductEligibilityResultErrorDetails.
func (*MoveProductEligibilityResultErrorDetails) UnmarshalJSON ¶ added in v1.0.0
func (m *MoveProductEligibilityResultErrorDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MoveProductEligibilityResultErrorDetails.
type MoveProductErrorDetails ¶ added in v1.0.0
type MoveProductErrorDetails struct { // READ-ONLY; Error code for the product transfer validation. Code *MoveValidationErrorCode // READ-ONLY; Error details of the transfer eligibility validation. Details *string // READ-ONLY; The error message. Message *string }
MoveProductErrorDetails - Error details of the transfer eligibility validation.
func (MoveProductErrorDetails) MarshalJSON ¶ added in v1.0.0
func (m MoveProductErrorDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MoveProductErrorDetails.
func (*MoveProductErrorDetails) UnmarshalJSON ¶ added in v1.0.0
func (m *MoveProductErrorDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MoveProductErrorDetails.
type MoveProductRequest ¶ added in v1.0.0
type MoveProductRequest struct { // REQUIRED; The destination invoice section id. DestinationInvoiceSectionID *string }
MoveProductRequest - The properties of the product to initiate a transfer.
func (MoveProductRequest) MarshalJSON ¶ added in v1.0.0
func (m MoveProductRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MoveProductRequest.
func (*MoveProductRequest) UnmarshalJSON ¶ added in v1.0.0
func (m *MoveProductRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MoveProductRequest.
type MoveValidationErrorCode ¶ added in v1.0.0
type MoveValidationErrorCode string
MoveValidationErrorCode - Error code for the product transfer validation.
const ( MoveValidationErrorCodeBillingAccountInactive MoveValidationErrorCode = "BillingAccountInactive" MoveValidationErrorCodeDestinationBillingProfileInactive MoveValidationErrorCode = "DestinationBillingProfileInactive" MoveValidationErrorCodeDestinationBillingProfileNotFound MoveValidationErrorCode = "DestinationBillingProfileNotFound" MoveValidationErrorCodeDestinationBillingProfilePastDue MoveValidationErrorCode = "DestinationBillingProfilePastDue" MoveValidationErrorCodeDestinationInvoiceSectionInactive MoveValidationErrorCode = "DestinationInvoiceSectionInactive" MoveValidationErrorCodeDestinationInvoiceSectionNotFound MoveValidationErrorCode = "DestinationInvoiceSectionNotFound" MoveValidationErrorCodeInsufficientPermissionOnDestination MoveValidationErrorCode = "InsufficientPermissionOnDestination" MoveValidationErrorCodeInsufficientPermissionOnSource MoveValidationErrorCode = "InsufficientPermissionOnSource" MoveValidationErrorCodeInvalidDestination MoveValidationErrorCode = "InvalidDestination" MoveValidationErrorCodeInvalidSource MoveValidationErrorCode = "InvalidSource" MoveValidationErrorCodeMarketplaceNotEnabledOnDestination MoveValidationErrorCode = "MarketplaceNotEnabledOnDestination" MoveValidationErrorCodeOther MoveValidationErrorCode = "Other" MoveValidationErrorCodeProductInactive MoveValidationErrorCode = "ProductInactive" MoveValidationErrorCodeProductNotFound MoveValidationErrorCode = "ProductNotFound" MoveValidationErrorCodeProductTypeNotSupported MoveValidationErrorCode = "ProductTypeNotSupported" MoveValidationErrorCodeSourceBillingProfilePastDue MoveValidationErrorCode = "SourceBillingProfilePastDue" MoveValidationErrorCodeSourceInvoiceSectionInactive MoveValidationErrorCode = "SourceInvoiceSectionInactive" )
func PossibleMoveValidationErrorCodeValues ¶ added in v1.0.0
func PossibleMoveValidationErrorCodeValues() []MoveValidationErrorCode
PossibleMoveValidationErrorCodeValues returns the possible values for the MoveValidationErrorCode const type.
type NextBillingCycleDetails ¶ added in v1.0.0
type NextBillingCycleDetails struct { // READ-ONLY; Billing frequency of the product under the subscription. BillingFrequency *string }
NextBillingCycleDetails - Billing cycle details of the product.
func (NextBillingCycleDetails) MarshalJSON ¶ added in v1.0.0
func (n NextBillingCycleDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NextBillingCycleDetails.
func (*NextBillingCycleDetails) UnmarshalJSON ¶ added in v1.0.0
func (n *NextBillingCycleDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NextBillingCycleDetails.
type Operation ¶
type Operation struct { // Localized display information for this particular operation. Display *OperationDisplay // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane // operations. IsDataAction *bool // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", // "Microsoft.Compute/virtualMachines/capture/action". Name *string }
Operation - Details of a REST API operation, returned from the Resource Provider Operations API.
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; The short, localized friendly description of the operation; suitable for tool tips and detailed views. Description *string // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual // Machine", "Restart Virtual Machine". Operation *string // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft // Compute". Provider *string // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job // Schedule Collections". Resource *string }
OperationDisplay - Localized display information for this particular 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; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*Operation }
OperationListResult - A container for a list of resources
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 - List of operations supported by provider.
Generated from API version 2024-04-01
- options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/operationsList.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.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.OperationListResult = armbilling.OperationListResult{ // Value: []*armbilling.Operation{ // { // Name: to.Ptr("{namespace}/resource/read"), // Display: &armbilling.OperationDisplay{ // Operation: to.Ptr("List resources"), // Provider: to.Ptr("{namespace}"), // Resource: to.Ptr("resource"), // }, // }}, // } } }
Output:
type OperationsClientListOptions ¶ added in v0.2.0
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶ added in v0.2.0
type OperationsClientListResponse struct { // A container for a list of resources OperationListResult }
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type Participant ¶ added in v1.0.0
type Participant 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 }
Participant - Billing account name. Available for a specific type of agreement.
func (Participant) MarshalJSON ¶ added in v1.0.0
func (p Participant) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Participant.
func (*Participant) UnmarshalJSON ¶ added in v1.0.0
func (p *Participant) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Participant.
type PartnerInitiateTransferProperties ¶ added in v1.0.0
type PartnerInitiateTransferProperties struct { // The email ID of the recipient to whom the transfer request is sent. RecipientEmailID *string // Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft Partner Agreement billing account. ResellerID *string }
PartnerInitiateTransferProperties - Request parameters to initiate transfer.
func (PartnerInitiateTransferProperties) MarshalJSON ¶ added in v1.0.0
func (p PartnerInitiateTransferProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PartnerInitiateTransferProperties.
func (*PartnerInitiateTransferProperties) UnmarshalJSON ¶ added in v1.0.0
func (p *PartnerInitiateTransferProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PartnerInitiateTransferProperties.
type PartnerInitiateTransferRequest ¶ added in v1.0.0
type PartnerInitiateTransferRequest struct { // Request parameters to initiate partner transfer. Properties *PartnerInitiateTransferProperties }
PartnerInitiateTransferRequest - Request parameters to initiate partner transfer.
func (PartnerInitiateTransferRequest) MarshalJSON ¶ added in v1.0.0
func (p PartnerInitiateTransferRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PartnerInitiateTransferRequest.
func (*PartnerInitiateTransferRequest) UnmarshalJSON ¶ added in v1.0.0
func (p *PartnerInitiateTransferRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PartnerInitiateTransferRequest.
type PartnerTransferDetails ¶ added in v1.0.0
type PartnerTransferDetails struct { // Details of the transfer. Properties *PartnerTransferProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
PartnerTransferDetails - Details of the transfer.
func (PartnerTransferDetails) MarshalJSON ¶ added in v1.0.0
func (p PartnerTransferDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PartnerTransferDetails.
func (*PartnerTransferDetails) UnmarshalJSON ¶ added in v1.0.0
func (p *PartnerTransferDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTransferDetails.
type PartnerTransferDetailsListResult ¶ added in v1.0.0
type PartnerTransferDetailsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of transfers initiated by partner. Value []*PartnerTransferDetails }
PartnerTransferDetailsListResult - The list of transfers initiated by partner.
func (PartnerTransferDetailsListResult) MarshalJSON ¶ added in v1.0.0
func (p PartnerTransferDetailsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PartnerTransferDetailsListResult.
func (*PartnerTransferDetailsListResult) UnmarshalJSON ¶ added in v1.0.0
func (p *PartnerTransferDetailsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTransferDetailsListResult.
type PartnerTransferProperties ¶ added in v1.0.0
type PartnerTransferProperties struct { // READ-ONLY; The email ID of the user who canceled the transfer request. CanceledBy *string // READ-ONLY; Detailed transfer status. DetailedTransferStatus []*DetailedTransferStatus // READ-ONLY; The time at which the transfer request expires. ExpirationTime *time.Time // READ-ONLY; The type of customer who sent the transfer request. InitiatorCustomerType *InitiatorCustomerType // READ-ONLY; The email ID of the user who sent the transfer request. InitiatorEmailID *string // READ-ONLY; The email ID of the user to whom the transfer request was sent. RecipientEmailID *string // READ-ONLY; Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft Partner Agreement billing // account. ResellerID *string // READ-ONLY; Optional name of the reseller for transfer requests that are sent from Microsoft Partner Agreement billing account. ResellerName *string // READ-ONLY; Overall transfer status. TransferStatus *TransferStatus }
PartnerTransferProperties - Transfer Details.
func (PartnerTransferProperties) MarshalJSON ¶ added in v1.0.0
func (p PartnerTransferProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PartnerTransferProperties.
func (*PartnerTransferProperties) UnmarshalJSON ¶ added in v1.0.0
func (p *PartnerTransferProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTransferProperties.
type PartnerTransfersClient ¶ added in v1.0.0
type PartnerTransfersClient struct {
// contains filtered or unexported fields
}
PartnerTransfersClient contains the methods for the PartnerTransfers group. Don't use this type directly, use NewPartnerTransfersClient() instead.
func NewPartnerTransfersClient ¶ added in v1.0.0
func NewPartnerTransfersClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PartnerTransfersClient, error)
NewPartnerTransfersClient creates a new instance of PartnerTransfersClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PartnerTransfersClient) Cancel ¶ added in v1.0.0
func (client *PartnerTransfersClient) Cancel(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, transferName string, options *PartnerTransfersClientCancelOptions) (PartnerTransfersClientCancelResponse, error)
Cancel - Cancels a transfer request. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- transferName - The ID that uniquely identifies a transfer request.
- options - PartnerTransfersClientCancelOptions contains the optional parameters for the PartnerTransfersClient.Cancel method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersCancel.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.NewPartnerTransfersClient().Cancel(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "11111111-1111-1111-1111-111111111111", "aabb123", 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.PartnerTransferDetails = armbilling.PartnerTransferDetails{ // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/transfers/aabb123"), // Properties: &armbilling.PartnerTransferProperties{ // CanceledBy: to.Ptr("user@contoso.com"), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorCustomerType: to.Ptr(armbilling.InitiatorCustomerTypePartner), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusPending), // }, // } }
Output:
func (*PartnerTransfersClient) Get ¶ added in v1.0.0
func (client *PartnerTransfersClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, transferName string, options *PartnerTransfersClientGetOptions) (PartnerTransfersClientGetResponse, error)
Get - Gets a transfer request by 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- transferName - The ID that uniquely identifies a transfer request.
- options - PartnerTransfersClientGetOptions contains the optional parameters for the PartnerTransfersClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersGet.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.NewPartnerTransfersClient().Get(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "11111111-1111-1111-1111-111111111111", "aabb123", 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.PartnerTransferDetails = armbilling.PartnerTransferDetails{ // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/transfers/aabb123"), // Properties: &armbilling.PartnerTransferProperties{ // DetailedTransferStatus: []*armbilling.DetailedTransferStatus{ // { // ProductID: to.Ptr("subscriptionId"), // ProductName: to.Ptr("Azure subscription 1"), // ProductType: to.Ptr(armbilling.ProductTypeAzureSubscription), // SKUDescription: to.Ptr("MS-AZR-0017G"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }, // { // ProductID: to.Ptr("reservedInstanceId"), // ProductName: to.Ptr("Reservation name"), // ProductType: to.Ptr(armbilling.ProductTypeAzureReservation), // SKUDescription: to.Ptr("Standard_D2s_v3;VirtualMachines;P1Y"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }}, // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorCustomerType: to.Ptr(armbilling.InitiatorCustomerTypePartner), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusInProgress), // }, // } }
Output:
func (*PartnerTransfersClient) Initiate ¶ added in v1.0.0
func (client *PartnerTransfersClient) Initiate(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, transferName string, parameters PartnerInitiateTransferRequest, options *PartnerTransfersClientInitiateOptions) (PartnerTransfersClientInitiateResponse, error)
Initiate - Sends a request to a user in a customer's billing account to transfer billing ownership of their subscriptions. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- transferName - The ID that uniquely identifies a transfer request.
- parameters - Request parameters that are provided to the initiate transfer operation.
- options - PartnerTransfersClientInitiateOptions contains the optional parameters for the PartnerTransfersClient.Initiate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersInitiate.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.NewPartnerTransfersClient().Initiate(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "11111111-1111-1111-1111-111111111111", "aabb123", armbilling.PartnerInitiateTransferRequest{ Properties: &armbilling.PartnerInitiateTransferProperties{ RecipientEmailID: to.Ptr("user@contoso.com"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.PartnerTransferDetails = armbilling.PartnerTransferDetails{ // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/transfers/aabb123"), // Properties: &armbilling.PartnerTransferProperties{ // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorCustomerType: to.Ptr(armbilling.InitiatorCustomerTypePartner), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusPending), // }, // } }
Output:
func (*PartnerTransfersClient) NewListPager ¶ added in v1.0.0
func (client *PartnerTransfersClient) NewListPager(billingAccountName string, billingProfileName string, customerName string, options *PartnerTransfersClientListOptions) *runtime.Pager[PartnerTransfersClientListResponse]
NewListPager - Lists the transfer requests sent to a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- options - PartnerTransfersClientListOptions contains the optional parameters for the PartnerTransfersClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersList.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.NewPartnerTransfersClient().NewListPager("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "11111111-1111-1111-1111-111111111111", 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.PartnerTransferDetailsListResult = armbilling.PartnerTransferDetailsListResult{ // Value: []*armbilling.PartnerTransferDetails{ // { // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/transfers/aabb123"), // Properties: &armbilling.PartnerTransferProperties{ // DetailedTransferStatus: []*armbilling.DetailedTransferStatus{ // { // ProductID: to.Ptr("subscriptionId"), // ProductName: to.Ptr("Azure subscription 1"), // ProductType: to.Ptr(armbilling.ProductTypeAzureSubscription), // SKUDescription: to.Ptr("MS-AZR-0017G"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }, // { // ProductID: to.Ptr("reservedInstanceId"), // ProductName: to.Ptr("Reservation name"), // ProductType: to.Ptr(armbilling.ProductTypeAzureReservation), // SKUDescription: to.Ptr("Standard_D2s_v3;VirtualMachines;P1Y"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }}, // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorCustomerType: to.Ptr(armbilling.InitiatorCustomerTypePartner), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusInProgress), // }, // }}, // } } }
Output:
type PartnerTransfersClientCancelOptions ¶ added in v1.0.0
type PartnerTransfersClientCancelOptions struct { }
PartnerTransfersClientCancelOptions contains the optional parameters for the PartnerTransfersClient.Cancel method.
type PartnerTransfersClientCancelResponse ¶ added in v1.0.0
type PartnerTransfersClientCancelResponse struct { // Details of the transfer. PartnerTransferDetails }
PartnerTransfersClientCancelResponse contains the response from method PartnerTransfersClient.Cancel.
type PartnerTransfersClientGetOptions ¶ added in v1.0.0
type PartnerTransfersClientGetOptions struct { }
PartnerTransfersClientGetOptions contains the optional parameters for the PartnerTransfersClient.Get method.
type PartnerTransfersClientGetResponse ¶ added in v1.0.0
type PartnerTransfersClientGetResponse struct { // Details of the transfer. PartnerTransferDetails }
PartnerTransfersClientGetResponse contains the response from method PartnerTransfersClient.Get.
type PartnerTransfersClientInitiateOptions ¶ added in v1.0.0
type PartnerTransfersClientInitiateOptions struct { }
PartnerTransfersClientInitiateOptions contains the optional parameters for the PartnerTransfersClient.Initiate method.
type PartnerTransfersClientInitiateResponse ¶ added in v1.0.0
type PartnerTransfersClientInitiateResponse struct { // Details of the transfer. PartnerTransferDetails }
PartnerTransfersClientInitiateResponse contains the response from method PartnerTransfersClient.Initiate.
type PartnerTransfersClientListOptions ¶ added in v1.0.0
type PartnerTransfersClientListOptions struct { }
PartnerTransfersClientListOptions contains the optional parameters for the PartnerTransfersClient.NewListPager method.
type PartnerTransfersClientListResponse ¶ added in v1.0.0
type PartnerTransfersClientListResponse struct { // The list of transfers initiated by partner. PartnerTransferDetailsListResult }
PartnerTransfersClientListResponse contains the response from method PartnerTransfersClient.NewListPager.
type Patch ¶ added in v1.0.0
type Patch struct { // Properties for reservation patch Properties *PatchProperties // The sku information associated to this reservation SKU *ReservationSKUProperty // Tags for this reservation Tags map[string]*string }
Patch - The request for reservation patch
func (Patch) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type Patch.
func (*Patch) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type Patch.
type PatchProperties ¶ added in v1.0.0
type PatchProperties struct { // Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId // if AppliedScopeType is ManagementGroup AppliedScopeProperties *ReservationAppliedScopeProperties // Type of the Applied Scope. AppliedScopeType *AppliedScopeType // Display name of the reservation DisplayName *string // Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines // reserved resource type. InstanceFlexibility *InstanceFlexibility // Setting this to true will automatically purchase a new benefit on the expiration date time. Renew *bool RenewProperties *PatchPropertiesRenewProperties // This is the date-time when the Azure hybrid benefit needs to be reviewed. ReviewDateTime *time.Time }
PatchProperties - Properties for reservation patch
func (PatchProperties) MarshalJSON ¶ added in v1.0.0
func (p PatchProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PatchProperties.
func (*PatchProperties) UnmarshalJSON ¶ added in v1.0.0
func (p *PatchProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PatchProperties.
type PatchPropertiesRenewProperties ¶ added in v1.0.0
type PatchPropertiesRenewProperties struct { // The request for reservation purchase PurchaseProperties *ReservationPurchaseRequest }
func (PatchPropertiesRenewProperties) MarshalJSON ¶ added in v1.0.0
func (p PatchPropertiesRenewProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PatchPropertiesRenewProperties.
func (*PatchPropertiesRenewProperties) UnmarshalJSON ¶ added in v1.0.0
func (p *PatchPropertiesRenewProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PatchPropertiesRenewProperties.
type Payment ¶ added in v1.0.0
type Payment struct { // The paid amount. Amount *PaymentAmount // READ-ONLY; The date when the payment was made. Date *time.Time // READ-ONLY; The family of payment method. PaymentMethodFamily *PaymentMethodFamily // READ-ONLY; The ID that uniquely identifies the payment method used for the invoice. PaymentMethodID *string // READ-ONLY; The type of payment method. PaymentMethodType *string // READ-ONLY; The type of payment. PaymentType *string }
Payment - An invoice payment.
func (Payment) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type Payment.
func (*Payment) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type Payment.
type PaymentAmount ¶ added in v1.0.0
type PaymentAmount struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
PaymentAmount - The paid amount.
func (PaymentAmount) MarshalJSON ¶ added in v1.0.0
func (p PaymentAmount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentAmount.
func (*PaymentAmount) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentAmount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentAmount.
type PaymentDetail ¶ added in v1.0.0
type PaymentDetail struct { // Amount charged in Billing currency. Tax not included. Is null for future payments BillingCurrencyTotal *Price // Date when the payment needs to be done. DueDate *time.Time // Date when the transaction is completed. Null when it is scheduled. PaymentDate *time.Time // Amount in pricing currency. Tax not included. PricingCurrencyTotal *Price // Describes whether the payment is completed, failed, pending, cancelled or scheduled in the future. Status *PaymentStatus // READ-ONLY; Extended status information ExtendedStatusInfo *ExtendedStatusInfo }
PaymentDetail - Information about payment related to a savings plan order.
func (PaymentDetail) MarshalJSON ¶ added in v1.0.0
func (p PaymentDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentDetail.
func (*PaymentDetail) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentDetail.
type PaymentMethod ¶ added in v1.0.0
type PaymentMethod struct { // Payment method properties Properties *PaymentMethodProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
PaymentMethod - A payment method.
func (PaymentMethod) MarshalJSON ¶ added in v1.0.0
func (p PaymentMethod) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentMethod.
func (*PaymentMethod) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentMethod) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentMethod.
type PaymentMethodFamily ¶
type PaymentMethodFamily string
PaymentMethodFamily - Payment on Account type.
const ( PaymentMethodFamilyCheckWire PaymentMethodFamily = "CheckWire" PaymentMethodFamilyCreditCard PaymentMethodFamily = "CreditCard" PaymentMethodFamilyCredits PaymentMethodFamily = "Credits" PaymentMethodFamilyDirectDebit PaymentMethodFamily = "DirectDebit" PaymentMethodFamilyEWallet PaymentMethodFamily = "EWallet" PaymentMethodFamilyNone PaymentMethodFamily = "None" PaymentMethodFamilyOther PaymentMethodFamily = "Other" PaymentMethodFamilyTaskOrder PaymentMethodFamily = "TaskOrder" )
func PossiblePaymentMethodFamilyValues ¶
func PossiblePaymentMethodFamilyValues() []PaymentMethodFamily
PossiblePaymentMethodFamilyValues returns the possible values for the PaymentMethodFamily const type.
type PaymentMethodLink ¶ added in v1.0.0
type PaymentMethodLink struct { // Payment method link properties Properties *PaymentMethodLinkProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
PaymentMethodLink - A payment method link.
func (PaymentMethodLink) MarshalJSON ¶ added in v1.0.0
func (p PaymentMethodLink) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentMethodLink.
func (*PaymentMethodLink) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentMethodLink) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentMethodLink.
type PaymentMethodLinkProperties ¶ added in v1.0.0
type PaymentMethodLinkProperties struct { // Projection of a payment method. Will not be returned in this or future versions. PaymentMethod *PaymentMethodProperties // Id of payment method. Example: /providers/Microsoft.Billing/paymentMethods/ABCDABCDABC0 PaymentMethodID *string // READ-ONLY; The account holder name for the payment method. This is only supported for payment methods with family CreditCard. AccountHolderName *string // READ-ONLY; The display name of the payment method. DisplayName *string // READ-ONLY; The expiration month and year of the payment method. This is only supported for payment methods with family // CreditCard. Expiration *string // READ-ONLY; The family of payment method. Family *PaymentMethodFamily // READ-ONLY; Last four digits of payment method. LastFourDigits *string // READ-ONLY; The list of logos for the payment method. Logos []*PaymentMethodLogo // READ-ONLY; The type of payment method. PaymentMethodType *string // READ-ONLY; Status of the payment method. Status *PaymentMethodStatus }
PaymentMethodLinkProperties - The properties of a payment method link.
func (PaymentMethodLinkProperties) MarshalJSON ¶ added in v1.0.0
func (p PaymentMethodLinkProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentMethodLinkProperties.
func (*PaymentMethodLinkProperties) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentMethodLinkProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentMethodLinkProperties.
type PaymentMethodLinksListResult ¶ added in v1.0.0
type PaymentMethodLinksListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of payment method links. Value []*PaymentMethodLink }
PaymentMethodLinksListResult - The list of payment method links.
func (PaymentMethodLinksListResult) MarshalJSON ¶ added in v1.0.0
func (p PaymentMethodLinksListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentMethodLinksListResult.
func (*PaymentMethodLinksListResult) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentMethodLinksListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentMethodLinksListResult.
type PaymentMethodLogo ¶ added in v1.0.0
type PaymentMethodLogo struct { // READ-ONLY; MIME type of the logo. MimeType *string // READ-ONLY; Public URL of image of the logo. URL *string }
PaymentMethodLogo - Logo of payment method.
func (PaymentMethodLogo) MarshalJSON ¶ added in v1.0.0
func (p PaymentMethodLogo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentMethodLogo.
func (*PaymentMethodLogo) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentMethodLogo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentMethodLogo.
type PaymentMethodProperties ¶ added in v1.0.0
type PaymentMethodProperties struct { // The family of payment method. Family *PaymentMethodFamily // The list of logos for the payment method. Logos []*PaymentMethodLogo // Status of the payment method. Status *PaymentMethodStatus // READ-ONLY; The account holder name for the payment method. This is only supported for payment methods with family CreditCard. AccountHolderName *string // READ-ONLY; The display name of the payment method. DisplayName *string // READ-ONLY; The expiration month and year of the payment method. This is only supported for payment methods with family // CreditCard. Expiration *string // READ-ONLY; Id of payment method. ID *string // READ-ONLY; Last four digits of payment method. LastFourDigits *string // READ-ONLY; The type of payment method. PaymentMethodType *string }
PaymentMethodProperties - The properties of a payment method.
func (PaymentMethodProperties) MarshalJSON ¶ added in v1.0.0
func (p PaymentMethodProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentMethodProperties.
func (*PaymentMethodProperties) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentMethodProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentMethodProperties.
type PaymentMethodStatus ¶ added in v1.0.0
type PaymentMethodStatus string
PaymentMethodStatus - Status of the payment method.
const ( PaymentMethodStatusActive PaymentMethodStatus = "active" PaymentMethodStatusInactive PaymentMethodStatus = "inactive" )
func PossiblePaymentMethodStatusValues ¶ added in v1.0.0
func PossiblePaymentMethodStatusValues() []PaymentMethodStatus
PossiblePaymentMethodStatusValues returns the possible values for the PaymentMethodStatus const type.
type PaymentMethodsClient ¶ added in v1.0.0
type PaymentMethodsClient struct {
// contains filtered or unexported fields
}
PaymentMethodsClient contains the methods for the PaymentMethods group. Don't use this type directly, use NewPaymentMethodsClient() instead.
func NewPaymentMethodsClient ¶ added in v1.0.0
func NewPaymentMethodsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PaymentMethodsClient, error)
NewPaymentMethodsClient creates a new instance of PaymentMethodsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PaymentMethodsClient) DeleteByUser ¶ added in v1.0.0
func (client *PaymentMethodsClient) DeleteByUser(ctx context.Context, paymentMethodName string, options *PaymentMethodsClientDeleteByUserOptions) (PaymentMethodsClientDeleteByUserResponse, error)
DeleteByUser - Deletes a payment method owned by the caller. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- paymentMethodName - The ID that uniquely identifies a payment method.
- options - PaymentMethodsClientDeleteByUserOptions contains the optional parameters for the PaymentMethodsClient.DeleteByUser method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsDeleteByUser.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) } _, err = clientFactory.NewPaymentMethodsClient().DeleteByUser(ctx, "ABCDABCDABC0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*PaymentMethodsClient) GetByBillingAccount ¶ added in v1.0.0
func (client *PaymentMethodsClient) GetByBillingAccount(ctx context.Context, billingAccountName string, paymentMethodName string, options *PaymentMethodsClientGetByBillingAccountOptions) (PaymentMethodsClientGetByBillingAccountResponse, error)
GetByBillingAccount - Gets a payment method available for a billing account. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- paymentMethodName - The ID that uniquely identifies a payment method.
- options - PaymentMethodsClientGetByBillingAccountOptions contains the optional parameters for the PaymentMethodsClient.GetByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingAccount.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.NewPaymentMethodsClient().GetByBillingAccount(ctx, "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", "21dd9edc-af71-4d62-80ce-37151d475326", 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.PaymentMethod = armbilling.PaymentMethod{ // Name: to.Ptr("21dd9edc-af71-4d62-80ce-37151d475326"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/paymentMethods"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31/paymentMethods/21dd9edc-af71-4d62-80ce-37151d475326"), // Properties: &armbilling.PaymentMethodProperties{ // DisplayName: to.Ptr("Check/wire transfer"), // Family: to.Ptr(armbilling.PaymentMethodFamilyCheckWire), // PaymentMethodType: to.Ptr("check"), // }, // } }
Output:
func (*PaymentMethodsClient) GetByBillingProfile ¶ added in v1.0.0
func (client *PaymentMethodsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, paymentMethodName string, options *PaymentMethodsClientGetByBillingProfileOptions) (PaymentMethodsClientGetByBillingProfileResponse, error)
GetByBillingProfile - Gets a payment method linked with a billing profile. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- paymentMethodName - The ID that uniquely identifies a payment method.
- options - PaymentMethodsClientGetByBillingProfileOptions contains the optional parameters for the PaymentMethodsClient.GetByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingProfile.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.NewPaymentMethodsClient().GetByBillingProfile(ctx, "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", "ABC1-A1CD-AB1-BP1", "ABCDABCDABC0", 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.PaymentMethodLink = armbilling.PaymentMethodLink{ // Name: to.Ptr("ABCDABCDABC0"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/paymentMethodLinks"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31/billingProfiles/ABC1-A1CD-AB1-BP1/paymentMethodLinks/ABCDABCDABC0"), // Properties: &armbilling.PaymentMethodLinkProperties{ // AccountHolderName: to.Ptr("abc"), // DisplayName: to.Ptr("Master Card"), // Expiration: to.Ptr("1/2035"), // Family: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // LastFourDigits: to.Ptr("1270"), // Logos: []*armbilling.PaymentMethodLogo{ // { // MimeType: to.Ptr("image/png"), // URL: to.Ptr("https://contoso.com/staticresourceservice/images/v4/logo_visa_rect.png"), // }, // { // MimeType: to.Ptr("image/svg+xml"), // URL: to.Ptr("https://contoso.com/staticresourceservice/images/v4/logo_visa.svg"), // }}, // PaymentMethodID: to.Ptr("/providers/Microsoft.Billing/paymentMethods/ABCDABCDABC0"), // PaymentMethodType: to.Ptr("mc"), // Status: to.Ptr(armbilling.PaymentMethodStatusActive), // }, // } }
Output:
func (*PaymentMethodsClient) GetByUser ¶ added in v1.0.0
func (client *PaymentMethodsClient) GetByUser(ctx context.Context, paymentMethodName string, options *PaymentMethodsClientGetByUserOptions) (PaymentMethodsClientGetByUserResponse, error)
GetByUser - Gets a payment method owned by the caller. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- paymentMethodName - The ID that uniquely identifies a payment method.
- options - PaymentMethodsClientGetByUserOptions contains the optional parameters for the PaymentMethodsClient.GetByUser method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByUser.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.NewPaymentMethodsClient().GetByUser(ctx, "ABCDABCDABC0", 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.PaymentMethod = armbilling.PaymentMethod{ // Name: to.Ptr("ABCDABCDABC0"), // Type: to.Ptr("Microsoft.Billing/paymentMethods"), // ID: to.Ptr("/providers/Microsoft.Billing/paymentMethods/ABCDABCDABC0"), // Properties: &armbilling.PaymentMethodProperties{ // AccountHolderName: to.Ptr("abc"), // DisplayName: to.Ptr("Master Card"), // Expiration: to.Ptr("1/2035"), // Family: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // LastFourDigits: to.Ptr("1270"), // Logos: []*armbilling.PaymentMethodLogo{ // { // MimeType: to.Ptr("image/png"), // URL: to.Ptr("https://contoso.com/staticresourceservice/images/v4/logo_visa_rect.png"), // }, // { // MimeType: to.Ptr("image/svg+xml"), // URL: to.Ptr("https://contoso.com/staticresourceservice/images/v4/logo_visa.svg"), // }}, // PaymentMethodType: to.Ptr("mc"), // Status: to.Ptr(armbilling.PaymentMethodStatusActive), // }, // } }
Output:
func (*PaymentMethodsClient) NewListByBillingAccountPager ¶ added in v1.0.0
func (client *PaymentMethodsClient) NewListByBillingAccountPager(billingAccountName string, options *PaymentMethodsClientListByBillingAccountOptions) *runtime.Pager[PaymentMethodsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the payment methods available for a billing account. Along with the payment methods owned by the caller, these payment methods can be attached to a billing profile to make payments. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - PaymentMethodsClientListByBillingAccountOptions contains the optional parameters for the PaymentMethodsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingAccount.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.NewPaymentMethodsClient().NewListByBillingAccountPager("00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", 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.PaymentMethodsListResult = armbilling.PaymentMethodsListResult{ // Value: []*armbilling.PaymentMethod{ // { // Name: to.Ptr("21dd9edc-af71-4d62-80ce-37151d475326"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/paymentMethods"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31/paymentMethods/21dd9edc-af71-4d62-80ce-37151d475326"), // Properties: &armbilling.PaymentMethodProperties{ // DisplayName: to.Ptr("Check/wire transfer"), // Family: to.Ptr(armbilling.PaymentMethodFamilyCheckWire), // PaymentMethodType: to.Ptr("check"), // }, // }}, // } } }
Output:
func (*PaymentMethodsClient) NewListByBillingProfilePager ¶ added in v1.0.0
func (client *PaymentMethodsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *PaymentMethodsClientListByBillingProfileOptions) *runtime.Pager[PaymentMethodsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists payment methods attached to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - PaymentMethodsClientListByBillingProfileOptions contains the optional parameters for the PaymentMethodsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingProfile.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.NewPaymentMethodsClient().NewListByBillingProfilePager("00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", "ABC1-A1CD-AB1-BP1", 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.PaymentMethodLinksListResult = armbilling.PaymentMethodLinksListResult{ // Value: []*armbilling.PaymentMethodLink{ // { // Name: to.Ptr("ABCDABCDABC0"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/paymentMethodLinks"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31/billingProfiles/ABC1-A1CD-AB1-BP1/paymentMethodLinks/ABCDABCDABC0"), // Properties: &armbilling.PaymentMethodLinkProperties{ // AccountHolderName: to.Ptr("abc"), // DisplayName: to.Ptr("Master Card"), // Expiration: to.Ptr("1/2035"), // Family: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // LastFourDigits: to.Ptr("1270"), // Logos: []*armbilling.PaymentMethodLogo{ // { // MimeType: to.Ptr("image/png"), // URL: to.Ptr("https://contoso.com/staticresourceservice/images/v4/logo_visa_rect.png"), // }, // { // MimeType: to.Ptr("image/svg+xml"), // URL: to.Ptr("https://contoso.com/staticresourceservice/images/v4/logo_visa.svg"), // }}, // PaymentMethodID: to.Ptr("/providers/Microsoft.Billing/paymentMethods/ABCDABCDABC0"), // PaymentMethodType: to.Ptr("mc"), // Status: to.Ptr(armbilling.PaymentMethodStatusActive), // }, // }}, // } } }
Output:
func (*PaymentMethodsClient) NewListByUserPager ¶ added in v1.0.0
func (client *PaymentMethodsClient) NewListByUserPager(options *PaymentMethodsClientListByUserOptions) *runtime.Pager[PaymentMethodsClientListByUserResponse]
NewListByUserPager - Lists the payment methods owned by the caller.
Generated from API version 2024-04-01
- options - PaymentMethodsClientListByUserOptions contains the optional parameters for the PaymentMethodsClient.NewListByUserPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByUser.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.NewPaymentMethodsClient().NewListByUserPager(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.PaymentMethodsListResult = armbilling.PaymentMethodsListResult{ // Value: []*armbilling.PaymentMethod{ // { // Name: to.Ptr("ABCDABCDABC0"), // Type: to.Ptr("Microsoft.Billing/paymentMethods"), // ID: to.Ptr("/providers/Microsoft.Billing/paymentMethods/ABCDABCDABC0"), // Properties: &armbilling.PaymentMethodProperties{ // AccountHolderName: to.Ptr("abc"), // DisplayName: to.Ptr("Master Card"), // Expiration: to.Ptr("1/2035"), // Family: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // LastFourDigits: to.Ptr("1270"), // Logos: []*armbilling.PaymentMethodLogo{ // { // MimeType: to.Ptr("image/png"), // URL: to.Ptr("https://contoso.com/staticresourceservice/images/v4/logo_mc_rect.png"), // }, // { // MimeType: to.Ptr("image/svg+xml"), // URL: to.Ptr("https://contoso.com/staticresourceservice/images/v4/logo_mc.svg"), // }}, // PaymentMethodType: to.Ptr("mc"), // Status: to.Ptr(armbilling.PaymentMethodStatusActive), // }, // }, // { // Name: to.Ptr("ABCDABCDABC1"), // Type: to.Ptr("Microsoft.Billing/paymentMethods"), // ID: to.Ptr("/providers/Microsoft.Billing/paymentMethods/ABCDABCDABC1"), // Properties: &armbilling.PaymentMethodProperties{ // AccountHolderName: to.Ptr("abc"), // DisplayName: to.Ptr("Visa"), // Expiration: to.Ptr("1/2025"), // Family: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), // LastFourDigits: to.Ptr("7373"), // Logos: []*armbilling.PaymentMethodLogo{ // { // MimeType: to.Ptr("image/png"), // URL: to.Ptr("https://contoso.com/staticresourceservice/images/v4/logo_visa_rect.png"), // }, // { // MimeType: to.Ptr("image/svg+xml"), // URL: to.Ptr("https://contoso.com/staticresourceservice/images/v4/logo_visa.svg"), // }}, // PaymentMethodType: to.Ptr("visa"), // Status: to.Ptr(armbilling.PaymentMethodStatusActive), // }, // }}, // } } }
Output:
type PaymentMethodsClientDeleteByUserOptions ¶ added in v1.0.0
type PaymentMethodsClientDeleteByUserOptions struct { }
PaymentMethodsClientDeleteByUserOptions contains the optional parameters for the PaymentMethodsClient.DeleteByUser method.
type PaymentMethodsClientDeleteByUserResponse ¶ added in v1.0.0
type PaymentMethodsClientDeleteByUserResponse struct { }
PaymentMethodsClientDeleteByUserResponse contains the response from method PaymentMethodsClient.DeleteByUser.
type PaymentMethodsClientGetByBillingAccountOptions ¶ added in v1.0.0
type PaymentMethodsClientGetByBillingAccountOptions struct { }
PaymentMethodsClientGetByBillingAccountOptions contains the optional parameters for the PaymentMethodsClient.GetByBillingAccount method.
type PaymentMethodsClientGetByBillingAccountResponse ¶ added in v1.0.0
type PaymentMethodsClientGetByBillingAccountResponse struct { // A payment method. PaymentMethod }
PaymentMethodsClientGetByBillingAccountResponse contains the response from method PaymentMethodsClient.GetByBillingAccount.
type PaymentMethodsClientGetByBillingProfileOptions ¶ added in v1.0.0
type PaymentMethodsClientGetByBillingProfileOptions struct { }
PaymentMethodsClientGetByBillingProfileOptions contains the optional parameters for the PaymentMethodsClient.GetByBillingProfile method.
type PaymentMethodsClientGetByBillingProfileResponse ¶ added in v1.0.0
type PaymentMethodsClientGetByBillingProfileResponse struct { // A payment method link. PaymentMethodLink }
PaymentMethodsClientGetByBillingProfileResponse contains the response from method PaymentMethodsClient.GetByBillingProfile.
type PaymentMethodsClientGetByUserOptions ¶ added in v1.0.0
type PaymentMethodsClientGetByUserOptions struct { }
PaymentMethodsClientGetByUserOptions contains the optional parameters for the PaymentMethodsClient.GetByUser method.
type PaymentMethodsClientGetByUserResponse ¶ added in v1.0.0
type PaymentMethodsClientGetByUserResponse struct { // A payment method. PaymentMethod }
PaymentMethodsClientGetByUserResponse contains the response from method PaymentMethodsClient.GetByUser.
type PaymentMethodsClientListByBillingAccountOptions ¶ added in v1.0.0
type PaymentMethodsClientListByBillingAccountOptions struct { }
PaymentMethodsClientListByBillingAccountOptions contains the optional parameters for the PaymentMethodsClient.NewListByBillingAccountPager method.
type PaymentMethodsClientListByBillingAccountResponse ¶ added in v1.0.0
type PaymentMethodsClientListByBillingAccountResponse struct { // The list of payment methods. PaymentMethodsListResult }
PaymentMethodsClientListByBillingAccountResponse contains the response from method PaymentMethodsClient.NewListByBillingAccountPager.
type PaymentMethodsClientListByBillingProfileOptions ¶ added in v1.0.0
type PaymentMethodsClientListByBillingProfileOptions struct { }
PaymentMethodsClientListByBillingProfileOptions contains the optional parameters for the PaymentMethodsClient.NewListByBillingProfilePager method.
type PaymentMethodsClientListByBillingProfileResponse ¶ added in v1.0.0
type PaymentMethodsClientListByBillingProfileResponse struct { // The list of payment method links. PaymentMethodLinksListResult }
PaymentMethodsClientListByBillingProfileResponse contains the response from method PaymentMethodsClient.NewListByBillingProfilePager.
type PaymentMethodsClientListByUserOptions ¶ added in v1.0.0
type PaymentMethodsClientListByUserOptions struct { }
PaymentMethodsClientListByUserOptions contains the optional parameters for the PaymentMethodsClient.NewListByUserPager method.
type PaymentMethodsClientListByUserResponse ¶ added in v1.0.0
type PaymentMethodsClientListByUserResponse struct { // The list of payment methods. PaymentMethodsListResult }
PaymentMethodsClientListByUserResponse contains the response from method PaymentMethodsClient.NewListByUserPager.
type PaymentMethodsListResult ¶ added in v1.0.0
type PaymentMethodsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of payment methods. Value []*PaymentMethod }
PaymentMethodsListResult - The list of payment methods.
func (PaymentMethodsListResult) MarshalJSON ¶ added in v1.0.0
func (p PaymentMethodsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentMethodsListResult.
func (*PaymentMethodsListResult) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentMethodsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentMethodsListResult.
type PaymentOnAccount ¶ added in v1.0.0
type PaymentOnAccount struct { // Payment on Account amount. Amount *PaymentOnAccountAmount // READ-ONLY; The name of the billing profile for the payments on account. BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile for the payments on account. BillingProfileID *string // READ-ONLY; The date of the payments on account. Date *time.Time // READ-ONLY; The ID of the invoice for which the payments on account was generated. InvoiceID *string // READ-ONLY; The name of the invoice for the payments on account. InvoiceName *string // READ-ONLY; Payment on Account type. PaymentMethodType *PaymentMethodFamily }
PaymentOnAccount - A Payment on Account.
func (PaymentOnAccount) MarshalJSON ¶ added in v1.0.0
func (p PaymentOnAccount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentOnAccount.
func (*PaymentOnAccount) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentOnAccount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentOnAccount.
type PaymentOnAccountAmount ¶ added in v1.0.0
type PaymentOnAccountAmount struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
PaymentOnAccountAmount - Payment on Account amount.
func (PaymentOnAccountAmount) MarshalJSON ¶ added in v1.0.0
func (p PaymentOnAccountAmount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentOnAccountAmount.
func (*PaymentOnAccountAmount) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentOnAccountAmount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentOnAccountAmount.
type PaymentStatus ¶ added in v1.0.0
type PaymentStatus string
PaymentStatus - Describes whether the payment is completed, failed, pending, cancelled or scheduled in the future.
const ( PaymentStatusCancelled PaymentStatus = "Cancelled" PaymentStatusCompleted PaymentStatus = "Completed" PaymentStatusFailed PaymentStatus = "Failed" PaymentStatusPending PaymentStatus = "Pending" PaymentStatusScheduled PaymentStatus = "Scheduled" PaymentStatusSucceeded PaymentStatus = "Succeeded" )
func PossiblePaymentStatusValues ¶ added in v1.0.0
func PossiblePaymentStatusValues() []PaymentStatus
PossiblePaymentStatusValues returns the possible values for the PaymentStatus const type.
type PaymentTerm ¶ added in v1.0.0
type PaymentTerm struct { // The date on when the defined 'Payment Term' will end and is always in UTC. EndDate *time.Time // The date on when the defined 'Payment Term' will be effective from and is always in UTC. StartDate *time.Time // Represents duration in netXX format. Always in days. Term *string // READ-ONLY; Indicates payment term is the standard payment term. IsDefault *bool }
PaymentTerm - The properties of payment term.
func (PaymentTerm) MarshalJSON ¶ added in v1.0.0
func (p PaymentTerm) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentTerm.
func (*PaymentTerm) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentTerm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentTerm.
type PaymentTermsEligibilityCode ¶ added in v1.0.0
type PaymentTermsEligibilityCode string
PaymentTermsEligibilityCode - Indicates the reason for the ineligibility of the payment terms.
const ( PaymentTermsEligibilityCodeBillingAccountNotFound PaymentTermsEligibilityCode = "BillingAccountNotFound" PaymentTermsEligibilityCodeInactiveBillingAccount PaymentTermsEligibilityCode = "InactiveBillingAccount" PaymentTermsEligibilityCodeIneligibleBillingAccountStatus PaymentTermsEligibilityCode = "IneligibleBillingAccountStatus" PaymentTermsEligibilityCodeInvalidBillingAccountType PaymentTermsEligibilityCode = "InvalidBillingAccountType" PaymentTermsEligibilityCodeInvalidDateFormat PaymentTermsEligibilityCode = "InvalidDateFormat" PaymentTermsEligibilityCodeInvalidDateRange PaymentTermsEligibilityCode = "InvalidDateRange" PaymentTermsEligibilityCodeInvalidTerms PaymentTermsEligibilityCode = "InvalidTerms" PaymentTermsEligibilityCodeNullOrEmptyPaymentTerms PaymentTermsEligibilityCode = "NullOrEmptyPaymentTerms" PaymentTermsEligibilityCodeOther PaymentTermsEligibilityCode = "Other" PaymentTermsEligibilityCodeOverlappingPaymentTerms PaymentTermsEligibilityCode = "OverlappingPaymentTerms" )
func PossiblePaymentTermsEligibilityCodeValues ¶ added in v1.0.0
func PossiblePaymentTermsEligibilityCodeValues() []PaymentTermsEligibilityCode
PossiblePaymentTermsEligibilityCodeValues returns the possible values for the PaymentTermsEligibilityCode const type.
type PaymentTermsEligibilityDetail ¶ added in v1.0.0
type PaymentTermsEligibilityDetail struct { // Indicates the reason for the ineligibility of the payment terms. Code *PaymentTermsEligibilityCode // Indicates the message for the ineligibility of the payment terms. Message *string }
PaymentTermsEligibilityDetail - Details of the payment terms eligibility.
func (PaymentTermsEligibilityDetail) MarshalJSON ¶ added in v1.0.0
func (p PaymentTermsEligibilityDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentTermsEligibilityDetail.
func (*PaymentTermsEligibilityDetail) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentTermsEligibilityDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentTermsEligibilityDetail.
type PaymentTermsEligibilityResult ¶ added in v1.0.0
type PaymentTermsEligibilityResult struct { // Details of the payment terms eligibility. EligibilityDetails []*PaymentTermsEligibilityDetail // Indicates the eligibility status of the payment terms. EligibilityStatus *PaymentTermsEligibilityStatus }
PaymentTermsEligibilityResult - Result of the payment terms eligibility.
func (PaymentTermsEligibilityResult) MarshalJSON ¶ added in v1.0.0
func (p PaymentTermsEligibilityResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentTermsEligibilityResult.
func (*PaymentTermsEligibilityResult) UnmarshalJSON ¶ added in v1.0.0
func (p *PaymentTermsEligibilityResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentTermsEligibilityResult.
type PaymentTermsEligibilityStatus ¶ added in v1.0.0
type PaymentTermsEligibilityStatus string
PaymentTermsEligibilityStatus - Indicates the eligibility status of the payment terms.
const ( PaymentTermsEligibilityStatusInvalid PaymentTermsEligibilityStatus = "Invalid" PaymentTermsEligibilityStatusOther PaymentTermsEligibilityStatus = "Other" PaymentTermsEligibilityStatusValid PaymentTermsEligibilityStatus = "Valid" )
func PossiblePaymentTermsEligibilityStatusValues ¶ added in v1.0.0
func PossiblePaymentTermsEligibilityStatusValues() []PaymentTermsEligibilityStatus
PossiblePaymentTermsEligibilityStatusValues returns the possible values for the PaymentTermsEligibilityStatus const type.
type Permission ¶ added in v1.0.0
type Permission 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 }
Permission - The set of allowed action and not allowed actions a caller has on a resource.
func (Permission) MarshalJSON ¶ added in v1.0.0
func (p Permission) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Permission.
func (*Permission) UnmarshalJSON ¶ added in v1.0.0
func (p *Permission) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Permission.
type PermissionListResult ¶ added in v1.0.0
type PermissionListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*Permission }
PermissionListResult - A container for a list of resources
func (PermissionListResult) MarshalJSON ¶ added in v1.0.0
func (p PermissionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PermissionListResult.
func (*PermissionListResult) UnmarshalJSON ¶ added in v1.0.0
func (p *PermissionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PermissionListResult.
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) CheckAccessByBillingAccount ¶ added in v1.0.0
func (client *PermissionsClient) CheckAccessByBillingAccount(ctx context.Context, billingAccountName string, parameters CheckAccessRequest, options *PermissionsClientCheckAccessByBillingAccountOptions) (PermissionsClientCheckAccessByBillingAccountResponse, error)
CheckAccessByBillingAccount - Provides a list of check access response objects for a billing account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - The request object against which access of the caller will be checked.
- options - PermissionsClientCheckAccessByBillingAccountOptions contains the optional parameters for the PermissionsClient.CheckAccessByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingAccount.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.NewPermissionsClient().CheckAccessByBillingAccount(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", armbilling.CheckAccessRequest{ Actions: []*string{ to.Ptr("Microsoft.Billing/billingAccounts/read"), to.Ptr("Microsoft.Subscription/subscriptions/write")}, }, 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.CheckAccessResponseArray = []*armbilling.CheckAccessResponse{ // { // AccessDecision: to.Ptr(armbilling.AccessDecisionAllowed), // Action: to.Ptr("Microsoft.Billing/billingAccounts/read"), // }, // { // AccessDecision: to.Ptr(armbilling.AccessDecisionNotAllowed), // Action: to.Ptr("Microsoft.Subscription/subscriptions/write"), // }} }
Output:
func (*PermissionsClient) CheckAccessByBillingProfile ¶ added in v1.0.0
func (client *PermissionsClient) CheckAccessByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, parameters CheckAccessRequest, options *PermissionsClientCheckAccessByBillingProfileOptions) (PermissionsClientCheckAccessByBillingProfileResponse, error)
CheckAccessByBillingProfile - Provides a list of check access response objects for a billing profile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- parameters - The request object against which access of the caller will be checked.
- options - PermissionsClientCheckAccessByBillingProfileOptions contains the optional parameters for the PermissionsClient.CheckAccessByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingProfile.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.NewPermissionsClient().CheckAccessByBillingProfile(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", armbilling.CheckAccessRequest{ Actions: []*string{ to.Ptr("Microsoft.Billing/billingAccounts/read"), to.Ptr("Microsoft.Subscription/subscriptions/write")}, }, 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.CheckAccessResponseArray = []*armbilling.CheckAccessResponse{ // { // AccessDecision: to.Ptr(armbilling.AccessDecisionAllowed), // Action: to.Ptr("Microsoft.Billing/billingAccounts/read"), // }, // { // AccessDecision: to.Ptr(armbilling.AccessDecisionNotAllowed), // Action: to.Ptr("Microsoft.Subscription/subscriptions/write"), // }} }
Output:
func (*PermissionsClient) CheckAccessByCustomer ¶ added in v1.0.0
func (client *PermissionsClient) CheckAccessByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, parameters CheckAccessRequest, options *PermissionsClientCheckAccessByCustomerOptions) (PermissionsClientCheckAccessByCustomerResponse, error)
CheckAccessByCustomer - Provides a list of check access response objects for a customer. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- parameters - The request object against which access of the caller will be checked.
- options - PermissionsClientCheckAccessByCustomerOptions contains the optional parameters for the PermissionsClient.CheckAccessByCustomer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByCustomer.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.NewPermissionsClient().CheckAccessByCustomer(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "703ab484-dda2-4402-827b-a74513b61e2d", armbilling.CheckAccessRequest{ Actions: []*string{ to.Ptr("Microsoft.Billing/billingAccounts/read"), to.Ptr("Microsoft.Subscription/subscriptions/write")}, }, 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.CheckAccessResponseArray = []*armbilling.CheckAccessResponse{ // { // AccessDecision: to.Ptr(armbilling.AccessDecisionAllowed), // Action: to.Ptr("Microsoft.Billing/billingAccounts/read"), // }, // { // AccessDecision: to.Ptr(armbilling.AccessDecisionNotAllowed), // Action: to.Ptr("Microsoft.Subscription/subscriptions/write"), // }} }
Output:
func (*PermissionsClient) CheckAccessByDepartment ¶ added in v1.0.0
func (client *PermissionsClient) CheckAccessByDepartment(ctx context.Context, billingAccountName string, departmentName string, parameters CheckAccessRequest, options *PermissionsClientCheckAccessByDepartmentOptions) (PermissionsClientCheckAccessByDepartmentResponse, error)
CheckAccessByDepartment - Provides a list of check access response objects for a department. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- parameters - The request object against which access of the caller will be checked.
- options - PermissionsClientCheckAccessByDepartmentOptions contains the optional parameters for the PermissionsClient.CheckAccessByDepartment method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByDepartment.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.NewPermissionsClient().CheckAccessByDepartment(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "12345", armbilling.CheckAccessRequest{ Actions: []*string{ to.Ptr("Microsoft.Billing/billingAccounts/read"), to.Ptr("Microsoft.Subscription/subscriptions/write")}, }, 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.CheckAccessResponseArray = []*armbilling.CheckAccessResponse{ // { // AccessDecision: to.Ptr(armbilling.AccessDecisionAllowed), // Action: to.Ptr("Microsoft.Billing/billingAccounts/read"), // }, // { // AccessDecision: to.Ptr(armbilling.AccessDecisionNotAllowed), // Action: to.Ptr("Microsoft.Subscription/subscriptions/write"), // }} }
Output:
func (*PermissionsClient) CheckAccessByEnrollmentAccount ¶ added in v1.0.0
func (client *PermissionsClient) CheckAccessByEnrollmentAccount(ctx context.Context, billingAccountName string, enrollmentAccountName string, parameters CheckAccessRequest, options *PermissionsClientCheckAccessByEnrollmentAccountOptions) (PermissionsClientCheckAccessByEnrollmentAccountResponse, error)
CheckAccessByEnrollmentAccount - Provides a list of check access response objects for an enrollment account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- enrollmentAccountName - The name of the enrollment account.
- parameters - The request object against which access of the caller will be checked.
- options - PermissionsClientCheckAccessByEnrollmentAccountOptions contains the optional parameters for the PermissionsClient.CheckAccessByEnrollmentAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByEnrollmentAccount.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.NewPermissionsClient().CheckAccessByEnrollmentAccount(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "123456", armbilling.CheckAccessRequest{ Actions: []*string{ to.Ptr("Microsoft.Billing/billingAccounts/read"), to.Ptr("Microsoft.Subscription/subscriptions/write")}, }, 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.CheckAccessResponseArray = []*armbilling.CheckAccessResponse{ // { // AccessDecision: to.Ptr(armbilling.AccessDecisionAllowed), // Action: to.Ptr("Microsoft.Billing/billingAccounts/read"), // }, // { // AccessDecision: to.Ptr(armbilling.AccessDecisionNotAllowed), // Action: to.Ptr("Microsoft.Subscription/subscriptions/write"), // }} }
Output:
func (*PermissionsClient) CheckAccessByInvoiceSection ¶ added in v1.0.0
func (client *PermissionsClient) CheckAccessByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, parameters CheckAccessRequest, options *PermissionsClientCheckAccessByInvoiceSectionOptions) (PermissionsClientCheckAccessByInvoiceSectionResponse, error)
CheckAccessByInvoiceSection - Provides a list of check access response objects for an invoice section. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-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 request object against which access of the caller will be checked.
- options - PermissionsClientCheckAccessByInvoiceSectionOptions contains the optional parameters for the PermissionsClient.CheckAccessByInvoiceSection method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByInvoiceSection.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.NewPermissionsClient().CheckAccessByInvoiceSection(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "Q7GV-UUVA-PJA-TGB", armbilling.CheckAccessRequest{ Actions: []*string{ to.Ptr("Microsoft.Billing/billingAccounts/read"), to.Ptr("Microsoft.Subscription/subscriptions/write")}, }, 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.CheckAccessResponseArray = []*armbilling.CheckAccessResponse{ // { // AccessDecision: to.Ptr(armbilling.AccessDecisionAllowed), // Action: to.Ptr("Microsoft.Billing/billingAccounts/read"), // }, // { // AccessDecision: to.Ptr(armbilling.AccessDecisionNotAllowed), // Action: to.Ptr("Microsoft.Subscription/subscriptions/write"), // }} }
Output:
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingAccount.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("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", 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.PermissionListResult = armbilling.PermissionListResult{ // Value: []*armbilling.Permission{ // { // 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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingProfile.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("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", 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.PermissionListResult = armbilling.PermissionListResult{ // Value: []*armbilling.Permission{ // { // 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) NewListByCustomerAtBillingAccountPager ¶ added in v1.0.0
func (client *PermissionsClient) NewListByCustomerAtBillingAccountPager(billingAccountName string, customerName string, options *PermissionsClientListByCustomerAtBillingAccountOptions) *runtime.Pager[PermissionsClientListByCustomerAtBillingAccountResponse]
NewListByCustomerAtBillingAccountPager - Lists the billing permissions the caller has for a customer at billing account level.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- options - PermissionsClientListByCustomerAtBillingAccountOptions contains the optional parameters for the PermissionsClient.NewListByCustomerAtBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomerAtBillingAccount.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().NewListByCustomerAtBillingAccountPager("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", 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.PermissionListResult = armbilling.PermissionListResult{ // Value: []*armbilling.Permission{ // { // 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) NewListByCustomerPager ¶ added in v0.4.0
func (client *PermissionsClient) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, options *PermissionsClientListByCustomerOptions) *runtime.Pager[PermissionsClientListByCustomerResponse]
NewListByCustomerPager - Lists the billing permissions the caller has for a customer.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- 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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomer.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("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "BKM6-54VH-BG7-PGB", "11111111-1111-1111-1111-111111111111", 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.PermissionListResult = armbilling.PermissionListResult{ // Value: []*armbilling.Permission{ // { // 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) NewListByDepartmentPager ¶ added in v1.0.0
func (client *PermissionsClient) NewListByDepartmentPager(billingAccountName string, departmentName string, options *PermissionsClientListByDepartmentOptions) *runtime.Pager[PermissionsClientListByDepartmentResponse]
NewListByDepartmentPager - Lists the billing permissions the caller has for a department.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- options - PermissionsClientListByDepartmentOptions contains the optional parameters for the PermissionsClient.NewListByDepartmentPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByDepartment.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().NewListByDepartmentPager("6100092", "123456", 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.PermissionListResult = armbilling.PermissionListResult{ // Value: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("Microsoft.Billing/billingAccounts/departments/read"), // to.Ptr("Microsoft.Billing/billingAccounts/departments/write"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/write"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/write")}, // NotActions: []*string{ // }, // }}, // } } }
Output:
func (*PermissionsClient) NewListByEnrollmentAccountPager ¶ added in v1.0.0
func (client *PermissionsClient) NewListByEnrollmentAccountPager(billingAccountName string, enrollmentAccountName string, options *PermissionsClientListByEnrollmentAccountOptions) *runtime.Pager[PermissionsClientListByEnrollmentAccountResponse]
NewListByEnrollmentAccountPager - Lists the billing permissions the caller has for an enrollment account.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- enrollmentAccountName - The name of the enrollment account.
- options - PermissionsClientListByEnrollmentAccountOptions contains the optional parameters for the PermissionsClient.NewListByEnrollmentAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByEnrollmentAccount.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().NewListByEnrollmentAccountPager("6100092", "123456", 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.PermissionListResult = armbilling.PermissionListResult{ // Value: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/write"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/write")}, // NotActions: []*string{ // }, // }}, // } } }
Output:
func (*PermissionsClient) NewListByInvoiceSectionPager ¶ added in v1.0.0
func (client *PermissionsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *PermissionsClientListByInvoiceSectionOptions) *runtime.Pager[PermissionsClientListByInvoiceSectionResponse]
NewListByInvoiceSectionPager - Lists the billing permissions the caller has for an invoice section.
Generated from API version 2024-04-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 - PermissionsClientListByInvoiceSectionOptions contains the optional parameters for the PermissionsClient.NewListByInvoiceSectionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByInvoiceSection.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().NewListByInvoiceSectionPager("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "XXXX-XXXX-XXX-XXX", 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.PermissionListResult = armbilling.PermissionListResult{ // Value: []*armbilling.Permission{ // { // 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:
type PermissionsClientCheckAccessByBillingAccountOptions ¶ added in v1.0.0
type PermissionsClientCheckAccessByBillingAccountOptions struct { }
PermissionsClientCheckAccessByBillingAccountOptions contains the optional parameters for the PermissionsClient.CheckAccessByBillingAccount method.
type PermissionsClientCheckAccessByBillingAccountResponse ¶ added in v1.0.0
type PermissionsClientCheckAccessByBillingAccountResponse struct { // Array of CheckAccessResponse CheckAccessResponseArray []*CheckAccessResponse }
PermissionsClientCheckAccessByBillingAccountResponse contains the response from method PermissionsClient.CheckAccessByBillingAccount.
type PermissionsClientCheckAccessByBillingProfileOptions ¶ added in v1.0.0
type PermissionsClientCheckAccessByBillingProfileOptions struct { }
PermissionsClientCheckAccessByBillingProfileOptions contains the optional parameters for the PermissionsClient.CheckAccessByBillingProfile method.
type PermissionsClientCheckAccessByBillingProfileResponse ¶ added in v1.0.0
type PermissionsClientCheckAccessByBillingProfileResponse struct { // Array of CheckAccessResponse CheckAccessResponseArray []*CheckAccessResponse }
PermissionsClientCheckAccessByBillingProfileResponse contains the response from method PermissionsClient.CheckAccessByBillingProfile.
type PermissionsClientCheckAccessByCustomerOptions ¶ added in v1.0.0
type PermissionsClientCheckAccessByCustomerOptions struct { }
PermissionsClientCheckAccessByCustomerOptions contains the optional parameters for the PermissionsClient.CheckAccessByCustomer method.
type PermissionsClientCheckAccessByCustomerResponse ¶ added in v1.0.0
type PermissionsClientCheckAccessByCustomerResponse struct { // Array of CheckAccessResponse CheckAccessResponseArray []*CheckAccessResponse }
PermissionsClientCheckAccessByCustomerResponse contains the response from method PermissionsClient.CheckAccessByCustomer.
type PermissionsClientCheckAccessByDepartmentOptions ¶ added in v1.0.0
type PermissionsClientCheckAccessByDepartmentOptions struct { }
PermissionsClientCheckAccessByDepartmentOptions contains the optional parameters for the PermissionsClient.CheckAccessByDepartment method.
type PermissionsClientCheckAccessByDepartmentResponse ¶ added in v1.0.0
type PermissionsClientCheckAccessByDepartmentResponse struct { // Array of CheckAccessResponse CheckAccessResponseArray []*CheckAccessResponse }
PermissionsClientCheckAccessByDepartmentResponse contains the response from method PermissionsClient.CheckAccessByDepartment.
type PermissionsClientCheckAccessByEnrollmentAccountOptions ¶ added in v1.0.0
type PermissionsClientCheckAccessByEnrollmentAccountOptions struct { }
PermissionsClientCheckAccessByEnrollmentAccountOptions contains the optional parameters for the PermissionsClient.CheckAccessByEnrollmentAccount method.
type PermissionsClientCheckAccessByEnrollmentAccountResponse ¶ added in v1.0.0
type PermissionsClientCheckAccessByEnrollmentAccountResponse struct { // Array of CheckAccessResponse CheckAccessResponseArray []*CheckAccessResponse }
PermissionsClientCheckAccessByEnrollmentAccountResponse contains the response from method PermissionsClient.CheckAccessByEnrollmentAccount.
type PermissionsClientCheckAccessByInvoiceSectionOptions ¶ added in v1.0.0
type PermissionsClientCheckAccessByInvoiceSectionOptions struct { }
PermissionsClientCheckAccessByInvoiceSectionOptions contains the optional parameters for the PermissionsClient.CheckAccessByInvoiceSection method.
type PermissionsClientCheckAccessByInvoiceSectionResponse ¶ added in v1.0.0
type PermissionsClientCheckAccessByInvoiceSectionResponse struct { // Array of CheckAccessResponse CheckAccessResponseArray []*CheckAccessResponse }
PermissionsClientCheckAccessByInvoiceSectionResponse contains the response from method PermissionsClient.CheckAccessByInvoiceSection.
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 { // A container for a list of resources PermissionListResult }
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 { // A container for a list of resources PermissionListResult }
PermissionsClientListByBillingProfileResponse contains the response from method PermissionsClient.NewListByBillingProfilePager.
type PermissionsClientListByCustomerAtBillingAccountOptions ¶ added in v1.0.0
type PermissionsClientListByCustomerAtBillingAccountOptions struct { }
PermissionsClientListByCustomerAtBillingAccountOptions contains the optional parameters for the PermissionsClient.NewListByCustomerAtBillingAccountPager method.
type PermissionsClientListByCustomerAtBillingAccountResponse ¶ added in v1.0.0
type PermissionsClientListByCustomerAtBillingAccountResponse struct { // A container for a list of resources PermissionListResult }
PermissionsClientListByCustomerAtBillingAccountResponse contains the response from method PermissionsClient.NewListByCustomerAtBillingAccountPager.
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 { // A container for a list of resources PermissionListResult }
PermissionsClientListByCustomerResponse contains the response from method PermissionsClient.NewListByCustomerPager.
type PermissionsClientListByDepartmentOptions ¶ added in v1.0.0
type PermissionsClientListByDepartmentOptions struct { }
PermissionsClientListByDepartmentOptions contains the optional parameters for the PermissionsClient.NewListByDepartmentPager method.
type PermissionsClientListByDepartmentResponse ¶ added in v1.0.0
type PermissionsClientListByDepartmentResponse struct { // A container for a list of resources PermissionListResult }
PermissionsClientListByDepartmentResponse contains the response from method PermissionsClient.NewListByDepartmentPager.
type PermissionsClientListByEnrollmentAccountOptions ¶ added in v1.0.0
type PermissionsClientListByEnrollmentAccountOptions struct { }
PermissionsClientListByEnrollmentAccountOptions contains the optional parameters for the PermissionsClient.NewListByEnrollmentAccountPager method.
type PermissionsClientListByEnrollmentAccountResponse ¶ added in v1.0.0
type PermissionsClientListByEnrollmentAccountResponse struct { // A container for a list of resources PermissionListResult }
PermissionsClientListByEnrollmentAccountResponse contains the response from method PermissionsClient.NewListByEnrollmentAccountPager.
type PermissionsClientListByInvoiceSectionOptions ¶ added in v1.0.0
type PermissionsClientListByInvoiceSectionOptions struct { }
PermissionsClientListByInvoiceSectionOptions contains the optional parameters for the PermissionsClient.NewListByInvoiceSectionPager method.
type PermissionsClientListByInvoiceSectionResponse ¶ added in v1.0.0
type PermissionsClientListByInvoiceSectionResponse struct { // A container for a list of resources PermissionListResult }
PermissionsClientListByInvoiceSectionResponse contains the response from method PermissionsClient.NewListByInvoiceSectionPager.
type PlanInformation ¶ added in v1.0.0
type PlanInformation struct { // For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. NextPaymentDueDate *time.Time // Amount of money to be paid for the Order. Tax is not included. PricingCurrencyTotal *Price // Date when the billing plan has started. StartDate *time.Time Transactions []*PaymentDetail }
PlanInformation - Information describing the type of billing plan for this savings plan.
func (PlanInformation) MarshalJSON ¶ added in v1.0.0
func (p PlanInformation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PlanInformation.
func (*PlanInformation) UnmarshalJSON ¶ added in v1.0.0
func (p *PlanInformation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PlanInformation.
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(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PoliciesClient, error)
NewPoliciesClient creates a new instance of PoliciesClient with the specified values.
- subscriptionID - The ID that uniquely identifies a billing subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PoliciesClient) BeginCreateOrUpdateByBillingAccount ¶ added in v1.0.0
func (client *PoliciesClient) BeginCreateOrUpdateByBillingAccount(ctx context.Context, billingAccountName string, parameters AccountPolicy, options *PoliciesClientBeginCreateOrUpdateByBillingAccountOptions) (*runtime.Poller[PoliciesClientCreateOrUpdateByBillingAccountResponse], error)
BeginCreateOrUpdateByBillingAccount - Update the policies for a billing account of Enterprise Agreement type. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - A policy at billing account scope.
- options - PoliciesClientBeginCreateOrUpdateByBillingAccountOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdateByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingAccount.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.NewPoliciesClient().BeginCreateOrUpdateByBillingAccount(ctx, "1234567", armbilling.AccountPolicy{ Properties: &armbilling.AccountPolicyProperties{ EnterpriseAgreementPolicies: &armbilling.AccountPolicyPropertiesEnterpriseAgreementPolicies{ AuthenticationType: to.Ptr(armbilling.EnrollmentAuthLevelStateOrganizationalAccountOnly), }, MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyAllAllowed), ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyAllowed), SavingsPlanPurchases: to.Ptr(armbilling.SavingsPlanPurchasesPolicyNotAllowed), }, }, 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.AccountPolicy = armbilling.AccountPolicy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/1234567/policies/default"), // Properties: &armbilling.AccountPolicyProperties{ // EnterpriseAgreementPolicies: &armbilling.AccountPolicyPropertiesEnterpriseAgreementPolicies{ // AuthenticationType: to.Ptr(armbilling.EnrollmentAuthLevelStateOrganizationalAccountOnly), // }, // MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyAllAllowed), // ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyAllowed), // SavingsPlanPurchases: to.Ptr(armbilling.SavingsPlanPurchasesPolicyNotAllowed), // }, // } }
Output:
func (*PoliciesClient) BeginCreateOrUpdateByBillingProfile ¶ added in v1.0.0
func (client *PoliciesClient) BeginCreateOrUpdateByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, parameters ProfilePolicy, options *PoliciesClientBeginCreateOrUpdateByBillingProfileOptions) (*runtime.Poller[PoliciesClientCreateOrUpdateByBillingProfileResponse], error)
BeginCreateOrUpdateByBillingProfile - 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- parameters - A policy at billing profile scope.
- options - PoliciesClientBeginCreateOrUpdateByBillingProfileOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdateByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingProfile.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.NewPoliciesClient().BeginCreateOrUpdateByBillingProfile(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", armbilling.ProfilePolicy{ Properties: &armbilling.ProfilePolicyProperties{ InvoiceSectionLabelManagement: to.Ptr(armbilling.InvoiceSectionLabelManagementPolicyAllowed), MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyAllAllowed), ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyAllowed), SavingsPlanPurchases: to.Ptr(armbilling.SavingsPlanPurchasesPolicyAllowed), }, }, 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.ProfilePolicy = armbilling.ProfilePolicy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/policies/default"), // Properties: &armbilling.ProfilePolicyProperties{ // InvoiceSectionLabelManagement: to.Ptr(armbilling.InvoiceSectionLabelManagementPolicyAllowed), // MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyAllAllowed), // ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyAllowed), // SavingsPlanPurchases: to.Ptr(armbilling.SavingsPlanPurchasesPolicyAllowed), // }, // } }
Output:
func (*PoliciesClient) BeginCreateOrUpdateByCustomer ¶ added in v1.0.0
func (client *PoliciesClient) BeginCreateOrUpdateByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, parameters CustomerPolicy, options *PoliciesClientBeginCreateOrUpdateByCustomerOptions) (*runtime.Poller[PoliciesClientCreateOrUpdateByCustomerResponse], error)
BeginCreateOrUpdateByCustomer - 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- parameters - A policy at customer scope.
- options - PoliciesClientBeginCreateOrUpdateByCustomerOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdateByCustomer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomer.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.NewPoliciesClient().BeginCreateOrUpdateByCustomer(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "11111111-1111-1111-1111-111111111111", armbilling.CustomerPolicy{ Properties: &armbilling.CustomerPolicyProperties{ ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), }, }, 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.CustomerPolicy = armbilling.CustomerPolicy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/policies/default"), // Properties: &armbilling.CustomerPolicyProperties{ // ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), // }, // } }
Output:
func (*PoliciesClient) BeginCreateOrUpdateByCustomerAtBillingAccount ¶ added in v1.0.0
func (client *PoliciesClient) BeginCreateOrUpdateByCustomerAtBillingAccount(ctx context.Context, billingAccountName string, customerName string, parameters CustomerPolicy, options *PoliciesClientBeginCreateOrUpdateByCustomerAtBillingAccountOptions) (*runtime.Poller[PoliciesClientCreateOrUpdateByCustomerAtBillingAccountResponse], error)
BeginCreateOrUpdateByCustomerAtBillingAccount - Updates the policies for a customer at billing account scope. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- parameters - A policy at customer scope.
- options - PoliciesClientBeginCreateOrUpdateByCustomerAtBillingAccountOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdateByCustomerAtBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomerAtBillingAccount.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.NewPoliciesClient().BeginCreateOrUpdateByCustomerAtBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", armbilling.CustomerPolicy{ Properties: &armbilling.CustomerPolicyProperties{ ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), }, }, 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.CustomerPolicy = armbilling.CustomerPolicy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/policies/default"), // Properties: &armbilling.CustomerPolicyProperties{ // ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), // }, // } }
Output:
func (*PoliciesClient) GetByBillingAccount ¶ added in v1.0.0
func (client *PoliciesClient) GetByBillingAccount(ctx context.Context, billingAccountName string, options *PoliciesClientGetByBillingAccountOptions) (PoliciesClientGetByBillingAccountResponse, error)
GetByBillingAccount - Get the policies for a billing account of Enterprise Agreement type. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - PoliciesClientGetByBillingAccountOptions contains the optional parameters for the PoliciesClient.GetByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingAccount.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().GetByBillingAccount(ctx, "1234567", 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.AccountPolicy = armbilling.AccountPolicy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/1234567/policies/default"), // Properties: &armbilling.AccountPolicyProperties{ // EnterpriseAgreementPolicies: &armbilling.AccountPolicyPropertiesEnterpriseAgreementPolicies{ // AuthenticationType: to.Ptr(armbilling.EnrollmentAuthLevelStateOrganizationalAccountOnly), // }, // MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyAllAllowed), // ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyAllowed), // SavingsPlanPurchases: to.Ptr(armbilling.SavingsPlanPurchasesPolicyNotAllowed), // }, // } }
Output:
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingProfile.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", 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.ProfilePolicy = armbilling.ProfilePolicy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/policies/default"), // Properties: &armbilling.ProfilePolicyProperties{ // InvoiceSectionLabelManagement: to.Ptr(armbilling.InvoiceSectionLabelManagementPolicyAllowed), // MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyAllAllowed), // ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyAllowed), // SavingsPlanPurchases: to.Ptr(armbilling.SavingsPlanPurchasesPolicyAllowed), // }, // } }
Output:
func (*PoliciesClient) GetByCustomer ¶
func (client *PoliciesClient) GetByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, policyName ServiceDefinedResourceName, 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- policyName - Service-defined resource names such as 'default' which are reserved resource names.
- 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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomer.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "11111111-1111-1111-1111-111111111111", armbilling.ServiceDefinedResourceNameDefault, 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/billingProfiles/customers/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/policies/default"), // Properties: &armbilling.CustomerPolicyProperties{ // ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), // }, // } }
Output:
func (*PoliciesClient) GetByCustomerAtBillingAccount ¶ added in v1.0.0
func (client *PoliciesClient) GetByCustomerAtBillingAccount(ctx context.Context, billingAccountName string, customerName string, options *PoliciesClientGetByCustomerAtBillingAccountOptions) (PoliciesClientGetByCustomerAtBillingAccountResponse, error)
GetByCustomerAtBillingAccount - Lists the policies for a customer at billing account scope. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- options - PoliciesClientGetByCustomerAtBillingAccountOptions contains the optional parameters for the PoliciesClient.GetByCustomerAtBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomerAtBillingAccount.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().GetByCustomerAtBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", 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/billingProfiles/customers/policies"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/policies/default"), // Properties: &armbilling.CustomerPolicyProperties{ // ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), // }, // } }
Output:
func (*PoliciesClient) GetBySubscription ¶ added in v1.0.0
func (client *PoliciesClient) GetBySubscription(ctx context.Context, options *PoliciesClientGetBySubscriptionOptions) (PoliciesClientGetBySubscriptionResponse, error)
GetBySubscription - Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- options - PoliciesClientGetBySubscriptionOptions contains the optional parameters for the PoliciesClient.GetBySubscription method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetBySubscription.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().GetBySubscription(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.SubscriptionPolicy = armbilling.SubscriptionPolicy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Billing/policies"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/policies/default"), // Properties: &armbilling.SubscriptionPolicyProperties{ // Policies: []*armbilling.PolicySummary{ // { // Name: to.Ptr("ViewCharges"), // PolicyType: to.Ptr(armbilling.PolicyTypeSystemControlled), // Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000"), // Value: to.Ptr("Allowed"), // }}, // }, // } }
Output:
type PoliciesClientBeginCreateOrUpdateByBillingAccountOptions ¶ added in v1.0.0
type PoliciesClientBeginCreateOrUpdateByBillingAccountOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
PoliciesClientBeginCreateOrUpdateByBillingAccountOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdateByBillingAccount method.
type PoliciesClientBeginCreateOrUpdateByBillingProfileOptions ¶ added in v1.0.0
type PoliciesClientBeginCreateOrUpdateByBillingProfileOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
PoliciesClientBeginCreateOrUpdateByBillingProfileOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdateByBillingProfile method.
type PoliciesClientBeginCreateOrUpdateByCustomerAtBillingAccountOptions ¶ added in v1.0.0
type PoliciesClientBeginCreateOrUpdateByCustomerAtBillingAccountOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
PoliciesClientBeginCreateOrUpdateByCustomerAtBillingAccountOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdateByCustomerAtBillingAccount method.
type PoliciesClientBeginCreateOrUpdateByCustomerOptions ¶ added in v1.0.0
type PoliciesClientBeginCreateOrUpdateByCustomerOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
PoliciesClientBeginCreateOrUpdateByCustomerOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdateByCustomer method.
type PoliciesClientCreateOrUpdateByBillingAccountResponse ¶ added in v1.0.0
type PoliciesClientCreateOrUpdateByBillingAccountResponse struct { // A policy at billing account scope. AccountPolicy }
PoliciesClientCreateOrUpdateByBillingAccountResponse contains the response from method PoliciesClient.BeginCreateOrUpdateByBillingAccount.
type PoliciesClientCreateOrUpdateByBillingProfileResponse ¶ added in v1.0.0
type PoliciesClientCreateOrUpdateByBillingProfileResponse struct { // A policy at billing profile scope. ProfilePolicy }
PoliciesClientCreateOrUpdateByBillingProfileResponse contains the response from method PoliciesClient.BeginCreateOrUpdateByBillingProfile.
type PoliciesClientCreateOrUpdateByCustomerAtBillingAccountResponse ¶ added in v1.0.0
type PoliciesClientCreateOrUpdateByCustomerAtBillingAccountResponse struct { // A policy at customer scope. CustomerPolicy }
PoliciesClientCreateOrUpdateByCustomerAtBillingAccountResponse contains the response from method PoliciesClient.BeginCreateOrUpdateByCustomerAtBillingAccount.
type PoliciesClientCreateOrUpdateByCustomerResponse ¶ added in v1.0.0
type PoliciesClientCreateOrUpdateByCustomerResponse struct { // A policy at customer scope. CustomerPolicy }
PoliciesClientCreateOrUpdateByCustomerResponse contains the response from method PoliciesClient.BeginCreateOrUpdateByCustomer.
type PoliciesClientGetByBillingAccountOptions ¶ added in v1.0.0
type PoliciesClientGetByBillingAccountOptions struct { }
PoliciesClientGetByBillingAccountOptions contains the optional parameters for the PoliciesClient.GetByBillingAccount method.
type PoliciesClientGetByBillingAccountResponse ¶ added in v1.0.0
type PoliciesClientGetByBillingAccountResponse struct { // A policy at billing account scope. AccountPolicy }
PoliciesClientGetByBillingAccountResponse contains the response from method PoliciesClient.GetByBillingAccount.
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 at billing profile scope. ProfilePolicy }
PoliciesClientGetByBillingProfileResponse contains the response from method PoliciesClient.GetByBillingProfile.
type PoliciesClientGetByCustomerAtBillingAccountOptions ¶ added in v1.0.0
type PoliciesClientGetByCustomerAtBillingAccountOptions struct { }
PoliciesClientGetByCustomerAtBillingAccountOptions contains the optional parameters for the PoliciesClient.GetByCustomerAtBillingAccount method.
type PoliciesClientGetByCustomerAtBillingAccountResponse ¶ added in v1.0.0
type PoliciesClientGetByCustomerAtBillingAccountResponse struct { // A policy at customer scope. CustomerPolicy }
PoliciesClientGetByCustomerAtBillingAccountResponse contains the response from method PoliciesClient.GetByCustomerAtBillingAccount.
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 { // A policy at customer scope. CustomerPolicy }
PoliciesClientGetByCustomerResponse contains the response from method PoliciesClient.GetByCustomer.
type PoliciesClientGetBySubscriptionOptions ¶ added in v1.0.0
type PoliciesClientGetBySubscriptionOptions struct { }
PoliciesClientGetBySubscriptionOptions contains the optional parameters for the PoliciesClient.GetBySubscription method.
type PoliciesClientGetBySubscriptionResponse ¶ added in v1.0.0
type PoliciesClientGetBySubscriptionResponse struct { // A policy at subscription scope. SubscriptionPolicy }
PoliciesClientGetBySubscriptionResponse contains the response from method PoliciesClient.GetBySubscription.
type PolicySummary ¶ added in v1.0.0
type PolicySummary struct { // The name of the policy. Name *string // The type of the policy. PolicyType *PolicyType // The scope at which the policy is defined. Scope *string // The value of the policy. Value *string }
PolicySummary - The summary of the policy.
func (PolicySummary) MarshalJSON ¶ added in v1.0.0
func (p PolicySummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PolicySummary.
func (*PolicySummary) UnmarshalJSON ¶ added in v1.0.0
func (p *PolicySummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PolicySummary.
type PolicyType ¶ added in v1.0.0
type PolicyType string
PolicyType - The type of the policy.
const ( PolicyTypeOther PolicyType = "Other" PolicyTypeSystemControlled PolicyType = "SystemControlled" PolicyTypeUserControlled PolicyType = "UserControlled" )
func PossiblePolicyTypeValues ¶ added in v1.0.0
func PossiblePolicyTypeValues() []PolicyType
PossiblePolicyTypeValues returns the possible values for the PolicyType const type.
type Price ¶ added in v1.0.0
type Price struct { Amount *float64 // The ISO 4217 3-letter currency code for the currency used by this purchase record. CurrencyCode *string }
Price - The price.
func (Price) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type Price.
func (*Price) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type Price.
type Principal ¶ added in v1.0.0
type Principal struct { // The object id of the principal who has interacted with a billing entity. ObjectID *string // The tenant id of the principal who has interacted with a billing entity. TenantID *string // The user principal name of the principal who has interacted with a billing entity. Upn *string }
Principal - A principal who has interacted with a billing entity.
func (Principal) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type Principal.
func (*Principal) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type Principal.
type PrincipalType ¶ added in v1.0.0
type PrincipalType string
PrincipalType - The type of a role Assignment.
const ( PrincipalTypeDirectoryRole PrincipalType = "DirectoryRole" PrincipalTypeEveryone PrincipalType = "Everyone" PrincipalTypeGroup PrincipalType = "Group" PrincipalTypeNone PrincipalType = "None" PrincipalTypeServicePrincipal PrincipalType = "ServicePrincipal" PrincipalTypeUnknown PrincipalType = "Unknown" PrincipalTypeUser PrincipalType = "User" )
func PossiblePrincipalTypeValues ¶ added in v1.0.0
func PossiblePrincipalTypeValues() []PrincipalType
PossiblePrincipalTypeValues returns the possible values for the PrincipalType const type.
type Product ¶
type Product struct { // A product. Properties *ProductProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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 ProductDetails ¶ added in v1.0.0
type ProductDetails struct { // The ID of the product that is transferred. ProductID *string // Type of the product that is transferred. ProductType *ProductType }
ProductDetails - Details of the product that is transferred.
func (ProductDetails) MarshalJSON ¶ added in v1.0.0
func (p ProductDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProductDetails.
func (*ProductDetails) UnmarshalJSON ¶ added in v1.0.0
func (p *ProductDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProductDetails.
type ProductListResult ¶ added in v1.0.0
type ProductListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*Product }
ProductListResult - A container for a list of resources
func (ProductListResult) MarshalJSON ¶ added in v1.0.0
func (p ProductListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProductListResult.
func (*ProductListResult) UnmarshalJSON ¶ added in v1.0.0
func (p *ProductListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProductListResult.
type ProductPatch ¶ added in v1.0.0
type ProductPatch struct { // A product. Properties *ProductProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
ProductPatch - A product.
func (ProductPatch) MarshalJSON ¶ added in v1.0.0
func (p ProductPatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProductPatch.
func (*ProductPatch) UnmarshalJSON ¶ added in v1.0.0
func (p *ProductPatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProductPatch.
type ProductProperties ¶
type ProductProperties struct { // Indicates whether auto renewal is turned on or off for a product. AutoRenew *AutoRenew // The last month charges. LastCharge *ProductPropertiesLastCharge // Reseller for this product. The fields is not available for Microsoft Partner Agreement products. Reseller *ProductPropertiesReseller // READ-ONLY; The availability of the product. AvailabilityID *string // READ-ONLY; The frequency at which the product will be billed. BillingFrequency *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 *string // 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 date of the last charge. LastChargeDate *string // 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 *string // READ-ONLY; The quantity purchased for the product. Quantity *int64 // READ-ONLY; The sku description of the product. SKUDescription *string // READ-ONLY; The sku ID of the product. SKUID *string // READ-ONLY; The status of the product. Status *ProductStatus // READ-ONLY; The id of the tenant in which the product is used. TenantID *string }
ProductProperties - 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 ProductPropertiesLastCharge ¶ added in v1.0.0
type ProductPropertiesLastCharge struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
ProductPropertiesLastCharge - The last month charges.
func (ProductPropertiesLastCharge) MarshalJSON ¶ added in v1.0.0
func (p ProductPropertiesLastCharge) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProductPropertiesLastCharge.
func (*ProductPropertiesLastCharge) UnmarshalJSON ¶ added in v1.0.0
func (p *ProductPropertiesLastCharge) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProductPropertiesLastCharge.
type ProductPropertiesReseller ¶ added in v1.0.0
type ProductPropertiesReseller struct { // READ-ONLY; The name of the reseller. Description *string // READ-ONLY; The MPN ID of the reseller. ResellerID *string }
ProductPropertiesReseller - Reseller for this product. The fields is not available for Microsoft Partner Agreement products.
func (ProductPropertiesReseller) MarshalJSON ¶ added in v1.0.0
func (p ProductPropertiesReseller) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProductPropertiesReseller.
func (*ProductPropertiesReseller) UnmarshalJSON ¶ added in v1.0.0
func (p *ProductPropertiesReseller) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProductPropertiesReseller.
type ProductStatus ¶ added in v1.0.0
type ProductStatus string
ProductStatus - The status of the product.
const ( ProductStatusActive ProductStatus = "Active" ProductStatusAutoRenew ProductStatus = "AutoRenew" ProductStatusCanceled ProductStatus = "Canceled" ProductStatusDeleted ProductStatus = "Deleted" ProductStatusDisabled ProductStatus = "Disabled" ProductStatusExpired ProductStatus = "Expired" ProductStatusExpiring ProductStatus = "Expiring" ProductStatusOther ProductStatus = "Other" ProductStatusPastDue ProductStatus = "PastDue" ProductStatusSuspended ProductStatus = "Suspended" )
func PossibleProductStatusValues ¶ added in v1.0.0
func PossibleProductStatusValues() []ProductStatus
PossibleProductStatusValues returns the possible values for the ProductStatus const type.
type ProductTransferStatus ¶ added in v1.0.0
type ProductTransferStatus string
ProductTransferStatus - The status of a transfer.
const ( ProductTransferStatusCompleted ProductTransferStatus = "Completed" ProductTransferStatusFailed ProductTransferStatus = "Failed" ProductTransferStatusInProgress ProductTransferStatus = "InProgress" ProductTransferStatusNotStarted ProductTransferStatus = "NotStarted" )
func PossibleProductTransferStatusValues ¶ added in v1.0.0
func PossibleProductTransferStatusValues() []ProductTransferStatus
PossibleProductTransferStatusValues returns the possible values for the ProductTransferStatus const type.
type ProductType ¶ added in v1.0.0
type ProductType string
ProductType - The type of product that is transferred.
const ( ProductTypeAzureReservation ProductType = "AzureReservation" ProductTypeAzureSubscription ProductType = "AzureSubscription" ProductTypeDepartment ProductType = "Department" ProductTypeSAAS ProductType = "SAAS" ProductTypeSavingsPlan ProductType = "SavingsPlan" )
func PossibleProductTypeValues ¶ added in v1.0.0
func PossibleProductTypeValues() []ProductType
PossibleProductTypeValues returns the possible values for the ProductType 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) BeginMove ¶ added in v1.0.0
func (client *ProductsClient) BeginMove(ctx context.Context, billingAccountName string, productName string, parameters MoveProductRequest, options *ProductsClientBeginMoveOptions) (*runtime.Poller[ProductsClientMoveResponse], error)
BeginMove - 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- productName - The ID that uniquely identifies a product.
- parameters - The properties of the product to initiate a transfer.
- options - ProductsClientBeginMoveOptions contains the optional parameters for the ProductsClient.BeginMove method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productMove.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.NewProductsClient().BeginMove(ctx, "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "6b96d3f2-9008-4a9d-912f-f87744185aa3", armbilling.MoveProductRequest{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), }, 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.Product = armbilling.Product{ // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/products/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("My Product"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // } }
Output:
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsGet.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", 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("90000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/products/90000000-0000-0000-0000-000000000000"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("My product"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr("2023-01-04T22:39:34.2606750Z"), // Quantity: to.Ptr[int64](1), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.ProductsClientListByBillingAccountOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.ProductListResult = armbilling.ProductListResult{ // Value: []*armbilling.Product{ // { // Name: to.Ptr("90000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/products/90000000-0000-0000-0000-000000000000"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("My product"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr("2023-01-04T22:39:34.2606750Z"), // Quantity: to.Ptr[int64](1), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }, // { // Name: to.Ptr("90000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/products/90000000-0000-0000-0000-000000000001"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Test product"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // ProductType: to.Ptr("Software Product Type"), // ProductTypeID: to.Ptr("EFG456"), // PurchaseDate: to.Ptr("2023-01-06T22:39:34.2606750Z"), // Quantity: to.Ptr[int64](1), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }, // { // Name: to.Ptr("90000000-0000-0000-0000-000000000002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/products/90000000-0000-0000-0000-000000000002"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Dev product"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // ProductType: to.Ptr("Reservation Product Type"), // ProductTypeID: to.Ptr("JKL789"), // PurchaseDate: to.Ptr("2023-01-05T22:39:34.2606750Z"), // Quantity: to.Ptr[int64](1), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusSuspended), // }, // }}, // } } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "ea36e548-1505-41db-bebc-46fff3d37998", &armbilling.ProductsClientListByBillingProfileOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.ProductListResult = armbilling.ProductListResult{ // Value: []*armbilling.Product{ // { // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("My Product"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/22000000-0000-0000-0000-000000000000"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }, // { // Name: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Test Product"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/22000000-0000-0000-0000-000000000000"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }, // { // Name: to.Ptr("90D31600-D46D-4084-84C6-1235CDAFFB56"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/90D31600-D46D-4084-84C6-1235CDAFFB56"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Dev Product"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/22000000-0000-0000-0000-000000000000"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }, // { // Name: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Dev Test Product"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/22000000-0000-0000-0000-000000000000"), // SKUDescription: to.Ptr("Domain Name Registration ORG"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }}, // } } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "Q7GV-UUVA-PJA-TGB", &armbilling.ProductsClientListByCustomerOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.ProductListResult = armbilling.ProductListResult{ // Value: []*armbilling.Product{ // { // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("BillingProfile1"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/customers/Q7GV-UUVA-PJA-TGB"), // DisplayName: to.Ptr("My Product"), // SKUDescription: to.Ptr("Microsoft Azure Standard"), // SKUID: to.Ptr("0002"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }, // { // Name: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("BillingProfile1"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/customers/Q7GV-UUVA-PJA-TGB"), // DisplayName: to.Ptr("Test Product"), // SKUDescription: to.Ptr("Microsoft Azure Standard"), // SKUID: to.Ptr("0002"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }, // { // Name: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("BillingProfile1"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/customers/Q7GV-UUVA-PJA-TGB"), // DisplayName: to.Ptr("Dev Test Product"), // SKUDescription: to.Ptr("Domain Name Registration ORG"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }}, // } } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "ea36e548-1505-41db-bebc-46fff3d37998", "Q7GV-UUVA-PJA-TGB", &armbilling.ProductsClientListByInvoiceSectionOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.ProductListResult = armbilling.ProductListResult{ // Value: []*armbilling.Product{ // { // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("My Product"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }, // { // Name: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Test Product"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }, // { // Name: to.Ptr("90D31600-D46D-4084-84C6-1235CDAFFB56"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/90D31600-D46D-4084-84C6-1235CDAFFB56"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Dev Product"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }, // { // Name: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProducts/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Properties: &armbilling.ProductProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Dev Test Product"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), // SKUDescription: to.Ptr("Domain Name Registration ORG"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // }}, // } } }
Output:
func (*ProductsClient) Update ¶
func (client *ProductsClient) Update(ctx context.Context, billingAccountName string, productName string, parameters ProductPatch, 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- productName - The ID that uniquely identifies a product.
- parameters - A product.
- 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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsUpdate.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", armbilling.ProductPatch{ Properties: &armbilling.ProductProperties{ AutoRenew: to.Ptr(armbilling.AutoRenewOn), }, }, 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("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/products/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.ProductProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Product Display Name"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr("2023-01-05T22:39:34.2606750Z"), // Quantity: to.Ptr[int64](1), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.ProductStatusActive), // }, // } }
Output:
func (*ProductsClient) ValidateMoveEligibility ¶ added in v1.0.0
func (client *ProductsClient) ValidateMoveEligibility(ctx context.Context, billingAccountName string, productName string, parameters MoveProductRequest, options *ProductsClientValidateMoveEligibilityOptions) (ProductsClientValidateMoveEligibilityResponse, error)
ValidateMoveEligibility - 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- productName - The ID that uniquely identifies a product.
- parameters - The properties of the product to initiate a transfer.
- options - ProductsClientValidateMoveEligibilityOptions contains the optional parameters for the ProductsClient.ValidateMoveEligibility method.
Example (ProductValidateMoveFailure) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productValidateMoveFailure.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().ValidateMoveEligibility(ctx, "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "6b96d3f2-9008-4a9d-912f-f87744185aa3", armbilling.MoveProductRequest{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), }, 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.MoveProductEligibilityResult = armbilling.MoveProductEligibilityResult{ // ErrorDetails: &armbilling.MoveProductEligibilityResultErrorDetails{ // Code: to.Ptr(armbilling.MoveValidationErrorCodeProductInactive), // Message: to.Ptr("Invoice Sections can only be changed for active products."), // }, // } }
Output:
Example (ProductValidateMoveSuccess) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productValidateMoveSuccess.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().ValidateMoveEligibility(ctx, "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "6b96d3f2-9008-4a9d-912f-f87744185aa3", armbilling.MoveProductRequest{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), }, 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.MoveProductEligibilityResult = armbilling.MoveProductEligibilityResult{ // IsMoveEligible: to.Ptr(true), // } }
Output:
type ProductsClientBeginMoveOptions ¶ added in v1.0.0
type ProductsClientBeginMoveOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ProductsClientBeginMoveOptions contains the optional parameters for the ProductsClient.BeginMove method.
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 { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
ProductsClientListByBillingAccountOptions contains the optional parameters for the ProductsClient.NewListByBillingAccountPager method.
type ProductsClientListByBillingAccountResponse ¶ added in v0.2.0
type ProductsClientListByBillingAccountResponse struct { // A container for a list of resources ProductListResult }
ProductsClientListByBillingAccountResponse contains the response from method ProductsClient.NewListByBillingAccountPager.
type ProductsClientListByBillingProfileOptions ¶ added in v0.2.0
type ProductsClientListByBillingProfileOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
ProductsClientListByBillingProfileOptions contains the optional parameters for the ProductsClient.NewListByBillingProfilePager method.
type ProductsClientListByBillingProfileResponse ¶ added in v0.2.0
type ProductsClientListByBillingProfileResponse struct { // A container for a list of resources ProductListResult }
ProductsClientListByBillingProfileResponse contains the response from method ProductsClient.NewListByBillingProfilePager.
type ProductsClientListByCustomerOptions ¶ added in v0.2.0
type ProductsClientListByCustomerOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
ProductsClientListByCustomerOptions contains the optional parameters for the ProductsClient.NewListByCustomerPager method.
type ProductsClientListByCustomerResponse ¶ added in v0.2.0
type ProductsClientListByCustomerResponse struct { // A container for a list of resources ProductListResult }
ProductsClientListByCustomerResponse contains the response from method ProductsClient.NewListByCustomerPager.
type ProductsClientListByInvoiceSectionOptions ¶ added in v0.2.0
type ProductsClientListByInvoiceSectionOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
ProductsClientListByInvoiceSectionOptions contains the optional parameters for the ProductsClient.NewListByInvoiceSectionPager method.
type ProductsClientListByInvoiceSectionResponse ¶ added in v0.2.0
type ProductsClientListByInvoiceSectionResponse struct { // A container for a list of resources ProductListResult }
ProductsClientListByInvoiceSectionResponse contains the response from method ProductsClient.NewListByInvoiceSectionPager.
type ProductsClientMoveResponse ¶ added in v0.2.0
type ProductsClientMoveResponse struct { // A product. Product }
ProductsClientMoveResponse contains the response from method ProductsClient.BeginMove.
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 ProductsClientValidateMoveEligibilityOptions ¶ added in v1.0.0
type ProductsClientValidateMoveEligibilityOptions struct { }
ProductsClientValidateMoveEligibilityOptions contains the optional parameters for the ProductsClient.ValidateMoveEligibility method.
type ProductsClientValidateMoveEligibilityResponse ¶ added in v1.0.0
type ProductsClientValidateMoveEligibilityResponse struct { // Result of the transfer eligibility validation. MoveProductEligibilityResult }
ProductsClientValidateMoveEligibilityResponse contains the response from method ProductsClient.ValidateMoveEligibility.
type Profile ¶ added in v0.2.0
type Profile struct { // A billing profile. Properties *ProfileProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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 ProfileInfo ¶ added in v0.3.0
type ProfileInfo struct { // The fully qualified ID that uniquely identifies a billing account. BillingAccountID *string // The name of the billing profile. BillingProfileDisplayName *string // The friendly ID that uniquely identifies a billing profile. BillingProfileID *string // The fully qualified ID that uniquely identifies a billing profile. BillingProfileSystemID *string // Billing account name. 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; The list of resources. Value []*Profile }
ProfileListResult - A container for a list of resources
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 ProfilePolicy ¶ added in v1.0.0
type ProfilePolicy struct { // A policy at billing profile scope. Properties *ProfilePolicyProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
ProfilePolicy - A policy at billing profile scope.
func (ProfilePolicy) MarshalJSON ¶ added in v1.0.0
func (p ProfilePolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfilePolicy.
func (*ProfilePolicy) UnmarshalJSON ¶ added in v1.0.0
func (p *ProfilePolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePolicy.
type ProfilePolicyProperties ¶ added in v1.0.0
type ProfilePolicyProperties struct { // The policies for Enterprise Agreement enrollments. EnterpriseAgreementPolicies *ProfilePolicyPropertiesEnterpriseAgreementPolicies // The policy that controls invoice section label management at invoice section scope. This is allowed by default. InvoiceSectionLabelManagement *InvoiceSectionLabelManagementPolicy // The policy that controls whether Azure marketplace purchases are allowed. MarketplacePurchases *MarketplacePurchasesPolicy // List of all policies defined at the billing scope. Policies []*PolicySummary // The policy that controls whether Azure reservation purchases are allowed. ReservationPurchases *ReservationPurchasesPolicy // The policy that controls whether users with Azure savings plan purchase are allowed. SavingsPlanPurchases *SavingsPlanPurchasesPolicy // The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. ViewCharges *ViewChargesPolicy // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState }
ProfilePolicyProperties - A policy at billing profile scope.
func (ProfilePolicyProperties) MarshalJSON ¶ added in v1.0.0
func (p ProfilePolicyProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfilePolicyProperties.
func (*ProfilePolicyProperties) UnmarshalJSON ¶ added in v1.0.0
func (p *ProfilePolicyProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePolicyProperties.
type ProfilePolicyPropertiesEnterpriseAgreementPolicies ¶ added in v1.0.0
type ProfilePolicyPropertiesEnterpriseAgreementPolicies struct { // The policy that controls whether account owner can view charges. AccountOwnerViewCharges *EnrollmentAccountOwnerViewCharges // The state showing the enrollment auth level. AuthenticationType *EnrollmentAuthLevelState // The policy that controls whether department admin can view charges. DepartmentAdminViewCharges *EnrollmentDepartmentAdminViewCharges }
ProfilePolicyPropertiesEnterpriseAgreementPolicies - The policies for Enterprise Agreement enrollments.
func (ProfilePolicyPropertiesEnterpriseAgreementPolicies) MarshalJSON ¶ added in v1.0.0
func (p ProfilePolicyPropertiesEnterpriseAgreementPolicies) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfilePolicyPropertiesEnterpriseAgreementPolicies.
func (*ProfilePolicyPropertiesEnterpriseAgreementPolicies) UnmarshalJSON ¶ added in v1.0.0
func (p *ProfilePolicyPropertiesEnterpriseAgreementPolicies) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePolicyPropertiesEnterpriseAgreementPolicies.
type ProfileProperties ¶ added in v0.2.0
type ProfileProperties struct { // Billing address. BillTo *ProfilePropertiesBillTo // The current payment term of the billing profile. CurrentPaymentTerm *ProfilePropertiesCurrentPaymentTerm // The name of the billing profile. DisplayName *string // Information about the enabled azure plans. EnabledAzurePlans []*AzurePlan // Identifies the billing profile that is linked to another billing profile in indirect purchase motion. IndirectRelationshipInfo *ProfilePropertiesIndirectRelationshipInfo // Flag controlling whether the invoices for the billing profile are sent through email. InvoiceEmailOptIn *bool // The list of email addresses to receive invoices by email for the billing profile. InvoiceRecipients []*string // The default purchase order number that will appear on the invoices generated for the billing profile. PoNumber *string // The default address where the products are shipped, or the services are being used. If a ship to is not specified for a // product or a subscription, then this address will be used. ShipTo *ProfilePropertiesShipTo // The address of the individual or organization that is responsible for the billing account. SoldTo *ProfilePropertiesSoldTo // Dictionary of metadata associated with the resource. 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 billing relationship represented by the billing profile. The billing relationship may be between // Microsoft, the customer, and/or a third-party. 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; The day of the month when the invoice for the billing profile is generated. InvoiceDay *int32 // READ-ONLY; The other payment terms of the billing profile. OtherPaymentTerms []*PaymentTerm // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState // READ-ONLY; The billing profile spending limit. SpendingLimit *SpendingLimit // READ-ONLY; The details of billing profile spending limit. SpendingLimitDetails []*SpendingLimitDetails // READ-ONLY; The status of the billing profile. Status *BillingProfileStatus // READ-ONLY; Reason for the specified billing profile status. StatusReasonCode *BillingProfileStatusReasonCode // 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 []*string }
ProfileProperties - A 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 ProfilePropertiesBillTo ¶ added in v1.0.0
type ProfilePropertiesBillTo struct { // REQUIRED; Address line 1. AddressLine1 *string // REQUIRED; Country code uses ISO 3166-1 Alpha-2 format. Country *string // Address line 2. AddressLine2 *string // Address line 3. AddressLine3 *string // Address city. City *string // Company name. Optional for MCA Individual (Pay-as-you-go). CompanyName *string // Address district. District *string // Email address. Email *string // First name. Optional for MCA Enterprise. FirstName *string // Indicates if the address is incomplete. IsValidAddress *bool // Last name. Optional for MCA Enterprise. LastName *string // Middle name. MiddleName *string // Phone number. PhoneNumber *string // Postal code. PostalCode *string // Address region. Region *string }
ProfilePropertiesBillTo - Billing address.
func (ProfilePropertiesBillTo) MarshalJSON ¶ added in v1.0.0
func (p ProfilePropertiesBillTo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfilePropertiesBillTo.
func (*ProfilePropertiesBillTo) UnmarshalJSON ¶ added in v1.0.0
func (p *ProfilePropertiesBillTo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePropertiesBillTo.
type ProfilePropertiesCurrentPaymentTerm ¶ added in v1.0.0
type ProfilePropertiesCurrentPaymentTerm struct { // The date on when the defined 'Payment Term' will end and is always in UTC. EndDate *time.Time // The date on when the defined 'Payment Term' will be effective from and is always in UTC. StartDate *time.Time // Represents duration in netXX format. Always in days. Term *string // READ-ONLY; Indicates payment term is the standard payment term. IsDefault *bool }
ProfilePropertiesCurrentPaymentTerm - The current payment term of the billing profile.
func (ProfilePropertiesCurrentPaymentTerm) MarshalJSON ¶ added in v1.0.0
func (p ProfilePropertiesCurrentPaymentTerm) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfilePropertiesCurrentPaymentTerm.
func (*ProfilePropertiesCurrentPaymentTerm) UnmarshalJSON ¶ added in v1.0.0
func (p *ProfilePropertiesCurrentPaymentTerm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePropertiesCurrentPaymentTerm.
type ProfilePropertiesIndirectRelationshipInfo ¶ added in v1.0.0
type ProfilePropertiesIndirectRelationshipInfo 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 }
ProfilePropertiesIndirectRelationshipInfo - Identifies the billing profile that is linked to another billing profile in indirect purchase motion.
func (ProfilePropertiesIndirectRelationshipInfo) MarshalJSON ¶ added in v1.0.0
func (p ProfilePropertiesIndirectRelationshipInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfilePropertiesIndirectRelationshipInfo.
func (*ProfilePropertiesIndirectRelationshipInfo) UnmarshalJSON ¶ added in v1.0.0
func (p *ProfilePropertiesIndirectRelationshipInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePropertiesIndirectRelationshipInfo.
type ProfilePropertiesShipTo ¶ added in v1.0.0
type ProfilePropertiesShipTo struct { // REQUIRED; Address line 1. AddressLine1 *string // REQUIRED; Country code uses ISO 3166-1 Alpha-2 format. Country *string // Address line 2. AddressLine2 *string // Address line 3. AddressLine3 *string // Address city. City *string // Company name. Optional for MCA Individual (Pay-as-you-go). CompanyName *string // Address district. District *string // Email address. Email *string // First name. Optional for MCA Enterprise. FirstName *string // Indicates if the address is incomplete. IsValidAddress *bool // Last name. Optional for MCA Enterprise. LastName *string // Middle name. MiddleName *string // Phone number. PhoneNumber *string // Postal code. PostalCode *string // Address region. Region *string }
ProfilePropertiesShipTo - The default address where the products are shipped, or the services are being used. If a ship to is not specified for a product or a subscription, then this address will be used.
func (ProfilePropertiesShipTo) MarshalJSON ¶ added in v1.0.0
func (p ProfilePropertiesShipTo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfilePropertiesShipTo.
func (*ProfilePropertiesShipTo) UnmarshalJSON ¶ added in v1.0.0
func (p *ProfilePropertiesShipTo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePropertiesShipTo.
type ProfilePropertiesSoldTo ¶ added in v1.0.0
type ProfilePropertiesSoldTo struct { // REQUIRED; Address line 1. AddressLine1 *string // REQUIRED; Country code uses ISO 3166-1 Alpha-2 format. Country *string // Address line 2. AddressLine2 *string // Address line 3. AddressLine3 *string // Address city. City *string // Company name. Optional for MCA Individual (Pay-as-you-go). CompanyName *string // Address district. District *string // Email address. Email *string // First name. Optional for MCA Enterprise. FirstName *string // Indicates if the address is incomplete. IsValidAddress *bool // Last name. Optional for MCA Enterprise. LastName *string // Middle name. MiddleName *string // Phone number. PhoneNumber *string // Postal code. PostalCode *string // Address region. Region *string }
ProfilePropertiesSoldTo - The address of the individual or organization that is responsible for the billing account.
func (ProfilePropertiesSoldTo) MarshalJSON ¶ added in v1.0.0
func (p ProfilePropertiesSoldTo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfilePropertiesSoldTo.
func (*ProfilePropertiesSoldTo) UnmarshalJSON ¶ added in v1.0.0
func (p *ProfilePropertiesSoldTo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePropertiesSoldTo.
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 and Microsoft Partner Agreement. If you are a MCA Individual (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- parameters - A 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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesCreateOrUpdate.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", armbilling.Profile{ Properties: &armbilling.ProfileProperties{ BillTo: &armbilling.ProfilePropertiesBillTo{ 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"), IsValidAddress: to.Ptr(true), LastName: to.Ptr("User"), PhoneNumber: to.Ptr("000-000-0000"), PostalCode: to.Ptr("00000"), Region: to.Ptr("WA"), }, DisplayName: to.Ptr("Billing Profile 1"), EnabledAzurePlans: []*armbilling.AzurePlan{ { SKUID: to.Ptr("0001"), }, { SKUID: to.Ptr("0002"), }}, InvoiceEmailOptIn: to.Ptr(true), PoNumber: to.Ptr("ABC12345"), ShipTo: &armbilling.ProfilePropertiesShipTo{ 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"), IsValidAddress: to.Ptr(true), LastName: to.Ptr("User"), PhoneNumber: to.Ptr("000-000-0000"), PostalCode: to.Ptr("00000"), 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.Profile = armbilling.Profile{ // Name: to.Ptr("xxxx-xxxx-xxx-xxx"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.ProfilePropertiesBillTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("Billing Profile 1"), // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // PoNumber: to.Ptr("ABC12345"), // ShipTo: &armbilling.ProfilePropertiesShipTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // Status: to.Ptr(armbilling.BillingProfileStatusActive), // SystemID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // } }
Output:
func (*ProfilesClient) BeginDelete ¶ added in v1.0.0
func (client *ProfilesClient) BeginDelete(ctx context.Context, billingAccountName string, billingProfileName string, options *ProfilesClientBeginDeleteOptions) (*runtime.Poller[ProfilesClientDeleteResponse], error)
BeginDelete - Deletes a billing profile. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesDelete.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.NewProfilesClient().BeginDelete(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*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 and Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-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 ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesGet.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", 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("xxxx-xxxx-xxx-xxx"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.ProfilePropertiesBillTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("Billing Profile 1"), // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceRecipients: []*string{ // to.Ptr("abc@contoso.com"), // to.Ptr("xyz@contoso.com")}, // PoNumber: to.Ptr("ABC12345"), // ShipTo: &armbilling.ProfilePropertiesShipTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // SoldTo: &armbilling.ProfilePropertiesSoldTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // SpendingLimitDetails: []*armbilling.SpendingLimitDetails{ // { // Type: to.Ptr(armbilling.SpendingLimitTypeFreeAccount), // Amount: to.Ptr[float32](200), // Currency: to.Ptr("USD"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T00:00:00.000Z"); return t}()), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // Status: to.Ptr(armbilling.SpendingLimitStatusActive), // }}, // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.BillingProfileStatusReasonCodePastDue), // SystemID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // } }
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 of type Microsoft Customer Agreement and Microsoft Partner Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - ProfilesClientListByBillingAccountOptions contains the optional parameters for the ProfilesClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.ProfilesClientListByBillingAccountOptions{IncludeDeleted: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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("xxxx-xxxx-xxx-xxx"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.ProfilePropertiesBillTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("Billing Profile 1"), // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceRecipients: []*string{ // to.Ptr("abc@contoso.com"), // to.Ptr("xyz@contoso.com")}, // PoNumber: to.Ptr("ABC12345"), // ShipTo: &armbilling.ProfilePropertiesShipTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // SoldTo: &armbilling.ProfilePropertiesSoldTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), // SpendingLimitDetails: []*armbilling.SpendingLimitDetails{ // { // Type: to.Ptr(armbilling.SpendingLimitTypeFreeAccount), // Amount: to.Ptr[float32](200), // Currency: to.Ptr("USD"), // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T00:00:00.000Z"); return t}()), // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // Status: to.Ptr(armbilling.SpendingLimitStatusActive), // }}, // Status: to.Ptr(armbilling.BillingProfileStatusWarned), // StatusReasonCode: to.Ptr(armbilling.BillingProfileStatusReasonCodePastDue), // SystemID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // }, // { // Name: to.Ptr("yyyy-yyyy-yyy-yyy"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/yyyy-yyyy-yyy-yyy"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.ProfilePropertiesBillTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("Billing Profile 2"), // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceRecipients: []*string{ // to.Ptr("abc@contoso.com"), // to.Ptr("xyz@contoso.com")}, // PoNumber: to.Ptr("ABC12345"), // ShipTo: &armbilling.ProfilePropertiesShipTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // SoldTo: &armbilling.ProfilePropertiesSoldTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // Status: to.Ptr(armbilling.BillingProfileStatusUnderReview), // StatusReasonCode: to.Ptr(armbilling.BillingProfileStatusReasonCodeUnusualActivity), // SystemID: to.Ptr("22222222-2222-2222-2222-222222222222"), // }, // }, // { // Name: to.Ptr("zzzz-zzzz-zzz-zzz"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/zzzz-zzzz-zzz-zzz"), // Properties: &armbilling.ProfileProperties{ // BillTo: &armbilling.ProfilePropertiesBillTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // Currency: to.Ptr("USD"), // DisplayName: to.Ptr("Billing Profile 1"), // HasReadAccess: to.Ptr(true), // InvoiceDay: to.Ptr[int32](5), // InvoiceEmailOptIn: to.Ptr(true), // InvoiceRecipients: []*string{ // to.Ptr("abc@contoso.com"), // to.Ptr("xyz@contoso.com")}, // PoNumber: to.Ptr("ABC12345"), // ShipTo: &armbilling.ProfilePropertiesShipTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // SoldTo: &armbilling.ProfilePropertiesSoldTo{ // 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"), // IsValidAddress: to.Ptr(true), // LastName: to.Ptr("User"), // PhoneNumber: to.Ptr("000-000-0000"), // PostalCode: to.Ptr("00000"), // Region: to.Ptr("WA"), // }, // Status: to.Ptr(armbilling.BillingProfileStatusActive), // SystemID: to.Ptr("33333333-3333-3333-3333-333333333333"), // }, // }}, // } } }
Output:
func (*ProfilesClient) ValidateDeleteEligibility ¶ added in v1.0.0
func (client *ProfilesClient) ValidateDeleteEligibility(ctx context.Context, billingAccountName string, billingProfileName string, options *ProfilesClientValidateDeleteEligibilityOptions) (ProfilesClientValidateDeleteEligibilityResponse, error)
ValidateDeleteEligibility - Validates if the billing profile can be deleted. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - ProfilesClientValidateDeleteEligibilityOptions contains the optional parameters for the ProfilesClient.ValidateDeleteEligibility method.
Example (BillingProfilesValidateDeleteEligibilityFailure) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesValidateDeleteEligibilityFailure.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().ValidateDeleteEligibility(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", 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.DeleteBillingProfileEligibilityResult = armbilling.DeleteBillingProfileEligibilityResult{ // EligibilityDetails: []*armbilling.DeleteBillingProfileEligibilityDetail{ // { // Code: to.Ptr(armbilling.DeleteBillingProfileEligibilityCodeActiveBillingSubscriptions), // Message: to.Ptr("There are active or disabled subscriptions assigned to the invoice section. Either move the subscription to another invoice section or delete the subscriptions and then try deleting the invoice section."), // }, // { // Code: to.Ptr(armbilling.DeleteBillingProfileEligibilityCodeLastBillingProfile), // Message: to.Ptr("Billing profile cannot be deleted as this is the only billing profile in this billing account."), // }, // { // Code: to.Ptr(armbilling.DeleteBillingProfileEligibilityCodeOutstandingCharges), // Message: to.Ptr("Billing Profile cannot be deleted as there are outstanding charges on this billing profile."), // }, // { // Code: to.Ptr(armbilling.DeleteBillingProfileEligibilityCodePendingCharges), // Message: to.Ptr("Billing Profile cannot be deleted as there are pending charges accumulating on this billing profile."), // }, // { // Code: to.Ptr(armbilling.DeleteBillingProfileEligibilityCodeReservedInstances), // Message: to.Ptr("Billing Profile cannot be deleted as there are reserved assets with a billing plan."), // }}, // EligibilityStatus: to.Ptr(armbilling.DeleteBillingProfileEligibilityStatusNotAllowed), // } }
Output:
Example (BillingProfilesValidateDeleteEligibilitySuccess) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesValidateDeleteEligibilitySuccess.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().ValidateDeleteEligibility(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", 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.DeleteBillingProfileEligibilityResult = armbilling.DeleteBillingProfileEligibilityResult{ // } }
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 ProfilesClientBeginDeleteOptions ¶ added in v1.0.0
type ProfilesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method.
type ProfilesClientCreateOrUpdateResponse ¶ added in v0.2.0
type ProfilesClientCreateOrUpdateResponse struct { // A billing profile. Profile }
ProfilesClientCreateOrUpdateResponse contains the response from method ProfilesClient.BeginCreateOrUpdate.
type ProfilesClientDeleteResponse ¶ added in v1.0.0
type ProfilesClientDeleteResponse struct { }
ProfilesClientDeleteResponse contains the response from method ProfilesClient.BeginDelete.
type ProfilesClientGetOptions ¶ added in v0.2.0
type ProfilesClientGetOptions struct { }
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 { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Can be used to get deleted billing profiles. IncludeDeleted *bool // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
ProfilesClientListByBillingAccountOptions contains the optional parameters for the ProfilesClient.NewListByBillingAccountPager method.
type ProfilesClientListByBillingAccountResponse ¶ added in v0.2.0
type ProfilesClientListByBillingAccountResponse struct { // A container for a list of resources ProfileListResult }
ProfilesClientListByBillingAccountResponse contains the response from method ProfilesClient.NewListByBillingAccountPager.
type ProfilesClientValidateDeleteEligibilityOptions ¶ added in v1.0.0
type ProfilesClientValidateDeleteEligibilityOptions struct { }
ProfilesClientValidateDeleteEligibilityOptions contains the optional parameters for the ProfilesClient.ValidateDeleteEligibility method.
type ProfilesClientValidateDeleteEligibilityResponse ¶ added in v1.0.0
type ProfilesClientValidateDeleteEligibilityResponse struct { // Eligibility to delete a billing profile result. DeleteBillingProfileEligibilityResult }
ProfilesClientValidateDeleteEligibilityResponse contains the response from method ProfilesClient.ValidateDeleteEligibility.
type Property ¶ added in v0.2.0
type Property struct { // A billing property. Properties *PropertyProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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 a billing 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 - Gets the billing properties for a subscription If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- options - PropertyClientGetOptions contains the optional parameters for the PropertyClient.Get method.
Example (BillingPropertyGetMca) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMCA.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, &armbilling.PropertyClientGetOptions{IncludeBillingCountry: nil, IncludeTransitionStatus: 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/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingProperty/default"), // Properties: &armbilling.PropertyProperties{ // BillingAccountAgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // BillingAccountDisplayName: to.Ptr("My Account"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000"), // BillingAccountSoldToCountry: to.Ptr("US"), // BillingAccountType: to.Ptr(armbilling.AccountTypeBusiness), // BillingProfileDisplayName: to.Ptr("Contoso"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000/billingProfiles/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileSpendingLimit: to.Ptr(armbilling.SpendingLimitOff), // BillingProfileStatus: to.Ptr(armbilling.BillingProfileStatusActive), // CostCenter: to.Ptr("1010"), // InvoiceSectionDisplayName: to.Ptr("Operations"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000/billingProfiles/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionBillingStatusDetails: []*armbilling.SubscriptionStatusDetails{ // { // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-01T17:32:28.000Z"); return t}()), // Reason: to.Ptr(armbilling.SubscriptionStatusReasonCancelled), // }}, // SubscriptionBillingType: to.Ptr(armbilling.SubscriptionBillingTypeFree), // SubscriptionWorkloadType: to.Ptr(armbilling.SubscriptionWorkloadTypeProduction), // }, // } }
Output:
Example (BillingPropertyGetMosp) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMOSP.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, &armbilling.PropertyClientGetOptions{IncludeBillingCountry: nil, IncludeTransitionStatus: 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/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingProperty/default"), // Properties: &armbilling.PropertyProperties{ // BillingAccountAgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftOnlineServicesProgram), // BillingAccountDisplayName: to.Ptr("My Account"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000"), // BillingAccountSoldToCountry: to.Ptr("US"), // BillingAccountType: to.Ptr(armbilling.AccountTypeIndividual), // SubscriptionBillingType: to.Ptr(armbilling.SubscriptionBillingTypeFree), // SubscriptionServiceUsageAddress: &armbilling.PropertyPropertiesSubscriptionServiceUsageAddress{ // AddressLine1: to.Ptr("Address line 1"), // AddressLine2: to.Ptr("Address line 2"), // City: to.Ptr("City"), // Country: to.Ptr("US"), // FirstName: to.Ptr("Jenny"), // LastName: to.Ptr("Doe"), // MiddleName: to.Ptr("Ann"), // PostalCode: to.Ptr("12345"), // Region: to.Ptr("State"), // }, // SubscriptionWorkloadType: to.Ptr(armbilling.SubscriptionWorkloadTypeProduction), // }, // } }
Output:
Example (BillingPropertyGetMpa) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMPA.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, &armbilling.PropertyClientGetOptions{IncludeBillingCountry: nil, IncludeTransitionStatus: 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/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingProperty/default"), // Properties: &armbilling.PropertyProperties{ // BillingAccountAgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // BillingAccountDisplayName: to.Ptr("My Account"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000"), // BillingAccountSoldToCountry: to.Ptr("US"), // BillingAccountType: to.Ptr(armbilling.AccountTypeBusiness), // BillingProfileDisplayName: to.Ptr("Contoso"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000/billingProfiles/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileSpendingLimit: to.Ptr(armbilling.SpendingLimitOff), // BillingProfileStatus: to.Ptr(armbilling.BillingProfileStatusActive), // CostCenter: to.Ptr("1010"), // CustomerDisplayName: to.Ptr("Operations"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000/billingProfiles/billingProfiles/xxxx-xxxx-xxx-xxx/customers/yyyy-yyyy-yyy-yyy"), // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionBillingStatusDetails: []*armbilling.SubscriptionStatusDetails{ // { // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-01T17:32:28.000Z"); return t}()), // Reason: to.Ptr(armbilling.SubscriptionStatusReasonCancelled), // }}, // SubscriptionBillingType: to.Ptr(armbilling.SubscriptionBillingTypeFree), // SubscriptionWorkloadType: to.Ptr(armbilling.SubscriptionWorkloadTypeProduction), // }, // } }
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 for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- parameters - A billing property.
- options - PropertyClientUpdateOptions contains the optional parameters for the PropertyClient.Update method.
Example (BillingPropertyPatchCostCenter) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyPatchCostCenter.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/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingProperty/default"), // Properties: &armbilling.PropertyProperties{ // BillingAccountAgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), // BillingAccountDisplayName: to.Ptr("My Account"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000"), // BillingAccountSoldToCountry: to.Ptr("US"), // BillingAccountType: to.Ptr(armbilling.AccountTypeBusiness), // BillingProfileDisplayName: to.Ptr("Contoso"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000/billingProfiles/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileSpendingLimit: to.Ptr(armbilling.SpendingLimitOff), // BillingProfileStatus: to.Ptr(armbilling.BillingProfileStatusActive), // CostCenter: to.Ptr("1010"), // InvoiceSectionDisplayName: to.Ptr("Operations"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000/billingProfiles/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionBillingStatusDetails: []*armbilling.SubscriptionStatusDetails{ // { // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-01T17:32:28.000Z"); return t}()), // Reason: to.Ptr(armbilling.SubscriptionStatusReasonCancelled), // }}, // SubscriptionBillingType: to.Ptr(armbilling.SubscriptionBillingTypeFree), // SubscriptionWorkloadType: to.Ptr(armbilling.SubscriptionWorkloadTypeProduction), // }, // } }
Output:
Example (BillingPropertyPatchSubscriptionServiceUsageAddress) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyPatchSubscriptionServiceUsageAddress.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{ SubscriptionServiceUsageAddress: &armbilling.PropertyPropertiesSubscriptionServiceUsageAddress{ AddressLine1: to.Ptr("Address line 1"), AddressLine2: to.Ptr("Address line 2"), City: to.Ptr("City"), Country: to.Ptr("US"), FirstName: to.Ptr("Jenny"), LastName: to.Ptr("Doe"), MiddleName: to.Ptr("Ann"), PostalCode: to.Ptr("12345"), Region: to.Ptr("State"), }, }, }, 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/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingProperty/default"), // Properties: &armbilling.PropertyProperties{ // BillingAccountAgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftOnlineServicesProgram), // BillingAccountDisplayName: to.Ptr("My Account"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000"), // BillingAccountSoldToCountry: to.Ptr("US"), // BillingAccountType: to.Ptr(armbilling.AccountTypeIndividual), // SubscriptionBillingType: to.Ptr(armbilling.SubscriptionBillingTypeFree), // SubscriptionServiceUsageAddress: &armbilling.PropertyPropertiesSubscriptionServiceUsageAddress{ // AddressLine1: to.Ptr("Address line 1"), // AddressLine2: to.Ptr("Address line 2"), // City: to.Ptr("City"), // Country: to.Ptr("US"), // FirstName: to.Ptr("Jenny"), // LastName: to.Ptr("Doe"), // MiddleName: to.Ptr("Ann"), // PostalCode: to.Ptr("12345"), // Region: to.Ptr("State"), // }, // SubscriptionWorkloadType: to.Ptr(armbilling.SubscriptionWorkloadTypeProduction), // }, // } }
Output:
type PropertyClientGetOptions ¶ added in v0.2.0
type PropertyClientGetOptions struct { // A flag that specifies whether or not to include billing country. IncludeBillingCountry *bool // A flag that specifies whether or not to include transition status for billing accounts with agreement type Microsoft Customer // Agreement. IncludeTransitionStatus *bool }
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. Available for agreement type Microsoft Customer Agreement and Microsoft Partner // Agreement. This property can be updated via patch. CostCenter *string // The enrollment details for the subscription. Available for billing accounts with agreement type Enterprise Agreement. EnrollmentDetails *PropertyPropertiesEnrollmentDetails // The address of the individual or organization where service subscription is being used. Available for agreement type Microsoft // Online Services Program. This property can be updated via patch. SubscriptionServiceUsageAddress *PropertyPropertiesSubscriptionServiceUsageAddress // READ-ONLY; Notification email address for legacy account. Available for agreement type Microsoft Online Services Program. AccountAdminNotificationEmailAddress *string // READ-ONLY; The type of agreement. BillingAccountAgreementType *AgreementType // READ-ONLY; The name of the billing account. BillingAccountDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a billing account. BillingAccountID *string // READ-ONLY; The country of the individual or organization that is responsible for the billing account. BillingAccountSoldToCountry *string // READ-ONLY; The current status of the billing account. BillingAccountStatus *AccountStatus // READ-ONLY; Reason for the specified billing account status. BillingAccountStatusReasonCode *BillingAccountStatusReasonCode // READ-ONLY; The tier of the account. BillingAccountSubType *AccountSubType // READ-ONLY; The type of customer. BillingAccountType *AccountType // READ-ONLY; The billing currency for the subscription. Available for billing accounts with agreement type Enterprise Agreement BillingCurrency *string // READ-ONLY; The name of the billing profile. BillingProfileDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a billing profile. BillingProfileID *string // READ-ONLY; The payment method family of the primary payment method for the billing profile. BillingProfilePaymentMethodFamily *PaymentMethodFamily // READ-ONLY; The payment method type of the primary payment method for the billing profile. BillingProfilePaymentMethodType *string // READ-ONLY; The billing profile spending limit. BillingProfileSpendingLimit *SpendingLimit // READ-ONLY; The details of billing profile spending limit. BillingProfileSpendingLimitDetails []*SpendingLimitDetails // 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 customer. CustomerDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a customer. CustomerID *string // READ-ONLY; Identifies the status of an customer. This is an upcoming property that will be populated in the future. CustomerStatus *CustomerStatus // READ-ONLY; The name of the invoice section. InvoiceSectionDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies an invoice section. InvoiceSectionID *string // READ-ONLY; Identifies the status of an invoice section. InvoiceSectionStatus *InvoiceSectionState // READ-ONLY; Reason for the specified invoice section status. InvoiceSectionStatusReasonCode *InvoiceSectionStateReasonCode // READ-ONLY; Indicates whether user is the account admin. IsAccountAdmin *bool // READ-ONLY; Specifies if the billing account for the subscription is transitioned from a Microsoft Online Service Program // to a Microsoft Customer Agreement (MCA) account. Will be present and value will be true if // its a transitioned billing account. IsTransitionedBillingAccount *bool // READ-ONLY; The ID that uniquely identifies a product. ProductID *string // READ-ONLY; The ID that uniquely identifies a product. ProductName *string // READ-ONLY; The sku description. SKUDescription *string // READ-ONLY; The ID that uniquely identifies a sku. SKUID *string // READ-ONLY; The subscription status. SubscriptionBillingStatus *BillingSubscriptionStatus // READ-ONLY; The reason codes for the subscription status. SubscriptionBillingStatusDetails []*SubscriptionStatusDetails // READ-ONLY; The type of billing subscription. SubscriptionBillingType *SubscriptionBillingType // READ-ONLY; The Azure workload type of the subscription. SubscriptionWorkloadType *SubscriptionWorkloadType }
PropertyProperties - A 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 PropertyPropertiesEnrollmentDetails ¶ added in v1.0.0
type PropertyPropertiesEnrollmentDetails struct { // The name of the department DepartmentDisplayName *string // The ID that uniquely identifies the department. DepartmentID *string // The name of the enrollment account. EnrollmentAccountDisplayName *string // The ID that uniquely identifies an enrollment account. EnrollmentAccountID *string // The status of the enrollment account. EnrollmentAccountStatus *string }
PropertyPropertiesEnrollmentDetails - The enrollment details for the subscription. Available for billing accounts with agreement type Enterprise Agreement.
func (PropertyPropertiesEnrollmentDetails) MarshalJSON ¶ added in v1.0.0
func (p PropertyPropertiesEnrollmentDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PropertyPropertiesEnrollmentDetails.
func (*PropertyPropertiesEnrollmentDetails) UnmarshalJSON ¶ added in v1.0.0
func (p *PropertyPropertiesEnrollmentDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PropertyPropertiesEnrollmentDetails.
type PropertyPropertiesSubscriptionServiceUsageAddress ¶ added in v1.0.0
type PropertyPropertiesSubscriptionServiceUsageAddress struct { // REQUIRED; Address line 1. AddressLine1 *string // REQUIRED; Country code uses ISO 3166-1 Alpha-2 format. Country *string // Address line 2. AddressLine2 *string // Address line 3. AddressLine3 *string // Address city. City *string // Company name. Optional for MCA Individual (Pay-as-you-go). CompanyName *string // Address district. District *string // Email address. Email *string // First name. Optional for MCA Enterprise. FirstName *string // Indicates if the address is incomplete. IsValidAddress *bool // Last name. Optional for MCA Enterprise. LastName *string // Middle name. MiddleName *string // Phone number. PhoneNumber *string // Postal code. PostalCode *string // Address region. Region *string }
PropertyPropertiesSubscriptionServiceUsageAddress - The address of the individual or organization where service subscription is being used. Available for agreement type Microsoft Online Services Program. This property can be updated via patch.
func (PropertyPropertiesSubscriptionServiceUsageAddress) MarshalJSON ¶ added in v1.0.0
func (p PropertyPropertiesSubscriptionServiceUsageAddress) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PropertyPropertiesSubscriptionServiceUsageAddress.
func (*PropertyPropertiesSubscriptionServiceUsageAddress) UnmarshalJSON ¶ added in v1.0.0
func (p *PropertyPropertiesSubscriptionServiceUsageAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PropertyPropertiesSubscriptionServiceUsageAddress.
type ProvisioningState ¶ added in v1.0.0
type ProvisioningState string
ProvisioningState - The provisioning state of the resource during a long-running operation.
const ( ProvisioningStateCanceled ProvisioningState = "Canceled" ProvisioningStateConfirmedBilling ProvisioningState = "ConfirmedBilling" ProvisioningStateCreated ProvisioningState = "Created" ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateExpired ProvisioningState = "Expired" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateNew ProvisioningState = "New" ProvisioningStatePending ProvisioningState = "Pending" ProvisioningStatePendingBilling ProvisioningState = "PendingBilling" ProvisioningStateProvisioning ProvisioningState = "Provisioning" ProvisioningStateSucceeded ProvisioningState = "Succeeded" )
func PossibleProvisioningStateValues ¶ added in v1.0.0
func PossibleProvisioningStateValues() []ProvisioningState
PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
type ProvisioningTenantState ¶ added in v1.0.0
type ProvisioningTenantState string
ProvisioningTenantState - The state determines whether subscriptions and licenses can be provisioned in the associated tenant. It can be set to 'Pending' to initiate a billing request.
const ( ProvisioningTenantStateActive ProvisioningTenantState = "Active" ProvisioningTenantStateBillingRequestDeclined ProvisioningTenantState = "BillingRequestDeclined" ProvisioningTenantStateBillingRequestExpired ProvisioningTenantState = "BillingRequestExpired" ProvisioningTenantStateNotRequested ProvisioningTenantState = "NotRequested" ProvisioningTenantStateOther ProvisioningTenantState = "Other" ProvisioningTenantStatePending ProvisioningTenantState = "Pending" ProvisioningTenantStateRevoked ProvisioningTenantState = "Revoked" )
func PossibleProvisioningTenantStateValues ¶ added in v1.0.0
func PossibleProvisioningTenantStateValues() []ProvisioningTenantState
PossibleProvisioningTenantStateValues returns the possible values for the ProvisioningTenantState const type.
type ProxyResource ¶ added in v1.0.0
type ProxyResource struct { // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location
func (ProxyResource) MarshalJSON ¶ added in v1.0.0
func (p ProxyResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProxyResource.
func (*ProxyResource) UnmarshalJSON ¶ added in v1.0.0
func (p *ProxyResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
type ProxyResourceWithTags ¶ added in v1.0.0
type ProxyResourceWithTags struct { // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
ProxyResourceWithTags - Common fields that are returned in the response for all Azure Resource Manager resources.
func (ProxyResourceWithTags) MarshalJSON ¶ added in v1.0.0
func (p ProxyResourceWithTags) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProxyResourceWithTags.
func (*ProxyResourceWithTags) UnmarshalJSON ¶ added in v1.0.0
func (p *ProxyResourceWithTags) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceWithTags.
type PurchaseRequest ¶ added in v1.0.0
type PurchaseRequest struct { // Purchase request properties. Properties *PurchaseRequestProperties // The SKU to be applied for this resource SKU *SKU }
PurchaseRequest - Purchase request.
func (PurchaseRequest) MarshalJSON ¶ added in v1.0.0
func (p PurchaseRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PurchaseRequest.
func (*PurchaseRequest) UnmarshalJSON ¶ added in v1.0.0
func (p *PurchaseRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PurchaseRequest.
type PurchaseRequestProperties ¶ added in v1.0.0
type PurchaseRequestProperties struct { // Properties specific to applied scope type. Not required if not applicable. AppliedScopeProperties *AppliedScopeProperties // Type of the Applied Scope. AppliedScopeType *AppliedScopeType // Represents the billing plan in ISO 8601 format. Required only for monthly purchases. BillingPlan *BillingPlan // Subscription that will be charged for purchasing SavingsPlan BillingScopeID *string // Commitment towards the benefit. Commitment *Commitment // Friendly name of the savings plan DisplayName *string // Setting this to true will automatically purchase a new benefit on the expiration date time. Renew *bool // Represents the Savings plan term in ISO 8601 format. Term *SavingsPlanTerm }
PurchaseRequestProperties - Purchase request properties.
func (PurchaseRequestProperties) MarshalJSON ¶ added in v1.0.0
func (p PurchaseRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PurchaseRequestProperties.
func (*PurchaseRequestProperties) UnmarshalJSON ¶ added in v1.0.0
func (p *PurchaseRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PurchaseRequestProperties.
type RebillDetails ¶
type RebillDetails struct { // READ-ONLY; The ID of credit note. CreditNoteDocumentID *string // READ-ONLY; The ID of invoice. InvoiceDocumentID *string // READ-ONLY; The rebill details of an invoice. RebillDetails *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 RecipientTransferDetails ¶ added in v1.0.0
type RecipientTransferDetails struct { // Details of the transfer. Properties *RecipientTransferProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
RecipientTransferDetails - Details of the transfer.
func (RecipientTransferDetails) MarshalJSON ¶ added in v1.0.0
func (r RecipientTransferDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RecipientTransferDetails.
func (*RecipientTransferDetails) UnmarshalJSON ¶ added in v1.0.0
func (r *RecipientTransferDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RecipientTransferDetails.
type RecipientTransferDetailsListResult ¶ added in v1.0.0
type RecipientTransferDetailsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of transfers received by caller. Value []*RecipientTransferDetails }
RecipientTransferDetailsListResult - The list of transfers received by caller.
func (RecipientTransferDetailsListResult) MarshalJSON ¶ added in v1.0.0
func (r RecipientTransferDetailsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RecipientTransferDetailsListResult.
func (*RecipientTransferDetailsListResult) UnmarshalJSON ¶ added in v1.0.0
func (r *RecipientTransferDetailsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RecipientTransferDetailsListResult.
type RecipientTransferProperties ¶ added in v1.0.0
type RecipientTransferProperties struct { // READ-ONLY; Type of subscriptions that can be transferred. AllowedProductType []*EligibleProductType // READ-ONLY; The email ID of the user who canceled the transfer request. CanceledBy *string // READ-ONLY; The customer tenant id. CustomerTenantID *string // READ-ONLY; Detailed transfer status. DetailedTransferStatus []*DetailedTransferStatus // READ-ONLY; The time at which the transfer request expires. ExpirationTime *time.Time // READ-ONLY; The type of customer who sent the transfer request. InitiatorCustomerType *InitiatorCustomerType // READ-ONLY; The email ID of the user who sent the transfer request. InitiatorEmailID *string // READ-ONLY; The email ID of the user to whom the transfer request was sent. RecipientEmailID *string // READ-ONLY; Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft Partner Agreement billing // account. ResellerID *string // READ-ONLY; Optional name of the reseller for transfer requests that are sent from Microsoft Partner Agreement billing account. ResellerName *string // READ-ONLY; List of supported account types. SupportedAccounts []*SupportedAccountType // READ-ONLY; Overall transfer status. TransferStatus *TransferStatus }
RecipientTransferProperties - Transfer Details.
func (RecipientTransferProperties) MarshalJSON ¶ added in v1.0.0
func (r RecipientTransferProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RecipientTransferProperties.
func (*RecipientTransferProperties) UnmarshalJSON ¶ added in v1.0.0
func (r *RecipientTransferProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RecipientTransferProperties.
type RecipientTransfersClient ¶ added in v1.0.0
type RecipientTransfersClient struct {
// contains filtered or unexported fields
}
RecipientTransfersClient contains the methods for the RecipientTransfers group. Don't use this type directly, use NewRecipientTransfersClient() instead.
func NewRecipientTransfersClient ¶ added in v1.0.0
func NewRecipientTransfersClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*RecipientTransfersClient, error)
NewRecipientTransfersClient creates a new instance of RecipientTransfersClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*RecipientTransfersClient) Accept ¶ added in v1.0.0
func (client *RecipientTransfersClient) Accept(ctx context.Context, transferName string, parameters AcceptTransferRequest, options *RecipientTransfersClientAcceptOptions) (RecipientTransfersClientAcceptResponse, error)
Accept - Accepts a transfer request. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- transferName - The ID that uniquely identifies a transfer request.
- parameters - Request parameters that are provided to the accept transfer operation.
- options - RecipientTransfersClientAcceptOptions contains the optional parameters for the RecipientTransfersClient.Accept method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersAccept.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.NewRecipientTransfersClient().Accept(ctx, "aabb123", armbilling.AcceptTransferRequest{ Properties: &armbilling.AcceptTransferProperties{ ProductDetails: []*armbilling.ProductDetails{ { ProductID: to.Ptr("subscriptionId"), ProductType: to.Ptr(armbilling.ProductTypeAzureSubscription), }, { ProductID: to.Ptr("reservedInstanceId"), ProductType: to.Ptr(armbilling.ProductTypeAzureReservation), }}, }, }, 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.RecipientTransferDetails = armbilling.RecipientTransferDetails{ // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/transfers/aabb123"), // Properties: &armbilling.RecipientTransferProperties{ // DetailedTransferStatus: []*armbilling.DetailedTransferStatus{ // { // ProductID: to.Ptr("subscriptionId"), // ProductName: to.Ptr("Azure subscription 1"), // ProductType: to.Ptr(armbilling.ProductTypeAzureSubscription), // SKUDescription: to.Ptr("MS-AZR-0017G"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }, // { // ProductID: to.Ptr("reservedInstanceId"), // ProductName: to.Ptr("Reservation name"), // ProductType: to.Ptr(armbilling.ProductTypeAzureReservation), // SKUDescription: to.Ptr("Standard_D2s_v3;VirtualMachines;P1Y"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }}, // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusInProgress), // }, // } }
Output:
func (*RecipientTransfersClient) Decline ¶ added in v1.0.0
func (client *RecipientTransfersClient) Decline(ctx context.Context, transferName string, options *RecipientTransfersClientDeclineOptions) (RecipientTransfersClientDeclineResponse, error)
Decline - Declines a transfer request. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- transferName - The ID that uniquely identifies a transfer request.
- options - RecipientTransfersClientDeclineOptions contains the optional parameters for the RecipientTransfersClient.Decline method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersDecline.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.NewRecipientTransfersClient().Decline(ctx, "aabb123", 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.RecipientTransferDetails = armbilling.RecipientTransferDetails{ // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/transfers/aabb123"), // Properties: &armbilling.RecipientTransferProperties{ // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusDeclined), // }, // } }
Output:
func (*RecipientTransfersClient) Get ¶ added in v1.0.0
func (client *RecipientTransfersClient) Get(ctx context.Context, transferName string, options *RecipientTransfersClientGetOptions) (RecipientTransfersClientGetResponse, error)
Get - Gets a transfer request by ID. The caller must be the recipient of the transfer request. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- transferName - The ID that uniquely identifies a transfer request.
- options - RecipientTransfersClientGetOptions contains the optional parameters for the RecipientTransfersClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersGet.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.NewRecipientTransfersClient().Get(ctx, "aabb123", 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.RecipientTransferDetails = armbilling.RecipientTransferDetails{ // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/transfers/aabb123"), // Properties: &armbilling.RecipientTransferProperties{ // DetailedTransferStatus: []*armbilling.DetailedTransferStatus{ // { // ProductID: to.Ptr("subscriptionId"), // ProductName: to.Ptr("Azure subscription 1"), // ProductType: to.Ptr(armbilling.ProductTypeAzureSubscription), // SKUDescription: to.Ptr("MS-AZR-0017G"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }, // { // ProductID: to.Ptr("reservedInstanceId"), // ProductName: to.Ptr("Reservation name"), // ProductType: to.Ptr(armbilling.ProductTypeAzureReservation), // SKUDescription: to.Ptr("Standard_D2s_v3;VirtualMachines;P1Y"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }}, // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusInProgress), // }, // } }
Output:
func (*RecipientTransfersClient) NewListPager ¶ added in v1.0.0
func (client *RecipientTransfersClient) NewListPager(options *RecipientTransfersClientListOptions) *runtime.Pager[RecipientTransfersClientListResponse]
NewListPager - Lists the transfer requests received by the caller.
Generated from API version 2024-04-01
- options - RecipientTransfersClientListOptions contains the optional parameters for the RecipientTransfersClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersList.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.NewRecipientTransfersClient().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.RecipientTransferDetailsListResult = armbilling.RecipientTransferDetailsListResult{ // Value: []*armbilling.RecipientTransferDetails{ // { // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/transfers/aabb123"), // Properties: &armbilling.RecipientTransferProperties{ // DetailedTransferStatus: []*armbilling.DetailedTransferStatus{ // { // ProductID: to.Ptr("subscriptionId"), // ProductName: to.Ptr("Azure subscription 1"), // ProductType: to.Ptr(armbilling.ProductTypeAzureSubscription), // SKUDescription: to.Ptr("MS-AZR-0017G"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }, // { // ProductID: to.Ptr("reservedInstanceId"), // ProductName: to.Ptr("Reservation name"), // ProductType: to.Ptr(armbilling.ProductType("ReservedInstance")), // SKUDescription: to.Ptr("Standard_D2s_v3;VirtualMachines;P1Y"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }}, // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusInProgress), // }, // }}, // } } }
Output:
func (*RecipientTransfersClient) Validate ¶ added in v1.0.0
func (client *RecipientTransfersClient) Validate(ctx context.Context, transferName string, parameters AcceptTransferRequest, options *RecipientTransfersClientValidateOptions) (RecipientTransfersClientValidateResponse, error)
Validate - Validates if a subscription or a reservation can be transferred. Use this operation to validate your subscriptions or reservation before using the accept transfer operation. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- transferName - The ID that uniquely identifies a transfer request.
- parameters - Request parameters that are provided to the validate transfer operation.
- options - RecipientTransfersClientValidateOptions contains the optional parameters for the RecipientTransfersClient.Validate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersValidate.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.NewRecipientTransfersClient().Validate(ctx, "aabb123", armbilling.AcceptTransferRequest{ Properties: &armbilling.AcceptTransferProperties{ ProductDetails: []*armbilling.ProductDetails{ { ProductID: to.Ptr("subscriptionId"), ProductType: to.Ptr(armbilling.ProductTypeAzureSubscription), }, { ProductID: to.Ptr("reservedInstanceId"), ProductType: to.Ptr(armbilling.ProductTypeAzureReservation), }}, }, }, 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.ValidateTransferListResponse = armbilling.ValidateTransferListResponse{ // Value: []*armbilling.ValidateTransferResponse{ // { // Properties: &armbilling.ValidateTransferResponseProperties{ // ProductID: to.Ptr("subscriptionId"), // Results: []*armbilling.ValidationResultProperties{ // { // Code: to.Ptr("NotIntendedRecipient"), // Level: to.Ptr("Error"), // Message: to.Ptr("Intended recipient is different."), // }}, // Status: to.Ptr("Failed"), // }, // }}, // } }
Output:
type RecipientTransfersClientAcceptOptions ¶ added in v1.0.0
type RecipientTransfersClientAcceptOptions struct { }
RecipientTransfersClientAcceptOptions contains the optional parameters for the RecipientTransfersClient.Accept method.
type RecipientTransfersClientAcceptResponse ¶ added in v1.0.0
type RecipientTransfersClientAcceptResponse struct { // Details of the transfer. RecipientTransferDetails }
RecipientTransfersClientAcceptResponse contains the response from method RecipientTransfersClient.Accept.
type RecipientTransfersClientDeclineOptions ¶ added in v1.0.0
type RecipientTransfersClientDeclineOptions struct { }
RecipientTransfersClientDeclineOptions contains the optional parameters for the RecipientTransfersClient.Decline method.
type RecipientTransfersClientDeclineResponse ¶ added in v1.0.0
type RecipientTransfersClientDeclineResponse struct { // Details of the transfer. RecipientTransferDetails }
RecipientTransfersClientDeclineResponse contains the response from method RecipientTransfersClient.Decline.
type RecipientTransfersClientGetOptions ¶ added in v1.0.0
type RecipientTransfersClientGetOptions struct { }
RecipientTransfersClientGetOptions contains the optional parameters for the RecipientTransfersClient.Get method.
type RecipientTransfersClientGetResponse ¶ added in v1.0.0
type RecipientTransfersClientGetResponse struct { // Details of the transfer. RecipientTransferDetails }
RecipientTransfersClientGetResponse contains the response from method RecipientTransfersClient.Get.
type RecipientTransfersClientListOptions ¶ added in v1.0.0
type RecipientTransfersClientListOptions struct { }
RecipientTransfersClientListOptions contains the optional parameters for the RecipientTransfersClient.NewListPager method.
type RecipientTransfersClientListResponse ¶ added in v1.0.0
type RecipientTransfersClientListResponse struct { // The list of transfers received by caller. RecipientTransferDetailsListResult }
RecipientTransfersClientListResponse contains the response from method RecipientTransfersClient.NewListPager.
type RecipientTransfersClientValidateOptions ¶ added in v1.0.0
type RecipientTransfersClientValidateOptions struct { }
RecipientTransfersClientValidateOptions contains the optional parameters for the RecipientTransfersClient.Validate method.
type RecipientTransfersClientValidateResponse ¶ added in v1.0.0
type RecipientTransfersClientValidateResponse struct { // Result of transfer validation. ValidateTransferListResponse }
RecipientTransfersClientValidateResponse contains the response from method RecipientTransfersClient.Validate.
type RefundDetailsSummary ¶ added in v1.0.0
type RefundDetailsSummary struct { // The amount refunded. AmountRefunded *RefundDetailsSummaryAmountRefunded // The amount of refund requested. AmountRequested *RefundDetailsSummaryAmountRequested // READ-ONLY; Date when the refund was approved. ApprovedOn *time.Time // READ-ONLY; Date when the refund was completed. CompletedOn *time.Time // READ-ONLY; The invoice ID of the rebill invoice for a refund. RebillInvoiceID *string // READ-ONLY; The ID of refund operation. RefundOperationID *string // READ-ONLY; The reason for refund. RefundReason *RefundReasonCode // READ-ONLY; The status of refund request. RefundStatus *RefundStatus // READ-ONLY; Date when the refund was requested. RequestedOn *time.Time // READ-ONLY; The number of transactions refunded. TransactionCount *int32 }
RefundDetailsSummary - The details of refund request.
func (RefundDetailsSummary) MarshalJSON ¶ added in v1.0.0
func (r RefundDetailsSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundDetailsSummary.
func (*RefundDetailsSummary) UnmarshalJSON ¶ added in v1.0.0
func (r *RefundDetailsSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundDetailsSummary.
type RefundDetailsSummaryAmountRefunded ¶ added in v1.0.0
type RefundDetailsSummaryAmountRefunded struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
RefundDetailsSummaryAmountRefunded - The amount refunded.
func (RefundDetailsSummaryAmountRefunded) MarshalJSON ¶ added in v1.0.0
func (r RefundDetailsSummaryAmountRefunded) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundDetailsSummaryAmountRefunded.
func (*RefundDetailsSummaryAmountRefunded) UnmarshalJSON ¶ added in v1.0.0
func (r *RefundDetailsSummaryAmountRefunded) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundDetailsSummaryAmountRefunded.
type RefundDetailsSummaryAmountRequested ¶ added in v1.0.0
type RefundDetailsSummaryAmountRequested struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
RefundDetailsSummaryAmountRequested - The amount of refund requested.
func (RefundDetailsSummaryAmountRequested) MarshalJSON ¶ added in v1.0.0
func (r RefundDetailsSummaryAmountRequested) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundDetailsSummaryAmountRequested.
func (*RefundDetailsSummaryAmountRequested) UnmarshalJSON ¶ added in v1.0.0
func (r *RefundDetailsSummaryAmountRequested) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundDetailsSummaryAmountRequested.
type RefundReasonCode ¶ added in v1.0.0
type RefundReasonCode string
RefundReasonCode - The reason for refund.
const ( RefundReasonCodeAccidentalConversion RefundReasonCode = "AccidentalConversion" RefundReasonCodeAccidentalPurchase RefundReasonCode = "AccidentalPurchase" RefundReasonCodeForgotToCancel RefundReasonCode = "ForgotToCancel" RefundReasonCodeOther RefundReasonCode = "Other" RefundReasonCodeUnclearDocumentation RefundReasonCode = "UnclearDocumentation" RefundReasonCodeUnclearPricing RefundReasonCode = "UnclearPricing" )
func PossibleRefundReasonCodeValues ¶ added in v1.0.0
func PossibleRefundReasonCodeValues() []RefundReasonCode
PossibleRefundReasonCodeValues returns the possible values for the RefundReasonCode const type.
type RefundStatus ¶ added in v1.0.0
type RefundStatus string
RefundStatus - The status of refund request.
const ( RefundStatusApproved RefundStatus = "Approved" RefundStatusCancelled RefundStatus = "Cancelled" RefundStatusCompleted RefundStatus = "Completed" RefundStatusDeclined RefundStatus = "Declined" RefundStatusExpired RefundStatus = "Expired" RefundStatusOther RefundStatus = "Other" RefundStatusPending RefundStatus = "Pending" )
func PossibleRefundStatusValues ¶ added in v1.0.0
func PossibleRefundStatusValues() []RefundStatus
PossibleRefundStatusValues returns the possible values for the RefundStatus const type.
type RefundTransactionDetails ¶ added in v1.0.0
type RefundTransactionDetails struct { // The amount refunded. AmountRefunded *RefundTransactionDetailsAmountRefunded // The amount of refund requested. AmountRequested *RefundTransactionDetailsAmountRequested // The ID of refund operation. RefundOperationID *string }
RefundTransactionDetails - The refund details of a transaction.
func (RefundTransactionDetails) MarshalJSON ¶ added in v1.0.0
func (r RefundTransactionDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundTransactionDetails.
func (*RefundTransactionDetails) UnmarshalJSON ¶ added in v1.0.0
func (r *RefundTransactionDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundTransactionDetails.
type RefundTransactionDetailsAmountRefunded ¶ added in v1.0.0
type RefundTransactionDetailsAmountRefunded struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
RefundTransactionDetailsAmountRefunded - The amount refunded.
func (RefundTransactionDetailsAmountRefunded) MarshalJSON ¶ added in v1.0.0
func (r RefundTransactionDetailsAmountRefunded) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundTransactionDetailsAmountRefunded.
func (*RefundTransactionDetailsAmountRefunded) UnmarshalJSON ¶ added in v1.0.0
func (r *RefundTransactionDetailsAmountRefunded) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundTransactionDetailsAmountRefunded.
type RefundTransactionDetailsAmountRequested ¶ added in v1.0.0
type RefundTransactionDetailsAmountRequested struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
RefundTransactionDetailsAmountRequested - The amount of refund requested.
func (RefundTransactionDetailsAmountRequested) MarshalJSON ¶ added in v1.0.0
func (r RefundTransactionDetailsAmountRequested) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundTransactionDetailsAmountRequested.
func (*RefundTransactionDetailsAmountRequested) UnmarshalJSON ¶ added in v1.0.0
func (r *RefundTransactionDetailsAmountRequested) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundTransactionDetailsAmountRequested.
type RegistrationNumber ¶ added in v1.0.0
type RegistrationNumber struct { // The unique identification number of the organization linked with the billing account. ID *string // READ-ONLY; Identifies if the registration number is required for the billing account. Required *bool // READ-ONLY; The types of registration number allowed based on the country of the billing account. Type []*string }
RegistrationNumber - Describes the registration number of the organization linked with the billing account.
func (RegistrationNumber) MarshalJSON ¶ added in v1.0.0
func (r RegistrationNumber) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RegistrationNumber.
func (*RegistrationNumber) UnmarshalJSON ¶ added in v1.0.0
func (r *RegistrationNumber) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationNumber.
type RenewProperties ¶ added in v1.0.0
type RenewProperties struct { // Purchase request. PurchaseProperties *PurchaseRequest }
RenewProperties - Properties specific to renew.
func (RenewProperties) MarshalJSON ¶ added in v1.0.0
func (r RenewProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RenewProperties.
func (*RenewProperties) UnmarshalJSON ¶ added in v1.0.0
func (r *RenewProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RenewProperties.
type RenewPropertiesResponse ¶ added in v1.0.0
type RenewPropertiesResponse struct { // Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included. BillingCurrencyTotal *Price // Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked // price 30 days before expiry. PricingCurrencyTotal *Price // The request for reservation purchase PurchaseProperties *ReservationPurchaseRequest }
RenewPropertiesResponse - The renew properties for a reservation.
func (RenewPropertiesResponse) MarshalJSON ¶ added in v1.0.0
func (r RenewPropertiesResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RenewPropertiesResponse.
func (*RenewPropertiesResponse) UnmarshalJSON ¶ added in v1.0.0
func (r *RenewPropertiesResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RenewPropertiesResponse.
type RenewalTermDetails ¶ added in v1.0.0
type RenewalTermDetails struct { // The quantity of licenses or fulfillment units for the subscription. Quantity *int64 // READ-ONLY; The billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y BillingFrequency *string // READ-ONLY; Id of the product for which the subscription is purchased. ProductID *string // READ-ONLY; Type Id of the product for which the subscription is purchased. ProductTypeID *string // READ-ONLY; The SKU ID of the product for which the subscription is purchased. This field is is only available for Microsoft // Customer Agreement billing accounts. SKUID *string // READ-ONLY; The duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y TermDuration *string // READ-ONLY; End date of the term in UTC time. TermEndDate *time.Time }
RenewalTermDetails - Details for the next renewal term of a subscription.
func (RenewalTermDetails) MarshalJSON ¶ added in v1.0.0
func (r RenewalTermDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RenewalTermDetails.
func (*RenewalTermDetails) UnmarshalJSON ¶ added in v1.0.0
func (r *RenewalTermDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RenewalTermDetails.
type Request ¶ added in v1.0.0
type Request struct { // A request submitted by a user to manage billing. Users with an owner role on the scope can approve or decline these requests. Properties *RequestProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
Request - A request submitted by a user to manage billing. Users with an owner role on the scope can approve or decline these requests.
func (Request) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type Request.
func (*Request) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type Request.
type RequestListResult ¶ added in v1.0.0
type RequestListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*Request }
RequestListResult - A container for a list of resources
func (RequestListResult) MarshalJSON ¶ added in v1.0.0
func (r RequestListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RequestListResult.
func (*RequestListResult) UnmarshalJSON ¶ added in v1.0.0
func (r *RequestListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RequestListResult.
type RequestProperties ¶ added in v1.0.0
type RequestProperties struct { // Additional information for the billing request. AdditionalInformation map[string]*string // The principal of the entity who created the request. CreatedBy *RequestPropertiesCreatedBy // The reason to approve or decline the request. DecisionReason *string // Justification for submitting request. Justification *string // The principal of the entity who last updated the request. LastUpdatedBy *RequestPropertiesLastUpdatedBy // The recipients of the billing request. Recipients []*Principal // The billing scope for which the request was submitted (ex. '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'). RequestScope *string // The principal of the request reviewer. Will only be set if request is approved. ReviewedBy *RequestPropertiesReviewedBy // Status of billing request. Status *BillingRequestStatus // Type of billing request. Type *BillingRequestType // READ-ONLY; The name of the billing account. BillingAccountDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a billing account. BillingAccountID *string // READ-ONLY; The ID that uniquely identifies a billing account. BillingAccountName *string // READ-ONLY; The primary tenant ID of the billing account for which the billing request was submitted. BillingAccountPrimaryBillingTenantID *string // READ-ONLY; The name of the billing profile. BillingProfileDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a billing profile. BillingProfileID *string // READ-ONLY; The ID that uniquely identifies a billing profile. BillingProfileName *string // READ-ONLY; The billing scope for which the request will be applied. This is a read only property derived by the service. BillingScope *string // READ-ONLY; The date and time when the request was created. CreationDate *time.Time // READ-ONLY; The name of the customer. CustomerDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a customer. CustomerID *string // READ-ONLY; The ID that uniquely identifies a customer. CustomerName *string // READ-ONLY; The date and time when the request expires. ExpirationDate *time.Time // READ-ONLY; The name of the invoice section. InvoiceSectionDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies an invoice section. InvoiceSectionID *string // READ-ONLY; The ID that uniquely identifies an invoice section. InvoiceSectionName *string // READ-ONLY; Date and time of last update. LastUpdatedDate *time.Time // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState // READ-ONLY; The date and time when the request was reviewed. ReviewalDate *time.Time // READ-ONLY; The name of the billing subscription. SubscriptionDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a billing subscription. SubscriptionID *string // READ-ONLY; The ID that uniquely identifies a billing subscription. SubscriptionName *string }
RequestProperties - A request submitted by a user to manage billing. Users with an owner role on the scope can approve or decline these requests.
func (RequestProperties) MarshalJSON ¶ added in v1.0.0
func (r RequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RequestProperties.
func (*RequestProperties) UnmarshalJSON ¶ added in v1.0.0
func (r *RequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RequestProperties.
type RequestPropertiesCreatedBy ¶ added in v1.0.0
type RequestPropertiesCreatedBy struct { // The object id of the principal who has interacted with a billing entity. ObjectID *string // The tenant id of the principal who has interacted with a billing entity. TenantID *string // The user principal name of the principal who has interacted with a billing entity. Upn *string }
RequestPropertiesCreatedBy - The principal of the entity who created the request.
func (RequestPropertiesCreatedBy) MarshalJSON ¶ added in v1.0.0
func (r RequestPropertiesCreatedBy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RequestPropertiesCreatedBy.
func (*RequestPropertiesCreatedBy) UnmarshalJSON ¶ added in v1.0.0
func (r *RequestPropertiesCreatedBy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RequestPropertiesCreatedBy.
type RequestPropertiesLastUpdatedBy ¶ added in v1.0.0
type RequestPropertiesLastUpdatedBy struct { // The object id of the principal who has interacted with a billing entity. ObjectID *string // The tenant id of the principal who has interacted with a billing entity. TenantID *string // The user principal name of the principal who has interacted with a billing entity. Upn *string }
RequestPropertiesLastUpdatedBy - The principal of the entity who last updated the request.
func (RequestPropertiesLastUpdatedBy) MarshalJSON ¶ added in v1.0.0
func (r RequestPropertiesLastUpdatedBy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RequestPropertiesLastUpdatedBy.
func (*RequestPropertiesLastUpdatedBy) UnmarshalJSON ¶ added in v1.0.0
func (r *RequestPropertiesLastUpdatedBy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RequestPropertiesLastUpdatedBy.
type RequestPropertiesReviewedBy ¶ added in v1.0.0
type RequestPropertiesReviewedBy struct { // The object id of the principal who has interacted with a billing entity. ObjectID *string // The tenant id of the principal who has interacted with a billing entity. TenantID *string // The user principal name of the principal who has interacted with a billing entity. Upn *string }
RequestPropertiesReviewedBy - The principal of the request reviewer. Will only be set if request is approved.
func (RequestPropertiesReviewedBy) MarshalJSON ¶ added in v1.0.0
func (r RequestPropertiesReviewedBy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RequestPropertiesReviewedBy.
func (*RequestPropertiesReviewedBy) UnmarshalJSON ¶ added in v1.0.0
func (r *RequestPropertiesReviewedBy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RequestPropertiesReviewedBy.
type RequestsClient ¶ added in v1.0.0
type RequestsClient struct {
// contains filtered or unexported fields
}
RequestsClient contains the methods for the BillingRequests group. Don't use this type directly, use NewRequestsClient() instead.
func NewRequestsClient ¶ added in v1.0.0
func NewRequestsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*RequestsClient, error)
NewRequestsClient creates a new instance of RequestsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*RequestsClient) BeginCreateOrUpdate ¶ added in v1.0.0
func (client *RequestsClient) BeginCreateOrUpdate(ctx context.Context, billingRequestName string, parameters Request, options *RequestsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RequestsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update a billing request. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingRequestName - The ID that uniquely identifies a billing request.
- parameters - A request submitted by a user to manage billing. Users with an owner role on the scope can approve or decline these requests.
- options - RequestsClientBeginCreateOrUpdateOptions contains the optional parameters for the RequestsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsCreateOrUpdate.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.NewRequestsClient().BeginCreateOrUpdate(ctx, "00000000-0000-0000-0000-000000000000", armbilling.Request{ Properties: &armbilling.RequestProperties{ Type: to.Ptr(armbilling.BillingRequestTypeRoleAssignment), AdditionalInformation: map[string]*string{ "RoleId": to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), }, DecisionReason: to.Ptr("New team member"), RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), Status: to.Ptr(armbilling.BillingRequestStatusPending), }, }, 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.Request = armbilling.Request{ // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingRequests"), // ID: to.Ptr("/providers/Microsoft.Billing/billingRequests/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RequestProperties{ // Type: to.Ptr(armbilling.BillingRequestTypeRoleAssignment), // AdditionalInformation: map[string]*string{ // "RoleId": to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // }, // BillingAccountDisplayName: to.Ptr("Contoso"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingAccountName: to.Ptr("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // CreatedBy: &armbilling.RequestPropertiesCreatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-15T17:32:28.000Z"); return t}()), // LastUpdatedBy: &armbilling.RequestPropertiesLastUpdatedBy{ // Upn: to.Ptr("admin@contoso.com"), // }, // LastUpdatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // Status: to.Ptr(armbilling.BillingRequestStatusPending), // }, // } }
Output:
func (*RequestsClient) Get ¶ added in v1.0.0
func (client *RequestsClient) Get(ctx context.Context, billingRequestName string, options *RequestsClientGetOptions) (RequestsClientGetResponse, error)
Get - Gets a billing request by its ID. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingRequestName - The ID that uniquely identifies a billing request.
- options - RequestsClientGetOptions contains the optional parameters for the RequestsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsGet.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.NewRequestsClient().Get(ctx, "00000000-0000-0000-0000-000000000000", 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.Request = armbilling.Request{ // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingRequests"), // ID: to.Ptr("/providers/Microsoft.Billing/billingRequests/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RequestProperties{ // Type: to.Ptr(armbilling.BillingRequestTypeRoleAssignment), // AdditionalInformation: map[string]*string{ // "RoleId": to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // }, // BillingAccountDisplayName: to.Ptr("Contoso"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingAccountName: to.Ptr("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // CreatedBy: &armbilling.RequestPropertiesCreatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-15T17:32:28.000Z"); return t}()), // LastUpdatedBy: &armbilling.RequestPropertiesLastUpdatedBy{ // Upn: to.Ptr("admin@contoso.com"), // }, // LastUpdatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // Status: to.Ptr(armbilling.BillingRequestStatusPending), // }, // } }
Output:
func (*RequestsClient) NewListByBillingAccountPager ¶ added in v1.0.0
func (client *RequestsClient) NewListByBillingAccountPager(billingAccountName string, options *RequestsClientListByBillingAccountOptions) *runtime.Pager[RequestsClientListByBillingAccountResponse]
NewListByBillingAccountPager - The list of billing requests submitted for the billing account.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - RequestsClientListByBillingAccountOptions contains the optional parameters for the RequestsClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingAccount.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.NewRequestsClient().NewListByBillingAccountPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.RequestsClientListByBillingAccountOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.RequestListResult = armbilling.RequestListResult{ // Value: []*armbilling.Request{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingRequests"), // ID: to.Ptr("/providers/Microsoft.Billing/billingRequests/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RequestProperties{ // Type: to.Ptr(armbilling.BillingRequestTypeRoleAssignment), // AdditionalInformation: map[string]*string{ // "RoleId": to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // }, // BillingAccountDisplayName: to.Ptr("Contoso"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingAccountName: to.Ptr("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // CreatedBy: &armbilling.RequestPropertiesCreatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-15T17:32:28.000Z"); return t}()), // LastUpdatedBy: &armbilling.RequestPropertiesLastUpdatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // LastUpdatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // Status: to.Ptr(armbilling.BillingRequestStatusPending), // }, // }, // { // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingRequests"), // ID: to.Ptr("/providers/Microsoft.Billing/billingRequests/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.RequestProperties{ // Type: to.Ptr(armbilling.BillingRequestTypeProvisioningAccess), // BillingAccountDisplayName: to.Ptr("Contoso"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingAccountName: to.Ptr("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // CreatedBy: &armbilling.RequestPropertiesCreatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T17:32:28.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-15T17:32:28.000Z"); return t}()), // LastUpdatedBy: &armbilling.RequestPropertiesLastUpdatedBy{ // Upn: to.Ptr("admin@contosofinance.com"), // }, // LastUpdatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-02T17:32:28.000Z"); return t}()), // RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/associatedTenants/100000000-0000-0000-0000-00000000"), // ReviewalDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-02T17:32:28.000Z"); return t}()), // ReviewedBy: &armbilling.RequestPropertiesReviewedBy{ // Upn: to.Ptr("admin@contosofinance.com"), // }, // Status: to.Ptr(armbilling.BillingRequestStatusApproved), // }, // }}, // } } }
Output:
func (*RequestsClient) NewListByBillingProfilePager ¶ added in v1.0.0
func (client *RequestsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *RequestsClientListByBillingProfileOptions) *runtime.Pager[RequestsClientListByBillingProfileResponse]
NewListByBillingProfilePager - The list of billing requests submitted for the billing profile.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - RequestsClientListByBillingProfileOptions contains the optional parameters for the RequestsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingProfile.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.NewRequestsClient().NewListByBillingProfilePager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", &armbilling.RequestsClientListByBillingProfileOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.RequestListResult = armbilling.RequestListResult{ // Value: []*armbilling.Request{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingRequests"), // ID: to.Ptr("/providers/Microsoft.Billing/billingRequests/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RequestProperties{ // Type: to.Ptr(armbilling.BillingRequestTypeRoleAssignment), // AdditionalInformation: map[string]*string{ // "RoleId": to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // }, // BillingAccountDisplayName: to.Ptr("Contoso"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingAccountName: to.Ptr("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // CreatedBy: &armbilling.RequestPropertiesCreatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-15T17:32:28.000Z"); return t}()), // LastUpdatedBy: &armbilling.RequestPropertiesLastUpdatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // LastUpdatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // Status: to.Ptr(armbilling.BillingRequestStatusPending), // }, // }}, // } } }
Output:
func (*RequestsClient) NewListByCustomerPager ¶ added in v1.0.0
func (client *RequestsClient) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, options *RequestsClientListByCustomerOptions) *runtime.Pager[RequestsClientListByCustomerResponse]
NewListByCustomerPager - The list of billing requests submitted for the customer.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- options - RequestsClientListByCustomerOptions contains the optional parameters for the RequestsClient.NewListByCustomerPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByCustomer.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.NewRequestsClient().NewListByCustomerPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "11111111-1111-1111-1111-111111111111", &armbilling.RequestsClientListByCustomerOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.RequestListResult = armbilling.RequestListResult{ // Value: []*armbilling.Request{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingRequests"), // ID: to.Ptr("/providers/Microsoft.Billing/billingRequests/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RequestProperties{ // Type: to.Ptr(armbilling.BillingRequestTypeRoleAssignment), // AdditionalInformation: map[string]*string{ // "RoleId": to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // }, // BillingAccountDisplayName: to.Ptr("Contoso"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingAccountName: to.Ptr("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // CreatedBy: &armbilling.RequestPropertiesCreatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // CustomerDisplayName: to.Ptr("Customer 1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111"), // CustomerName: to.Ptr("11111111-1111-1111-1111-111111111111"), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-15T17:32:28.000Z"); return t}()), // LastUpdatedBy: &armbilling.RequestPropertiesLastUpdatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // LastUpdatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111"), // Status: to.Ptr(armbilling.BillingRequestStatusPending), // }, // }}, // } } }
Output:
func (*RequestsClient) NewListByInvoiceSectionPager ¶ added in v1.0.0
func (client *RequestsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *RequestsClientListByInvoiceSectionOptions) *runtime.Pager[RequestsClientListByInvoiceSectionResponse]
NewListByInvoiceSectionPager - The list of billing requests submitted for the invoice section.
Generated from API version 2024-04-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 - RequestsClientListByInvoiceSectionOptions contains the optional parameters for the RequestsClient.NewListByInvoiceSectionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByInvoiceSection.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.NewRequestsClient().NewListByInvoiceSectionPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", &armbilling.RequestsClientListByInvoiceSectionOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.RequestListResult = armbilling.RequestListResult{ // Value: []*armbilling.Request{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingRequests"), // ID: to.Ptr("/providers/Microsoft.Billing/billingRequests/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RequestProperties{ // Type: to.Ptr(armbilling.BillingRequestTypeRoleAssignment), // AdditionalInformation: map[string]*string{ // "RoleId": to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // }, // BillingAccountDisplayName: to.Ptr("Contoso"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingAccountName: to.Ptr("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // CreatedBy: &armbilling.RequestPropertiesCreatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-15T17:32:28.000Z"); return t}()), // InvoiceSectionDisplayName: to.Ptr("Department 1"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // LastUpdatedBy: &armbilling.RequestPropertiesLastUpdatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // LastUpdatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // Status: to.Ptr(armbilling.BillingRequestStatusPending), // }, // }}, // } } }
Output:
func (*RequestsClient) NewListByUserPager ¶ added in v1.0.0
func (client *RequestsClient) NewListByUserPager(options *RequestsClientListByUserOptions) *runtime.Pager[RequestsClientListByUserResponse]
NewListByUserPager - The list of billing requests submitted by a user.
Generated from API version 2024-04-01
- options - RequestsClientListByUserOptions contains the optional parameters for the RequestsClient.NewListByUserPager method.
Example (BillingRequestsListByUser) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByUser.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.NewRequestsClient().NewListByUserPager(&armbilling.RequestsClientListByUserOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.RequestListResult = armbilling.RequestListResult{ // Value: []*armbilling.Request{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingRequests"), // ID: to.Ptr("/providers/Microsoft.Billing/billingRequests/00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RequestProperties{ // Type: to.Ptr(armbilling.BillingRequestTypeRoleAssignment), // AdditionalInformation: map[string]*string{ // "RoleId": to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // }, // BillingAccountDisplayName: to.Ptr("Contoso"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingAccountName: to.Ptr("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // CreatedBy: &armbilling.RequestPropertiesCreatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-15T17:32:28.000Z"); return t}()), // LastUpdatedBy: &armbilling.RequestPropertiesLastUpdatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // LastUpdatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T17:32:28.000Z"); return t}()), // RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // Status: to.Ptr(armbilling.BillingRequestStatusPending), // }, // }, // { // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingRequests"), // ID: to.Ptr("/providers/Microsoft.Billing/billingRequests/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.RequestProperties{ // Type: to.Ptr(armbilling.BillingRequestTypeProvisioningAccess), // BillingAccountDisplayName: to.Ptr("Contoso"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingAccountName: to.Ptr("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // CreatedBy: &armbilling.RequestPropertiesCreatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T17:32:28.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-15T17:32:28.000Z"); return t}()), // LastUpdatedBy: &armbilling.RequestPropertiesLastUpdatedBy{ // Upn: to.Ptr("admin@contosofinance.com"), // }, // LastUpdatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-02T17:32:28.000Z"); return t}()), // RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/associatedTenants/100000000-0000-0000-0000-00000000"), // ReviewalDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-02T17:32:28.000Z"); return t}()), // ReviewedBy: &armbilling.RequestPropertiesReviewedBy{ // Upn: to.Ptr("admin@contosofinance.com"), // }, // Status: to.Ptr(armbilling.BillingRequestStatusApproved), // }, // }}, // } } }
Output:
Example (BillingRequestsListByUserWithFilter) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByUserWithFilter.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.NewRequestsClient().NewListByUserPager(&armbilling.RequestsClientListByUserOptions{Filter: to.Ptr("properties/status eq 'Approved'"), OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.RequestListResult = armbilling.RequestListResult{ // Value: []*armbilling.Request{ // { // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingRequests"), // ID: to.Ptr("/providers/Microsoft.Billing/billingRequests/11111111-1111-1111-1111-111111111111"), // Properties: &armbilling.RequestProperties{ // Type: to.Ptr(armbilling.BillingRequestTypeProvisioningAccess), // BillingAccountDisplayName: to.Ptr("Contoso"), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingAccountName: to.Ptr("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // CreatedBy: &armbilling.RequestPropertiesCreatedBy{ // Upn: to.Ptr("foo@contoso.com"), // }, // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T17:32:28.000Z"); return t}()), // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-15T17:32:28.000Z"); return t}()), // LastUpdatedBy: &armbilling.RequestPropertiesLastUpdatedBy{ // Upn: to.Ptr("admin@contosofinance.com"), // }, // LastUpdatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-02T17:32:28.000Z"); return t}()), // RequestScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/associatedTenants/100000000-0000-0000-0000-00000000"), // ReviewalDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-02T17:32:28.000Z"); return t}()), // ReviewedBy: &armbilling.RequestPropertiesReviewedBy{ // Upn: to.Ptr("admin@contosofinance.com"), // }, // Status: to.Ptr(armbilling.BillingRequestStatusApproved), // }, // }}, // } } }
Output:
type RequestsClientBeginCreateOrUpdateOptions ¶ added in v1.0.0
type RequestsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RequestsClientBeginCreateOrUpdateOptions contains the optional parameters for the RequestsClient.BeginCreateOrUpdate method.
type RequestsClientCreateOrUpdateResponse ¶ added in v1.0.0
type RequestsClientCreateOrUpdateResponse struct { // A request submitted by a user to manage billing. Users with an owner role on the scope can approve or decline these requests. Request }
RequestsClientCreateOrUpdateResponse contains the response from method RequestsClient.BeginCreateOrUpdate.
type RequestsClientGetOptions ¶ added in v1.0.0
type RequestsClientGetOptions struct { }
RequestsClientGetOptions contains the optional parameters for the RequestsClient.Get method.
type RequestsClientGetResponse ¶ added in v1.0.0
type RequestsClientGetResponse struct { // A request submitted by a user to manage billing. Users with an owner role on the scope can approve or decline these requests. Request }
RequestsClientGetResponse contains the response from method RequestsClient.Get.
type RequestsClientListByBillingAccountOptions ¶ added in v1.0.0
type RequestsClientListByBillingAccountOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
RequestsClientListByBillingAccountOptions contains the optional parameters for the RequestsClient.NewListByBillingAccountPager method.
type RequestsClientListByBillingAccountResponse ¶ added in v1.0.0
type RequestsClientListByBillingAccountResponse struct { // A container for a list of resources RequestListResult }
RequestsClientListByBillingAccountResponse contains the response from method RequestsClient.NewListByBillingAccountPager.
type RequestsClientListByBillingProfileOptions ¶ added in v1.0.0
type RequestsClientListByBillingProfileOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
RequestsClientListByBillingProfileOptions contains the optional parameters for the RequestsClient.NewListByBillingProfilePager method.
type RequestsClientListByBillingProfileResponse ¶ added in v1.0.0
type RequestsClientListByBillingProfileResponse struct { // A container for a list of resources RequestListResult }
RequestsClientListByBillingProfileResponse contains the response from method RequestsClient.NewListByBillingProfilePager.
type RequestsClientListByCustomerOptions ¶ added in v1.0.0
type RequestsClientListByCustomerOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
RequestsClientListByCustomerOptions contains the optional parameters for the RequestsClient.NewListByCustomerPager method.
type RequestsClientListByCustomerResponse ¶ added in v1.0.0
type RequestsClientListByCustomerResponse struct { // A container for a list of resources RequestListResult }
RequestsClientListByCustomerResponse contains the response from method RequestsClient.NewListByCustomerPager.
type RequestsClientListByInvoiceSectionOptions ¶ added in v1.0.0
type RequestsClientListByInvoiceSectionOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
RequestsClientListByInvoiceSectionOptions contains the optional parameters for the RequestsClient.NewListByInvoiceSectionPager method.
type RequestsClientListByInvoiceSectionResponse ¶ added in v1.0.0
type RequestsClientListByInvoiceSectionResponse struct { // A container for a list of resources RequestListResult }
RequestsClientListByInvoiceSectionResponse contains the response from method RequestsClient.NewListByInvoiceSectionPager.
type RequestsClientListByUserOptions ¶ added in v1.0.0
type RequestsClientListByUserOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
RequestsClientListByUserOptions contains the optional parameters for the RequestsClient.NewListByUserPager method.
type RequestsClientListByUserResponse ¶ added in v1.0.0
type RequestsClientListByUserResponse struct { // A container for a list of resources RequestListResult }
RequestsClientListByUserResponse contains the response from method RequestsClient.NewListByUserPager.
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 { Etag *int32 // The location of the reservation. Location *string // The properties associated to this reservation Properties *ReservationProperty // The sku information associated to this reservation SKU *ReservationSKUProperty // Tags for this reservation Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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 ReservationAppliedScopeProperties ¶ added in v1.0.0
type ReservationAppliedScopeProperties struct { // Display name DisplayName *string // Fully-qualified identifier of the management group where the benefit must be applied. ManagementGroupID *string // Fully-qualified identifier of the resource group. ResourceGroupID *string // Fully-qualified identifier of the subscription. SubscriptionID *string // Tenant ID where the reservation should apply benefit. TenantID *string }
ReservationAppliedScopeProperties - Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup
func (ReservationAppliedScopeProperties) MarshalJSON ¶ added in v1.0.0
func (r ReservationAppliedScopeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationAppliedScopeProperties.
func (*ReservationAppliedScopeProperties) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationAppliedScopeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationAppliedScopeProperties.
type ReservationBillingPlan ¶ added in v1.0.0
type ReservationBillingPlan string
ReservationBillingPlan - Represent the billing plans.
const ( ReservationBillingPlanMonthly ReservationBillingPlan = "Monthly" ReservationBillingPlanUpfront ReservationBillingPlan = "Upfront" )
func PossibleReservationBillingPlanValues ¶ added in v1.0.0
func PossibleReservationBillingPlanValues() []ReservationBillingPlan
PossibleReservationBillingPlanValues returns the possible values for the ReservationBillingPlan const type.
type ReservationExtendedStatusInfo ¶ added in v1.0.0
type ReservationExtendedStatusInfo struct { // The message giving detailed information about the status code. Message *string // Properties for extended status information Properties *ExtendedStatusDefinitionProperties // The status of the reservation. StatusCode *ReservationStatusCode }
ReservationExtendedStatusInfo - Extended status information for the reservation.
func (ReservationExtendedStatusInfo) MarshalJSON ¶ added in v1.0.0
func (r ReservationExtendedStatusInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationExtendedStatusInfo.
func (*ReservationExtendedStatusInfo) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationExtendedStatusInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationExtendedStatusInfo.
type ReservationList ¶ added in v1.0.0
type ReservationList struct { // Url to get the next page of reservations. NextLink *string Value []*Reservation }
ReservationList - List of `Reservations
func (ReservationList) MarshalJSON ¶ added in v1.0.0
func (r ReservationList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationList.
func (*ReservationList) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationList.
type ReservationMergeProperties ¶ added in v1.0.0
type ReservationMergeProperties struct { // Reservation resource id Created due to the merge. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} MergeDestination *string // Resource ids of the source reservation's merged to form this reservation. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} MergeSources []*string }
ReservationMergeProperties - Properties of reservation merge
func (ReservationMergeProperties) MarshalJSON ¶ added in v1.0.0
func (r ReservationMergeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationMergeProperties.
func (*ReservationMergeProperties) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationMergeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationMergeProperties.
type ReservationOrder ¶ added in v1.0.0
type ReservationOrder struct { Etag *int32 // The properties associated to this reservation order Properties *ReservationOrderProperty // Tags for this reservation Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
ReservationOrder - Details of a reservation order being returned.
func (ReservationOrder) MarshalJSON ¶ added in v1.0.0
func (r ReservationOrder) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrder.
func (*ReservationOrder) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrder.
type ReservationOrderBillingPlanInformation ¶ added in v1.0.0
type ReservationOrderBillingPlanInformation struct { // For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. NextPaymentDueDate *time.Time // Amount of money to be paid for the Order. Tax is not included. PricingCurrencyTotal *Price // Date when the billing plan has started. StartDate *time.Time Transactions []*ReservationPaymentDetail }
ReservationOrderBillingPlanInformation - Information describing the type of billing plan for this reservation order.
func (ReservationOrderBillingPlanInformation) MarshalJSON ¶ added in v1.0.0
func (r ReservationOrderBillingPlanInformation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderBillingPlanInformation.
func (*ReservationOrderBillingPlanInformation) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationOrderBillingPlanInformation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderBillingPlanInformation.
type ReservationOrderList ¶ added in v1.0.0
type ReservationOrderList struct { // Url to get the next page of reservationOrders. NextLink *string Value []*ReservationOrder }
ReservationOrderList - List of ReservationOrders
func (ReservationOrderList) MarshalJSON ¶ added in v1.0.0
func (r ReservationOrderList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderList.
func (*ReservationOrderList) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationOrderList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderList.
type ReservationOrderProperty ¶ added in v1.0.0
type ReservationOrderProperty struct { // This is the DateTime when the reservation benefit started. BenefitStartTime *time.Time // Billing account Id associated to this reservation order. BillingAccountID *string // Represent the billing plans. BillingPlan *ReservationBillingPlan // Billing profile Id associated to this reservation order. BillingProfileID *string // This is the DateTime when the reservation order was created. CreatedDateTime *time.Time // Fully-qualified identifier of the customerId where the benefit is applied. Present only for Enterprise Agreement PartnerLed // customers. CustomerID *string // Friendly name for user to easily identified the reservation order. DisplayName *string // Enrollment id of the reservation order. EnrollmentID *string // This is the date when the reservation order will expire. ExpiryDate *time.Time // This is the date-time when the reservation order will expire. ExpiryDateTime *time.Time // Extended status information for the reservation. ExtendedStatusInfo *ReservationExtendedStatusInfo // Total original quantity of the skus purchased in the reservation order. OriginalQuantity *int32 // Information describing the type of billing plan for this reservation order. PlanInformation *ReservationOrderBillingPlanInformation // Represents UPN ProductCode *string // This is the DateTime when the reservation order was initially requested for purchase. RequestDateTime *time.Time Reservations []*Reservation // This is the date-time when the Azure Hybrid Benefit needs to be reviewed. ReviewDateTime *time.Time // READ-ONLY; The provisioning state of the reservation, e.g. Succeeded ProvisioningState *string // READ-ONLY; The term of the reservation, e.g. P1Y Term *string }
ReservationOrderProperty - Properties of a reservation order.
func (ReservationOrderProperty) MarshalJSON ¶ added in v1.0.0
func (r ReservationOrderProperty) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderProperty.
func (*ReservationOrderProperty) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationOrderProperty) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderProperty.
type ReservationOrdersClient ¶ added in v1.0.0
type ReservationOrdersClient struct {
// contains filtered or unexported fields
}
ReservationOrdersClient contains the methods for the ReservationOrders group. Don't use this type directly, use NewReservationOrdersClient() instead.
func NewReservationOrdersClient ¶ added in v1.0.0
func NewReservationOrdersClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationOrdersClient, error)
NewReservationOrdersClient creates a new instance of ReservationOrdersClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ReservationOrdersClient) GetByBillingAccount ¶ added in v1.0.0
func (client *ReservationOrdersClient) GetByBillingAccount(ctx context.Context, billingAccountName string, reservationOrderID string, options *ReservationOrdersClientGetByBillingAccountOptions) (ReservationOrdersClientGetByBillingAccountResponse, error)
GetByBillingAccount - Get the details of the ReservationOrder in the billing account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- reservationOrderID - Order Id of the reservation
- options - ReservationOrdersClientGetByBillingAccountOptions contains the optional parameters for the ReservationOrdersClient.GetByBillingAccount method.
Example (ReservationOrderGetByBillingAccount) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrderGetByBillingAccount.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.NewReservationOrdersClient().GetByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", &armbilling.ReservationOrdersClientGetByBillingAccountOptions{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.ReservationOrder = armbilling.ReservationOrder{ // Name: to.Ptr("20000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/reservationOrders/20000000-0000-0000-0000-000000000000"), // Etag: to.Ptr[int32](27), // Properties: &armbilling.ReservationOrderProperty{ // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:34:12.926Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-AAAA-AAA-AAA"), // CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:34:13.973Z"); return t}()), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-25T06:34:12.926Z"); return t}()), // OriginalQuantity: to.Ptr[int32](1), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // RequestDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:31:18.392Z"); return t}()), // Reservations: []*armbilling.Reservation{ // { // ID: to.Ptr("/providers/Microsoft.Capacity/reservationOrders/20000000-0000-0000-0000-000000000000/reservations/20000000-0000-0000-0000-000000000001"), // }}, // Term: to.Ptr("P3Y"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // } }
Output:
Example (ReservationOrderGetByBillingAccountWithExpandPlanInformation) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrderGetByBillingAccountWithExpandPlanInformation.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.NewReservationOrdersClient().GetByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", &armbilling.ReservationOrdersClientGetByBillingAccountOptions{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.ReservationOrder = armbilling.ReservationOrder{ // Name: to.Ptr("20000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/reservationOrders/20000000-0000-0000-0000-000000000000"), // Etag: to.Ptr[int32](26), // Properties: &armbilling.ReservationOrderProperty{ // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:34:12.926Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-AAAA-AAA-AAA"), // CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:34:13.973Z"); return t}()), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-25T06:34:12.926Z"); return t}()), // OriginalQuantity: to.Ptr[int32](1), // PlanInformation: &armbilling.ReservationOrderBillingPlanInformation{ // NextPaymentDueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-11-25"); return t}()), // Transactions: []*armbilling.ReservationPaymentDetail{ // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-11-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-11-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-12-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-12-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-01-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-01-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-02-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-02-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-03-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-03-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-04-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-04-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-05-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-05-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-06-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-06-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-07-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-07-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-08-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-08-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-09-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-09-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-10-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-10-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-11-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-11-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-12-25"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-12-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-03-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-04-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-05-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-06-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-07-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-08-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-09-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-10-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-11-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-12-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-01-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-02-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-03-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-04-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-05-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-06-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-07-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-08-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-09-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-10-25"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](19.88), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }}, // }, // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // RequestDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:31:18.392Z"); return t}()), // Reservations: []*armbilling.Reservation{ // { // ID: to.Ptr("/providers/Microsoft.Capacity/reservationOrders/20000000-0000-0000-0000-000000000000/reservations/20000000-0000-0000-0000-000000000001"), // }}, // Term: to.Ptr("P3Y"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // } }
Output:
func (*ReservationOrdersClient) NewListByBillingAccountPager ¶ added in v1.0.0
func (client *ReservationOrdersClient) NewListByBillingAccountPager(billingAccountName string, options *ReservationOrdersClientListByBillingAccountOptions) *runtime.Pager[ReservationOrdersClientListByBillingAccountResponse]
NewListByBillingAccountPager - List all the `ReservationOrders in the billing account.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - ReservationOrdersClientListByBillingAccountOptions contains the optional parameters for the ReservationOrdersClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrdersListByBillingAccount.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.NewReservationOrdersClient().NewListByBillingAccountPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.ReservationOrdersClientListByBillingAccountOptions{Filter: nil, OrderBy: nil, Skiptoken: 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.ReservationOrderList = armbilling.ReservationOrderList{ // Value: []*armbilling.ReservationOrder{ // { // Name: to.Ptr("20000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/400000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/reservationOrders/20000000-0000-0000-0000-000000000000"), // Etag: to.Ptr[int32](10), // Properties: &armbilling.ReservationOrderProperty{ // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-03T21:26:48.512Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/400000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanUpfront), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/400000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-AAAA-AAA-AAA"), // CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-03T21:26:50.778Z"); return t}()), // DisplayName: to.Ptr("SUSE_Plan_08-03-2021_14-22"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-03T21:26:48.512Z"); return t}()), // OriginalQuantity: to.Ptr[int32](1), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // RequestDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-03T21:23:47.909Z"); return t}()), // Reservations: []*armbilling.Reservation{ // { // ID: to.Ptr("/providers/Microsoft.Capacity/reservationOrders/20000000-0000-0000-0000-000000000000/reservations/20000000-0000-0000-0000-000000000001"), // }}, // Term: to.Ptr("P3Y"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // }}, // } } }
Output:
type ReservationOrdersClientGetByBillingAccountOptions ¶ added in v1.0.0
type ReservationOrdersClientGetByBillingAccountOptions struct { // May be used to expand the detail information of some properties. Expand *string }
ReservationOrdersClientGetByBillingAccountOptions contains the optional parameters for the ReservationOrdersClient.GetByBillingAccount method.
type ReservationOrdersClientGetByBillingAccountResponse ¶ added in v1.0.0
type ReservationOrdersClientGetByBillingAccountResponse struct { // Details of a reservation order being returned. ReservationOrder }
ReservationOrdersClientGetByBillingAccountResponse contains the response from method ReservationOrdersClient.GetByBillingAccount.
type ReservationOrdersClientListByBillingAccountOptions ¶ added in v1.0.0
type ReservationOrdersClientListByBillingAccountOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The number of reservations to skip from the list before returning results Skiptoken *float32 }
ReservationOrdersClientListByBillingAccountOptions contains the optional parameters for the ReservationOrdersClient.NewListByBillingAccountPager method.
type ReservationOrdersClientListByBillingAccountResponse ¶ added in v1.0.0
type ReservationOrdersClientListByBillingAccountResponse struct { // List of ReservationOrders ReservationOrderList }
ReservationOrdersClientListByBillingAccountResponse contains the response from method ReservationOrdersClient.NewListByBillingAccountPager.
type ReservationPaymentDetail ¶ added in v1.0.0
type ReservationPaymentDetail struct { // Shows the Account that is charged for this payment. BillingAccount *string // Amount charged in Billing currency. Tax not included. Is null for future payments BillingCurrencyTotal *Price // Date when the payment needs to be done. DueDate *time.Time // Extended status information for the reservation. ExtendedStatusInfo *ReservationExtendedStatusInfo // Date when the transaction is completed. Is null when it is scheduled. PaymentDate *time.Time // Amount in pricing currency. Tax not included. PricingCurrencyTotal *Price // Describes whether the payment is completed, failed, pending, cancelled or scheduled in the future. Status *PaymentStatus }
ReservationPaymentDetail - Information about payment related to a reservation order.
func (ReservationPaymentDetail) MarshalJSON ¶ added in v1.0.0
func (r ReservationPaymentDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationPaymentDetail.
func (*ReservationPaymentDetail) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationPaymentDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationPaymentDetail.
type ReservationProperty ¶
type ReservationProperty struct { // Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId // if AppliedScopeType is ManagementGroup AppliedScopeProperties *ReservationAppliedScopeProperties // The array of applied scopes of a reservation. Will be null if the reservation is in Shared scope AppliedScopes []*string // Indicates if the reservation is archived Archived *bool // This is the DateTime when the reservation benefit started. BenefitStartTime *time.Time // The billing plan options available for this sku. BillingPlan *ReservationBillingPlan // Capabilities of the reservation Capabilities *string // This is the date-time when the reservation will expire. ExpiryDateTime *time.Time // The message giving detailed information about the status code. ExtendedStatusInfo *ReservationExtendedStatusInfo // Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size // flexibility. InstanceFlexibility *InstanceFlexibility // Properties of reservation merge MergeProperties *ReservationMergeProperties // Represents UPN ProductCode *string // This is the date when the reservation was purchased. PurchaseDate *time.Time // This is the date-time when the reservation was purchased. PurchaseDateTime *time.Time // Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. RenewDestination *string // The renew properties for a reservation. RenewProperties *RenewPropertiesResponse // This is the date-time when the Azure Hybrid Benefit needs to be reviewed. ReviewDateTime *time.Time // Properties of reservation split SplitProperties *ReservationSplitProperties // Properties of reservation swap SwapProperties *ReservationSwapProperties // READ-ONLY; The applied scope type of the reservation. AppliedScopeType *string // READ-ONLY; Subscription that will be charged for purchasing reservation or savings plan BillingScopeID *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 *time.Time // READ-ONLY; The expiry date of the reservation ExpiryDate *string // READ-ONLY; DateTime of the last time the reservation was updated. LastUpdatedDateTime *time.Time // 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; last 7 day utilization 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 ReservationPurchaseRequest ¶ added in v1.0.0
type ReservationPurchaseRequest struct { // The Azure region where the reserved resource lives. Location *string // Properties of reservation purchase request Properties *ReservationPurchaseRequestProperties // The name of sku SKU *SKUName }
ReservationPurchaseRequest - The request for reservation purchase
func (ReservationPurchaseRequest) MarshalJSON ¶ added in v1.0.0
func (r ReservationPurchaseRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationPurchaseRequest.
func (*ReservationPurchaseRequest) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationPurchaseRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationPurchaseRequest.
type ReservationPurchaseRequestProperties ¶ added in v1.0.0
type ReservationPurchaseRequestProperties struct { // Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId // if AppliedScopeType is ManagementGroup AppliedScopeProperties *ReservationAppliedScopeProperties // Type of the Applied Scope. AppliedScopeType *AppliedScopeType // List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. AppliedScopes []*string // Represent the billing plans. BillingPlan *ReservationBillingPlan // Friendly name of the reservation DisplayName *string // Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size // flexibility. InstanceFlexibility *InstanceFlexibility // Quantity of the skus that are part of the reservation. Must be greater than zero. Quantity *int32 // Setting this to true will automatically purchase a new benefit on the expiration date time. Renew *bool // Properties specific to each reserved resource type. Not required if not applicable. ReservedResourceProperties *ReservationPurchaseRequestPropertiesReservedResourceProperties // This is the date-time when the Azure hybrid benefit needs to be reviewed. ReviewDateTime *time.Time // READ-ONLY; Subscription that will be charged for purchasing reservation or savings plan BillingScopeID *string // READ-ONLY; The reserved source type of the reservation, e.g. virtual machine. ReservedResourceType *string // READ-ONLY; The term of the reservation, e.g. P1Y Term *string }
ReservationPurchaseRequestProperties - Properties of reservation purchase request
func (ReservationPurchaseRequestProperties) MarshalJSON ¶ added in v1.0.0
func (r ReservationPurchaseRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationPurchaseRequestProperties.
func (*ReservationPurchaseRequestProperties) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationPurchaseRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationPurchaseRequestProperties.
type ReservationPurchaseRequestPropertiesReservedResourceProperties ¶ added in v1.0.0
type ReservationPurchaseRequestPropertiesReservedResourceProperties struct { // Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines // reserved resource type. InstanceFlexibility *InstanceFlexibility }
ReservationPurchaseRequestPropertiesReservedResourceProperties - Properties specific to each reserved resource type. Not required if not applicable.
func (ReservationPurchaseRequestPropertiesReservedResourceProperties) MarshalJSON ¶ added in v1.0.0
func (r ReservationPurchaseRequestPropertiesReservedResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationPurchaseRequestPropertiesReservedResourceProperties.
func (*ReservationPurchaseRequestPropertiesReservedResourceProperties) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationPurchaseRequestPropertiesReservedResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationPurchaseRequestPropertiesReservedResourceProperties.
type ReservationPurchasesPolicy ¶
type ReservationPurchasesPolicy string
ReservationPurchasesPolicy - The policy that controls whether Azure reservation purchases are allowed.
const ( ReservationPurchasesPolicyAllowed ReservationPurchasesPolicy = "Allowed" ReservationPurchasesPolicyDisabled ReservationPurchasesPolicy = "Disabled" ReservationPurchasesPolicyNotAllowed ReservationPurchasesPolicy = "NotAllowed" ReservationPurchasesPolicyOther ReservationPurchasesPolicy = "Other" )
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 ReservationSplitProperties ¶ added in v1.0.0
type ReservationSplitProperties struct { // List of destination resource id that are created due to split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} SplitDestinations []*string // Resource id of the reservation from which this is split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} SplitSource *string }
ReservationSplitProperties - Properties of reservation split
func (ReservationSplitProperties) MarshalJSON ¶ added in v1.0.0
func (r ReservationSplitProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationSplitProperties.
func (*ReservationSplitProperties) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationSplitProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationSplitProperties.
type ReservationStatusCode ¶ added in v1.0.0
type ReservationStatusCode string
ReservationStatusCode - The status of the reservation.
const ( ReservationStatusCodeActive ReservationStatusCode = "Active" ReservationStatusCodeCapacityError ReservationStatusCode = "CapacityError" ReservationStatusCodeCapacityRestricted ReservationStatusCode = "CapacityRestricted" ReservationStatusCodeCreditLineCheckFailed ReservationStatusCode = "CreditLineCheckFailed" ReservationStatusCodeExchanged ReservationStatusCode = "Exchanged" ReservationStatusCodeExpired ReservationStatusCode = "Expired" ReservationStatusCodeMerged ReservationStatusCode = "Merged" ReservationStatusCodeNoBenefit ReservationStatusCode = "NoBenefit" ReservationStatusCodeNoBenefitDueToSubscriptionDeletion ReservationStatusCode = "NoBenefitDueToSubscriptionDeletion" ReservationStatusCodeNoBenefitDueToSubscriptionTransfer ReservationStatusCode = "NoBenefitDueToSubscriptionTransfer" ReservationStatusCodeNone ReservationStatusCode = "None" ReservationStatusCodePaymentInstrumentError ReservationStatusCode = "PaymentInstrumentError" ReservationStatusCodePending ReservationStatusCode = "Pending" ReservationStatusCodeProcessing ReservationStatusCode = "Processing" ReservationStatusCodePurchaseError ReservationStatusCode = "PurchaseError" ReservationStatusCodeRiskCheckFailed ReservationStatusCode = "RiskCheckFailed" ReservationStatusCodeSplit ReservationStatusCode = "Split" ReservationStatusCodeSucceeded ReservationStatusCode = "Succeeded" ReservationStatusCodeUnknownError ReservationStatusCode = "UnknownError" ReservationStatusCodeWarning ReservationStatusCode = "Warning" )
func PossibleReservationStatusCodeValues ¶ added in v1.0.0
func PossibleReservationStatusCodeValues() []ReservationStatusCode
PossibleReservationStatusCodeValues returns the possible values for the ReservationStatusCode const type.
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 'No Benefit' state NoBenefitCount *float32 // READ-ONLY; The number of reservation in Pending state PendingCount *float32 // READ-ONLY; The number of reservation in Processing state ProcessingCount *float32 // READ-ONLY; The number of reservation in Succeeded state SucceededCount *float32 // READ-ONLY; The number of reservation in Warning state WarningCount *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 ReservationSwapProperties ¶ added in v1.0.0
type ReservationSwapProperties struct { // Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} SwapDestination *string // Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} SwapSource *string }
ReservationSwapProperties - Properties of reservation swap
func (ReservationSwapProperties) MarshalJSON ¶ added in v1.0.0
func (r ReservationSwapProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationSwapProperties.
func (*ReservationSwapProperties) UnmarshalJSON ¶ added in v1.0.0
func (r *ReservationSwapProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationSwapProperties.
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) BeginUpdateByBillingAccount ¶ added in v1.0.0
func (client *ReservationsClient) BeginUpdateByBillingAccount(ctx context.Context, billingAccountName string, reservationOrderID string, reservationID string, body Patch, options *ReservationsClientBeginUpdateByBillingAccountOptions) (*runtime.Poller[ReservationsClientUpdateByBillingAccountResponse], error)
BeginUpdateByBillingAccount - Update reservation by billing account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- reservationOrderID - Order Id of the reservation
- reservationID - Id of the reservation item
- body - Request body for patching a reservation
- options - ReservationsClientBeginUpdateByBillingAccountOptions contains the optional parameters for the ReservationsClient.BeginUpdateByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationUpdateByBillingAccount.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.NewReservationsClient().BeginUpdateByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", armbilling.Patch{ Properties: &armbilling.PatchProperties{ DisplayName: to.Ptr("NewName"), }, }, 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.Reservation = armbilling.Reservation{ // Name: to.Ptr("30000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders/reservations"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/reservationOrders/20000000-0000-0000-0000-000000000000/reservations/30000000-0000-0000-0000-000000000000"), // Etag: to.Ptr[int32](15), // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationProperty{ // AppliedScopeType: to.Ptr("Shared"), // Archived: to.Ptr(false), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:34:12.926Z"); return t}()), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // DisplayName: to.Ptr("NewName"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-24T01:46:05.425Z"); return t}()), // ExpiryDate: to.Ptr("2024-11-25"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-25T06:34:12.926Z"); return t}()), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-24T01:46:05.534Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-11-25"); return t}()), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:31:18.392Z"); return t}()), // Quantity: to.Ptr[float32](1), // Renew: to.Ptr(true), // RenewProperties: &armbilling.RenewPropertiesResponse{ // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // PurchaseProperties: &armbilling.ReservationPurchaseRequest{ // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationPurchaseRequestProperties{ // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeShared), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30_renewed"), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // Quantity: to.Ptr[int32](1), // Renew: to.Ptr(false), // ReservedResourceProperties: &armbilling.ReservationPurchaseRequestPropertiesReservedResourceProperties{ // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // }, // ReservedResourceType: to.Ptr("VirtualMachines"), // Term: to.Ptr("P3Y"), // }, // SKU: &armbilling.SKUName{ // Name: to.Ptr("Standard_DS1_v2"), // }, // }, // }, // ReservedResourceType: to.Ptr("VirtualMachines"), // SKUDescription: to.Ptr("Reserved VM Instance, Standard_DS1_v2, US West, 3 Years"), // Term: to.Ptr("P3Y"), // UserFriendlyAppliedScopeType: to.Ptr("Shared"), // UserFriendlyRenewState: to.Ptr("On"), // Utilization: &armbilling.ReservationPropertyUtilization{ // Aggregates: []*armbilling.ReservationUtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.ReservationSKUProperty{ // Name: to.Ptr("Standard_DS1_v2"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // } }
Output:
func (*ReservationsClient) GetByReservationOrder ¶ added in v1.0.0
func (client *ReservationsClient) GetByReservationOrder(ctx context.Context, billingAccountName string, reservationOrderID string, reservationID string, options *ReservationsClientGetByReservationOrderOptions) (ReservationsClientGetByReservationOrderResponse, error)
GetByReservationOrder - Get specific Reservation details in the billing account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- reservationOrderID - Order Id of the reservation
- reservationID - Id of the reservation item
- options - ReservationsClientGetByReservationOrderOptions contains the optional parameters for the ReservationsClient.GetByReservationOrder method.
Example (ReservationGetByBillingAccount) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccount.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.NewReservationsClient().GetByReservationOrder(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", &armbilling.ReservationsClientGetByReservationOrderOptions{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.Reservation = armbilling.Reservation{ // Name: to.Ptr("30000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders/reservations"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/reservationOrders/20000000-0000-0000-0000-000000000000/reservations/30000000-0000-0000-0000-000000000000"), // Etag: to.Ptr[int32](15), // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationProperty{ // AppliedScopeType: to.Ptr("Shared"), // Archived: to.Ptr(false), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:34:12.926Z"); return t}()), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-24T01:46:05.425Z"); return t}()), // ExpiryDate: to.Ptr("2024-11-25"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-25T06:34:12.926Z"); return t}()), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-24T01:46:05.534Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-11-25"); return t}()), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:31:18.392Z"); return t}()), // Quantity: to.Ptr[float32](1), // Renew: to.Ptr(true), // RenewProperties: &armbilling.RenewPropertiesResponse{ // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // PurchaseProperties: &armbilling.ReservationPurchaseRequest{ // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationPurchaseRequestProperties{ // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeShared), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30_renewed"), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // Quantity: to.Ptr[int32](1), // Renew: to.Ptr(false), // ReservedResourceProperties: &armbilling.ReservationPurchaseRequestPropertiesReservedResourceProperties{ // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // }, // ReservedResourceType: to.Ptr("VirtualMachines"), // Term: to.Ptr("P3Y"), // }, // SKU: &armbilling.SKUName{ // Name: to.Ptr("Standard_DS1_v2"), // }, // }, // }, // ReservedResourceType: to.Ptr("VirtualMachines"), // SKUDescription: to.Ptr("Reserved VM Instance, Standard_DS1_v2, US West, 3 Years"), // Term: to.Ptr("P3Y"), // UserFriendlyAppliedScopeType: to.Ptr("Shared"), // UserFriendlyRenewState: to.Ptr("On"), // Utilization: &armbilling.ReservationPropertyUtilization{ // Aggregates: []*armbilling.ReservationUtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.ReservationSKUProperty{ // Name: to.Ptr("Standard_DS1_v2"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // } }
Output:
Example (ReservationGetByBillingAccountManagementGroup) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountManagementGroup.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.NewReservationsClient().GetByReservationOrder(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", &armbilling.ReservationsClientGetByReservationOrderOptions{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.Reservation = armbilling.Reservation{ // Name: to.Ptr("30000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders/reservations"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/reservationOrders/20000000-0000-0000-0000-000000000000/reservations/30000000-0000-0000-0000-000000000000"), // Etag: to.Ptr[int32](21), // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationProperty{ // AppliedScopeProperties: &armbilling.ReservationAppliedScopeProperties{ // DisplayName: to.Ptr("TestRg"), // ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/TestRg"), // TenantID: to.Ptr("50000000-0000-0000-0000-000000000009"), // }, // AppliedScopeType: to.Ptr("ManagementGroup"), // Archived: to.Ptr(false), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:34:12.926Z"); return t}()), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30"), // DisplayProvisioningState: to.Ptr("NoBenefit"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-26T01:19:31.991Z"); return t}()), // ExpiryDate: to.Ptr("2024-11-25"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-25T06:34:12.926Z"); return t}()), // ExtendedStatusInfo: &armbilling.ReservationExtendedStatusInfo{ // Message: to.Ptr("The subscriptions utilizing the reservation were removed or transferred from this account and no longer receive the reservation benefit. You can cancel the reservation or transfer to the right account or create resources and subscriptions to map it to this reservation."), // StatusCode: to.Ptr(armbilling.ReservationStatusCodeNoBenefit), // }, // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-26T01:19:32.069Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-11-25"); return t}()), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:31:18.392Z"); return t}()), // Quantity: to.Ptr[float32](1), // Renew: to.Ptr(true), // RenewProperties: &armbilling.RenewPropertiesResponse{ // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // PurchaseProperties: &armbilling.ReservationPurchaseRequest{ // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationPurchaseRequestProperties{ // AppliedScopeProperties: &armbilling.ReservationAppliedScopeProperties{ // ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/TestRg"), // TenantID: to.Ptr("50000000-0000-0000-0000-000000000009"), // }, // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeManagementGroup), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30_renewed"), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // Quantity: to.Ptr[int32](1), // Renew: to.Ptr(false), // ReservedResourceProperties: &armbilling.ReservationPurchaseRequestPropertiesReservedResourceProperties{ // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // }, // ReservedResourceType: to.Ptr("VirtualMachines"), // Term: to.Ptr("P3Y"), // }, // SKU: &armbilling.SKUName{ // Name: to.Ptr("Standard_DS1_v2"), // }, // }, // }, // ReservedResourceType: to.Ptr("VirtualMachines"), // SKUDescription: to.Ptr("Reserved VM Instance, Standard_DS1_v2, US West, 3 Years"), // Term: to.Ptr("P3Y"), // UserFriendlyAppliedScopeType: to.Ptr("ManagementGroup"), // UserFriendlyRenewState: to.Ptr("On"), // Utilization: &armbilling.ReservationPropertyUtilization{ // Aggregates: []*armbilling.ReservationUtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.ReservationSKUProperty{ // Name: to.Ptr("Standard_DS1_v2"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // } }
Output:
Example (ReservationGetByBillingAccountSingleResourceGroup) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountSingleResourceGroup.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.NewReservationsClient().GetByReservationOrder(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", &armbilling.ReservationsClientGetByReservationOrderOptions{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.Reservation = armbilling.Reservation{ // Name: to.Ptr("30000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders/reservations"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/reservationOrders/20000000-0000-0000-0000-000000000000/reservations/30000000-0000-0000-0000-000000000000"), // Etag: to.Ptr[int32](23), // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationProperty{ // AppliedScopeProperties: &armbilling.ReservationAppliedScopeProperties{ // DisplayName: to.Ptr("fastpathtesting_20210915"), // ResourceGroupID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009/resourcegroups/fastpathtesting_20210915"), // }, // AppliedScopeType: to.Ptr("Single"), // Archived: to.Ptr(false), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:34:12.926Z"); return t}()), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-26T01:21:47.293Z"); return t}()), // ExpiryDate: to.Ptr("2024-11-25"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-25T06:34:12.926Z"); return t}()), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-26T01:21:47.356Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-11-25"); return t}()), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:31:18.392Z"); return t}()), // Quantity: to.Ptr[float32](1), // Renew: to.Ptr(true), // RenewProperties: &armbilling.RenewPropertiesResponse{ // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // PurchaseProperties: &armbilling.ReservationPurchaseRequest{ // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationPurchaseRequestProperties{ // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeSingle), // AppliedScopes: []*string{ // to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009/resourcegroups/fastpathtesting_20210915")}, // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30_renewed"), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // Quantity: to.Ptr[int32](1), // Renew: to.Ptr(false), // ReservedResourceProperties: &armbilling.ReservationPurchaseRequestPropertiesReservedResourceProperties{ // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // }, // ReservedResourceType: to.Ptr("VirtualMachines"), // Term: to.Ptr("P3Y"), // }, // SKU: &armbilling.SKUName{ // Name: to.Ptr("Standard_DS1_v2"), // }, // }, // }, // ReservedResourceType: to.Ptr("VirtualMachines"), // SKUDescription: to.Ptr("Reserved VM Instance, Standard_DS1_v2, US West, 3 Years"), // Term: to.Ptr("P3Y"), // UserFriendlyAppliedScopeType: to.Ptr("ResourceGroup"), // UserFriendlyRenewState: to.Ptr("On"), // Utilization: &armbilling.ReservationPropertyUtilization{ // Aggregates: []*armbilling.ReservationUtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.ReservationSKUProperty{ // Name: to.Ptr("Standard_DS1_v2"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // } }
Output:
Example (ReservationGetByBillingAccountSingleScope) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountSingleScope.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.NewReservationsClient().GetByReservationOrder(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", &armbilling.ReservationsClientGetByReservationOrderOptions{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.Reservation = armbilling.Reservation{ // Name: to.Ptr("30000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders/reservations"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/reservationOrders/20000000-0000-0000-0000-000000000000/reservations/30000000-0000-0000-0000-000000000000"), // Etag: to.Ptr[int32](19), // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationProperty{ // AppliedScopeProperties: &armbilling.ReservationAppliedScopeProperties{ // DisplayName: to.Ptr("Azure subscription 1"), // SubscriptionID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // }, // AppliedScopeType: to.Ptr("Single"), // Archived: to.Ptr(false), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:34:12.926Z"); return t}()), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-26T01:14:18.558Z"); return t}()), // ExpiryDate: to.Ptr("2024-11-25"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-25T06:34:12.926Z"); return t}()), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOff), // LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-26T01:14:18.605Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-11-25"); return t}()), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:31:18.392Z"); return t}()), // Quantity: to.Ptr[float32](1), // Renew: to.Ptr(true), // RenewProperties: &armbilling.RenewPropertiesResponse{ // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](715.68), // CurrencyCode: to.Ptr("USD"), // }, // PurchaseProperties: &armbilling.ReservationPurchaseRequest{ // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationPurchaseRequestProperties{ // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeSingle), // AppliedScopes: []*string{ // to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009")}, // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000009"), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30_renewed"), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOff), // Quantity: to.Ptr[int32](1), // Renew: to.Ptr(false), // ReservedResourceProperties: &armbilling.ReservationPurchaseRequestPropertiesReservedResourceProperties{ // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOff), // }, // ReservedResourceType: to.Ptr("VirtualMachines"), // Term: to.Ptr("P3Y"), // }, // SKU: &armbilling.SKUName{ // Name: to.Ptr("Standard_DS1_v2"), // }, // }, // }, // ReservedResourceType: to.Ptr("VirtualMachines"), // SKUDescription: to.Ptr("Reserved VM Instance, Standard_DS1_v2, US West, 3 Years"), // Term: to.Ptr("P3Y"), // UserFriendlyAppliedScopeType: to.Ptr("Single"), // UserFriendlyRenewState: to.Ptr("On"), // Utilization: &armbilling.ReservationPropertyUtilization{ // Aggregates: []*armbilling.ReservationUtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.ReservationSKUProperty{ // Name: to.Ptr("Standard_DS1_v2"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // } }
Output:
func (*ReservationsClient) NewListByBillingAccountPager ¶ added in v0.4.0
func (client *ReservationsClient) NewListByBillingAccountPager(billingAccountName string, options *ReservationsClientListByBillingAccountOptions) *runtime.Pager[ReservationsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the reservations in the billing account and the roll up counts of reservations group by provisioning states.
Generated from API version 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.ReservationsClientListByBillingAccountOptions{Filter: nil, OrderBy: nil, Skiptoken: nil, RefreshSummary: nil, SelectedState: to.Ptr("Succeeded"), Take: 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.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), // NoBenefitCount: to.Ptr[float32](0), // PendingCount: to.Ptr[float32](0), // ProcessingCount: to.Ptr[float32](0), // SucceededCount: to.Ptr[float32](1), // WarningCount: to.Ptr[float32](0), // }, // Value: []*armbilling.Reservation{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders/reservations"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/reservationOrders/00000000-0000-0000-0000-000000000001/reservations/00000000-0000-0000-0000-000000000000"), // Location: to.Ptr("global"), // Properties: &armbilling.ReservationProperty{ // AppliedScopeType: to.Ptr("Shared"), // Archived: to.Ptr(false), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-18T21:54:31.074Z"); return t}()), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/eef82110-c91b-4395-9420-fcfcbefc5a47"), // DisplayName: to.Ptr("VirtualMachineSoftware_01-18-2022_13-51"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), // ExpiryDate: to.Ptr("2025-01-18"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-18T21:54:31.074Z"); return t}()), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0-12-31T15:54:17.000Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-01-18"); return t}()), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-18T21:51:29.906Z"); return t}()), // Quantity: to.Ptr[float32](1), // Renew: to.Ptr(false), // ReservedResourceType: to.Ptr("VirtualMachineSoftware"), // SKUDescription: to.Ptr("Sku description"), // Term: to.Ptr("P3Y"), // 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), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.ReservationSKUProperty{ // Name: to.Ptr("mock_sku"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // }}, // } } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "AAAA-AAAA-AAA-AAA", &armbilling.ReservationsClientListByBillingProfileOptions{Filter: nil, OrderBy: nil, Skiptoken: nil, RefreshSummary: nil, SelectedState: to.Ptr("Succeeded"), Take: 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.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), // NoBenefitCount: to.Ptr[float32](0), // PendingCount: to.Ptr[float32](0), // ProcessingCount: to.Ptr[float32](0), // SucceededCount: to.Ptr[float32](1), // WarningCount: to.Ptr[float32](0), // }, // Value: []*armbilling.Reservation{ // { // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders/reservations"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/reservationOrders/00000000-0000-0000-0000-000000000001/reservations/00000000-0000-0000-0000-000000000000"), // Location: to.Ptr("global"), // Properties: &armbilling.ReservationProperty{ // AppliedScopeType: to.Ptr("Shared"), // Archived: to.Ptr(false), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-18T21:54:31.074Z"); return t}()), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/eef82110-c91b-4395-9420-fcfcbefc5a47"), // DisplayName: to.Ptr("VirtualMachineSoftware_01-18-2022_13-51"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), // ExpiryDate: to.Ptr("2025-01-18"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-18T21:54:31.074Z"); return t}()), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0-12-31T15:54:17.000Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2022-01-18"); return t}()), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-18T21:51:29.906Z"); return t}()), // Quantity: to.Ptr[float32](1), // Renew: to.Ptr(false), // ReservedResourceType: to.Ptr("VirtualMachineSoftware"), // SKUDescription: to.Ptr("Sku description"), // Term: to.Ptr("P3Y"), // 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), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.ReservationSKUProperty{ // Name: to.Ptr("mock_sku"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // }}, // } } }
Output:
func (*ReservationsClient) NewListByReservationOrderPager ¶ added in v1.0.0
func (client *ReservationsClient) NewListByReservationOrderPager(billingAccountName string, reservationOrderID string, options *ReservationsClientListByReservationOrderOptions) *runtime.Pager[ReservationsClientListByReservationOrderResponse]
NewListByReservationOrderPager - List Reservations within a single ReservationOrder in the billing account.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- reservationOrderID - Order Id of the reservation
- options - ReservationsClientListByReservationOrderOptions contains the optional parameters for the ReservationsClient.NewListByReservationOrderPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsGetFromOrderByBillingAccount.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.NewReservationsClient().NewListByReservationOrderPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", 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.ReservationList = armbilling.ReservationList{ // Value: []*armbilling.Reservation{ // { // Name: to.Ptr("a7d70646-b848-4498-8093-5938128b225c"), // Type: to.Ptr("microsoft.billing/billingAccounts/reservationOrders/reservations"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/4973e1de-a829-5c64-4fef-0a692e2b3108:1970c5da-0aa4-46fd-a917-4772f9a17978_2019-05-31/reservationOrders/99f340d1-6db4-41b4-b469-cfc499716973/reservations/a7d70646-b848-4498-8093-5938128b225c"), // Etag: to.Ptr[int32](15), // Location: to.Ptr("westus"), // Properties: &armbilling.ReservationProperty{ // AppliedScopeType: to.Ptr("Shared"), // Archived: to.Ptr(false), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:34:12.926Z"); return t}()), // BillingPlan: to.Ptr(armbilling.ReservationBillingPlanMonthly), // BillingScopeID: to.Ptr("/subscriptions/eef82110-c91b-4395-9420-fcfcbefc5a47"), // DisplayName: to.Ptr("VM_RI_11-24-2021_22-30"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-24T01:46:05.425Z"); return t}()), // ExpiryDate: to.Ptr("2024-11-25"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-25T06:34:12.926Z"); return t}()), // InstanceFlexibility: to.Ptr(armbilling.InstanceFlexibilityOn), // LastUpdatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-24T01:46:05.534Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-11-25"); return t}()), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-25T06:31:18.392Z"); return t}()), // Quantity: to.Ptr[float32](1), // Renew: to.Ptr(true), // ReservedResourceType: to.Ptr("VirtualMachines"), // SKUDescription: to.Ptr("Reserved VM Instance, Standard_DS1_v2, US West, 3 Years"), // Term: to.Ptr("P3Y"), // UserFriendlyAppliedScopeType: to.Ptr("Shared"), // UserFriendlyRenewState: to.Ptr("On"), // Utilization: &armbilling.ReservationPropertyUtilization{ // Aggregates: []*armbilling.ReservationUtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.ReservationSKUProperty{ // Name: to.Ptr("Standard_DS1_v2"), // }, // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // }}, // } } }
Output:
type ReservationsClientBeginUpdateByBillingAccountOptions ¶ added in v1.0.0
type ReservationsClientBeginUpdateByBillingAccountOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ReservationsClientBeginUpdateByBillingAccountOptions contains the optional parameters for the ReservationsClient.BeginUpdateByBillingAccount method.
type ReservationsClientGetByReservationOrderOptions ¶ added in v1.0.0
type ReservationsClientGetByReservationOrderOptions struct { // May be used to expand the detail information of some properties. Expand *string }
ReservationsClientGetByReservationOrderOptions contains the optional parameters for the ReservationsClient.GetByReservationOrder method.
type ReservationsClientGetByReservationOrderResponse ¶ added in v1.0.0
type ReservationsClientGetByReservationOrderResponse struct { // The definition of the reservation. Reservation }
ReservationsClientGetByReservationOrderResponse contains the response from method ReservationsClient.GetByReservationOrder.
type ReservationsClientListByBillingAccountOptions ¶ added in v0.2.0
type ReservationsClientListByBillingAccountOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. 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 // The number of reservations to skip from the list before returning results Skiptoken *float32 // The number of reservations to return in API response. Take *float32 }
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 { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. 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 // The number of reservations to skip from the list before returning results Skiptoken *float32 // The number of reservations to return in API response. Take *float32 }
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 ReservationsClientListByReservationOrderOptions ¶ added in v1.0.0
type ReservationsClientListByReservationOrderOptions struct { }
ReservationsClientListByReservationOrderOptions contains the optional parameters for the ReservationsClient.NewListByReservationOrderPager method.
type ReservationsClientListByReservationOrderResponse ¶ added in v1.0.0
type ReservationsClientListByReservationOrderResponse struct { // List of `Reservations ReservationList }
ReservationsClientListByReservationOrderResponse contains the response from method ReservationsClient.NewListByReservationOrderPager.
type ReservationsClientUpdateByBillingAccountResponse ¶ added in v1.0.0
type ReservationsClientUpdateByBillingAccountResponse struct { // The definition of the reservation. Reservation }
ReservationsClientUpdateByBillingAccountResponse contains the response from method ReservationsClient.BeginUpdateByBillingAccount.
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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
Resource - Common fields that are returned in the response for all Azure Resource Manager resources
func (Resource) MarshalJSON ¶
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 billing role assignment. Properties *RoleAssignmentProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
RoleAssignment - The properties of the billing 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 resources. Value []*RoleAssignment }
RoleAssignmentListResult - A container for a list of resources
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 { // REQUIRED; The ID of the role definition. RoleDefinitionID *string // The object id of the user to whom the role was assigned. PrincipalID *string // The principal PUID of the user to whom the role was assigned. PrincipalPuid *string // The principal tenant id of the user to whom the role was assigned. PrincipalTenantID *string // The scope at which the role was assigned. Scope *string // The authentication type of the user, whether Organization or MSA, of the user to whom the role was assigned. This is supported // only for billing accounts with agreement type Enterprise Agreement. UserAuthenticationType *string // The email address of the user to whom the role was assigned. This is supported only for billing accounts with agreement // type Enterprise Agreement. UserEmailAddress *string // READ-ONLY; The name of the billing account. BillingAccountDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a billing account. BillingAccountID *string // READ-ONLY; The name of the billing profile. BillingProfileDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a billing profile. BillingProfileID *string // READ-ONLY; The ID of the billing request that was created for the role assignment. This is only applicable to cross tenant // role assignments or role assignments created through the billing request. BillingRequestID *string // READ-ONLY; The object ID of the user who created the role assignment. CreatedByPrincipalID *string // READ-ONLY; The principal PUID of the user who created the role assignment. CreatedByPrincipalPuid *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. This is supported only for billing accounts with // agreement type Enterprise Agreement. CreatedByUserEmailAddress *string // READ-ONLY; The date the role assignment was created. CreatedOn *time.Time // READ-ONLY; The name of the customer. CustomerDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies a customer. CustomerID *string // READ-ONLY; The name of the invoice section. InvoiceSectionDisplayName *string // READ-ONLY; The fully qualified ID that uniquely identifies an invoice section. InvoiceSectionID *string // READ-ONLY; The principal PUID of the user who modified the role assignment. ModifiedByPrincipalID *string // READ-ONLY; The principal PUID of the user who modified the role assignment. ModifiedByPrincipalPuid *string // READ-ONLY; The tenant Id of the user who modified the role assignment. ModifiedByPrincipalTenantID *string // READ-ONLY; The email address of the user who modified the role assignment. This is supported only for billing accounts // with agreement type Enterprise Agreement. ModifiedByUserEmailAddress *string // READ-ONLY; The date the role assignment was modified. ModifiedOn *time.Time // READ-ONLY; The display name of the principal to whom the role was assigned. PrincipalDisplayName *string // READ-ONLY; The friendly name of the tenant of the user to whom the role was assigned. This will be 'Primary Tenant' for // the primary tenant of the billing account. PrincipalTenantName *string // READ-ONLY; The type of a role Assignment. PrincipalType *PrincipalType // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState }
RoleAssignmentProperties - The properties of the billing 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) BeginCreateByBillingAccount ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginCreateByBillingAccount(ctx context.Context, billingAccountName string, parameters RoleAssignmentProperties, options *RoleAssignmentsClientBeginCreateByBillingAccountOptions) (*runtime.Poller[RoleAssignmentsClientCreateByBillingAccountResponse], error)
BeginCreateByBillingAccount - Adds a role assignment 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- parameters - The properties of the billing role assignment.
- options - RoleAssignmentsClientBeginCreateByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingAccount.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.NewRoleAssignmentsClient().BeginCreateByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", armbilling.RoleAssignmentProperties{ PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), PrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), UserEmailAddress: to.Ptr("john@contoso.com"), }, 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("47309529-17e6-4104-b9e8-39f62fa1e5ed"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"), // }, // } }
Output:
func (*RoleAssignmentsClient) BeginCreateByBillingProfile ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginCreateByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, parameters RoleAssignmentProperties, options *RoleAssignmentsClientBeginCreateByBillingProfileOptions) (*runtime.Poller[RoleAssignmentsClientCreateByBillingProfileResponse], error)
BeginCreateByBillingProfile - Adds a role assignment 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- parameters - The properties of the billing role assignment.
- options - RoleAssignmentsClientBeginCreateByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingProfile.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.NewRoleAssignmentsClient().BeginCreateByBillingProfile(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "BKM6-54VH-BG7-PGB", armbilling.RoleAssignmentProperties{ PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), PrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), UserEmailAddress: to.Ptr("john@contoso.com"), }, 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.RoleAssignment = armbilling.RoleAssignment{ // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("47309529-17e6-4104-b9e8-39f62fa1e5ed"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB"), // }, // } }
Output:
func (*RoleAssignmentsClient) BeginCreateByCustomer ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginCreateByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, parameters RoleAssignmentProperties, options *RoleAssignmentsClientBeginCreateByCustomerOptions) (*runtime.Poller[RoleAssignmentsClientCreateByCustomerResponse], error)
BeginCreateByCustomer - Adds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- parameters - The properties of the billing role assignment.
- options - RoleAssignmentsClientBeginCreateByCustomerOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateByCustomer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByCustomer.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.NewRoleAssignmentsClient().BeginCreateByCustomer(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "BKM6-54VH-BG7-PGB", "703ab484-dda2-4402-827b-a74513b61e2d", armbilling.RoleAssignmentProperties{ PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), PrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfileName/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), UserEmailAddress: to.Ptr("john@contoso.com"), }, 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("30000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfileName/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleAssignments/30000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("47309529-17e6-4104-b9e8-39f62fa1e5ed"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfileName/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfileName/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d"), // }, // } }
Output:
func (*RoleAssignmentsClient) BeginCreateByInvoiceSection ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginCreateByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, parameters RoleAssignmentProperties, options *RoleAssignmentsClientBeginCreateByInvoiceSectionOptions) (*runtime.Poller[RoleAssignmentsClientCreateByInvoiceSectionResponse], error)
BeginCreateByInvoiceSection - Adds a role assignment 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 2024-04-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 properties of the billing role assignment.
- options - RoleAssignmentsClientBeginCreateByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateByInvoiceSection method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByInvoiceSection.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.NewRoleAssignmentsClient().BeginCreateByInvoiceSection(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "BKM6-54VH-BG7-PGB", "xxxx-xxxx-xxx-xxx", armbilling.RoleAssignmentProperties{ PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), PrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), UserEmailAddress: to.Ptr("john@contoso.com"), }, 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("47309529-17e6-4104-b9e8-39f62fa1e5ed"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx"), // }, // } }
Output:
func (*RoleAssignmentsClient) BeginCreateOrUpdateByBillingAccount ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginCreateOrUpdateByBillingAccount(ctx context.Context, billingAccountName string, billingRoleAssignmentName string, parameters RoleAssignment, options *RoleAssignmentsClientBeginCreateOrUpdateByBillingAccountOptions) (*runtime.Poller[RoleAssignmentsClientCreateOrUpdateByBillingAccountResponse], error)
BeginCreateOrUpdateByBillingAccount - Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- parameters - The properties of the billing role assignment.
- options - RoleAssignmentsClientBeginCreateOrUpdateByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateOrUpdateByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByBillingAccount.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.NewRoleAssignmentsClient().BeginCreateOrUpdateByBillingAccount(ctx, "7898901", "9dfd08c2-62a3-4d47-85bd-1cdba1408402", armbilling.RoleAssignment{ Properties: &armbilling.RoleAssignmentProperties{ PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), PrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db"), UserEmailAddress: to.Ptr("john@contoso.com"), }, }, 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("9dfd08c2-62a3-4d47-85bd-1cdba1408402"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/billingRoleAssignments/9dfd08c2-62a3-4d47-85bd-1cdba1408402"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("60d97094-2be4-46cc-a4fe-3633021a25b9"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901"), // }, // } }
Output:
func (*RoleAssignmentsClient) BeginCreateOrUpdateByDepartment ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginCreateOrUpdateByDepartment(ctx context.Context, billingAccountName string, departmentName string, billingRoleAssignmentName string, parameters RoleAssignment, options *RoleAssignmentsClientBeginCreateOrUpdateByDepartmentOptions) (*runtime.Poller[RoleAssignmentsClientCreateOrUpdateByDepartmentResponse], error)
BeginCreateOrUpdateByDepartment - Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- parameters - The properties of the billing role assignment.
- options - RoleAssignmentsClientBeginCreateOrUpdateByDepartmentOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateOrUpdateByDepartment method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByDepartment.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.NewRoleAssignmentsClient().BeginCreateOrUpdateByDepartment(ctx, "7898901", "12345", "9dfd08c2-62a3-4d47-85bd-1cdba1408402", armbilling.RoleAssignment{ Properties: &armbilling.RoleAssignmentProperties{ PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), PrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/departments/12345/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db"), UserEmailAddress: to.Ptr("john@contoso.com"), }, }, 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("9dfd08c2-62a3-4d47-85bd-1cdba1408402"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/departments/12345/billingRoleAssignments/9dfd08c2-62a3-4d47-85bd-1cdba1408402"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("60d97094-2be4-46cc-a4fe-3633021a25b9"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/departments/12345/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/departments/12345"), // }, // } }
Output:
func (*RoleAssignmentsClient) BeginCreateOrUpdateByEnrollmentAccount ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginCreateOrUpdateByEnrollmentAccount(ctx context.Context, billingAccountName string, enrollmentAccountName string, billingRoleAssignmentName string, parameters RoleAssignment, options *RoleAssignmentsClientBeginCreateOrUpdateByEnrollmentAccountOptions) (*runtime.Poller[RoleAssignmentsClientCreateOrUpdateByEnrollmentAccountResponse], error)
BeginCreateOrUpdateByEnrollmentAccount - Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- enrollmentAccountName - The name of the enrollment account.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- parameters - The properties of the billing role assignment.
- options - RoleAssignmentsClientBeginCreateOrUpdateByEnrollmentAccountOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateOrUpdateByEnrollmentAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByEnrollmentAccount.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.NewRoleAssignmentsClient().BeginCreateOrUpdateByEnrollmentAccount(ctx, "7898901", "123456", "9dfd08c2-62a3-4d47-85bd-1cdba1408402", armbilling.RoleAssignment{ Properties: &armbilling.RoleAssignmentProperties{ PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), PrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/enrollmentAccounts/123456/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db"), UserEmailAddress: to.Ptr("john@contoso.com"), }, }, 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.RoleAssignment = armbilling.RoleAssignment{ // Name: to.Ptr("9dfd08c2-62a3-4d47-85bd-1cdba1408402"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/enrollmentAccounts/123456/billingRoleAssignments/9dfd08c2-62a3-4d47-85bd-1cdba1408402"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("60d97094-2be4-46cc-a4fe-3633021a25b9"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/enrollmentAccounts/123456/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/enrollmentAccounts/123456"), // }, // } }
Output:
func (*RoleAssignmentsClient) BeginResolveByBillingAccount ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginResolveByBillingAccount(ctx context.Context, billingAccountName string, options *RoleAssignmentsClientBeginResolveByBillingAccountOptions) (*runtime.Poller[RoleAssignmentsClientResolveByBillingAccountResponse], error)
BeginResolveByBillingAccount - Lists the role assignments for the caller on a billing account while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - RoleAssignmentsClientBeginResolveByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.BeginResolveByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingAccount.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.NewRoleAssignmentsClient().BeginResolveByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", &armbilling.RoleAssignmentsClientBeginResolveByBillingAccountOptions{ResolveScopeDisplayNames: nil, Filter: 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.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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/00000000-0000-0000-0000-000000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"), // }, // }, // { // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/00000000-0000-0000-0000-000000000001"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"), // }, // }}, // } }
Output:
func (*RoleAssignmentsClient) BeginResolveByBillingProfile ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginResolveByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, options *RoleAssignmentsClientBeginResolveByBillingProfileOptions) (*runtime.Poller[RoleAssignmentsClientResolveByBillingProfileResponse], error)
BeginResolveByBillingProfile - Lists the role assignments for the caller on an billing profile while fetching user info for each role assignment. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - RoleAssignmentsClientBeginResolveByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.BeginResolveByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingProfile.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.NewRoleAssignmentsClient().BeginResolveByBillingProfile(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "xxxx-xxxx-xxx-xxx", &armbilling.RoleAssignmentsClientBeginResolveByBillingProfileOptions{ResolveScopeDisplayNames: nil, Filter: 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.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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/00000000-0000-0000-0000-000000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx"), // }, // }, // { // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/00000000-0000-0000-0000-000000000001"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx"), // }, // }}, // } }
Output:
func (*RoleAssignmentsClient) BeginResolveByCustomer ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginResolveByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, options *RoleAssignmentsClientBeginResolveByCustomerOptions) (*runtime.Poller[RoleAssignmentsClientResolveByCustomerResponse], error)
BeginResolveByCustomer - Lists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- options - RoleAssignmentsClientBeginResolveByCustomerOptions contains the optional parameters for the RoleAssignmentsClient.BeginResolveByCustomer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByCustomer.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.NewRoleAssignmentsClient().BeginResolveByCustomer(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "xxxx-xxxx-xxx-xxx", "703ab484-dda2-4402-827b-a74513b61e2d", &armbilling.RoleAssignmentsClientBeginResolveByCustomerOptions{ResolveScopeDisplayNames: nil, Filter: 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.RoleAssignmentListResult = armbilling.RoleAssignmentListResult{ // Value: []*armbilling.RoleAssignment{ // { // Name: to.Ptr("30000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleAssignments/30000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalTenantID: to.Ptr("c360d6f1-2709-476d-81bb-d075b213d9fc"), // PrincipalTenantName: to.Ptr("Foo Bar"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/customers/703ab484-dda2-4402-827b-a74513b61e2d"), // UserEmailAddress: to.Ptr("foo@bar.com"), // }, // }, // { // Name: to.Ptr("30000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleAssignments/30000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalTenantID: to.Ptr("c360d6f1-2709-476d-81bb-d075b213d9fc"), // PrincipalTenantName: to.Ptr("Foo Bar"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/customers/703ab484-dda2-4402-827b-a74513b61e2d"), // UserEmailAddress: to.Ptr("foo@bar.com"), // }, // }}, // } }
Output:
func (*RoleAssignmentsClient) BeginResolveByInvoiceSection ¶ added in v1.0.0
func (client *RoleAssignmentsClient) BeginResolveByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, options *RoleAssignmentsClientBeginResolveByInvoiceSectionOptions) (*runtime.Poller[RoleAssignmentsClientResolveByInvoiceSectionResponse], error)
BeginResolveByInvoiceSection - Lists the role assignments for the caller on an invoice section while fetching user info for each role assignment. 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 2024-04-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 - RoleAssignmentsClientBeginResolveByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.BeginResolveByInvoiceSection method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByInvoiceSection.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.NewRoleAssignmentsClient().BeginResolveByInvoiceSection(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "BKM6-54VH-BG7-PGB", "xxxx-xxxx-xxx-xxx", &armbilling.RoleAssignmentsClientBeginResolveByInvoiceSectionOptions{ResolveScopeDisplayNames: nil, Filter: 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.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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx"), // }, // }, // { // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx"), // }, // }}, // } }
Output:
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 on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingAccount.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) } _, err = clientFactory.NewRoleAssignmentsClient().DeleteByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
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 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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingProfile.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) } _, err = clientFactory.NewRoleAssignmentsClient().DeleteByBillingProfile(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "BKM6-54VH-BG7-PGB", "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*RoleAssignmentsClient) DeleteByCustomer ¶ added in v1.0.0
func (client *RoleAssignmentsClient) DeleteByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByCustomerOptions) (RoleAssignmentsClientDeleteByCustomerResponse, error)
DeleteByCustomer - Deletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientDeleteByCustomerOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByCustomer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByCustomer.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) } _, err = clientFactory.NewRoleAssignmentsClient().DeleteByCustomer(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "BKM6-54VH-BG7-PGB", "703ab484-dda2-4402-827b-a74513b61e2d", "30000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*RoleAssignmentsClient) DeleteByDepartment ¶ added in v1.0.0
func (client *RoleAssignmentsClient) DeleteByDepartment(ctx context.Context, billingAccountName string, departmentName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByDepartmentOptions) (RoleAssignmentsClientDeleteByDepartmentResponse, error)
DeleteByDepartment - Deletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientDeleteByDepartmentOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByDepartment method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByDepartment.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) } _, err = clientFactory.NewRoleAssignmentsClient().DeleteByDepartment(ctx, "8608480", "123456", "9dfd08c2-62a3-4d47-85bd-1cdba1408402", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*RoleAssignmentsClient) DeleteByEnrollmentAccount ¶ added in v1.0.0
func (client *RoleAssignmentsClient) DeleteByEnrollmentAccount(ctx context.Context, billingAccountName string, enrollmentAccountName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByEnrollmentAccountOptions) (RoleAssignmentsClientDeleteByEnrollmentAccountResponse, error)
DeleteByEnrollmentAccount - Deletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- enrollmentAccountName - The name of the enrollment account.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientDeleteByEnrollmentAccountOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByEnrollmentAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByEnrollmentAccount.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) } _, err = clientFactory.NewRoleAssignmentsClient().DeleteByEnrollmentAccount(ctx, "8608480", "123456", "9dfd08c2-62a3-4d47-85bd-1cdba1408402", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
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 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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByInvoiceSection.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) } _, err = clientFactory.NewRoleAssignmentsClient().DeleteByInvoiceSection(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "BKM6-54VH-BG7-PGB", "xxxx-xxxx-xxx-xxx", "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
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, Microsoft Customer Agreement or Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingAccount.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr(""), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/00000000-0000-0000-0000-000000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"), // }, // } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingProfile.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "xxxx-xxxx-xxx-xxx", "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", 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/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("46b831ec-42b2-4f1a-8b54-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/00000000-0000-0000-0000-000000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx"), // }, // } }
Output:
func (*RoleAssignmentsClient) GetByCustomer ¶ added in v1.0.0
func (client *RoleAssignmentsClient) GetByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByCustomerOptions) (RoleAssignmentsClientGetByCustomerResponse, error)
GetByCustomer - Gets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientGetByCustomerOptions contains the optional parameters for the RoleAssignmentsClient.GetByCustomer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByCustomer.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().GetByCustomer(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "xxxx-xxxx-xxx-xxx", "703ab484-dda2-4402-827b-a74513b61e2d", "30000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", 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("30000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleAssignments/30000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr(""), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/customers/703ab484-dda2-4402-827b-a74513b61e2d"), // }, // } }
Output:
func (*RoleAssignmentsClient) GetByDepartment ¶ added in v1.0.0
func (client *RoleAssignmentsClient) GetByDepartment(ctx context.Context, billingAccountName string, departmentName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByDepartmentOptions) (RoleAssignmentsClientGetByDepartmentResponse, error)
GetByDepartment - Gets a role assignment for the caller on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientGetByDepartmentOptions contains the optional parameters for the RoleAssignmentsClient.GetByDepartment method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByDepartment.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().GetByDepartment(ctx, "7898901", "225314", "9dfd08c2-62a3-4d47-85bd-1cdba1408402", 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("9dfd08c2-62a3-4d47-85bd-1cdba1408402"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/departments/225314/billingRoleAssignments/9dfd08c2-62a3-4d47-85bd-1cdba1408402"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByUserEmailAddress: to.Ptr("test@billtest900006.onmicrosoft.com"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/departments/225314/billingRoleDefinitions/c15c22c0-9faf-424c-9b7e-bd91c06a240b"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/departments/225314"), // UserAuthenticationType: to.Ptr("Organization"), // UserEmailAddress: to.Ptr("a_owner@billtest900006.onmicrosoft.com"), // }, // } }
Output:
func (*RoleAssignmentsClient) GetByEnrollmentAccount ¶ added in v1.0.0
func (client *RoleAssignmentsClient) GetByEnrollmentAccount(ctx context.Context, billingAccountName string, enrollmentAccountName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByEnrollmentAccountOptions) (RoleAssignmentsClientGetByEnrollmentAccountResponse, error)
GetByEnrollmentAccount - Gets a role assignment for the caller on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- enrollmentAccountName - The name of the enrollment account.
- billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
- options - RoleAssignmentsClientGetByEnrollmentAccountOptions contains the optional parameters for the RoleAssignmentsClient.GetByEnrollmentAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByEnrollmentAccount.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().GetByEnrollmentAccount(ctx, "7898901", "225314", "9dfd08c2-62a3-4d47-85bd-1cdba1408402", 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("9dfd08c2-62a3-4d47-85bd-1cdba1408402"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/enrollmentAccounts/225314/billingRoleAssignments/9dfd08c2-62a3-4d47-85bd-1cdba1408402"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByUserEmailAddress: to.Ptr("test@billtest900006.onmicrosoft.com"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/enrollmentAccounts/225314/billingRoleDefinitions/c15c22c0-9faf-424c-9b7e-bd91c06a240b"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7898901/enrollmentAccounts/225314"), // UserAuthenticationType: to.Ptr("Organization"), // UserEmailAddress: to.Ptr("a_owner@billtest900006.onmicrosoft.com"), // }, // } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByInvoiceSection.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "BKM6-54VH-BG7-PGB", "xxxx-xxxx-xxx-xxx", "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("46b831ec-42b2-4f1a-8b54-3fd5ff9d6aa1"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx"), // }, // } }
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, Microsoft Customer Agreement or Enterprise Agreement.
Generated from API version 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingAccount.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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", &armbilling.RoleAssignmentsClientListByBillingAccountOptions{Filter: nil, Top: nil, Skip: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/00000000-0000-0000-0000-000000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"), // }, // }, // { // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/00000000-0000-0000-0000-000000000001"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"), // }, // }}, // } } }
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 Partner Agreement or Microsoft Customer Agreement.
Generated from API version 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingProfile.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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "xxxx-xxxx-xxx-xxx", &armbilling.RoleAssignmentsClientListByBillingProfileOptions{Filter: nil, Top: nil, Skip: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/00000000-0000-0000-0000-000000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx"), // }, // }, // { // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/00000000-0000-0000-0000-000000000001"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/xxxx-xxxx-xxx-xxx"), // }, // }}, // } } }
Output:
func (*RoleAssignmentsClient) NewListByCustomerPager ¶ added in v1.0.0
func (client *RoleAssignmentsClient) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, options *RoleAssignmentsClientListByCustomerOptions) *runtime.Pager[RoleAssignmentsClientListByCustomerResponse]
NewListByCustomerPager - Lists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- options - RoleAssignmentsClientListByCustomerOptions contains the optional parameters for the RoleAssignmentsClient.NewListByCustomerPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByCustomer.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().NewListByCustomerPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "BKM6-54VH-BG7-PGB", "703ab484-dda2-4402-827b-a74513b61e2d", &armbilling.RoleAssignmentsClientListByCustomerOptions{Filter: nil, Top: nil, Skip: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.RoleAssignmentListResult = armbilling.RoleAssignmentListResult{ // Value: []*armbilling.RoleAssignment{ // { // Name: to.Ptr("30000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleAssignments/30000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr(""), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d"), // }, // }, // { // Name: to.Ptr("30000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleAssignments/30000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr(""), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d"), // }, // }}, // } } }
Output:
func (*RoleAssignmentsClient) NewListByDepartmentPager ¶ added in v1.0.0
func (client *RoleAssignmentsClient) NewListByDepartmentPager(billingAccountName string, departmentName string, options *RoleAssignmentsClientListByDepartmentOptions) *runtime.Pager[RoleAssignmentsClientListByDepartmentResponse]
NewListByDepartmentPager - Lists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- options - RoleAssignmentsClientListByDepartmentOptions contains the optional parameters for the RoleAssignmentsClient.NewListByDepartmentPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByDepartment.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().NewListByDepartmentPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "12345", 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/departments/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/departments/12345/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/departments/12345/billingRoleDefinitions/00000000-0000-0000-0000-000000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/departments/12345"), // }, // }, // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/departments/12345/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("\"/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/departments/12345/billingRoleDefinitions/00000000-0000-0000-0000-000000000001"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/departments/12345"), // }, // }}, // } } }
Output:
func (*RoleAssignmentsClient) NewListByEnrollmentAccountPager ¶ added in v1.0.0
func (client *RoleAssignmentsClient) NewListByEnrollmentAccountPager(billingAccountName string, enrollmentAccountName string, options *RoleAssignmentsClientListByEnrollmentAccountOptions) *runtime.Pager[RoleAssignmentsClientListByEnrollmentAccountResponse]
NewListByEnrollmentAccountPager - Lists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- enrollmentAccountName - The name of the enrollment account.
- options - RoleAssignmentsClientListByEnrollmentAccountOptions contains the optional parameters for the RoleAssignmentsClient.NewListByEnrollmentAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByEnrollmentAccount.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().NewListByEnrollmentAccountPager("6100092", "123456", 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/enrollmentAccounts/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6100092/enrollmentAccounts/123456/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6100092/enrollmentAccounts/123456/billingRoleDefinitions/50000000-0000-0000-0000-000000000000"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6100092/enrollmentAccounts/123456"), // }, // }, // { // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingRoleAssignments"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6100092/enrollmentAccounts/123456/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6100092/enrollmentAccounts/123456/billingRoleDefinitions/50000000-0000-0000-0000-000000000001"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6100092/enrollmentAccounts/123456"), // }, // }}, // } } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByInvoiceSection.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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30", "BKM6-54VH-BG7-PGB", "xxxx-xxxx-xxx-xxx", &armbilling.RoleAssignmentsClientListByInvoiceSectionOptions{Filter: nil, Top: nil, Skip: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000002"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx"), // }, // }, // { // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), // Properties: &armbilling.RoleAssignmentProperties{ // CreatedByPrincipalID: to.Ptr("00000000-0000-0000-0000-000000000001"), // CreatedByPrincipalTenantID: to.Ptr("076915e7-de10-4323-bb34-a58c904068bb"), // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-19T20:10:50.102Z"); return t}()), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalType: to.Ptr(armbilling.PrincipalTypeUser), // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000001"), // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx"), // }, // }}, // } } }
Output:
type RoleAssignmentsClientBeginCreateByBillingAccountOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginCreateByBillingAccountOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginCreateByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateByBillingAccount method.
type RoleAssignmentsClientBeginCreateByBillingProfileOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginCreateByBillingProfileOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginCreateByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateByBillingProfile method.
type RoleAssignmentsClientBeginCreateByCustomerOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginCreateByCustomerOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginCreateByCustomerOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateByCustomer method.
type RoleAssignmentsClientBeginCreateByInvoiceSectionOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginCreateByInvoiceSectionOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginCreateByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateByInvoiceSection method.
type RoleAssignmentsClientBeginCreateOrUpdateByBillingAccountOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginCreateOrUpdateByBillingAccountOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginCreateOrUpdateByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateOrUpdateByBillingAccount method.
type RoleAssignmentsClientBeginCreateOrUpdateByDepartmentOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginCreateOrUpdateByDepartmentOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginCreateOrUpdateByDepartmentOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateOrUpdateByDepartment method.
type RoleAssignmentsClientBeginCreateOrUpdateByEnrollmentAccountOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginCreateOrUpdateByEnrollmentAccountOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginCreateOrUpdateByEnrollmentAccountOptions contains the optional parameters for the RoleAssignmentsClient.BeginCreateOrUpdateByEnrollmentAccount method.
type RoleAssignmentsClientBeginResolveByBillingAccountOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginResolveByBillingAccountOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Resolves the scope display name for each of the role assignments. ResolveScopeDisplayNames *bool // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginResolveByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.BeginResolveByBillingAccount method.
type RoleAssignmentsClientBeginResolveByBillingProfileOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginResolveByBillingProfileOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Resolves the scope display name for each of the role assignments. ResolveScopeDisplayNames *bool // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginResolveByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.BeginResolveByBillingProfile method.
type RoleAssignmentsClientBeginResolveByCustomerOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginResolveByCustomerOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Resolves the scope display name for each of the role assignments. ResolveScopeDisplayNames *bool // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginResolveByCustomerOptions contains the optional parameters for the RoleAssignmentsClient.BeginResolveByCustomer method.
type RoleAssignmentsClientBeginResolveByInvoiceSectionOptions ¶ added in v1.0.0
type RoleAssignmentsClientBeginResolveByInvoiceSectionOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Resolves the scope display name for each of the role assignments. ResolveScopeDisplayNames *bool // Resumes the LRO from the provided token. ResumeToken string }
RoleAssignmentsClientBeginResolveByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.BeginResolveByInvoiceSection method.
type RoleAssignmentsClientCreateByBillingAccountResponse ¶ added in v1.0.0
type RoleAssignmentsClientCreateByBillingAccountResponse struct { // The properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientCreateByBillingAccountResponse contains the response from method RoleAssignmentsClient.BeginCreateByBillingAccount.
type RoleAssignmentsClientCreateByBillingProfileResponse ¶ added in v1.0.0
type RoleAssignmentsClientCreateByBillingProfileResponse struct { // The properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientCreateByBillingProfileResponse contains the response from method RoleAssignmentsClient.BeginCreateByBillingProfile.
type RoleAssignmentsClientCreateByCustomerResponse ¶ added in v1.0.0
type RoleAssignmentsClientCreateByCustomerResponse struct { // The properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientCreateByCustomerResponse contains the response from method RoleAssignmentsClient.BeginCreateByCustomer.
type RoleAssignmentsClientCreateByInvoiceSectionResponse ¶ added in v1.0.0
type RoleAssignmentsClientCreateByInvoiceSectionResponse struct { // The properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientCreateByInvoiceSectionResponse contains the response from method RoleAssignmentsClient.BeginCreateByInvoiceSection.
type RoleAssignmentsClientCreateOrUpdateByBillingAccountResponse ¶ added in v1.0.0
type RoleAssignmentsClientCreateOrUpdateByBillingAccountResponse struct { // The properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientCreateOrUpdateByBillingAccountResponse contains the response from method RoleAssignmentsClient.BeginCreateOrUpdateByBillingAccount.
type RoleAssignmentsClientCreateOrUpdateByDepartmentResponse ¶ added in v1.0.0
type RoleAssignmentsClientCreateOrUpdateByDepartmentResponse struct { // The properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientCreateOrUpdateByDepartmentResponse contains the response from method RoleAssignmentsClient.BeginCreateOrUpdateByDepartment.
type RoleAssignmentsClientCreateOrUpdateByEnrollmentAccountResponse ¶ added in v1.0.0
type RoleAssignmentsClientCreateOrUpdateByEnrollmentAccountResponse struct { // The properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientCreateOrUpdateByEnrollmentAccountResponse contains the response from method RoleAssignmentsClient.BeginCreateOrUpdateByEnrollmentAccount.
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 { }
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 { }
RoleAssignmentsClientDeleteByBillingProfileResponse contains the response from method RoleAssignmentsClient.DeleteByBillingProfile.
type RoleAssignmentsClientDeleteByCustomerOptions ¶ added in v1.0.0
type RoleAssignmentsClientDeleteByCustomerOptions struct { }
RoleAssignmentsClientDeleteByCustomerOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByCustomer method.
type RoleAssignmentsClientDeleteByCustomerResponse ¶ added in v1.0.0
type RoleAssignmentsClientDeleteByCustomerResponse struct { }
RoleAssignmentsClientDeleteByCustomerResponse contains the response from method RoleAssignmentsClient.DeleteByCustomer.
type RoleAssignmentsClientDeleteByDepartmentOptions ¶ added in v1.0.0
type RoleAssignmentsClientDeleteByDepartmentOptions struct { }
RoleAssignmentsClientDeleteByDepartmentOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByDepartment method.
type RoleAssignmentsClientDeleteByDepartmentResponse ¶ added in v1.0.0
type RoleAssignmentsClientDeleteByDepartmentResponse struct { }
RoleAssignmentsClientDeleteByDepartmentResponse contains the response from method RoleAssignmentsClient.DeleteByDepartment.
type RoleAssignmentsClientDeleteByEnrollmentAccountOptions ¶ added in v1.0.0
type RoleAssignmentsClientDeleteByEnrollmentAccountOptions struct { }
RoleAssignmentsClientDeleteByEnrollmentAccountOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByEnrollmentAccount method.
type RoleAssignmentsClientDeleteByEnrollmentAccountResponse ¶ added in v1.0.0
type RoleAssignmentsClientDeleteByEnrollmentAccountResponse struct { }
RoleAssignmentsClientDeleteByEnrollmentAccountResponse contains the response from method RoleAssignmentsClient.DeleteByEnrollmentAccount.
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 { }
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 properties of the billing 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 properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientGetByBillingProfileResponse contains the response from method RoleAssignmentsClient.GetByBillingProfile.
type RoleAssignmentsClientGetByCustomerOptions ¶ added in v1.0.0
type RoleAssignmentsClientGetByCustomerOptions struct { }
RoleAssignmentsClientGetByCustomerOptions contains the optional parameters for the RoleAssignmentsClient.GetByCustomer method.
type RoleAssignmentsClientGetByCustomerResponse ¶ added in v1.0.0
type RoleAssignmentsClientGetByCustomerResponse struct { // The properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientGetByCustomerResponse contains the response from method RoleAssignmentsClient.GetByCustomer.
type RoleAssignmentsClientGetByDepartmentOptions ¶ added in v1.0.0
type RoleAssignmentsClientGetByDepartmentOptions struct { }
RoleAssignmentsClientGetByDepartmentOptions contains the optional parameters for the RoleAssignmentsClient.GetByDepartment method.
type RoleAssignmentsClientGetByDepartmentResponse ¶ added in v1.0.0
type RoleAssignmentsClientGetByDepartmentResponse struct { // The properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientGetByDepartmentResponse contains the response from method RoleAssignmentsClient.GetByDepartment.
type RoleAssignmentsClientGetByEnrollmentAccountOptions ¶ added in v1.0.0
type RoleAssignmentsClientGetByEnrollmentAccountOptions struct { }
RoleAssignmentsClientGetByEnrollmentAccountOptions contains the optional parameters for the RoleAssignmentsClient.GetByEnrollmentAccount method.
type RoleAssignmentsClientGetByEnrollmentAccountResponse ¶ added in v1.0.0
type RoleAssignmentsClientGetByEnrollmentAccountResponse struct { // The properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientGetByEnrollmentAccountResponse contains the response from method RoleAssignmentsClient.GetByEnrollmentAccount.
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 properties of the billing role assignment. RoleAssignment }
RoleAssignmentsClientGetByInvoiceSectionResponse contains the response from method RoleAssignmentsClient.GetByInvoiceSection.
type RoleAssignmentsClientListByBillingAccountOptions ¶ added in v0.2.0
type RoleAssignmentsClientListByBillingAccountOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
RoleAssignmentsClientListByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.NewListByBillingAccountPager method.
type RoleAssignmentsClientListByBillingAccountResponse ¶ added in v0.2.0
type RoleAssignmentsClientListByBillingAccountResponse struct { // A container for a list of resources RoleAssignmentListResult }
RoleAssignmentsClientListByBillingAccountResponse contains the response from method RoleAssignmentsClient.NewListByBillingAccountPager.
type RoleAssignmentsClientListByBillingProfileOptions ¶ added in v0.2.0
type RoleAssignmentsClientListByBillingProfileOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
RoleAssignmentsClientListByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.NewListByBillingProfilePager method.
type RoleAssignmentsClientListByBillingProfileResponse ¶ added in v0.2.0
type RoleAssignmentsClientListByBillingProfileResponse struct { // A container for a list of resources RoleAssignmentListResult }
RoleAssignmentsClientListByBillingProfileResponse contains the response from method RoleAssignmentsClient.NewListByBillingProfilePager.
type RoleAssignmentsClientListByCustomerOptions ¶ added in v1.0.0
type RoleAssignmentsClientListByCustomerOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
RoleAssignmentsClientListByCustomerOptions contains the optional parameters for the RoleAssignmentsClient.NewListByCustomerPager method.
type RoleAssignmentsClientListByCustomerResponse ¶ added in v1.0.0
type RoleAssignmentsClientListByCustomerResponse struct { // A container for a list of resources RoleAssignmentListResult }
RoleAssignmentsClientListByCustomerResponse contains the response from method RoleAssignmentsClient.NewListByCustomerPager.
type RoleAssignmentsClientListByDepartmentOptions ¶ added in v1.0.0
type RoleAssignmentsClientListByDepartmentOptions struct { }
RoleAssignmentsClientListByDepartmentOptions contains the optional parameters for the RoleAssignmentsClient.NewListByDepartmentPager method.
type RoleAssignmentsClientListByDepartmentResponse ¶ added in v1.0.0
type RoleAssignmentsClientListByDepartmentResponse struct { // A container for a list of resources RoleAssignmentListResult }
RoleAssignmentsClientListByDepartmentResponse contains the response from method RoleAssignmentsClient.NewListByDepartmentPager.
type RoleAssignmentsClientListByEnrollmentAccountOptions ¶ added in v1.0.0
type RoleAssignmentsClientListByEnrollmentAccountOptions struct { }
RoleAssignmentsClientListByEnrollmentAccountOptions contains the optional parameters for the RoleAssignmentsClient.NewListByEnrollmentAccountPager method.
type RoleAssignmentsClientListByEnrollmentAccountResponse ¶ added in v1.0.0
type RoleAssignmentsClientListByEnrollmentAccountResponse struct { // A container for a list of resources RoleAssignmentListResult }
RoleAssignmentsClientListByEnrollmentAccountResponse contains the response from method RoleAssignmentsClient.NewListByEnrollmentAccountPager.
type RoleAssignmentsClientListByInvoiceSectionOptions ¶ added in v0.2.0
type RoleAssignmentsClientListByInvoiceSectionOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
RoleAssignmentsClientListByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.NewListByInvoiceSectionPager method.
type RoleAssignmentsClientListByInvoiceSectionResponse ¶ added in v0.2.0
type RoleAssignmentsClientListByInvoiceSectionResponse struct { // A container for a list of resources RoleAssignmentListResult }
RoleAssignmentsClientListByInvoiceSectionResponse contains the response from method RoleAssignmentsClient.NewListByInvoiceSectionPager.
type RoleAssignmentsClientResolveByBillingAccountResponse ¶ added in v1.0.0
type RoleAssignmentsClientResolveByBillingAccountResponse struct { // A container for a list of resources RoleAssignmentListResult }
RoleAssignmentsClientResolveByBillingAccountResponse contains the response from method RoleAssignmentsClient.BeginResolveByBillingAccount.
type RoleAssignmentsClientResolveByBillingProfileResponse ¶ added in v1.0.0
type RoleAssignmentsClientResolveByBillingProfileResponse struct { // A container for a list of resources RoleAssignmentListResult }
RoleAssignmentsClientResolveByBillingProfileResponse contains the response from method RoleAssignmentsClient.BeginResolveByBillingProfile.
type RoleAssignmentsClientResolveByCustomerResponse ¶ added in v1.0.0
type RoleAssignmentsClientResolveByCustomerResponse struct { // A container for a list of resources RoleAssignmentListResult }
RoleAssignmentsClientResolveByCustomerResponse contains the response from method RoleAssignmentsClient.BeginResolveByCustomer.
type RoleAssignmentsClientResolveByInvoiceSectionResponse ¶ added in v1.0.0
type RoleAssignmentsClientResolveByInvoiceSectionResponse struct { // A container for a list of resources RoleAssignmentListResult }
RoleAssignmentsClientResolveByInvoiceSectionResponse contains the response from method RoleAssignmentsClient.BeginResolveByInvoiceSection.
type RoleDefinition ¶ added in v0.2.0
type RoleDefinition struct { // The properties of a role definition. Properties *RoleDefinitionProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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 RoleDefinitionClient ¶ added in v1.0.0
type RoleDefinitionClient struct {
// contains filtered or unexported fields
}
RoleDefinitionClient contains the methods for the BillingRoleDefinition group. Don't use this type directly, use NewRoleDefinitionClient() instead.
func NewRoleDefinitionClient ¶ added in v1.0.0
func NewRoleDefinitionClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*RoleDefinitionClient, error)
NewRoleDefinitionClient creates a new instance of RoleDefinitionClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*RoleDefinitionClient) GetByBillingAccount ¶ added in v1.0.0
func (client *RoleDefinitionClient) GetByBillingAccount(ctx context.Context, billingAccountName string, roleDefinitionName string, options *RoleDefinitionClientGetByBillingAccountOptions) (RoleDefinitionClientGetByBillingAccountResponse, 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, Microsoft Customer Agreement or Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- roleDefinitionName - The ID that uniquely identifies a role definition.
- options - RoleDefinitionClientGetByBillingAccountOptions contains the optional parameters for the RoleDefinitionClient.GetByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingAccount.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.NewRoleDefinitionClient().GetByBillingAccount(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "50000000-aaaa-bbbb-cccc-100000000000", 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("50000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("50000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("50000000-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("50000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000018"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000016")}, // }}, // RoleName: to.Ptr("Billing account owner"), // }, // } }
Output:
func (*RoleDefinitionClient) GetByBillingProfile ¶ added in v1.0.0
func (client *RoleDefinitionClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, roleDefinitionName string, options *RoleDefinitionClientGetByBillingProfileOptions) (RoleDefinitionClientGetByBillingProfileResponse, 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- roleDefinitionName - The ID that uniquely identifies a role definition.
- options - RoleDefinitionClientGetByBillingProfileOptions contains the optional parameters for the RoleDefinitionClient.GetByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingProfile.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.NewRoleDefinitionClient().GetByBillingProfile(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "40000000-aaaa-bbbb-cccc-100000000000", 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("40000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/40000000-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.Permission{ // { // Actions: []*string{ // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000013")}, // }}, // RoleName: to.Ptr("Billing profile owner"), // }, // } }
Output:
func (*RoleDefinitionClient) GetByCustomer ¶ added in v1.0.0
func (client *RoleDefinitionClient) GetByCustomer(ctx context.Context, billingAccountName string, billingProfileName string, customerName string, roleDefinitionName string, options *RoleDefinitionClientGetByCustomerOptions) (RoleDefinitionClientGetByCustomerResponse, error)
GetByCustomer - Gets the definition for a role on a customer. 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- roleDefinitionName - The ID that uniquely identifies a role definition.
- options - RoleDefinitionClientGetByCustomerOptions contains the optional parameters for the RoleDefinitionClient.GetByCustomer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByCustomer.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.NewRoleDefinitionClient().GetByCustomer(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "11111111-1111-1111-1111-111111111111", "30000000-aaaa-bbbb-cccc-100000000000", 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("30000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the customer."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000016"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000018")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Customer owner"), // }, // } }
Output:
func (*RoleDefinitionClient) GetByDepartment ¶ added in v1.0.0
func (client *RoleDefinitionClient) GetByDepartment(ctx context.Context, billingAccountName string, departmentName string, roleDefinitionName string, options *RoleDefinitionClientGetByDepartmentOptions) (RoleDefinitionClientGetByDepartmentResponse, error)
GetByDepartment - Gets the definition for a role on a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- roleDefinitionName - The ID that uniquely identifies a role definition.
- options - RoleDefinitionClientGetByDepartmentOptions contains the optional parameters for the RoleDefinitionClient.GetByDepartment method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByDepartment.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.NewRoleDefinitionClient().GetByDepartment(ctx, "123456", "7368531", "50000000-aaaa-bbbb-cccc-100000000000", 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("50000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/123456/departments/7368531/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("Microsoft.Billing/billingAccounts/departments/read"), // to.Ptr("Microsoft.Billing/billingAccounts/departments/write"), // to.Ptr("Microsoft.Billing/billingAccounts/departments/action"), // to.Ptr("Microsoft.Billing/billingAccounts/departments/delete"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/write"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/action"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/delete")}, // }}, // RoleName: to.Ptr("Department Admin"), // }, // } }
Output:
func (*RoleDefinitionClient) GetByEnrollmentAccount ¶ added in v1.0.0
func (client *RoleDefinitionClient) GetByEnrollmentAccount(ctx context.Context, billingAccountName string, enrollmentAccountName string, roleDefinitionName string, options *RoleDefinitionClientGetByEnrollmentAccountOptions) (RoleDefinitionClientGetByEnrollmentAccountResponse, error)
GetByEnrollmentAccount - Gets the definition for a role on an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- enrollmentAccountName - The name of the enrollment account.
- roleDefinitionName - The ID that uniquely identifies a role definition.
- options - RoleDefinitionClientGetByEnrollmentAccountOptions contains the optional parameters for the RoleDefinitionClient.GetByEnrollmentAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByEnrollmentAccount.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.NewRoleDefinitionClient().GetByEnrollmentAccount(ctx, "123456", "4568789", "50000000-aaaa-bbbb-cccc-100000000000", 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("50000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/123456/enrollmentAccounts/4568789/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/write"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/action"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/delete"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/write"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/action")}, // }}, // RoleName: to.Ptr("Account Owner"), // }, // } }
Output:
func (*RoleDefinitionClient) GetByInvoiceSection ¶ added in v1.0.0
func (client *RoleDefinitionClient) GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, roleDefinitionName string, options *RoleDefinitionClientGetByInvoiceSectionOptions) (RoleDefinitionClientGetByInvoiceSectionResponse, 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 2024-04-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.
- roleDefinitionName - The ID that uniquely identifies a role definition.
- options - RoleDefinitionClientGetByInvoiceSectionOptions contains the optional parameters for the RoleDefinitionClient.GetByInvoiceSection method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByInvoiceSection.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.NewRoleDefinitionClient().GetByInvoiceSection(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", "30000000-aaaa-bbbb-cccc-100000000000", 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("30000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy/billingRoleDefinitions/30000000-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.Permission{ // { // Actions: []*string{ // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000016"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000018")}, // }}, // RoleName: to.Ptr("Invoice section owner"), // }, // } }
Output:
func (*RoleDefinitionClient) NewListByBillingAccountPager ¶ added in v1.0.0
func (client *RoleDefinitionClient) NewListByBillingAccountPager(billingAccountName string, options *RoleDefinitionClientListByBillingAccountOptions) *runtime.Pager[RoleDefinitionClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - RoleDefinitionClientListByBillingAccountOptions contains the optional parameters for the RoleDefinitionClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingAccount.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.NewRoleDefinitionClient().NewListByBillingAccountPager("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", 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("50000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("50000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("50000000-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("50000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000018"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000016")}, // }}, // RoleName: to.Ptr("Billing account owner"), // }, // }, // { // Name: to.Ptr("50000000-aaaa-bbbb-cccc-100000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000001"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Contributor role gives the user all permissions except access management on the organization."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("50000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("50000000-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("50000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000018"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000016")}, // }}, // RoleName: to.Ptr("Billing account contributor"), // }, // }, // { // Name: to.Ptr("50000000-aaaa-bbbb-cccc-100000000002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Reader role gives the user read permissions to an organization."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("50000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000012")}, // }}, // RoleName: to.Ptr("Billing account reader"), // }, // }, // { // Name: to.Ptr("50000000-aaaa-bbbb-cccc-100000000002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Reader role gives the user read permissions to an organization."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("50000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000012")}, // }}, // RoleName: to.Ptr("Billing account reader"), // }, // }, // { // Name: to.Ptr("50000000-aaaa-bbbb-cccc-100000000003"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000003"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Purchaser role gives the user permissions to make purchases by creating new Projects and Billing Groups in an organization."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("50000000-aaaa-bbbb-cccc-200000000006")}, // }}, // RoleName: to.Ptr("Basic Purchaser"), // }, // }}, // } } }
Output:
func (*RoleDefinitionClient) NewListByBillingProfilePager ¶ added in v1.0.0
func (client *RoleDefinitionClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *RoleDefinitionClientListByBillingProfileOptions) *runtime.Pager[RoleDefinitionClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- options - RoleDefinitionClientListByBillingProfileOptions contains the optional parameters for the RoleDefinitionClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingProfile.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.NewRoleDefinitionClient().NewListByBillingProfilePager("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", 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("40000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/40000000-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.Permission{ // { // Actions: []*string{ // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000013")}, // }}, // RoleName: to.Ptr("Billing profile owner"), // }, // }, // { // Name: to.Ptr("40000000-aaaa-bbbb-cccc-100000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/40000000-aaaa-bbbb-cccc-100000000001"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Contributor role gives the user all permissions except access management rights to the billing profile."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("40000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000002"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000013")}, // }}, // RoleName: to.Ptr("Billing profile contributor"), // }, // }, // { // Name: to.Ptr("40000000-aaaa-bbbb-cccc-100000000002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/40000000-aaaa-bbbb-cccc-100000000002"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Reader role gives the user read only access to the billing profile."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000012")}, // }}, // RoleName: to.Ptr("Billing profile reader"), // }, // }, // { // Name: to.Ptr("40000000-aaaa-bbbb-cccc-100000000004"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/40000000-aaaa-bbbb-cccc-100000000004"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Invoice Manager role gives the user the ability to view and manage invoices."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("40000000-aaaa-bbbb-cccc-200000000013")}, // }}, // RoleName: to.Ptr("Invoice manager"), // }, // }}, // } } }
Output:
func (*RoleDefinitionClient) NewListByCustomerPager ¶ added in v1.0.0
func (client *RoleDefinitionClient) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, options *RoleDefinitionClientListByCustomerOptions) *runtime.Pager[RoleDefinitionClientListByCustomerResponse]
NewListByCustomerPager - Lists the role definitions for a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- options - RoleDefinitionClientListByCustomerOptions contains the optional parameters for the RoleDefinitionClient.NewListByCustomerPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByCustomer.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.NewRoleDefinitionClient().NewListByCustomerPager("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "11111111-1111-1111-1111-111111111111", 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("30000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the customer."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000016"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000018")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Customer owner"), // }, // }, // { // Name: to.Ptr("30000000-aaaa-bbbb-cccc-100000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000001"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Contributor role gives the user all permissions except access management rights to the customer."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000016"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000018")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Customer contributor"), // }, // }, // { // Name: to.Ptr("30000000-aaaa-bbbb-cccc-100000000002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/customers/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/11111111-1111-1111-1111-111111111111/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000002"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The reader role gives the user read only access to the customer."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // 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-200000000017")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Customer reader"), // }, // }}, // } } }
Output:
func (*RoleDefinitionClient) NewListByDepartmentPager ¶ added in v1.0.0
func (client *RoleDefinitionClient) NewListByDepartmentPager(billingAccountName string, departmentName string, options *RoleDefinitionClientListByDepartmentOptions) *runtime.Pager[RoleDefinitionClientListByDepartmentResponse]
NewListByDepartmentPager - List the definition for a department. The operation is supported for billing accounts with agreement type Enterprise Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- departmentName - The name of the department.
- options - RoleDefinitionClientListByDepartmentOptions contains the optional parameters for the RoleDefinitionClient.NewListByDepartmentPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByDepartment.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.NewRoleDefinitionClient().NewListByDepartmentPager("123456", "7368531", 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("50000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/123456/departments/7368531/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("Microsoft.Billing/billingAccounts/departments/read"), // to.Ptr("Microsoft.Billing/billingAccounts/departments/write"), // to.Ptr("Microsoft.Billing/billingAccounts/departments/action"), // to.Ptr("Microsoft.Billing/billingAccounts/departments/delete"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/write"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/action"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/delete"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/read")}, // }}, // RoleName: to.Ptr("Department Admin"), // }, // }, // { // Name: to.Ptr("50000000-aaaa-bbbb-cccc-100000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/departments/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/123456/departments/7368531/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000001"), // Properties: &armbilling.RoleDefinitionProperties{ // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("Microsoft.Billing/billingAccounts/departments/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/read")}, // }}, // RoleName: to.Ptr("Department Reader"), // }, // }}, // } } }
Output:
func (*RoleDefinitionClient) NewListByEnrollmentAccountPager ¶ added in v1.0.0
func (client *RoleDefinitionClient) NewListByEnrollmentAccountPager(billingAccountName string, enrollmentAccountName string, options *RoleDefinitionClientListByEnrollmentAccountOptions) *runtime.Pager[RoleDefinitionClientListByEnrollmentAccountResponse]
NewListByEnrollmentAccountPager - List the definition for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- enrollmentAccountName - The name of the enrollment account.
- options - RoleDefinitionClientListByEnrollmentAccountOptions contains the optional parameters for the RoleDefinitionClient.NewListByEnrollmentAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByEnrollmentAccount.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.NewRoleDefinitionClient().NewListByEnrollmentAccountPager("123456", "4568789", 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("30000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/123456/enrollmentAccounts/4568789/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The account owner role gives the user all permissions including access management rights to an accounts."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/write"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/action"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/delete"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/read"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/write"), // to.Ptr("Microsoft.Billing/billingAccounts/enrollmentAccounts/billingSubscriptions/action")}, // NotActions: []*string{ // }, // }}, // RoleName: to.Ptr("Account Owner"), // }, // }}, // } } }
Output:
func (*RoleDefinitionClient) NewListByInvoiceSectionPager ¶ added in v1.0.0
func (client *RoleDefinitionClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *RoleDefinitionClientListByInvoiceSectionOptions) *runtime.Pager[RoleDefinitionClientListByInvoiceSectionResponse]
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 2024-04-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 - RoleDefinitionClientListByInvoiceSectionOptions contains the optional parameters for the RoleDefinitionClient.NewListByInvoiceSectionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByInvoiceSection.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.NewRoleDefinitionClient().NewListByInvoiceSectionPager("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", 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("30000000-aaaa-bbbb-cccc-100000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy/billingRoleDefinitions/30000000-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.Permission{ // { // Actions: []*string{ // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000016"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000018")}, // }}, // RoleName: to.Ptr("Invoice section owner"), // }, // }, // { // Name: to.Ptr("30000000-aaaa-bbbb-cccc-100000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000001"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Contributor role gives the user all permissions except access management rights to the invoice section."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000003"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000005"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000006"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000008"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000011"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000012"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000013"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000016"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000017"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000018")}, // }}, // RoleName: to.Ptr("Invoice section contributor"), // }, // }, // { // Name: to.Ptr("30000000-aaaa-bbbb-cccc-100000000002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000002"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The reader role gives the user read only access to the invoice section."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // 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-200000000017")}, // }}, // RoleName: to.Ptr("Invoice section reader"), // }, // }, // { // Name: to.Ptr("30000000-aaaa-bbbb-cccc-100000000006"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000006"), // Properties: &armbilling.RoleDefinitionProperties{ // Description: to.Ptr("The Azure subscription creator role gives the user the ability to create an Azure subscription for the invoice section."), // Permissions: []*armbilling.Permission{ // { // Actions: []*string{ // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), // to.Ptr("30000000-aaaa-bbbb-cccc-200000000013")}, // }}, // RoleName: to.Ptr("Azure subscription creator"), // }, // }}, // } } }
Output:
type RoleDefinitionClientGetByBillingAccountOptions ¶ added in v1.0.0
type RoleDefinitionClientGetByBillingAccountOptions struct { }
RoleDefinitionClientGetByBillingAccountOptions contains the optional parameters for the RoleDefinitionClient.GetByBillingAccount method.
type RoleDefinitionClientGetByBillingAccountResponse ¶ added in v1.0.0
type RoleDefinitionClientGetByBillingAccountResponse struct { // The properties of a role definition. RoleDefinition }
RoleDefinitionClientGetByBillingAccountResponse contains the response from method RoleDefinitionClient.GetByBillingAccount.
type RoleDefinitionClientGetByBillingProfileOptions ¶ added in v1.0.0
type RoleDefinitionClientGetByBillingProfileOptions struct { }
RoleDefinitionClientGetByBillingProfileOptions contains the optional parameters for the RoleDefinitionClient.GetByBillingProfile method.
type RoleDefinitionClientGetByBillingProfileResponse ¶ added in v1.0.0
type RoleDefinitionClientGetByBillingProfileResponse struct { // The properties of a role definition. RoleDefinition }
RoleDefinitionClientGetByBillingProfileResponse contains the response from method RoleDefinitionClient.GetByBillingProfile.
type RoleDefinitionClientGetByCustomerOptions ¶ added in v1.0.0
type RoleDefinitionClientGetByCustomerOptions struct { }
RoleDefinitionClientGetByCustomerOptions contains the optional parameters for the RoleDefinitionClient.GetByCustomer method.
type RoleDefinitionClientGetByCustomerResponse ¶ added in v1.0.0
type RoleDefinitionClientGetByCustomerResponse struct { // The properties of a role definition. RoleDefinition }
RoleDefinitionClientGetByCustomerResponse contains the response from method RoleDefinitionClient.GetByCustomer.
type RoleDefinitionClientGetByDepartmentOptions ¶ added in v1.0.0
type RoleDefinitionClientGetByDepartmentOptions struct { }
RoleDefinitionClientGetByDepartmentOptions contains the optional parameters for the RoleDefinitionClient.GetByDepartment method.
type RoleDefinitionClientGetByDepartmentResponse ¶ added in v1.0.0
type RoleDefinitionClientGetByDepartmentResponse struct { // The properties of a role definition. RoleDefinition }
RoleDefinitionClientGetByDepartmentResponse contains the response from method RoleDefinitionClient.GetByDepartment.
type RoleDefinitionClientGetByEnrollmentAccountOptions ¶ added in v1.0.0
type RoleDefinitionClientGetByEnrollmentAccountOptions struct { }
RoleDefinitionClientGetByEnrollmentAccountOptions contains the optional parameters for the RoleDefinitionClient.GetByEnrollmentAccount method.
type RoleDefinitionClientGetByEnrollmentAccountResponse ¶ added in v1.0.0
type RoleDefinitionClientGetByEnrollmentAccountResponse struct { // The properties of a role definition. RoleDefinition }
RoleDefinitionClientGetByEnrollmentAccountResponse contains the response from method RoleDefinitionClient.GetByEnrollmentAccount.
type RoleDefinitionClientGetByInvoiceSectionOptions ¶ added in v1.0.0
type RoleDefinitionClientGetByInvoiceSectionOptions struct { }
RoleDefinitionClientGetByInvoiceSectionOptions contains the optional parameters for the RoleDefinitionClient.GetByInvoiceSection method.
type RoleDefinitionClientGetByInvoiceSectionResponse ¶ added in v1.0.0
type RoleDefinitionClientGetByInvoiceSectionResponse struct { // The properties of a role definition. RoleDefinition }
RoleDefinitionClientGetByInvoiceSectionResponse contains the response from method RoleDefinitionClient.GetByInvoiceSection.
type RoleDefinitionClientListByBillingAccountOptions ¶ added in v1.0.0
type RoleDefinitionClientListByBillingAccountOptions struct { }
RoleDefinitionClientListByBillingAccountOptions contains the optional parameters for the RoleDefinitionClient.NewListByBillingAccountPager method.
type RoleDefinitionClientListByBillingAccountResponse ¶ added in v1.0.0
type RoleDefinitionClientListByBillingAccountResponse struct { // A container for a list of resources RoleDefinitionListResult }
RoleDefinitionClientListByBillingAccountResponse contains the response from method RoleDefinitionClient.NewListByBillingAccountPager.
type RoleDefinitionClientListByBillingProfileOptions ¶ added in v1.0.0
type RoleDefinitionClientListByBillingProfileOptions struct { }
RoleDefinitionClientListByBillingProfileOptions contains the optional parameters for the RoleDefinitionClient.NewListByBillingProfilePager method.
type RoleDefinitionClientListByBillingProfileResponse ¶ added in v1.0.0
type RoleDefinitionClientListByBillingProfileResponse struct { // A container for a list of resources RoleDefinitionListResult }
RoleDefinitionClientListByBillingProfileResponse contains the response from method RoleDefinitionClient.NewListByBillingProfilePager.
type RoleDefinitionClientListByCustomerOptions ¶ added in v1.0.0
type RoleDefinitionClientListByCustomerOptions struct { }
RoleDefinitionClientListByCustomerOptions contains the optional parameters for the RoleDefinitionClient.NewListByCustomerPager method.
type RoleDefinitionClientListByCustomerResponse ¶ added in v1.0.0
type RoleDefinitionClientListByCustomerResponse struct { // A container for a list of resources RoleDefinitionListResult }
RoleDefinitionClientListByCustomerResponse contains the response from method RoleDefinitionClient.NewListByCustomerPager.
type RoleDefinitionClientListByDepartmentOptions ¶ added in v1.0.0
type RoleDefinitionClientListByDepartmentOptions struct { }
RoleDefinitionClientListByDepartmentOptions contains the optional parameters for the RoleDefinitionClient.NewListByDepartmentPager method.
type RoleDefinitionClientListByDepartmentResponse ¶ added in v1.0.0
type RoleDefinitionClientListByDepartmentResponse struct { // A container for a list of resources RoleDefinitionListResult }
RoleDefinitionClientListByDepartmentResponse contains the response from method RoleDefinitionClient.NewListByDepartmentPager.
type RoleDefinitionClientListByEnrollmentAccountOptions ¶ added in v1.0.0
type RoleDefinitionClientListByEnrollmentAccountOptions struct { }
RoleDefinitionClientListByEnrollmentAccountOptions contains the optional parameters for the RoleDefinitionClient.NewListByEnrollmentAccountPager method.
type RoleDefinitionClientListByEnrollmentAccountResponse ¶ added in v1.0.0
type RoleDefinitionClientListByEnrollmentAccountResponse struct { // A container for a list of resources RoleDefinitionListResult }
RoleDefinitionClientListByEnrollmentAccountResponse contains the response from method RoleDefinitionClient.NewListByEnrollmentAccountPager.
type RoleDefinitionClientListByInvoiceSectionOptions ¶ added in v1.0.0
type RoleDefinitionClientListByInvoiceSectionOptions struct { }
RoleDefinitionClientListByInvoiceSectionOptions contains the optional parameters for the RoleDefinitionClient.NewListByInvoiceSectionPager method.
type RoleDefinitionClientListByInvoiceSectionResponse ¶ added in v1.0.0
type RoleDefinitionClientListByInvoiceSectionResponse struct { // A container for a list of resources RoleDefinitionListResult }
RoleDefinitionClientListByInvoiceSectionResponse contains the response from method RoleDefinitionClient.NewListByInvoiceSectionPager.
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 list of resources. Value []*RoleDefinition }
RoleDefinitionListResult - A container for a list of resources
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 { // REQUIRED; The name of the role. RoleName *string // READ-ONLY; The role description. Description *string // READ-ONLY; The billingPermissions the role has. Permissions []*Permission }
RoleDefinitionProperties - The properties of 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 SKU ¶ added in v1.0.0
type SKU struct { // Name of the SKU to be applied Name *string }
SKU - The SKU to be applied for this resource
func (SKU) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type SKU.
func (*SKU) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type SKU.
type SKUName ¶ added in v1.0.0
type SKUName struct {
Name *string
}
SKUName - The name of sku
func (SKUName) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type SKUName.
func (*SKUName) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type SKUName.
type SavingsPlanModel ¶ added in v1.0.0
type SavingsPlanModel struct { // REQUIRED; Savings plan SKU SKU *SKU // Savings plan properties Properties *SavingsPlanModelProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
SavingsPlanModel - Savings plan
func (SavingsPlanModel) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanModel.
func (*SavingsPlanModel) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModel.
type SavingsPlanModelList ¶ added in v1.0.0
type SavingsPlanModelList struct { // Url to get the next page. NextLink *string Value []*SavingsPlanModel }
SavingsPlanModelList - List of savings plans
func (SavingsPlanModelList) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanModelList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanModelList.
func (*SavingsPlanModelList) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanModelList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModelList.
type SavingsPlanModelListResult ¶ added in v1.0.0
type SavingsPlanModelListResult struct { // Url to get the next page. NextLink *string // The roll out count summary of the savings plans Summary *SavingsPlanSummaryCount Value []*SavingsPlanModel }
SavingsPlanModelListResult - List of savings plans
func (SavingsPlanModelListResult) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanModelListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanModelListResult.
func (*SavingsPlanModelListResult) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanModelListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModelListResult.
type SavingsPlanModelProperties ¶ added in v1.0.0
type SavingsPlanModelProperties struct { // Properties specific to applied scope type. Not required if not applicable. AppliedScopeProperties *AppliedScopeProperties // Type of the Applied Scope. AppliedScopeType *AppliedScopeType // Represents the billing plan in ISO 8601 format. Required only for monthly purchases. BillingPlan *BillingPlan // Subscription that will be charged for purchasing SavingsPlan BillingScopeID *string // Commitment towards the benefit. Commitment *Commitment // Display name DisplayName *string // Represents UPN ProductCode *string // The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState // Setting this to true will automatically purchase a new benefit on the expiration date time. Renew *bool // SavingsPlan Id of the SavingsPlan which is purchased because of renew. RenewDestination *string // Properties specific to renew. RenewProperties *RenewProperties // SavingsPlan Id of the SavingsPlan from which this SavingsPlan is renewed. RenewSource *string // Represents the Savings plan term in ISO 8601 format. Term *SavingsPlanTerm // READ-ONLY; This is the DateTime when the savings plan benefit starts. BenefitStartTime *time.Time // READ-ONLY; Fully-qualified identifier of the billing account where the savings plan is applied. BillingAccountID *string // READ-ONLY; Fully-qualified identifier of the billing profile where the savings plan is applied. Present only for Field-led // or Customer-led customers. BillingProfileID *string // READ-ONLY; Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers. CustomerID *string // READ-ONLY; The provisioning state of the savings plan for display, e.g. Succeeded DisplayProvisioningState *string // READ-ONLY; DateTime of the savings plan starting when this version is effective from. EffectiveDateTime *time.Time // READ-ONLY; This is the date-time when the savings plan will expire. ExpiryDateTime *time.Time // READ-ONLY; Extended status information ExtendedStatusInfo *ExtendedStatusInfo // READ-ONLY; Date time when the savings plan was purchased. PurchaseDateTime *time.Time // READ-ONLY; The applied scope type of the savings plan for display, e.g. Shared UserFriendlyAppliedScopeType *string // READ-ONLY; Savings plan utilization Utilization *Utilization }
SavingsPlanModelProperties - Savings plan properties
func (SavingsPlanModelProperties) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanModelProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanModelProperties.
func (*SavingsPlanModelProperties) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanModelProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanModelProperties.
type SavingsPlanOrderModel ¶ added in v1.0.0
type SavingsPlanOrderModel struct { // REQUIRED; Savings plan SKU SKU *SKU // Savings plan order properties Properties *SavingsPlanOrderModelProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
SavingsPlanOrderModel - Savings plan order
func (SavingsPlanOrderModel) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanOrderModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderModel.
func (*SavingsPlanOrderModel) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanOrderModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderModel.
type SavingsPlanOrderModelList ¶ added in v1.0.0
type SavingsPlanOrderModelList struct { // Url to get the next page. NextLink *string Value []*SavingsPlanOrderModel }
SavingsPlanOrderModelList - List of savings plan orders
func (SavingsPlanOrderModelList) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanOrderModelList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderModelList.
func (*SavingsPlanOrderModelList) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanOrderModelList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderModelList.
type SavingsPlanOrderModelProperties ¶ added in v1.0.0
type SavingsPlanOrderModelProperties struct { // Represents the billing plan in ISO 8601 format. Required only for monthly purchases. BillingPlan *BillingPlan // Subscription that will be charged for purchasing SavingsPlan BillingScopeID *string // Display name DisplayName *string // Information describing the type of billing plan for this savings plan. PlanInformation *PlanInformation // Represents UPN ProductCode *string SavingsPlans []*string // Represents the Savings plan term in ISO 8601 format. Term *SavingsPlanTerm // READ-ONLY; DateTime when the savings plan benefit started. BenefitStartTime *time.Time // READ-ONLY; Fully-qualified identifier of the billing account where the savings plan is applied. BillingAccountID *string // READ-ONLY; Fully-qualified identifier of the billing profile where the savings plan is applied. Present only for Field-led // or Customer-led customers. BillingProfileID *string // READ-ONLY; Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers. CustomerID *string // READ-ONLY; DateTime when the savings plan will expire. ExpiryDateTime *time.Time // READ-ONLY; Extended status information ExtendedStatusInfo *ExtendedStatusInfo // READ-ONLY; The provisioning state of the savings plan, e.g. Succeeded ProvisioningState *string }
SavingsPlanOrderModelProperties - Savings plan order properties
func (SavingsPlanOrderModelProperties) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanOrderModelProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanOrderModelProperties.
func (*SavingsPlanOrderModelProperties) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanOrderModelProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanOrderModelProperties.
type SavingsPlanOrdersClient ¶ added in v1.0.0
type SavingsPlanOrdersClient struct {
// contains filtered or unexported fields
}
SavingsPlanOrdersClient contains the methods for the SavingsPlanOrders group. Don't use this type directly, use NewSavingsPlanOrdersClient() instead.
func NewSavingsPlanOrdersClient ¶ added in v1.0.0
func NewSavingsPlanOrdersClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SavingsPlanOrdersClient, error)
NewSavingsPlanOrdersClient creates a new instance of SavingsPlanOrdersClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*SavingsPlanOrdersClient) GetByBillingAccount ¶ added in v1.0.0
func (client *SavingsPlanOrdersClient) GetByBillingAccount(ctx context.Context, billingAccountName string, savingsPlanOrderID string, options *SavingsPlanOrdersClientGetByBillingAccountOptions) (SavingsPlanOrdersClientGetByBillingAccountResponse, error)
GetByBillingAccount - Get a savings plan order by billing account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- savingsPlanOrderID - Order ID of the savings plan
- options - SavingsPlanOrdersClientGetByBillingAccountOptions contains the optional parameters for the SavingsPlanOrdersClient.GetByBillingAccount method.
Example (SavingsPlanOrderGet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderGetByBillingAccount.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.NewSavingsPlanOrdersClient().GetByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", &armbilling.SavingsPlanOrdersClientGetByBillingAccountOptions{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.SavingsPlanOrderModel = armbilling.SavingsPlanOrderModel{ // Name: to.Ptr("20000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanOrderModelProperties{ // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-20T02:36:22.339Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("10000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("SP1"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2026-01-20T02:36:22.339Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // SavingsPlans: []*string{ // to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000")}, // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // } }
Output:
Example (SavingsPlanOrderWithExpandedPaymentsGet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderExpandedScheduleGetByBillingAccount.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.NewSavingsPlanOrdersClient().GetByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", &armbilling.SavingsPlanOrdersClientGetByBillingAccountOptions{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.SavingsPlanOrderModel = armbilling.SavingsPlanOrderModel{ // Name: to.Ptr("20000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanOrderModelProperties{ // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-20T02:36:22.339Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("10000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("SP1"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2026-01-20T02:36:22.339Z"); return t}()), // PlanInformation: &armbilling.PlanInformation{ // NextPaymentDueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](26.28), // CurrencyCode: to.Ptr("USD"), // }, // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-20"); return t}()), // Transactions: []*armbilling.PaymentDetail{ // { // BillingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-20"); return t}()), // PaymentDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusCompleted), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-03-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-04-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-05-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-06-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-07-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-08-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-09-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-10-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-11-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-12-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-01-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-02-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-03-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-04-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-05-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-06-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-07-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-08-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-09-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-10-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-11-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-12-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-01-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-02-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-03-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-04-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-05-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-06-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-07-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-08-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-09-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-10-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-11-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }, // { // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2025-12-20"); return t}()), // PricingCurrencyTotal: &armbilling.Price{ // Amount: to.Ptr[float64](0.73), // CurrencyCode: to.Ptr("USD"), // }, // Status: to.Ptr(armbilling.PaymentStatusScheduled), // }}, // }, // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // SavingsPlans: []*string{ // to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000")}, // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // } }
Output:
func (*SavingsPlanOrdersClient) NewListByBillingAccountPager ¶ added in v1.0.0
func (client *SavingsPlanOrdersClient) NewListByBillingAccountPager(billingAccountName string, options *SavingsPlanOrdersClientListByBillingAccountOptions) *runtime.Pager[SavingsPlanOrdersClientListByBillingAccountResponse]
NewListByBillingAccountPager - List all Savings plan orders by billing account.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - SavingsPlanOrdersClientListByBillingAccountOptions contains the optional parameters for the SavingsPlanOrdersClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderListByBillingAccount.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.NewSavingsPlanOrdersClient().NewListByBillingAccountPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.SavingsPlanOrdersClientListByBillingAccountOptions{Filter: nil, OrderBy: nil, Skiptoken: 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.SavingsPlanOrderModelList = armbilling.SavingsPlanOrderModelList{ // Value: []*armbilling.SavingsPlanOrderModel{ // { // Name: to.Ptr("20000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanOrderModelProperties{ // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-04T03:18:31.307Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("10000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("SP1"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2026-02-04T03:18:31.307Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // SavingsPlans: []*string{ // to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000")}, // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // }, // { // Name: to.Ptr("20000000-0000-0000-0000-000000000001"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000001"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanOrderModelProperties{ // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-04T03:22:19.730Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("10000000-0000-0000-0000-000000000000"), // DisplayName: to.Ptr("SP2"), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2026-02-04T03:22:19.730Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr("Succeeded"), // SavingsPlans: []*string{ // to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/20000000-0000-0000-0000-000000000001/savingsPlans/30000000-0000-0000-0000-000000000001")}, // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // }}, // } } }
Output:
type SavingsPlanOrdersClientGetByBillingAccountOptions ¶ added in v1.0.0
type SavingsPlanOrdersClientGetByBillingAccountOptions struct { // May be used to expand the planInformation. Expand *string }
SavingsPlanOrdersClientGetByBillingAccountOptions contains the optional parameters for the SavingsPlanOrdersClient.GetByBillingAccount method.
type SavingsPlanOrdersClientGetByBillingAccountResponse ¶ added in v1.0.0
type SavingsPlanOrdersClientGetByBillingAccountResponse struct { // Savings plan order SavingsPlanOrderModel }
SavingsPlanOrdersClientGetByBillingAccountResponse contains the response from method SavingsPlanOrdersClient.GetByBillingAccount.
type SavingsPlanOrdersClientListByBillingAccountOptions ¶ added in v1.0.0
type SavingsPlanOrdersClientListByBillingAccountOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The number of savings plans to skip from the list before returning results Skiptoken *float32 }
SavingsPlanOrdersClientListByBillingAccountOptions contains the optional parameters for the SavingsPlanOrdersClient.NewListByBillingAccountPager method.
type SavingsPlanOrdersClientListByBillingAccountResponse ¶ added in v1.0.0
type SavingsPlanOrdersClientListByBillingAccountResponse struct { // List of savings plan orders SavingsPlanOrderModelList }
SavingsPlanOrdersClientListByBillingAccountResponse contains the response from method SavingsPlanOrdersClient.NewListByBillingAccountPager.
type SavingsPlanPurchasesPolicy ¶ added in v1.0.0
type SavingsPlanPurchasesPolicy string
SavingsPlanPurchasesPolicy - The policy that controls whether users with Azure savings plan purchase are allowed.
const ( SavingsPlanPurchasesPolicyAllowed SavingsPlanPurchasesPolicy = "Allowed" SavingsPlanPurchasesPolicyDisabled SavingsPlanPurchasesPolicy = "Disabled" SavingsPlanPurchasesPolicyNotAllowed SavingsPlanPurchasesPolicy = "NotAllowed" SavingsPlanPurchasesPolicyOther SavingsPlanPurchasesPolicy = "Other" )
func PossibleSavingsPlanPurchasesPolicyValues ¶ added in v1.0.0
func PossibleSavingsPlanPurchasesPolicyValues() []SavingsPlanPurchasesPolicy
PossibleSavingsPlanPurchasesPolicyValues returns the possible values for the SavingsPlanPurchasesPolicy const type.
type SavingsPlanSummaryCount ¶ added in v1.0.0
type SavingsPlanSummaryCount struct { // READ-ONLY; The number of savings plans in Cancelled state CancelledCount *float32 // READ-ONLY; The number of savings plans in Expired state ExpiredCount *float32 // READ-ONLY; The number of savings plans in Expiring state ExpiringCount *float32 // READ-ONLY; The number of savings plans in Failed state FailedCount *float32 // READ-ONLY; The number of savings plans in No Benefit state NoBenefitCount *float32 // READ-ONLY; The number of savings plans in Pending state PendingCount *float32 // READ-ONLY; The number of savings plans in Processing state ProcessingCount *float32 // READ-ONLY; The number of savings plans in Succeeded state SucceededCount *float32 // READ-ONLY; The number of savings plans in Warning state WarningCount *float32 }
SavingsPlanSummaryCount - The roll up count summary of savings plans in each state
func (SavingsPlanSummaryCount) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanSummaryCount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanSummaryCount.
func (*SavingsPlanSummaryCount) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanSummaryCount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanSummaryCount.
type SavingsPlanTerm ¶ added in v1.0.0
type SavingsPlanTerm string
SavingsPlanTerm - Represents the Savings plan term in ISO 8601 format.
const ( SavingsPlanTermP1Y SavingsPlanTerm = "P1Y" SavingsPlanTermP3Y SavingsPlanTerm = "P3Y" SavingsPlanTermP5Y SavingsPlanTerm = "P5Y" )
func PossibleSavingsPlanTermValues ¶ added in v1.0.0
func PossibleSavingsPlanTermValues() []SavingsPlanTerm
PossibleSavingsPlanTermValues returns the possible values for the SavingsPlanTerm const type.
type SavingsPlanUpdateRequest ¶ added in v1.0.0
type SavingsPlanUpdateRequest struct { // Savings plan patch request Properties *SavingsPlanUpdateRequestProperties // The SKU to be applied for this resource SKU *SKU // Tags for this reservation Tags map[string]*string }
SavingsPlanUpdateRequest - Savings plan patch request
func (SavingsPlanUpdateRequest) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanUpdateRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanUpdateRequest.
func (*SavingsPlanUpdateRequest) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanUpdateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUpdateRequest.
type SavingsPlanUpdateRequestProperties ¶ added in v1.0.0
type SavingsPlanUpdateRequestProperties struct { // Properties specific to applied scope type. Not required if not applicable. AppliedScopeProperties *AppliedScopeProperties // Type of the Applied Scope. AppliedScopeType *AppliedScopeType // Display name DisplayName *string // Setting this to true will automatically purchase a new benefit on the expiration date time. Renew *bool // Properties specific to renew. RenewProperties *RenewProperties }
SavingsPlanUpdateRequestProperties - Savings plan patch request
func (SavingsPlanUpdateRequestProperties) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanUpdateRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanUpdateRequestProperties.
func (*SavingsPlanUpdateRequestProperties) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanUpdateRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUpdateRequestProperties.
type SavingsPlanUpdateValidateRequest ¶ added in v1.0.0
type SavingsPlanUpdateValidateRequest struct { // The benefits of a savings plan. Benefits []*SavingsPlanUpdateRequestProperties }
SavingsPlanUpdateValidateRequest - Savings plan update validate request.
func (SavingsPlanUpdateValidateRequest) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanUpdateValidateRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanUpdateValidateRequest.
func (*SavingsPlanUpdateValidateRequest) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanUpdateValidateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUpdateValidateRequest.
type SavingsPlanValidResponseProperty ¶ added in v1.0.0
type SavingsPlanValidResponseProperty struct { // Failure reason if the provided input is invalid Reason *string // Failure reason code if the provided input is invalid ReasonCode *string // Indicates if the provided input is valid Valid *bool }
SavingsPlanValidResponseProperty - Benefit scope response property
func (SavingsPlanValidResponseProperty) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanValidResponseProperty) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanValidResponseProperty.
func (*SavingsPlanValidResponseProperty) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanValidResponseProperty) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanValidResponseProperty.
type SavingsPlanValidateResponse ¶ added in v1.0.0
type SavingsPlanValidateResponse struct { Benefits []*SavingsPlanValidResponseProperty // Url to get the next page. NextLink *string }
SavingsPlanValidateResponse - Savings plan update validate response.
func (SavingsPlanValidateResponse) MarshalJSON ¶ added in v1.0.0
func (s SavingsPlanValidateResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SavingsPlanValidateResponse.
func (*SavingsPlanValidateResponse) UnmarshalJSON ¶ added in v1.0.0
func (s *SavingsPlanValidateResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanValidateResponse.
type SavingsPlansClient ¶ added in v1.0.0
type SavingsPlansClient struct {
// contains filtered or unexported fields
}
SavingsPlansClient contains the methods for the SavingsPlans group. Don't use this type directly, use NewSavingsPlansClient() instead.
func NewSavingsPlansClient ¶ added in v1.0.0
func NewSavingsPlansClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SavingsPlansClient, error)
NewSavingsPlansClient creates a new instance of SavingsPlansClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*SavingsPlansClient) BeginUpdateByBillingAccount ¶ added in v1.0.0
func (client *SavingsPlansClient) BeginUpdateByBillingAccount(ctx context.Context, billingAccountName string, savingsPlanOrderID string, savingsPlanID string, body SavingsPlanUpdateRequest, options *SavingsPlansClientBeginUpdateByBillingAccountOptions) (*runtime.Poller[SavingsPlansClientUpdateByBillingAccountResponse], error)
BeginUpdateByBillingAccount - Update savings plan by billing account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- savingsPlanOrderID - Order ID of the savings plan
- savingsPlanID - ID of the savings plan
- body - Request body for patching a savings plan order alias
- options - SavingsPlansClientBeginUpdateByBillingAccountOptions contains the optional parameters for the SavingsPlansClient.BeginUpdateByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanUpdateByBillingAccount.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.NewSavingsPlansClient().BeginUpdateByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", armbilling.SavingsPlanUpdateRequest{ Properties: &armbilling.SavingsPlanUpdateRequestProperties{ AppliedScopeProperties: &armbilling.AppliedScopeProperties{ ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/mg1"), TenantID: to.Ptr("80000000-0000-0000-0000-000000000000"), }, AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeManagementGroup), DisplayName: to.Ptr("sp_newName"), Renew: to.Ptr(true), RenewProperties: &armbilling.RenewProperties{ PurchaseProperties: &armbilling.PurchaseRequest{ Properties: &armbilling.PurchaseRequestProperties{ AppliedScopeProperties: &armbilling.AppliedScopeProperties{ ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/mg1"), TenantID: to.Ptr("80000000-0000-0000-0000-000000000000"), }, AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeManagementGroup), BillingPlan: to.Ptr(armbilling.BillingPlanP1M), BillingScopeID: to.Ptr("/subscriptions/50000000-0000-0000-0000-000000000000"), Commitment: &armbilling.Commitment{ Amount: to.Ptr[float64](0.001), CurrencyCode: to.Ptr("USD"), Grain: to.Ptr(armbilling.CommitmentGrainHourly), }, DisplayName: to.Ptr("sp_newName_renewed"), Term: to.Ptr(armbilling.SavingsPlanTermP3Y), }, SKU: &armbilling.SKU{ Name: to.Ptr("Compute_Savings_Plan"), }, }, }, }, }, 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.SavingsPlanModel = armbilling.SavingsPlanModel{ // Name: to.Ptr("30000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders/savingsPlans"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanModelProperties{ // AppliedScopeProperties: &armbilling.AppliedScopeProperties{ // DisplayName: to.Ptr("mg1"), // ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/mg1"), // TenantID: to.Ptr("80000000-0000-0000-0000-000000000000"), // }, // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeManagementGroup), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-04T03:18:31.307Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("/subscriptions/50000000-0000-0000-0000-000000000000"), // Commitment: &armbilling.Commitment{ // Amount: to.Ptr[float64](0.001), // CurrencyCode: to.Ptr("USD"), // Grain: to.Ptr(armbilling.CommitmentGrainHourly), // }, // DisplayName: to.Ptr("sp_newName"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-04T04:30:49.198Z"); return t}()), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2026-02-04T03:18:31.307Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr(armbilling.ProvisioningStateSucceeded), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-04T03:16:38.906Z"); return t}()), // Renew: to.Ptr(true), // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // UserFriendlyAppliedScopeType: to.Ptr("ManagementGroup"), // Utilization: &armbilling.Utilization{ // Aggregates: []*armbilling.UtilizationAggregates{ // }, // }, // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // } }
Output:
func (*SavingsPlansClient) GetByBillingAccount ¶ added in v1.0.0
func (client *SavingsPlansClient) GetByBillingAccount(ctx context.Context, billingAccountName string, savingsPlanOrderID string, savingsPlanID string, options *SavingsPlansClientGetByBillingAccountOptions) (SavingsPlansClientGetByBillingAccountResponse, error)
GetByBillingAccount - Get savings plan by billing account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- savingsPlanOrderID - Order ID of the savings plan
- savingsPlanID - ID of the savings plan
- options - SavingsPlansClientGetByBillingAccountOptions contains the optional parameters for the SavingsPlansClient.GetByBillingAccount method.
Example (SavingsPlanGet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanGetByBillingAccount.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.NewSavingsPlansClient().GetByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", &armbilling.SavingsPlansClientGetByBillingAccountOptions{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.SavingsPlanModel = armbilling.SavingsPlanModel{ // Name: to.Ptr("30000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders/savingsPlans"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanModelProperties{ // AppliedScopeProperties: &armbilling.AppliedScopeProperties{ // DisplayName: to.Ptr("TestRg"), // ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/TestRg"), // TenantID: to.Ptr("70000000-0000-0000-0000-000000000000"), // }, // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeManagementGroup), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T02:25:11.718Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("/subscriptions/50000000-0000-0000-0000-000000000000"), // Commitment: &armbilling.Commitment{ // Amount: to.Ptr[float64](0.001), // CurrencyCode: to.Ptr("USD"), // Grain: to.Ptr(armbilling.CommitmentGrainHourly), // }, // DisplayName: to.Ptr("SP1"), // DisplayProvisioningState: to.Ptr("NoBenefit"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-16T01:35:36.290Z"); return t}()), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-11-16T02:25:11.718Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr(armbilling.ProvisioningStateSucceeded), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T02:23:21.386Z"); return t}()), // Renew: to.Ptr(false), // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // UserFriendlyAppliedScopeType: to.Ptr("ManagementGroup"), // Utilization: &armbilling.Utilization{ // Aggregates: []*armbilling.UtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // } }
Output:
Example (SavingsPlanGetExpandRenewProperties) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanGetExpandRenewPropertiesByBillingAccount.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.NewSavingsPlansClient().GetByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", &armbilling.SavingsPlansClientGetByBillingAccountOptions{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.SavingsPlanModel = armbilling.SavingsPlanModel{ // Name: to.Ptr("30000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders/savingsPlans"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanModelProperties{ // AppliedScopeProperties: &armbilling.AppliedScopeProperties{ // DisplayName: to.Ptr("TestRg"), // ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/TestRg"), // TenantID: to.Ptr("70000000-0000-0000-0000-000000000000"), // }, // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeManagementGroup), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T02:25:11.718Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("/subscriptions/50000000-0000-0000-0000-000000000000"), // Commitment: &armbilling.Commitment{ // Amount: to.Ptr[float64](0.001), // CurrencyCode: to.Ptr("USD"), // Grain: to.Ptr(armbilling.CommitmentGrainHourly), // }, // DisplayName: to.Ptr("SP1"), // DisplayProvisioningState: to.Ptr("NoBenefit"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-16T01:35:36.290Z"); return t}()), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-11-16T02:25:11.718Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr(armbilling.ProvisioningStateSucceeded), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T02:23:21.386Z"); return t}()), // Renew: to.Ptr(false), // RenewProperties: &armbilling.RenewProperties{ // PurchaseProperties: &armbilling.PurchaseRequest{ // Properties: &armbilling.PurchaseRequestProperties{ // AppliedScopeProperties: &armbilling.AppliedScopeProperties{ // ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/TestRg"), // TenantID: to.Ptr("70000000-0000-0000-0000-000000000000"), // }, // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeManagementGroup), // BillingPlan: to.Ptr(armbilling.BillingPlan("Monthly")), // BillingScopeID: to.Ptr("/subscriptions/50000000-0000-0000-0000-000000000000"), // Commitment: &armbilling.Commitment{ // Amount: to.Ptr[float64](0.001), // CurrencyCode: to.Ptr("USD"), // Grain: to.Ptr(armbilling.CommitmentGrainHourly), // }, // DisplayName: to.Ptr("SP1_renewed"), // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // }, // }, // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // UserFriendlyAppliedScopeType: to.Ptr("ManagementGroup"), // Utilization: &armbilling.Utilization{ // Aggregates: []*armbilling.UtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // } }
Output:
func (*SavingsPlansClient) NewListByBillingAccountPager ¶ added in v1.0.0
func (client *SavingsPlansClient) NewListByBillingAccountPager(billingAccountName string, options *SavingsPlansClientListByBillingAccountOptions) *runtime.Pager[SavingsPlansClientListByBillingAccountResponse]
NewListByBillingAccountPager - List savings plans by billing account.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - SavingsPlansClientListByBillingAccountOptions contains the optional parameters for the SavingsPlansClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListByBillingAccount.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.NewSavingsPlansClient().NewListByBillingAccountPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.SavingsPlansClientListByBillingAccountOptions{Filter: nil, OrderBy: nil, Skiptoken: nil, Take: to.Ptr[float32](3), SelectedState: to.Ptr("Succeeded"), RefreshSummary: to.Ptr("true"), }) 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.SavingsPlanModelListResult = armbilling.SavingsPlanModelListResult{ // Value: []*armbilling.SavingsPlanModel{ // { // Name: to.Ptr("30000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders/savingsPlans"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanModelProperties{ // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeShared), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-16T02:17:03.739Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"), // Commitment: &armbilling.Commitment{ // Amount: to.Ptr[float64](10), // CurrencyCode: to.Ptr("USD"), // Grain: to.Ptr(armbilling.CommitmentGrainHourly), // }, // DisplayName: to.Ptr("SP1"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-16T02:17:04.989Z"); return t}()), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-16T02:17:03.739Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr(armbilling.ProvisioningStateSucceeded), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-16T02:14:58.230Z"); return t}()), // Renew: to.Ptr(false), // Term: to.Ptr(armbilling.SavingsPlanTermP1Y), // UserFriendlyAppliedScopeType: to.Ptr("Shared"), // Utilization: &armbilling.Utilization{ // Aggregates: []*armbilling.UtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // }, // { // Name: to.Ptr("30000000-0000-0000-0000-000000000001"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders/savingsPlans"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000001/savingsPlans/30000000-0000-0000-0000-000000000001"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanModelProperties{ // AppliedScopeProperties: &armbilling.AppliedScopeProperties{ // DisplayName: to.Ptr("TestRg"), // ManagementGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/TestRg"), // TenantID: to.Ptr("50000000-0000-0000-0000-000000000000"), // }, // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeManagementGroup), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-16T02:22:22.725Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"), // Commitment: &armbilling.Commitment{ // Amount: to.Ptr[float64](10), // CurrencyCode: to.Ptr("USD"), // Grain: to.Ptr(armbilling.CommitmentGrainHourly), // }, // DisplayName: to.Ptr("SP2"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-16T02:22:24.553Z"); return t}()), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-12-16T02:22:22.725Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr(armbilling.ProvisioningStateSucceeded), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-16T02:20:23.473Z"); return t}()), // Renew: to.Ptr(false), // Term: to.Ptr(armbilling.SavingsPlanTermP1Y), // UserFriendlyAppliedScopeType: to.Ptr("ManagementGroup"), // Utilization: &armbilling.Utilization{ // Aggregates: []*armbilling.UtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // }, // { // Name: to.Ptr("30000000-0000-0000-0000-000000000002"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders/savingsPlans"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000002/savingsPlans/30000000-0000-0000-0000-000000000002"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanModelProperties{ // AppliedScopeProperties: &armbilling.AppliedScopeProperties{ // DisplayName: to.Ptr("Azure subscription 1"), // SubscriptionID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"), // }, // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeSingle), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-14T21:18:55.296Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/10000000-0000-0000-0000-000000000000"), // Commitment: &armbilling.Commitment{ // Amount: to.Ptr[float64](0.025), // CurrencyCode: to.Ptr("USD"), // Grain: to.Ptr(armbilling.CommitmentGrainHourly), // }, // DisplayName: to.Ptr("SP3"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T23:54:43.823Z"); return t}()), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-10-14T21:18:55.296Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr(armbilling.ProvisioningStateSucceeded), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-14T21:16:57.234Z"); return t}()), // Renew: to.Ptr(true), // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // UserFriendlyAppliedScopeType: to.Ptr("Single"), // Utilization: &armbilling.Utilization{ // Aggregates: []*armbilling.UtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](66), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](66), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](65.52), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // }, // { // Name: to.Ptr("30000000-0000-0000-0000-000000000003"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders/savingsPlans"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000003/savingsPlans/30000000-0000-0000-0000-000000000003"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armbilling.SavingsPlanModelProperties{ // AppliedScopeProperties: &armbilling.AppliedScopeProperties{ // DisplayName: to.Ptr("testRG"), // ResourceGroupID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourcegroups/testRG"), // }, // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeSingle), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-08T00:00:06.363Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"), // Commitment: &armbilling.Commitment{ // Amount: to.Ptr[float64](0.001), // CurrencyCode: to.Ptr("USD"), // Grain: to.Ptr(armbilling.CommitmentGrainHourly), // }, // DisplayName: to.Ptr("SP4"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-30T21:18:12.196Z"); return t}()), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-11-08T00:00:06.363Z"); return t}()), // ProductCode: to.Ptr("20000000-0000-0000-0000-000000000005"), // ProvisioningState: to.Ptr(armbilling.ProvisioningStateSucceeded), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T23:57:58.242Z"); return t}()), // Renew: to.Ptr(false), // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // UserFriendlyAppliedScopeType: to.Ptr("ResourceGroup"), // Utilization: &armbilling.Utilization{ // Aggregates: []*armbilling.UtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](100), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](100), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](100), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // }}, // Summary: &armbilling.SavingsPlanSummaryCount{ // CancelledCount: to.Ptr[float32](0), // ExpiredCount: to.Ptr[float32](0), // ExpiringCount: to.Ptr[float32](0), // FailedCount: to.Ptr[float32](0), // NoBenefitCount: to.Ptr[float32](0), // PendingCount: to.Ptr[float32](0), // ProcessingCount: to.Ptr[float32](0), // SucceededCount: to.Ptr[float32](3), // WarningCount: to.Ptr[float32](0), // }, // } } }
Output:
func (*SavingsPlansClient) NewListBySavingsPlanOrderPager ¶ added in v1.0.0
func (client *SavingsPlansClient) NewListBySavingsPlanOrderPager(billingAccountName string, savingsPlanOrderID string, options *SavingsPlansClientListBySavingsPlanOrderOptions) *runtime.Pager[SavingsPlansClientListBySavingsPlanOrderResponse]
NewListBySavingsPlanOrderPager - List savings plans in an order by billing account.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- savingsPlanOrderID - Order ID of the savings plan
- options - SavingsPlansClientListBySavingsPlanOrderOptions contains the optional parameters for the SavingsPlansClient.NewListBySavingsPlanOrderPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListBySavingsPlanOrders.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.NewSavingsPlansClient().NewListBySavingsPlanOrderPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", 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.SavingsPlanModelList = armbilling.SavingsPlanModelList{ // Value: []*armbilling.SavingsPlanModel{ // { // Name: to.Ptr("30000000-0000-0000-0000-000000000000"), // Type: to.Ptr("microsoft.billing/billingAccounts/savingsPlanOrders/savingsPlans"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000"), // Properties: &armbilling.SavingsPlanModelProperties{ // AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeShared), // BenefitStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-20T02:36:22.339Z"); return t}()), // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"), // BillingPlan: to.Ptr(armbilling.BillingPlanP1M), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD"), // BillingScopeID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000"), // Commitment: &armbilling.Commitment{ // Amount: to.Ptr[float64](0.001), // CurrencyCode: to.Ptr("USD"), // Grain: to.Ptr(armbilling.CommitmentGrainHourly), // }, // DisplayName: to.Ptr("SP1"), // DisplayProvisioningState: to.Ptr("Succeeded"), // EffectiveDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-20T02:36:25.089Z"); return t}()), // ExpiryDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2026-01-20T02:36:22.339Z"); return t}()), // ProvisioningState: to.Ptr(armbilling.ProvisioningStateSucceeded), // PurchaseDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-20T02:34:38.126Z"); return t}()), // Renew: to.Ptr(false), // Term: to.Ptr(armbilling.SavingsPlanTermP3Y), // UserFriendlyAppliedScopeType: to.Ptr("Shared"), // Utilization: &armbilling.Utilization{ // Aggregates: []*armbilling.UtilizationAggregates{ // { // Grain: to.Ptr[float32](1), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](7), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }, // { // Grain: to.Ptr[float32](30), // GrainUnit: to.Ptr("days"), // Value: to.Ptr[float32](0), // ValueUnit: to.Ptr("percentage"), // }}, // Trend: to.Ptr("SAME"), // }, // }, // SKU: &armbilling.SKU{ // Name: to.Ptr("Compute_Savings_Plan"), // }, // }}, // } } }
Output:
func (*SavingsPlansClient) ValidateUpdateByBillingAccount ¶ added in v1.0.0
func (client *SavingsPlansClient) ValidateUpdateByBillingAccount(ctx context.Context, billingAccountName string, savingsPlanOrderID string, savingsPlanID string, body SavingsPlanUpdateValidateRequest, options *SavingsPlansClientValidateUpdateByBillingAccountOptions) (SavingsPlansClientValidateUpdateByBillingAccountResponse, error)
ValidateUpdateByBillingAccount - Validate savings plan patch by billing account. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- savingsPlanOrderID - Order ID of the savings plan
- savingsPlanID - ID of the savings plan
- body - Request body for patching a savings plan order alias
- options - SavingsPlansClientValidateUpdateByBillingAccountOptions contains the optional parameters for the SavingsPlansClient.ValidateUpdateByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanValidateUpdateByBillingAccount.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.NewSavingsPlansClient().ValidateUpdateByBillingAccount(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "20000000-0000-0000-0000-000000000000", "30000000-0000-0000-0000-000000000000", armbilling.SavingsPlanUpdateValidateRequest{ Benefits: []*armbilling.SavingsPlanUpdateRequestProperties{ { AppliedScopeProperties: &armbilling.AppliedScopeProperties{ SubscriptionID: to.Ptr("/subscriptions/50000000-0000-0000-0000-000000000000"), }, AppliedScopeType: to.Ptr(armbilling.AppliedScopeTypeSingle), }}, }, 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.SavingsPlanValidateResponse = armbilling.SavingsPlanValidateResponse{ // Benefits: []*armbilling.SavingsPlanValidResponseProperty{ // { // Valid: to.Ptr(true), // }}, // } }
Output:
type SavingsPlansClientBeginUpdateByBillingAccountOptions ¶ added in v1.0.0
type SavingsPlansClientBeginUpdateByBillingAccountOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SavingsPlansClientBeginUpdateByBillingAccountOptions contains the optional parameters for the SavingsPlansClient.BeginUpdateByBillingAccount method.
type SavingsPlansClientGetByBillingAccountOptions ¶ added in v1.0.0
type SavingsPlansClientGetByBillingAccountOptions struct { // May be used to expand the planInformation. Expand *string }
SavingsPlansClientGetByBillingAccountOptions contains the optional parameters for the SavingsPlansClient.GetByBillingAccount method.
type SavingsPlansClientGetByBillingAccountResponse ¶ added in v1.0.0
type SavingsPlansClientGetByBillingAccountResponse struct { // Savings plan SavingsPlanModel }
SavingsPlansClientGetByBillingAccountResponse contains the response from method SavingsPlansClient.GetByBillingAccount.
type SavingsPlansClientListByBillingAccountOptions ¶ added in v1.0.0
type SavingsPlansClientListByBillingAccountOptions struct { // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // To indicate whether to refresh the roll up counts of the savings plans group by provisioning states RefreshSummary *string // The selected provisioning state SelectedState *string // The number of savings plans to skip from the list before returning results Skiptoken *float32 // The number of savings plans to return Take *float32 }
SavingsPlansClientListByBillingAccountOptions contains the optional parameters for the SavingsPlansClient.NewListByBillingAccountPager method.
type SavingsPlansClientListByBillingAccountResponse ¶ added in v1.0.0
type SavingsPlansClientListByBillingAccountResponse struct { // List of savings plans SavingsPlanModelListResult }
SavingsPlansClientListByBillingAccountResponse contains the response from method SavingsPlansClient.NewListByBillingAccountPager.
type SavingsPlansClientListBySavingsPlanOrderOptions ¶ added in v1.0.0
type SavingsPlansClientListBySavingsPlanOrderOptions struct { }
SavingsPlansClientListBySavingsPlanOrderOptions contains the optional parameters for the SavingsPlansClient.NewListBySavingsPlanOrderPager method.
type SavingsPlansClientListBySavingsPlanOrderResponse ¶ added in v1.0.0
type SavingsPlansClientListBySavingsPlanOrderResponse struct { // List of savings plans SavingsPlanModelList }
SavingsPlansClientListBySavingsPlanOrderResponse contains the response from method SavingsPlansClient.NewListBySavingsPlanOrderPager.
type SavingsPlansClientUpdateByBillingAccountResponse ¶ added in v1.0.0
type SavingsPlansClientUpdateByBillingAccountResponse struct { // Savings plan SavingsPlanModel }
SavingsPlansClientUpdateByBillingAccountResponse contains the response from method SavingsPlansClient.BeginUpdateByBillingAccount.
type SavingsPlansClientValidateUpdateByBillingAccountOptions ¶ added in v1.0.0
type SavingsPlansClientValidateUpdateByBillingAccountOptions struct { }
SavingsPlansClientValidateUpdateByBillingAccountOptions contains the optional parameters for the SavingsPlansClient.ValidateUpdateByBillingAccount method.
type SavingsPlansClientValidateUpdateByBillingAccountResponse ¶ added in v1.0.0
type SavingsPlansClientValidateUpdateByBillingAccountResponse struct { // Savings plan update validate response. SavingsPlanValidateResponse }
SavingsPlansClientValidateUpdateByBillingAccountResponse contains the response from method SavingsPlansClient.ValidateUpdateByBillingAccount.
type ServiceDefinedResourceName ¶ added in v1.0.0
type ServiceDefinedResourceName string
const (
ServiceDefinedResourceNameDefault ServiceDefinedResourceName = "default"
)
func PossibleServiceDefinedResourceNameValues ¶ added in v1.0.0
func PossibleServiceDefinedResourceNameValues() []ServiceDefinedResourceName
PossibleServiceDefinedResourceNameValues returns the possible values for the ServiceDefinedResourceName const type.
type SpecialTaxationType ¶ added in v1.0.0
type SpecialTaxationType string
SpecialTaxationType - Identifies the type of tax calculation used for the invoice. The field is applicable only to invoices with special tax calculation logic.
const ( SpecialTaxationTypeInvoiceLevel SpecialTaxationType = "InvoiceLevel" SpecialTaxationTypeSubtotalLevel SpecialTaxationType = "SubtotalLevel" )
func PossibleSpecialTaxationTypeValues ¶ added in v1.0.0
func PossibleSpecialTaxationTypeValues() []SpecialTaxationType
PossibleSpecialTaxationTypeValues returns the possible values for the SpecialTaxationType const type.
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 SpendingLimitDetails ¶ added in v1.0.0
type SpendingLimitDetails struct { // The initial amount for the billing profile. Amount *float32 // The currency in which the charges for the billing profile are billed. Currency *string // The date when this spending limit is no longer in effect. EndDate *time.Time // The date when this spending limit goes into effect. StartDate *time.Time // The status of current spending limit. Status *SpendingLimitStatus // The type of spending limit. Type *SpendingLimitType }
SpendingLimitDetails - The billing profile spending limit.
func (SpendingLimitDetails) MarshalJSON ¶ added in v1.0.0
func (s SpendingLimitDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SpendingLimitDetails.
func (*SpendingLimitDetails) UnmarshalJSON ¶ added in v1.0.0
func (s *SpendingLimitDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SpendingLimitDetails.
type SpendingLimitStatus ¶ added in v1.0.0
type SpendingLimitStatus string
SpendingLimitStatus - The status of current spending limit.
const ( SpendingLimitStatusActive SpendingLimitStatus = "Active" SpendingLimitStatusExpired SpendingLimitStatus = "Expired" SpendingLimitStatusLimitReached SpendingLimitStatus = "LimitReached" SpendingLimitStatusLimitRemoved SpendingLimitStatus = "LimitRemoved" SpendingLimitStatusNone SpendingLimitStatus = "None" SpendingLimitStatusOther SpendingLimitStatus = "Other" )
func PossibleSpendingLimitStatusValues ¶ added in v1.0.0
func PossibleSpendingLimitStatusValues() []SpendingLimitStatus
PossibleSpendingLimitStatusValues returns the possible values for the SpendingLimitStatus const type.
type SpendingLimitType ¶ added in v1.0.0
type SpendingLimitType string
SpendingLimitType - The type of spending limit.
const ( SpendingLimitTypeAcademicSponsorship SpendingLimitType = "AcademicSponsorship" SpendingLimitTypeAzureConsumptionCredit SpendingLimitType = "AzureConsumptionCredit" SpendingLimitTypeAzureForStudents SpendingLimitType = "AzureForStudents" SpendingLimitTypeAzureForStudentsStarter SpendingLimitType = "AzureForStudentsStarter" SpendingLimitTypeAzurePassSponsorship SpendingLimitType = "AzurePassSponsorship" SpendingLimitTypeFreeAccount SpendingLimitType = "FreeAccount" SpendingLimitTypeMSDN SpendingLimitType = "MSDN" SpendingLimitTypeMpnSponsorship SpendingLimitType = "MpnSponsorship" SpendingLimitTypeNonProfitSponsorship SpendingLimitType = "NonProfitSponsorship" SpendingLimitTypeNone SpendingLimitType = "None" SpendingLimitTypeOther SpendingLimitType = "Other" SpendingLimitTypeSandbox SpendingLimitType = "Sandbox" SpendingLimitTypeSponsorship SpendingLimitType = "Sponsorship" SpendingLimitTypeStartupSponsorship SpendingLimitType = "StartupSponsorship" SpendingLimitTypeVisualStudio SpendingLimitType = "VisualStudio" )
func PossibleSpendingLimitTypeValues ¶ added in v1.0.0
func PossibleSpendingLimitTypeValues() []SpendingLimitType
PossibleSpendingLimitTypeValues returns the possible values for the SpendingLimitType const type.
type Subscription ¶ added in v0.2.0
type Subscription struct { // The properties of a(n) BillingSubscription Properties *SubscriptionProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
Subscription - The billing properties of a 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 SubscriptionAlias ¶ added in v1.0.0
type SubscriptionAlias struct { // The properties of a(n) BillingSubscriptionAlias Properties *SubscriptionAliasProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
SubscriptionAlias - A billing subscription alias.
func (SubscriptionAlias) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionAlias) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionAlias.
func (*SubscriptionAlias) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionAlias) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionAlias.
type SubscriptionAliasListResult ¶ added in v1.0.0
type SubscriptionAliasListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*SubscriptionAlias }
SubscriptionAliasListResult - A container for a list of resources
func (SubscriptionAliasListResult) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionAliasListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionAliasListResult.
func (*SubscriptionAliasListResult) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionAliasListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionAliasListResult.
type SubscriptionAliasProperties ¶ added in v1.0.0
type SubscriptionAliasProperties struct { // Indicates whether auto renewal is turned on or off for a product. AutoRenew *AutoRenew // The beneficiary of the billing subscription. Beneficiary *Beneficiary // The provisioning tenant of the subscription. BeneficiaryTenantID *string // The billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y BillingFrequency *string // The fully qualified ID that uniquely identifies a billing profile. BillingProfileID *string // The cost center applied to the subscription. This field is only available for consumption subscriptions of Microsoft Customer // Agreement or Enterprise Agreement Type billing accounts. ConsumptionCostCenter *string // The fully qualified ID that uniquely identifies a customer. CustomerID *string // The name of the billing subscription. DisplayName *string // The fully qualified ID that uniquely identifies an invoice section. InvoiceSectionID *string // Id of the product for which the subscription is purchased. ProductTypeID *string // The tenant in which the subscription is provisioned. ProvisioningTenantID *string // The quantity of licenses or fulfillment units for the subscription. Quantity *int64 // The SKU ID of the product for which the subscription is purchased. This field is is only available for Microsoft Customer // Agreement billing accounts. SKUID *string // System imposed policies that regulate behavior of the subscription. SystemOverrides *SystemOverrides // The duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y TermDuration *string // READ-ONLY; Dictionary of billing policies associated with the subscription. BillingPolicies map[string]*string // READ-ONLY; The name of the billing profile. BillingProfileDisplayName *string // READ-ONLY; The ID that uniquely identifies a billing profile. BillingProfileName *string // READ-ONLY; The ID of the billing subscription with the subscription alias. BillingSubscriptionID *string // READ-ONLY; The name of the customer. CustomerDisplayName *string // READ-ONLY; The ID that uniquely identifies a customer. CustomerName *string // READ-ONLY; The enrollment Account name associated with the subscription. This field is available only for the Enterprise // Agreement Type billing accounts. EnrollmentAccountDisplayName *string // READ-ONLY; The enrollment Account ID associated with the subscription. This field is available only for the Enterprise // Agreement Type billing accounts. EnrollmentAccountID *string // READ-ONLY; Enrollment Account Subscription details. This field is available only for the Enterprise Agreement Type billing // accounts. EnrollmentAccountSubscriptionDetails *EnrollmentAccountSubscriptionDetails // READ-ONLY; The name of the invoice section. InvoiceSectionDisplayName *string // READ-ONLY; The ID that uniquely identifies an invoice section. InvoiceSectionName *string // READ-ONLY; The last month's charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement // billing accounts. LastMonthCharges *Amount // READ-ONLY; The current month to date charges. This field is only available for usage based subscriptions of Microsoft Customer // Agreement billing accounts. MonthToDateCharges *Amount // READ-ONLY; Next billing cycle details of the subscription. NextBillingCycleDetails *NextBillingCycleDetails // READ-ONLY; The offer ID for the subscription. This field is only available for the Microsoft Online Services Program billing // accounts. OfferID *string // READ-ONLY; The status of an operation on the subscription. When None, there is no ongoing operation. When LockedForUpdate, // write operations will be blocked on the Billing Subscription. Other is the default value // and you may need to refer to the latest API version for more details. OperationStatus *BillingSubscriptionOperationStatus // READ-ONLY; The category of the product for which the subscription is purchased. Possible values include: AzureSupport, // Hardware, ReservationOrder, SaaS, SavingsPlanOrder, Software, UsageBased, Other. ProductCategory *string // READ-ONLY; Type of the product for which the subscription is purchased. ProductType *string // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState // READ-ONLY; Purchase date of the product in UTC time. PurchaseDate *time.Time // READ-ONLY; Details for the next renewal term of a subscription. RenewalTermDetails *RenewalTermDetails // READ-ONLY; Reseller for this subscription. The fields is not available for Microsoft Partner Agreement billing accounts. Reseller *Reseller // READ-ONLY; Unique identifier of the linked resource. ResourceURI *string // READ-ONLY; The SKU description of the product for which the subscription is purchased. This field is is only available // for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner // Agreement. SKUDescription *string // READ-ONLY; The status of the subscription. This field is not available for Enterprise Agreement billing accounts Status *BillingSubscriptionStatus // READ-ONLY; The ID of the subscription. SubscriptionID *string // READ-ONLY; The suspension details for a subscription. This field is not available for Enterprise Agreement billing accounts. SuspensionReasonDetails []*SubscriptionStatusDetails // READ-ONLY; The suspension reason for a subscription. This field is not available for Enterprise Agreement billing accounts. SuspensionReasons []*string // READ-ONLY; End date of the term in UTC time. TermEndDate *time.Time // READ-ONLY; Start date of the term in UTC time. TermStartDate *time.Time }
SubscriptionAliasProperties - A billing subscription alias.
func (SubscriptionAliasProperties) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionAliasProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionAliasProperties.
func (*SubscriptionAliasProperties) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionAliasProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionAliasProperties.
type SubscriptionBillingType ¶ added in v1.0.0
type SubscriptionBillingType string
SubscriptionBillingType - The type of billing subscription.
const ( SubscriptionBillingTypeBenefit SubscriptionBillingType = "Benefit" SubscriptionBillingTypeFree SubscriptionBillingType = "Free" SubscriptionBillingTypeNone SubscriptionBillingType = "None" SubscriptionBillingTypePaid SubscriptionBillingType = "Paid" SubscriptionBillingTypePrePaid SubscriptionBillingType = "PrePaid" )
func PossibleSubscriptionBillingTypeValues ¶ added in v1.0.0
func PossibleSubscriptionBillingTypeValues() []SubscriptionBillingType
PossibleSubscriptionBillingTypeValues returns the possible values for the SubscriptionBillingType const type.
type SubscriptionEnrollmentAccountStatus ¶ added in v1.0.0
type SubscriptionEnrollmentAccountStatus string
SubscriptionEnrollmentAccountStatus - The current enrollment account status of the subscription. This field is available only for the Enterprise Agreement Type.
const ( SubscriptionEnrollmentAccountStatusActive SubscriptionEnrollmentAccountStatus = "Active" SubscriptionEnrollmentAccountStatusCancelled SubscriptionEnrollmentAccountStatus = "Cancelled" SubscriptionEnrollmentAccountStatusDeleted SubscriptionEnrollmentAccountStatus = "Deleted" SubscriptionEnrollmentAccountStatusExpired SubscriptionEnrollmentAccountStatus = "Expired" SubscriptionEnrollmentAccountStatusInactive SubscriptionEnrollmentAccountStatus = "Inactive" SubscriptionEnrollmentAccountStatusTransferredOut SubscriptionEnrollmentAccountStatus = "TransferredOut" SubscriptionEnrollmentAccountStatusTransferring SubscriptionEnrollmentAccountStatus = "Transferring" )
func PossibleSubscriptionEnrollmentAccountStatusValues ¶ added in v1.0.0
func PossibleSubscriptionEnrollmentAccountStatusValues() []SubscriptionEnrollmentAccountStatus
PossibleSubscriptionEnrollmentAccountStatusValues returns the possible values for the SubscriptionEnrollmentAccountStatus const type.
type SubscriptionEnrollmentDetails ¶ added in v1.0.0
type SubscriptionEnrollmentDetails struct { // The name of the department DepartmentDisplayName *string // The ID that uniquely identifies the department. DepartmentID *string // The name of the enrollment account. EnrollmentAccountDisplayName *string // The ID that uniquely identifies an enrollment account. EnrollmentAccountID *string // The status of the enrollment account. EnrollmentAccountStatus *string }
SubscriptionEnrollmentDetails - The enrollment details for the subscription. Available for billing accounts with agreement type Enterprise Agreement.
func (SubscriptionEnrollmentDetails) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionEnrollmentDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionEnrollmentDetails.
func (*SubscriptionEnrollmentDetails) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionEnrollmentDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionEnrollmentDetails.
type SubscriptionListResult ¶ added in v1.0.0
type SubscriptionListResult 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 resources. Value []*Subscription }
SubscriptionListResult - A container for a list of resources
func (SubscriptionListResult) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionListResult.
func (*SubscriptionListResult) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionListResult.
type SubscriptionMergeRequest ¶ added in v1.0.0
type SubscriptionMergeRequest struct { // The quantity of the source billing subscription that will be merged with the target billing subscription. Quantity *int32 // The ID of the target billing subscription that will be merged with the source subscription provided in the request. TargetBillingSubscriptionName *string }
SubscriptionMergeRequest - Request parameters that are provided to merge the two billing subscriptions.
func (SubscriptionMergeRequest) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionMergeRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionMergeRequest.
func (*SubscriptionMergeRequest) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionMergeRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionMergeRequest.
type SubscriptionPatch ¶ added in v1.0.0
type SubscriptionPatch struct { // The properties of a(n) BillingSubscription Properties *SubscriptionProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
SubscriptionPatch - The billing properties of a subscription.
func (SubscriptionPatch) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionPatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionPatch.
func (*SubscriptionPatch) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionPatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionPatch.
type SubscriptionPolicy ¶ added in v1.0.0
type SubscriptionPolicy struct { // A policy at subscription scope. Properties *SubscriptionPolicyProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
SubscriptionPolicy - A policy at subscription scope.
func (SubscriptionPolicy) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionPolicy.
func (*SubscriptionPolicy) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionPolicy.
type SubscriptionPolicyProperties ¶ added in v1.0.0
type SubscriptionPolicyProperties struct { // List of all policies defined at the billing scope. Policies []*PolicySummary // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState }
SubscriptionPolicyProperties - A policy at subscription scope.
func (SubscriptionPolicyProperties) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionPolicyProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionPolicyProperties.
func (*SubscriptionPolicyProperties) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionPolicyProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionPolicyProperties.
type SubscriptionProperties ¶ added in v0.2.0
type SubscriptionProperties struct { // Indicates whether auto renewal is turned on or off for a product. AutoRenew *AutoRenew // The beneficiary of the billing subscription. Beneficiary *Beneficiary // The provisioning tenant of the subscription. BeneficiaryTenantID *string // The billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y BillingFrequency *string // The fully qualified ID that uniquely identifies a billing profile. BillingProfileID *string // The cost center applied to the subscription. This field is only available for consumption subscriptions of Microsoft Customer // Agreement or Enterprise Agreement Type billing accounts. ConsumptionCostCenter *string // The fully qualified ID that uniquely identifies a customer. CustomerID *string // The name of the billing subscription. DisplayName *string // The fully qualified ID that uniquely identifies an invoice section. InvoiceSectionID *string // Id of the product for which the subscription is purchased. ProductTypeID *string // The tenant in which the subscription is provisioned. ProvisioningTenantID *string // The quantity of licenses or fulfillment units for the subscription. Quantity *int64 // The SKU ID of the product for which the subscription is purchased. This field is is only available for Microsoft Customer // Agreement billing accounts. SKUID *string // System imposed policies that regulate behavior of the subscription. SystemOverrides *SystemOverrides // The duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y TermDuration *string // READ-ONLY; Dictionary of billing policies associated with the subscription. BillingPolicies map[string]*string // READ-ONLY; The name of the billing profile. BillingProfileDisplayName *string // READ-ONLY; The ID that uniquely identifies a billing profile. BillingProfileName *string // READ-ONLY; The name of the customer. CustomerDisplayName *string // READ-ONLY; The ID that uniquely identifies a customer. CustomerName *string // READ-ONLY; The enrollment Account name associated with the subscription. This field is available only for the Enterprise // Agreement Type billing accounts. EnrollmentAccountDisplayName *string // READ-ONLY; The enrollment Account ID associated with the subscription. This field is available only for the Enterprise // Agreement Type billing accounts. EnrollmentAccountID *string // READ-ONLY; Enrollment Account Subscription details. This field is available only for the Enterprise Agreement Type billing // accounts. EnrollmentAccountSubscriptionDetails *EnrollmentAccountSubscriptionDetails // READ-ONLY; The name of the invoice section. InvoiceSectionDisplayName *string // READ-ONLY; The ID that uniquely identifies an invoice section. InvoiceSectionName *string // READ-ONLY; The last month's charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement // billing accounts. LastMonthCharges *Amount // READ-ONLY; The current month to date charges. This field is only available for usage based subscriptions of Microsoft Customer // Agreement billing accounts. MonthToDateCharges *Amount // READ-ONLY; Next billing cycle details of the subscription. NextBillingCycleDetails *NextBillingCycleDetails // READ-ONLY; The offer ID for the subscription. This field is only available for the Microsoft Online Services Program billing // accounts. OfferID *string // READ-ONLY; The status of an operation on the subscription. When None, there is no ongoing operation. When LockedForUpdate, // write operations will be blocked on the Billing Subscription. Other is the default value // and you may need to refer to the latest API version for more details. OperationStatus *BillingSubscriptionOperationStatus // READ-ONLY; The category of the product for which the subscription is purchased. Possible values include: AzureSupport, // Hardware, ReservationOrder, SaaS, SavingsPlanOrder, Software, UsageBased, Other. ProductCategory *string // READ-ONLY; Type of the product for which the subscription is purchased. ProductType *string // READ-ONLY; The provisioning state of the resource during a long-running operation. ProvisioningState *ProvisioningState // READ-ONLY; Purchase date of the product in UTC time. PurchaseDate *time.Time // READ-ONLY; Details for the next renewal term of a subscription. RenewalTermDetails *RenewalTermDetails // READ-ONLY; Reseller for this subscription. The fields is not available for Microsoft Partner Agreement billing accounts. Reseller *Reseller // READ-ONLY; Unique identifier of the linked resource. ResourceURI *string // READ-ONLY; The SKU description of the product for which the subscription is purchased. This field is is only available // for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner // Agreement. SKUDescription *string // READ-ONLY; The status of the subscription. This field is not available for Enterprise Agreement billing accounts Status *BillingSubscriptionStatus // READ-ONLY; The ID of the subscription. SubscriptionID *string // READ-ONLY; The suspension details for a subscription. This field is not available for Enterprise Agreement billing accounts. SuspensionReasonDetails []*SubscriptionStatusDetails // READ-ONLY; The suspension reason for a subscription. This field is not available for Enterprise Agreement billing accounts. SuspensionReasons []*string // READ-ONLY; End date of the term in UTC time. TermEndDate *time.Time // READ-ONLY; Start date of the term in UTC time. TermStartDate *time.Time }
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 SubscriptionSplitRequest ¶ added in v1.0.0
type SubscriptionSplitRequest struct { // The billing frequency of the target subscription in the ISO8601 format. Example: P1M, P3M, P1Y" BillingFrequency *string // The quantity of the target product to which the subscription needs to be split into. Quantity *int32 // The ID of the target product to which the subscription needs to be split into. This value is not same as the value returned // in Get API call and can be retrieved from Catalog API to know the product id // to split into. TargetProductTypeID *string // The ID of the target product to which the subscription needs to be split into. This value is not same as the value returned // in Get API call and can be retrieved from Catalog API to know the sku id to // split into. TargetSKUID *string // The term duration of the target in ISO8601 format product to which the subscription needs to be split into. Example: P1M, // P1Y TermDuration *string }
SubscriptionSplitRequest - Request parameters that are provided to split the billing subscription.
func (SubscriptionSplitRequest) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionSplitRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionSplitRequest.
func (*SubscriptionSplitRequest) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionSplitRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionSplitRequest.
type SubscriptionStatusDetails ¶ added in v1.0.0
type SubscriptionStatusDetails struct { // READ-ONLY; The suspension effective date for a subscription. This field is not available for Enterprise Agreement billing // accounts. EffectiveDate *time.Time // READ-ONLY; The suspension reason for a subscription. This field is not available for Enterprise Agreement billing accounts. Reason *SubscriptionStatusReason }
SubscriptionStatusDetails - The suspension details for a subscription. This field is not available for Enterprise Agreement billing accounts.
func (SubscriptionStatusDetails) MarshalJSON ¶ added in v1.0.0
func (s SubscriptionStatusDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionStatusDetails.
func (*SubscriptionStatusDetails) UnmarshalJSON ¶ added in v1.0.0
func (s *SubscriptionStatusDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionStatusDetails.
type SubscriptionStatusReason ¶ added in v1.0.0
type SubscriptionStatusReason string
SubscriptionStatusReason - The suspension reason for a subscription. This field is not available for Enterprise Agreement billing accounts.
const ( SubscriptionStatusReasonCancelled SubscriptionStatusReason = "Cancelled" SubscriptionStatusReasonExpired SubscriptionStatusReason = "Expired" SubscriptionStatusReasonNone SubscriptionStatusReason = "None" SubscriptionStatusReasonOther SubscriptionStatusReason = "Other" SubscriptionStatusReasonPastDue SubscriptionStatusReason = "PastDue" SubscriptionStatusReasonPolicyViolation SubscriptionStatusReason = "PolicyViolation" SubscriptionStatusReasonSpendingLimitReached SubscriptionStatusReason = "SpendingLimitReached" SubscriptionStatusReasonSuspiciousActivity SubscriptionStatusReason = "SuspiciousActivity" SubscriptionStatusReasonTransferred SubscriptionStatusReason = "Transferred" )
func PossibleSubscriptionStatusReasonValues ¶ added in v1.0.0
func PossibleSubscriptionStatusReasonValues() []SubscriptionStatusReason
PossibleSubscriptionStatusReasonValues returns the possible values for the SubscriptionStatusReason const type.
type SubscriptionTransferValidationErrorCode ¶
type SubscriptionTransferValidationErrorCode string
SubscriptionTransferValidationErrorCode - Error code of the transfer validation response.
const ( SubscriptionTransferValidationErrorCodeAccountIsLocked SubscriptionTransferValidationErrorCode = "AccountIsLocked" SubscriptionTransferValidationErrorCodeAssetHasCap SubscriptionTransferValidationErrorCode = "AssetHasCap" SubscriptionTransferValidationErrorCodeAssetNotActive SubscriptionTransferValidationErrorCode = "AssetNotActive" SubscriptionTransferValidationErrorCodeBillingAccountInactive SubscriptionTransferValidationErrorCode = "BillingAccountInactive" SubscriptionTransferValidationErrorCodeBillingProfilePastDue SubscriptionTransferValidationErrorCode = "BillingProfilePastDue" 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" SubscriptionTransferValidationErrorCodeInvoiceSectionIsRestricted SubscriptionTransferValidationErrorCode = "InvoiceSectionIsRestricted" SubscriptionTransferValidationErrorCodeMarketplaceNotEnabledOnDestination SubscriptionTransferValidationErrorCode = "MarketplaceNotEnabledOnDestination" SubscriptionTransferValidationErrorCodeNoActiveAzurePlan SubscriptionTransferValidationErrorCode = "NoActiveAzurePlan" SubscriptionTransferValidationErrorCodeNone SubscriptionTransferValidationErrorCode = "None" SubscriptionTransferValidationErrorCodeOther SubscriptionTransferValidationErrorCode = "Other" SubscriptionTransferValidationErrorCodeProductInactive SubscriptionTransferValidationErrorCode = "ProductInactive" SubscriptionTransferValidationErrorCodeProductNotFound SubscriptionTransferValidationErrorCode = "ProductNotFound" SubscriptionTransferValidationErrorCodeProductTypeNotSupported SubscriptionTransferValidationErrorCode = "ProductTypeNotSupported" SubscriptionTransferValidationErrorCodeSourceBillingProfilePastDue SubscriptionTransferValidationErrorCode = "SourceBillingProfilePastDue" SubscriptionTransferValidationErrorCodeSourceInvoiceSectionInactive SubscriptionTransferValidationErrorCode = "SourceInvoiceSectionInactive" SubscriptionTransferValidationErrorCodeSubscriptionHasReservations SubscriptionTransferValidationErrorCode = "SubscriptionHasReservations" SubscriptionTransferValidationErrorCodeSubscriptionNotActive SubscriptionTransferValidationErrorCode = "SubscriptionNotActive" SubscriptionTransferValidationErrorCodeSubscriptionTypeNotSupported SubscriptionTransferValidationErrorCode = "SubscriptionTypeNotSupported" )
func PossibleSubscriptionTransferValidationErrorCodeValues ¶
func PossibleSubscriptionTransferValidationErrorCodeValues() []SubscriptionTransferValidationErrorCode
PossibleSubscriptionTransferValidationErrorCodeValues returns the possible values for the SubscriptionTransferValidationErrorCode const type.
type SubscriptionWorkloadType ¶ added in v1.0.0
type SubscriptionWorkloadType string
SubscriptionWorkloadType - The Azure workload type of the subscription.
const ( SubscriptionWorkloadTypeDevTest SubscriptionWorkloadType = "DevTest" SubscriptionWorkloadTypeInternal SubscriptionWorkloadType = "Internal" SubscriptionWorkloadTypeNone SubscriptionWorkloadType = "None" SubscriptionWorkloadTypeProduction SubscriptionWorkloadType = "Production" )
func PossibleSubscriptionWorkloadTypeValues ¶ added in v1.0.0
func PossibleSubscriptionWorkloadTypeValues() []SubscriptionWorkloadType
PossibleSubscriptionWorkloadTypeValues returns the possible values for the SubscriptionWorkloadType const type.
type SubscriptionsAliasesClient ¶ added in v1.0.0
type SubscriptionsAliasesClient struct {
// contains filtered or unexported fields
}
SubscriptionsAliasesClient contains the methods for the BillingSubscriptionsAliases group. Don't use this type directly, use NewSubscriptionsAliasesClient() instead.
func NewSubscriptionsAliasesClient ¶ added in v1.0.0
func NewSubscriptionsAliasesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionsAliasesClient, error)
NewSubscriptionsAliasesClient creates a new instance of SubscriptionsAliasesClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*SubscriptionsAliasesClient) BeginCreateOrUpdate ¶ added in v1.0.0
func (client *SubscriptionsAliasesClient) BeginCreateOrUpdate(ctx context.Context, billingAccountName string, aliasName string, parameters SubscriptionAlias, options *SubscriptionsAliasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SubscriptionsAliasesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates or updates a billing subscription by its alias ID. The operation is supported for seat based billing subscriptions. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- aliasName - The ID that uniquely identifies a subscription alias.
- parameters - A billing subscription alias.
- options - SubscriptionsAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the SubscriptionsAliasesClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasCreateOrUpdate.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.NewSubscriptionsAliasesClient().BeginCreateOrUpdate(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "c356b7c7-7545-4686-b843-c1a49cf853fc", armbilling.SubscriptionAlias{ Properties: &armbilling.SubscriptionAliasProperties{ BillingFrequency: to.Ptr("P1M"), DisplayName: to.Ptr("Subscription 3"), Quantity: to.Ptr[int64](1), SKUID: to.Ptr("0001"), TermDuration: to.Ptr("P1M"), }, }, 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.SubscriptionAlias = armbilling.SubscriptionAlias{ // Name: to.Ptr("c356b7c7-7545-4686-b843-c1a49cf853fc"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptionAliases"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptionAliases/c356b7c7-7545-4686-b843-c1a49cf853fc"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-25T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionAliasProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Billing Subscription Display Name"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("SeatBased"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // BillingSubscriptionID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // } }
Output:
func (*SubscriptionsAliasesClient) Get ¶ added in v1.0.0
func (client *SubscriptionsAliasesClient) Get(ctx context.Context, billingAccountName string, aliasName string, options *SubscriptionsAliasesClientGetOptions) (SubscriptionsAliasesClientGetResponse, error)
Get - Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- aliasName - The ID that uniquely identifies a subscription alias.
- options - SubscriptionsAliasesClientGetOptions contains the optional parameters for the SubscriptionsAliasesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasGet.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.NewSubscriptionsAliasesClient().Get(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "c356b7c7-7545-4686-b843-c1a49cf853fc", 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.SubscriptionAlias = armbilling.SubscriptionAlias{ // Name: to.Ptr("c356b7c7-7545-4686-b843-c1a49cf853fc"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptionAliases"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptionAliases/c356b7c7-7545-4686-b843-c1a49cf853fc"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-25T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionAliasProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Billing Subscription Display Name"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("SeatBased"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // BillingSubscriptionID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // } }
Output:
func (*SubscriptionsAliasesClient) NewListByBillingAccountPager ¶ added in v1.0.0
func (client *SubscriptionsAliasesClient) NewListByBillingAccountPager(billingAccountName string, options *SubscriptionsAliasesClientListByBillingAccountOptions) *runtime.Pager[SubscriptionsAliasesClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the subscription aliases for a billing account. The operation is supported for seat based billing subscriptions.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- options - SubscriptionsAliasesClientListByBillingAccountOptions contains the optional parameters for the SubscriptionsAliasesClient.NewListByBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasList.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.NewSubscriptionsAliasesClient().NewListByBillingAccountPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.SubscriptionsAliasesClientListByBillingAccountOptions{IncludeDeleted: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.SubscriptionAliasListResult = armbilling.SubscriptionAliasListResult{ // Value: []*armbilling.SubscriptionAlias{ // { // Name: to.Ptr("90000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptionAliases"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptionAliases/90000000-0000-0000-0000-000000000000"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionAliasProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("My subscription"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("SeatBased"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptionAliases/11111111-1111-1111-1111-111111111111"), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // BillingSubscriptionID: to.Ptr("11111111-1111-1111-1111-111111111111"), // }, // }, // { // Name: to.Ptr("90000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptionAliases"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptionAliases/90000000-0000-0000-0000-000000000001"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-06T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-07T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionAliasProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Test subscription"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("Software"), // ProductType: to.Ptr("Software Product Type"), // ProductTypeID: to.Ptr("EFG456"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-06T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptionAliases/22222222-2222-2222-2222-222222222222"), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-07T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-07T22:39:34.260Z"); return t}()), // BillingSubscriptionID: to.Ptr("22222222-2222-2222-2222-222222222222"), // }, // }, // { // Name: to.Ptr("90000000-0000-0000-0000-000000000002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptionAliases"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptionAliases/90000000-0000-0000-0000-000000000002"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-25T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionAliasProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Dev subscription"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("ReservationOrder"), // ProductType: to.Ptr("Reservation Product Type"), // ProductTypeID: to.Ptr("JKL789"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // ResourceURI: to.Ptr("/providers/Microsoft.Capacity/reservationOrders/33333333-3333-3333-3333-333333333333"), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusSuspended), // SuspensionReasonDetails: []*armbilling.SubscriptionStatusDetails{ // { // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-15T22:39:34.260Z"); return t}()), // Reason: to.Ptr(armbilling.SubscriptionStatusReasonCancelled), // }}, // SuspensionReasons: []*string{ // to.Ptr("Cancelled")}, // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // BillingSubscriptionID: to.Ptr("33333333-3333-3333-3333-333333333333"), // }, // }}, // } } }
Output:
type SubscriptionsAliasesClientBeginCreateOrUpdateOptions ¶ added in v1.0.0
type SubscriptionsAliasesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SubscriptionsAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the SubscriptionsAliasesClient.BeginCreateOrUpdate method.
type SubscriptionsAliasesClientCreateOrUpdateResponse ¶ added in v1.0.0
type SubscriptionsAliasesClientCreateOrUpdateResponse struct { // A billing subscription alias. SubscriptionAlias }
SubscriptionsAliasesClientCreateOrUpdateResponse contains the response from method SubscriptionsAliasesClient.BeginCreateOrUpdate.
type SubscriptionsAliasesClientGetOptions ¶ added in v1.0.0
type SubscriptionsAliasesClientGetOptions struct { }
SubscriptionsAliasesClientGetOptions contains the optional parameters for the SubscriptionsAliasesClient.Get method.
type SubscriptionsAliasesClientGetResponse ¶ added in v1.0.0
type SubscriptionsAliasesClientGetResponse struct { // A billing subscription alias. SubscriptionAlias }
SubscriptionsAliasesClientGetResponse contains the response from method SubscriptionsAliasesClient.Get.
type SubscriptionsAliasesClientListByBillingAccountOptions ¶ added in v1.0.0
type SubscriptionsAliasesClientListByBillingAccountOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Can be used to get deleted billing subscriptions. IncludeDeleted *bool // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
SubscriptionsAliasesClientListByBillingAccountOptions contains the optional parameters for the SubscriptionsAliasesClient.NewListByBillingAccountPager method.
type SubscriptionsAliasesClientListByBillingAccountResponse ¶ added in v1.0.0
type SubscriptionsAliasesClientListByBillingAccountResponse struct { // A container for a list of resources SubscriptionAliasListResult }
SubscriptionsAliasesClientListByBillingAccountResponse contains the response from method SubscriptionsAliasesClient.NewListByBillingAccountPager.
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(credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionsClient, error)
NewSubscriptionsClient creates a new instance of SubscriptionsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*SubscriptionsClient) BeginCancel ¶ added in v1.0.0
func (client *SubscriptionsClient) BeginCancel(ctx context.Context, billingAccountName string, billingSubscriptionName string, parameters CancelSubscriptionRequest, options *SubscriptionsClientBeginCancelOptions) (*runtime.Poller[SubscriptionsClientCancelResponse], error)
BeginCancel - Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingSubscriptionName - The ID that uniquely identifies a subscription.
- parameters - Request parameters for cancel customer subscription.
- options - SubscriptionsClientBeginCancelOptions contains the optional parameters for the SubscriptionsClient.BeginCancel method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsCancel.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().BeginCancel(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", armbilling.CancelSubscriptionRequest{ CancellationReason: to.Ptr(armbilling.CancellationReasonCompromise), CustomerID: to.Ptr("11111111-1111-1111-1111-111111111111"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*SubscriptionsClient) BeginDelete ¶ added in v1.0.0
func (client *SubscriptionsClient) BeginDelete(ctx context.Context, billingAccountName string, billingSubscriptionName string, options *SubscriptionsClientBeginDeleteOptions) (*runtime.Poller[SubscriptionsClientDeleteResponse], error)
BeginDelete - Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingSubscriptionName - The ID that uniquely identifies a subscription.
- options - SubscriptionsClientBeginDeleteOptions contains the optional parameters for the SubscriptionsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsDelete.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.NewSubscriptionsClient().BeginDelete(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*SubscriptionsClient) BeginMerge ¶ added in v1.0.0
func (client *SubscriptionsClient) BeginMerge(ctx context.Context, billingAccountName string, billingSubscriptionName string, parameters SubscriptionMergeRequest, options *SubscriptionsClientBeginMergeOptions) (*runtime.Poller[SubscriptionsClientMergeResponse], error)
BeginMerge - Merges the billing subscription provided in the request with a target billing subscription. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingSubscriptionName - The ID that uniquely identifies a subscription.
- parameters - Request parameters that are provided to merge the two billing subscriptions.
- options - SubscriptionsClientBeginMergeOptions contains the optional parameters for the SubscriptionsClient.BeginMerge method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsMerge.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().BeginMerge(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", armbilling.SubscriptionMergeRequest{ Quantity: to.Ptr[int32](1), TargetBillingSubscriptionName: to.Ptr("22222222-2222-2222-2222-222222222222"), }, 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{ // Name: to.Ptr("22222222-2222-2222-2222-222222222222"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/22222222-2222-2222-2222-222222222222"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-25T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Billing Subscription Display Name"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("SeatBased"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](2), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // } }
Output:
func (*SubscriptionsClient) BeginMove ¶ added in v0.2.0
func (client *SubscriptionsClient) BeginMove(ctx context.Context, billingAccountName string, billingSubscriptionName string, parameters MoveBillingSubscriptionRequest, options *SubscriptionsClientBeginMoveOptions) (*runtime.Poller[SubscriptionsClientMoveResponse], error)
BeginMove - Moves charges for a subscription 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingSubscriptionName - The ID that uniquely identifies a subscription.
- parameters - Request parameters to transfer billing subscription.
- 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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionMove.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, "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "6b96d3f2-9008-4a9d-912f-f87744185aa3", armbilling.MoveBillingSubscriptionRequest{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), }, 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{ // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // ConsumptionCostCenter: to.Ptr("ABC1234"), // DisplayName: to.Ptr("My Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), // SKUDescription: to.Ptr("Microsoft Azure Plan"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // } }
Output:
func (*SubscriptionsClient) BeginSplit ¶ added in v1.0.0
func (client *SubscriptionsClient) BeginSplit(ctx context.Context, billingAccountName string, billingSubscriptionName string, parameters SubscriptionSplitRequest, options *SubscriptionsClientBeginSplitOptions) (*runtime.Poller[SubscriptionsClientSplitResponse], error)
BeginSplit - Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingSubscriptionName - The ID that uniquely identifies a subscription.
- parameters - Request parameters that are provided to split the billing subscription.
- options - SubscriptionsClientBeginSplitOptions contains the optional parameters for the SubscriptionsClient.BeginSplit method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsSplit.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().BeginSplit(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", armbilling.SubscriptionSplitRequest{ BillingFrequency: to.Ptr("P1M"), Quantity: to.Ptr[int32](1), TargetProductTypeID: to.Ptr("XYZ56789"), TargetSKUID: to.Ptr("0001"), TermDuration: to.Ptr("P1M"), }, 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{ // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/11111111-1111-1111-1111-111111111111"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-25T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Billing Subscription Display Name"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("SeatBased"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // } }
Output:
func (*SubscriptionsClient) BeginUpdate ¶ added in v1.0.0
func (client *SubscriptionsClient) BeginUpdate(ctx context.Context, billingAccountName string, billingSubscriptionName string, parameters SubscriptionPatch, options *SubscriptionsClientBeginUpdateOptions) (*runtime.Poller[SubscriptionsClientUpdateResponse], error)
BeginUpdate - Updates the properties of a billing subscription. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingSubscriptionName - The ID that uniquely identifies a subscription.
- parameters - The billing properties of a subscription.
- options - SubscriptionsClientBeginUpdateOptions contains the optional parameters for the SubscriptionsClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsUpdate.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().BeginUpdate(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", armbilling.SubscriptionPatch{ Properties: &armbilling.SubscriptionProperties{ ConsumptionCostCenter: to.Ptr("ABC1234"), }, }, 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{ // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/11111111-1111-1111-1111-111111111111"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-25T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Billing Subscription Display Name"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("SeatBased"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // } }
Output:
func (*SubscriptionsClient) Get ¶ added in v0.2.0
func (client *SubscriptionsClient) Get(ctx context.Context, billingAccountName string, billingSubscriptionName 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, Microsoft Partner Agreement, and Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingSubscriptionName - The ID that uniquely identifies a subscription.
- options - SubscriptionsClientGetOptions contains the optional parameters for the SubscriptionsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsGet.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, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "11111111-1111-1111-1111-111111111111", &armbilling.SubscriptionsClientGetOptions{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.Subscription = armbilling.Subscription{ // Name: to.Ptr("90000000-0000-0000-0000-000000000000"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/90000000-0000-0000-0000-000000000000"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("My subscription"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("SeatBased"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/90000000-0000-0000-0000-000000000000"), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // } }
Output:
func (*SubscriptionsClient) GetByBillingProfile ¶ added in v1.0.0
func (client *SubscriptionsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingSubscriptionName string, options *SubscriptionsClientGetByBillingProfileOptions) (SubscriptionsClientGetByBillingProfileResponse, error)
GetByBillingProfile - Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- billingSubscriptionName - The ID that uniquely identifies a subscription.
- options - SubscriptionsClientGetByBillingProfileOptions contains the optional parameters for the SubscriptionsClient.GetByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionGetByBillingProfile.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().GetByBillingProfile(ctx, "pcn.94077792", "6478903", "6b96d3f2-9008-4a9d-912f-f87744185aa3", &armbilling.SubscriptionsClientGetByBillingProfileOptions{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.Subscription = armbilling.Subscription{ // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/pcn.94077792/billingProfiles/6478903/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/pcn.94077792/billingProfiles/6478903"), // BillingProfileName: to.Ptr("47268432"), // DisplayName: to.Ptr("My Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/6564892/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), // ProvisioningTenantID: to.Ptr("7d62dbd1-1348-4496-b2f8-df6948c103ee"), // Quantity: to.Ptr[int64](50), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // SystemOverrides: &armbilling.SystemOverrides{ // Cancellation: to.Ptr(armbilling.CancellationAllowed), // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // }, // } }
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.
Generated from API version 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingAccount.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.NewSubscriptionsClient().NewListByBillingAccountPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", &armbilling.SubscriptionsClientListByBillingAccountOptions{IncludeDeleted: to.Ptr(false), IncludeTenantSubscriptions: to.Ptr(false), IncludeFailed: nil, Expand: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.SubscriptionListResult = armbilling.SubscriptionListResult{ // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/90000000-0000-0000-0000-000000000000"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("My subscription"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("SeatBased"), // ProductType: to.Ptr("Seat-Based Product Type"), // ProductTypeID: to.Ptr("XYZ56789"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/90000000-0000-0000-0000-000000000000"), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // }, // { // Name: to.Ptr("90000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/90000000-0000-0000-0000-000000000001"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-06T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-07T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Test subscription"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("Software"), // ProductType: to.Ptr("Software Product Type"), // ProductTypeID: to.Ptr("EFG456"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-06T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/90000000-0000-0000-0000-000000000001"), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-07T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-07T22:39:34.260Z"); return t}()), // }, // }, // { // Name: to.Ptr("90000000-0000-0000-0000-000000000002"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingSubscriptions/90000000-0000-0000-0000-000000000002"), // SystemData: &armbilling.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-25T22:39:34.260Z"); return t}()), // }, // Properties: &armbilling.SubscriptionProperties{ // AutoRenew: to.Ptr(armbilling.AutoRenewOn), // BillingProfileDisplayName: to.Ptr("Billing Profile Display Name"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // BillingProfileName: to.Ptr("xxxx-xxxx-xxx-xxx"), // DisplayName: to.Ptr("Dev subscription"), // InvoiceSectionDisplayName: to.Ptr("Invoice Section Display Name"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy"), // InvoiceSectionName: to.Ptr("yyyy-yyyy-yyy-yyy"), // ProductCategory: to.Ptr("ReservationOrder"), // ProductType: to.Ptr("Reservation Product Type"), // ProductTypeID: to.Ptr("JKL789"), // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // Quantity: to.Ptr[int64](1), // ResourceURI: to.Ptr("/providers/Microsoft.Capacity/reservationOrders/90000000-0000-0000-0000-000000000002"), // SKUDescription: to.Ptr("SKU Description"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusSuspended), // SuspensionReasonDetails: []*armbilling.SubscriptionStatusDetails{ // { // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-15T22:39:34.260Z"); return t}()), // Reason: to.Ptr(armbilling.SubscriptionStatusReasonCancelled), // }}, // SuspensionReasons: []*string{ // to.Ptr("Cancelled")}, // SystemOverrides: &armbilling.SystemOverrides{ // CancellationAllowedEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-01T22:39:34.260Z"); return t}()), // }, // TermDuration: to.Ptr("P1M"), // TermEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-05T22:39:34.260Z"); return t}()), // TermStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-05T22:39:34.260Z"); return t}()), // }, // }}, // } } }
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 2024-04-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 (BillingSubscriptionsListByBillingProfileEa) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingProfileEA.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("pcn.94077792", "6478903", &armbilling.SubscriptionsClientListByBillingProfileOptions{IncludeDeleted: nil, Expand: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.SubscriptionListResult = armbilling.SubscriptionListResult{ // Value: []*armbilling.Subscription{ // { // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/pcn.94077792/billingProfiles/6478903/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/pcn.94077792/billingProfiles/6478903"), // BillingProfileName: to.Ptr("47268432"), // DisplayName: to.Ptr("My Subscription"), // EnrollmentAccountDisplayName: to.Ptr("billtest332211@outlook.com"), // EnrollmentAccountID: to.Ptr("172988"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // }}, // } } }
Output:
Example (BillingSubscriptionsListByBillingProfileMca) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingProfileMCA.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("a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "ea36e548-1505-41db-bebc-46fff3d37998", &armbilling.SubscriptionsClientListByBillingProfileOptions{IncludeDeleted: nil, Expand: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.SubscriptionListResult = armbilling.SubscriptionListResult{ // Value: []*armbilling.Subscription{ // { // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("My Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/22000000-0000-0000-0000-000000000000"), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // }, // { // Name: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Test Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/22000000-0000-0000-0000-000000000000"), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // }, // }, // { // Name: to.Ptr("90D31600-D46D-4084-84C6-1235CDAFFB56"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/90D31600-D46D-4084-84C6-1235CDAFFB56"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Dev Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/22000000-0000-0000-0000-000000000000"), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/90D31600-D46D-4084-84C6-1235CDAFFB56"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("90D31600-D46D-4084-84C6-1235CDAFFB56"), // }, // }, // { // Name: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Dev Test Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/22000000-0000-0000-0000-000000000000"), // ResourceURI: to.Ptr("/providers/Microsoft.Domain/domainSubscriptions/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // SKUDescription: to.Ptr("Domain Name Registration ORG"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // }, // }}, // } } }
Output:
func (*SubscriptionsClient) NewListByCustomerAtBillingAccountPager ¶ added in v1.0.0
func (client *SubscriptionsClient) NewListByCustomerAtBillingAccountPager(billingAccountName string, customerName string, options *SubscriptionsClientListByCustomerAtBillingAccountOptions) *runtime.Pager[SubscriptionsClientListByCustomerAtBillingAccountResponse]
NewListByCustomerAtBillingAccountPager - Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- customerName - The ID that uniquely identifies a customer.
- options - SubscriptionsClientListByCustomerAtBillingAccountOptions contains the optional parameters for the SubscriptionsClient.NewListByCustomerAtBillingAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomerAtBillingAccount.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().NewListByCustomerAtBillingAccountPager("a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "Q7GV-UUVA-PJA-TGB", &armbilling.SubscriptionsClientListByCustomerAtBillingAccountOptions{IncludeDeleted: nil, Expand: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.SubscriptionListResult = armbilling.SubscriptionListResult{ // Value: []*armbilling.Subscription{ // { // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("BillingProfile1"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // BillingProfileName: to.Ptr("ea36e548-1505-41db-bebc-46fff3d37998"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/customers/Q7GV-UUVA-PJA-TGB"), // DisplayName: to.Ptr("My Subscription"), // Reseller: &armbilling.Reseller{ // Description: to.Ptr("Reseller1"), // ResellerID: to.Ptr("89e87bdf-a2a2-4687-925f-4c18b27bccfd"), // }, // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // SKUDescription: to.Ptr("Microsoft Azure Standard"), // SKUID: to.Ptr("0002"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // }, // { // Name: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("BillingProfile1"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // BillingProfileName: to.Ptr("ea36e548-1505-41db-bebc-46fff3d37998"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/customers/Q7GV-UUVA-PJA-TGB"), // DisplayName: to.Ptr("Test Subscription"), // Reseller: &armbilling.Reseller{ // Description: to.Ptr("Reseller3"), // ResellerID: to.Ptr("3b65b5a8-bd4f-4084-90e9-e1bd667a2b19"), // }, // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // SKUDescription: to.Ptr("Microsoft Azure Standard"), // SKUID: to.Ptr("0002"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // }, // }, // { // Name: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("BillingProfile1"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // BillingProfileName: to.Ptr("ea36e548-1505-41db-bebc-46fff3d37998"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/customers/Q7GV-UUVA-PJA-TGB"), // DisplayName: to.Ptr("Dev Test Subscription"), // ResourceURI: to.Ptr("/providers/Microsoft.Domain/domainSubscriptions/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // SKUDescription: to.Ptr("Domain Name Registration ORG"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // }, // }}, // } } }
Output:
func (*SubscriptionsClient) NewListByCustomerPager ¶ added in v0.4.0
func (client *SubscriptionsClient) NewListByCustomerPager(billingAccountName string, billingProfileName 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- 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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "ea36e548-1505-41db-bebc-46fff3d37998", "Q7GV-UUVA-PJA-TGB", &armbilling.SubscriptionsClientListByCustomerOptions{IncludeDeleted: nil, Expand: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.SubscriptionListResult = armbilling.SubscriptionListResult{ // Value: []*armbilling.Subscription{ // { // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("BillingProfile1"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // BillingProfileName: to.Ptr("ea36e548-1505-41db-bebc-46fff3d37998"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/customers/Q7GV-UUVA-PJA-TGB"), // DisplayName: to.Ptr("My Subscription"), // Reseller: &armbilling.Reseller{ // Description: to.Ptr("Reseller1"), // ResellerID: to.Ptr("89e87bdf-a2a2-4687-925f-4c18b27bccfd"), // }, // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // SKUDescription: to.Ptr("Microsoft Azure Standard"), // SKUID: to.Ptr("0002"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // }, // { // Name: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("BillingProfile1"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // BillingProfileName: to.Ptr("ea36e548-1505-41db-bebc-46fff3d37998"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/customers/Q7GV-UUVA-PJA-TGB"), // DisplayName: to.Ptr("Test Subscription"), // Reseller: &armbilling.Reseller{ // Description: to.Ptr("Reseller3"), // ResellerID: to.Ptr("3b65b5a8-bd4f-4084-90e9-e1bd667a2b19"), // }, // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // SKUDescription: to.Ptr("Microsoft Azure Standard"), // SKUID: to.Ptr("0002"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // }, // }, // { // Name: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("BillingProfile1"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // BillingProfileName: to.Ptr("ea36e548-1505-41db-bebc-46fff3d37998"), // CustomerDisplayName: to.Ptr("Customer1"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/customers/Q7GV-UUVA-PJA-TGB"), // DisplayName: to.Ptr("Dev Test Subscription"), // ResourceURI: to.Ptr("/providers/Microsoft.Domain/domainSubscriptions/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // SKUDescription: to.Ptr("Domain Name Registration ORG"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // }, // }}, // } } }
Output:
func (*SubscriptionsClient) NewListByEnrollmentAccountPager ¶ added in v1.0.0
func (client *SubscriptionsClient) NewListByEnrollmentAccountPager(billingAccountName string, enrollmentAccountName string, options *SubscriptionsClientListByEnrollmentAccountOptions) *runtime.Pager[SubscriptionsClientListByEnrollmentAccountResponse]
NewListByEnrollmentAccountPager - Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- enrollmentAccountName - The name of the enrollment account.
- options - SubscriptionsClientListByEnrollmentAccountOptions contains the optional parameters for the SubscriptionsClient.NewListByEnrollmentAccountPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByEnrollmentAccount.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().NewListByEnrollmentAccountPager("6564892", "172988", &armbilling.SubscriptionsClientListByEnrollmentAccountOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.SubscriptionListResult = armbilling.SubscriptionListResult{ // 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/6564892/billingSubscriptions/90000000-0000-0000-0000-000000000000"), // Properties: &armbilling.SubscriptionProperties{ // ConsumptionCostCenter: to.Ptr("123"), // DisplayName: to.Ptr("TestSubscription"), // EnrollmentAccountDisplayName: to.Ptr("billtest332211@outlook.com"), // EnrollmentAccountID: to.Ptr("172988"), // EnrollmentAccountSubscriptionDetails: &armbilling.EnrollmentAccountSubscriptionDetails{ // EnrollmentAccountStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T00:00:00.000Z"); return t}()), // }, // SubscriptionID: to.Ptr("90000000-0000-0000-0000-000000000000"), // }, // }, // { // Name: to.Ptr("90000000-0000-0000-0000-000000000001"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/6564892/billingSubscriptions/90000000-0000-0000-0000-000000000001"), // Properties: &armbilling.SubscriptionProperties{ // ConsumptionCostCenter: to.Ptr(""), // DisplayName: to.Ptr("Microsoft Azure Enterprise-1"), // EnrollmentAccountDisplayName: to.Ptr("billtest332211@outlook.com"), // EnrollmentAccountID: to.Ptr("172988"), // EnrollmentAccountSubscriptionDetails: &armbilling.EnrollmentAccountSubscriptionDetails{ // EnrollmentAccountStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-04T00:00:00.000Z"); return t}()), // SubscriptionEnrollmentAccountStatus: to.Ptr(armbilling.SubscriptionEnrollmentAccountStatusDeleted), // }, // SubscriptionID: to.Ptr("90000000-0000-0000-0000-000000000001"), // }, // }}, // } } }
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "ea36e548-1505-41db-bebc-46fff3d37998", "Q7GV-UUVA-PJA-TGB", &armbilling.SubscriptionsClientListByInvoiceSectionOptions{IncludeDeleted: nil, Expand: nil, Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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.SubscriptionListResult = armbilling.SubscriptionListResult{ // Value: []*armbilling.Subscription{ // { // Name: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("My Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/6b96d3f2-9008-4a9d-912f-f87744185aa3"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), // }, // }, // { // Name: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Test Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("CD0BBD7A-461A-4D9A-9C59-EAE51A0D5D12"), // }, // }, // { // Name: to.Ptr("90D31600-D46D-4084-84C6-1235CDAFFB56"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/90D31600-D46D-4084-84C6-1235CDAFFB56"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Dev Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), // ResourceURI: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/90D31600-D46D-4084-84C6-1235CDAFFB56"), // SKUDescription: to.Ptr("Microsoft Azure Dev/Test"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("90D31600-D46D-4084-84C6-1235CDAFFB56"), // }, // }, // { // Name: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingSubscriptions/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // Properties: &armbilling.SubscriptionProperties{ // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998"), // DisplayName: to.Ptr("Dev Test Subscription"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), // ResourceURI: to.Ptr("/providers/Microsoft.Domain/domainSubscriptions/9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // SKUDescription: to.Ptr("Domain Name Registration ORG"), // SKUID: to.Ptr("0001"), // Status: to.Ptr(armbilling.BillingSubscriptionStatusActive), // SubscriptionID: to.Ptr("9e90f86b-22fc-42f3-bfe2-0ac3e7c01d32"), // }, // }}, // } } }
Output:
func (*SubscriptionsClient) ValidateMoveEligibility ¶ added in v1.0.0
func (client *SubscriptionsClient) ValidateMoveEligibility(ctx context.Context, billingAccountName string, billingSubscriptionName string, parameters MoveBillingSubscriptionRequest, options *SubscriptionsClientValidateMoveEligibilityOptions) (SubscriptionsClientValidateMoveEligibilityResponse, error)
ValidateMoveEligibility - Validates if charges for a subscription 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 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingSubscriptionName - The ID that uniquely identifies a subscription.
- parameters - Request parameters to transfer billing subscription.
- options - SubscriptionsClientValidateMoveEligibilityOptions contains the optional parameters for the SubscriptionsClient.ValidateMoveEligibility method.
Example (BillingSubscriptionValidateMoveFailure) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionValidateMoveFailure.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().ValidateMoveEligibility(ctx, "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "6b96d3f2-9008-4a9d-912f-f87744185aa3", armbilling.MoveBillingSubscriptionRequest{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), }, 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.MoveBillingSubscriptionEligibilityResult = armbilling.MoveBillingSubscriptionEligibilityResult{ // ErrorDetails: &armbilling.MoveBillingSubscriptionErrorDetails{ // Code: to.Ptr(armbilling.SubscriptionTransferValidationErrorCodeSubscriptionNotActive), // Message: to.Ptr("Invoice Sections can only be changed for active subscriptions."), // }, // } }
Output:
Example (BillingSubscriptionValidateMoveSuccess) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionValidateMoveSuccess.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().ValidateMoveEligibility(ctx, "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "6b96d3f2-9008-4a9d-912f-f87744185aa3", armbilling.MoveBillingSubscriptionRequest{ DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"), }, 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.MoveBillingSubscriptionEligibilityResult = armbilling.MoveBillingSubscriptionEligibilityResult{ // IsMoveEligible: to.Ptr(true), // } }
Output:
type SubscriptionsClientBeginCancelOptions ¶ added in v1.0.0
type SubscriptionsClientBeginCancelOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SubscriptionsClientBeginCancelOptions contains the optional parameters for the SubscriptionsClient.BeginCancel method.
type SubscriptionsClientBeginDeleteOptions ¶ added in v1.0.0
type SubscriptionsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SubscriptionsClientBeginDeleteOptions contains the optional parameters for the SubscriptionsClient.BeginDelete method.
type SubscriptionsClientBeginMergeOptions ¶ added in v1.0.0
type SubscriptionsClientBeginMergeOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SubscriptionsClientBeginMergeOptions contains the optional parameters for the SubscriptionsClient.BeginMerge method.
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 SubscriptionsClientBeginSplitOptions ¶ added in v1.0.0
type SubscriptionsClientBeginSplitOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SubscriptionsClientBeginSplitOptions contains the optional parameters for the SubscriptionsClient.BeginSplit method.
type SubscriptionsClientBeginUpdateOptions ¶ added in v1.0.0
type SubscriptionsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SubscriptionsClientBeginUpdateOptions contains the optional parameters for the SubscriptionsClient.BeginUpdate method.
type SubscriptionsClientCancelResponse ¶ added in v1.0.0
type SubscriptionsClientCancelResponse struct { }
SubscriptionsClientCancelResponse contains the response from method SubscriptionsClient.BeginCancel.
type SubscriptionsClientDeleteResponse ¶ added in v1.0.0
type SubscriptionsClientDeleteResponse struct { }
SubscriptionsClientDeleteResponse contains the response from method SubscriptionsClient.BeginDelete.
type SubscriptionsClientGetByBillingProfileOptions ¶ added in v1.0.0
type SubscriptionsClientGetByBillingProfileOptions struct { // Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges Expand *string }
SubscriptionsClientGetByBillingProfileOptions contains the optional parameters for the SubscriptionsClient.GetByBillingProfile method.
type SubscriptionsClientGetByBillingProfileResponse ¶ added in v1.0.0
type SubscriptionsClientGetByBillingProfileResponse struct { // The billing properties of a subscription. Subscription }
SubscriptionsClientGetByBillingProfileResponse contains the response from method SubscriptionsClient.GetByBillingProfile.
type SubscriptionsClientGetOptions ¶ added in v0.2.0
type SubscriptionsClientGetOptions struct { // Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges Expand *string }
SubscriptionsClientGetOptions contains the optional parameters for the SubscriptionsClient.Get method.
type SubscriptionsClientGetResponse ¶ added in v0.2.0
type SubscriptionsClientGetResponse struct { // The billing properties of a subscription. Subscription }
SubscriptionsClientGetResponse contains the response from method SubscriptionsClient.Get.
type SubscriptionsClientListByBillingAccountOptions ¶ added in v0.2.0
type SubscriptionsClientListByBillingAccountOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges Expand *string // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Can be used to get deleted billing subscriptions. IncludeDeleted *bool // Can be used to get failed billing subscriptions. IncludeFailed *bool // Can be used to get tenant-owned billing subscriptions. This field is only applies to Microsoft Online Services Program // billing accounts. IncludeTenantSubscriptions *bool // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
SubscriptionsClientListByBillingAccountOptions contains the optional parameters for the SubscriptionsClient.NewListByBillingAccountPager method.
type SubscriptionsClientListByBillingAccountResponse ¶ added in v0.2.0
type SubscriptionsClientListByBillingAccountResponse struct { // A container for a list of resources SubscriptionListResult }
SubscriptionsClientListByBillingAccountResponse contains the response from method SubscriptionsClient.NewListByBillingAccountPager.
type SubscriptionsClientListByBillingProfileOptions ¶ added in v0.2.0
type SubscriptionsClientListByBillingProfileOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges Expand *string // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Can be used to get deleted billing subscriptions. IncludeDeleted *bool // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
SubscriptionsClientListByBillingProfileOptions contains the optional parameters for the SubscriptionsClient.NewListByBillingProfilePager method.
type SubscriptionsClientListByBillingProfileResponse ¶ added in v0.2.0
type SubscriptionsClientListByBillingProfileResponse struct { // A container for a list of resources SubscriptionListResult }
SubscriptionsClientListByBillingProfileResponse contains the response from method SubscriptionsClient.NewListByBillingProfilePager.
type SubscriptionsClientListByCustomerAtBillingAccountOptions ¶ added in v1.0.0
type SubscriptionsClientListByCustomerAtBillingAccountOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges Expand *string // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Can be used to get deleted billing subscriptions. IncludeDeleted *bool // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
SubscriptionsClientListByCustomerAtBillingAccountOptions contains the optional parameters for the SubscriptionsClient.NewListByCustomerAtBillingAccountPager method.
type SubscriptionsClientListByCustomerAtBillingAccountResponse ¶ added in v1.0.0
type SubscriptionsClientListByCustomerAtBillingAccountResponse struct { // A container for a list of resources SubscriptionListResult }
SubscriptionsClientListByCustomerAtBillingAccountResponse contains the response from method SubscriptionsClient.NewListByCustomerAtBillingAccountPager.
type SubscriptionsClientListByCustomerOptions ¶ added in v0.2.0
type SubscriptionsClientListByCustomerOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges Expand *string // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Can be used to get deleted billing subscriptions. IncludeDeleted *bool // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
SubscriptionsClientListByCustomerOptions contains the optional parameters for the SubscriptionsClient.NewListByCustomerPager method.
type SubscriptionsClientListByCustomerResponse ¶ added in v0.2.0
type SubscriptionsClientListByCustomerResponse struct { // A container for a list of resources SubscriptionListResult }
SubscriptionsClientListByCustomerResponse contains the response from method SubscriptionsClient.NewListByCustomerPager.
type SubscriptionsClientListByEnrollmentAccountOptions ¶ added in v1.0.0
type SubscriptionsClientListByEnrollmentAccountOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
SubscriptionsClientListByEnrollmentAccountOptions contains the optional parameters for the SubscriptionsClient.NewListByEnrollmentAccountPager method.
type SubscriptionsClientListByEnrollmentAccountResponse ¶ added in v1.0.0
type SubscriptionsClientListByEnrollmentAccountResponse struct { // A container for a list of resources SubscriptionListResult }
SubscriptionsClientListByEnrollmentAccountResponse contains the response from method SubscriptionsClient.NewListByEnrollmentAccountPager.
type SubscriptionsClientListByInvoiceSectionOptions ¶ added in v0.2.0
type SubscriptionsClientListByInvoiceSectionOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // Can be used to expand Reseller, ConsumptionCostCenter, LastMonthCharges and MonthToDateCharges Expand *string // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // Can be used to get deleted billing subscriptions. IncludeDeleted *bool // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
SubscriptionsClientListByInvoiceSectionOptions contains the optional parameters for the SubscriptionsClient.NewListByInvoiceSectionPager method.
type SubscriptionsClientListByInvoiceSectionResponse ¶ added in v0.2.0
type SubscriptionsClientListByInvoiceSectionResponse struct { // A container for a list of resources SubscriptionListResult }
SubscriptionsClientListByInvoiceSectionResponse contains the response from method SubscriptionsClient.NewListByInvoiceSectionPager.
type SubscriptionsClientMergeResponse ¶ added in v1.0.0
type SubscriptionsClientMergeResponse struct { // The billing properties of a subscription. Subscription }
SubscriptionsClientMergeResponse contains the response from method SubscriptionsClient.BeginMerge.
type SubscriptionsClientMoveResponse ¶ added in v0.2.0
type SubscriptionsClientMoveResponse struct { // The billing properties of a subscription. Subscription }
SubscriptionsClientMoveResponse contains the response from method SubscriptionsClient.BeginMove.
type SubscriptionsClientSplitResponse ¶ added in v1.0.0
type SubscriptionsClientSplitResponse struct { // The billing properties of a subscription. Subscription }
SubscriptionsClientSplitResponse contains the response from method SubscriptionsClient.BeginSplit.
type SubscriptionsClientUpdateResponse ¶ added in v0.2.0
type SubscriptionsClientUpdateResponse struct { // The billing properties of a subscription. Subscription }
SubscriptionsClientUpdateResponse contains the response from method SubscriptionsClient.BeginUpdate.
type SubscriptionsClientValidateMoveEligibilityOptions ¶ added in v1.0.0
type SubscriptionsClientValidateMoveEligibilityOptions struct { }
SubscriptionsClientValidateMoveEligibilityOptions contains the optional parameters for the SubscriptionsClient.ValidateMoveEligibility method.
type SubscriptionsClientValidateMoveEligibilityResponse ¶ added in v1.0.0
type SubscriptionsClientValidateMoveEligibilityResponse struct { // Result of the transfer eligibility validation. MoveBillingSubscriptionEligibilityResult }
SubscriptionsClientValidateMoveEligibilityResponse contains the response from method SubscriptionsClient.ValidateMoveEligibility.
type SupportLevel ¶ added in v1.0.0
type SupportLevel string
SupportLevel - The support level offer associated with an enrollment.
const ( SupportLevelDeveloper SupportLevel = "Developer" SupportLevelOther SupportLevel = "Other" SupportLevelProDirect SupportLevel = "Pro-Direct" SupportLevelStandard SupportLevel = "Standard" )
func PossibleSupportLevelValues ¶ added in v1.0.0
func PossibleSupportLevelValues() []SupportLevel
PossibleSupportLevelValues returns the possible values for the SupportLevel const type.
type SupportedAccountType ¶ added in v1.0.0
type SupportedAccountType string
SupportedAccountType - The supported account types.
const ( SupportedAccountTypeEnterprise SupportedAccountType = "Enterprise" SupportedAccountTypeIndividual SupportedAccountType = "Individual" SupportedAccountTypeNone SupportedAccountType = "None" SupportedAccountTypePartner SupportedAccountType = "Partner" )
func PossibleSupportedAccountTypeValues ¶ added in v1.0.0
func PossibleSupportedAccountTypeValues() []SupportedAccountType
PossibleSupportedAccountTypeValues returns the possible values for the SupportedAccountType const type.
type SystemData ¶ added in v1.0.0
type SystemData struct { // The timestamp of resource creation (UTC). CreatedAt *time.Time // The identity that created the resource. CreatedBy *string // The type of identity that created the resource. CreatedByType *CreatedByType // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time // The identity that last modified the resource. LastModifiedBy *string // The type of identity that last modified the resource. LastModifiedByType *CreatedByType }
SystemData - Metadata pertaining to creation and last modification of the resource.
func (SystemData) MarshalJSON ¶ added in v1.0.0
func (s SystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SystemData.
func (*SystemData) UnmarshalJSON ¶ added in v1.0.0
func (s *SystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
type SystemOverrides ¶ added in v1.0.0
type SystemOverrides struct { // READ-ONLY; The policy override for the subscription indicates whether the self-serve cancellation or seat reduction is // allowed. Cancellation *Cancellation // READ-ONLY; The end date in UTC time by when the self-serve cancellation ends. CancellationAllowedEndDate *time.Time }
SystemOverrides - System imposed policies that regulate behavior of the subscription.
func (SystemOverrides) MarshalJSON ¶ added in v1.0.0
func (s SystemOverrides) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SystemOverrides.
func (*SystemOverrides) UnmarshalJSON ¶ added in v1.0.0
func (s *SystemOverrides) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SystemOverrides.
type TaxIdentifier ¶ added in v1.0.0
type TaxIdentifier struct { // The country of the tax identifier. Country *string // The id of the tax identifier. ID *string // The scope of the tax identifier. Scope *string // The status of the tax identifier. Status *TaxIdentifierStatus // The type of the tax identifier. Type *TaxIdentifierType }
TaxIdentifier - A tax identifier for the billing account.
func (TaxIdentifier) MarshalJSON ¶ added in v1.0.0
func (t TaxIdentifier) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TaxIdentifier.
func (*TaxIdentifier) UnmarshalJSON ¶ added in v1.0.0
func (t *TaxIdentifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TaxIdentifier.
type TaxIdentifierStatus ¶ added in v1.0.0
type TaxIdentifierStatus string
TaxIdentifierStatus - The status of the tax identifier.
const ( TaxIdentifierStatusInvalid TaxIdentifierStatus = "Invalid" TaxIdentifierStatusOther TaxIdentifierStatus = "Other" TaxIdentifierStatusValid TaxIdentifierStatus = "Valid" )
func PossibleTaxIdentifierStatusValues ¶ added in v1.0.0
func PossibleTaxIdentifierStatusValues() []TaxIdentifierStatus
PossibleTaxIdentifierStatusValues returns the possible values for the TaxIdentifierStatus const type.
type TaxIdentifierType ¶ added in v1.0.0
type TaxIdentifierType string
TaxIdentifierType - The type of the tax identifier.
const ( TaxIdentifierTypeBrazilCcmID TaxIdentifierType = "BrazilCcmId" TaxIdentifierTypeBrazilCnpjID TaxIdentifierType = "BrazilCnpjId" TaxIdentifierTypeBrazilCpfID TaxIdentifierType = "BrazilCpfId" TaxIdentifierTypeCanadianFederalExempt TaxIdentifierType = "CanadianFederalExempt" TaxIdentifierTypeCanadianProvinceExempt TaxIdentifierType = "CanadianProvinceExempt" TaxIdentifierTypeExternalTaxation TaxIdentifierType = "ExternalTaxation" TaxIdentifierTypeIndiaFederalServiceTaxID TaxIdentifierType = "IndiaFederalServiceTaxId" TaxIdentifierTypeIndiaFederalTanID TaxIdentifierType = "IndiaFederalTanId" TaxIdentifierTypeIndiaPanID TaxIdentifierType = "IndiaPanId" TaxIdentifierTypeIndiaStateCstID TaxIdentifierType = "IndiaStateCstId" TaxIdentifierTypeIndiaStateGstINID TaxIdentifierType = "IndiaStateGstINId" TaxIdentifierTypeIndiaStateVatID TaxIdentifierType = "IndiaStateVatId" TaxIdentifierTypeIntlExempt TaxIdentifierType = "IntlExempt" TaxIdentifierTypeLoveCode TaxIdentifierType = "LoveCode" TaxIdentifierTypeMobileBarCode TaxIdentifierType = "MobileBarCode" TaxIdentifierTypeNationalIdentificationNumber TaxIdentifierType = "NationalIdentificationNumber" TaxIdentifierTypeOther TaxIdentifierType = "Other" TaxIdentifierTypePublicSectorID TaxIdentifierType = "PublicSectorId" TaxIdentifierTypeUSExempt TaxIdentifierType = "USExempt" TaxIdentifierTypeVatID TaxIdentifierType = "VatId" )
func PossibleTaxIdentifierTypeValues ¶ added in v1.0.0
func PossibleTaxIdentifierTypeValues() []TaxIdentifierType
PossibleTaxIdentifierTypeValues returns the possible values for the TaxIdentifierType const type.
type Transaction ¶
type Transaction struct { // A transaction. Properties *TransactionProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 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 TransactionKind ¶ added in v1.0.0
type TransactionKind string
TransactionKind - Type of the transaction, billed or unbilled.
const ( TransactionKindAll TransactionKind = "All" TransactionKindOther TransactionKind = "Other" TransactionKindReservation TransactionKind = "Reservation" )
func PossibleTransactionKindValues ¶ added in v1.0.0
func PossibleTransactionKindValues() []TransactionKind
PossibleTransactionKindValues returns the possible values for the TransactionKind const type.
type TransactionListResult ¶
type TransactionListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of resources. Value []*Transaction }
TransactionListResult - A container for a list of resources
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 amount of any Azure credits automatically applied to this transaction. AzureCreditApplied *TransactionPropertiesAzureCreditApplied // Details of the Azure plan. AzurePlan *string // The ISO 4217 code for the currency in which this transaction is billed. BillingCurrency *string // The name of the billing profile. BillingProfileDisplayName any // The fully qualified ID that uniquely identifies a billing profile. BillingProfileID *string // The amount of Microsoft Azure Consumption Commitment(MACC) decrement through the transaction. ConsumptionCommitmentDecremented *TransactionPropertiesConsumptionCommitmentDecremented // The credit type of the transaction. Applies only to credited transactions. CreditType *CreditType // The name of the customer. CustomerDisplayName *string // The fully qualified ID that uniquely identifies a customer. CustomerID *string // The date of transaction. Date *time.Time // The percentage discount, if any, applied to this transaction. Discount *float32 // The price of the product after applying any discounts. EffectivePrice *TransactionPropertiesEffectivePrice // The exchange rate used to convert charged amount to billing currency, if applicable. ExchangeRate *float32 // Invoice name on which the transaction was billed or 'Pending' if the transaction is not billed. Invoice *string // The fully qualified ID of the invoice on which the transaction was billed. This field is only applicable for transactions // which are billed. InvoiceID *string // The name of the invoice section. InvoiceSectionDisplayName *string // The fully qualified ID that uniquely identifies an invoice section. InvoiceSectionID *string // Whether or not the transaction is third party. IsThirdParty *bool // Type of the transaction, billed or unbilled. Kind *TransactionKind // The retail price of the product. MarketPrice *TransactionPropertiesMarketPrice // The part number of the product for which the transaction took place. The field is only applicable for Enterprise Agreement // invoices. PartNumber *string // The ISO 4217 code for the currency in which the product is priced. PricingCurrency *string // The description of the product for which the transaction took place. ProductDescription *string // The family of the product for which the transaction took place. ProductFamily *string // The type of the product for which the transaction took place. ProductType *string // The ID of the product type for which the transaction took place. ProductTypeID *string // The quantity purchased in the transaction. Quantity *int32 // There reason code for the transaction. ReasonCode *string // The refund details of a transaction. RefundTransactionDetails *TransactionPropertiesRefundTransactionDetails // The end date of the product term, or the end date of the month in which usage ended. ServicePeriodEndDate *time.Time // The date of the purchase of the product, or the start date of the month in which usage started. ServicePeriodStartDate *time.Time // Identifies the type of tax calculation used for the invoice. The field is applicable only to invoices with special tax // calculation logic. SpecialTaxationType *SpecialTaxationType // The pre-tax charged amount for the transaction. SubTotal *TransactionPropertiesSubTotal // The tax amount applied to the transaction. Tax *TransactionPropertiesTax // The charge associated with the transaction. TransactionAmount *TransactionPropertiesTransactionAmount // The type of transaction. TransactionType *string // The unit of measure used to bill for the product. For example, compute services are billed per hour. UnitOfMeasure *string // The description for the unit of measure for a given product. UnitType *string // The number of units used for a given product. Units *float32 }
TransactionProperties - 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 TransactionPropertiesAzureCreditApplied ¶ added in v1.0.0
type TransactionPropertiesAzureCreditApplied struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
TransactionPropertiesAzureCreditApplied - The amount of any Azure credits automatically applied to this transaction.
func (TransactionPropertiesAzureCreditApplied) MarshalJSON ¶ added in v1.0.0
func (t TransactionPropertiesAzureCreditApplied) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionPropertiesAzureCreditApplied.
func (*TransactionPropertiesAzureCreditApplied) UnmarshalJSON ¶ added in v1.0.0
func (t *TransactionPropertiesAzureCreditApplied) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionPropertiesAzureCreditApplied.
type TransactionPropertiesConsumptionCommitmentDecremented ¶ added in v1.0.0
type TransactionPropertiesConsumptionCommitmentDecremented struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
TransactionPropertiesConsumptionCommitmentDecremented - The amount of Microsoft Azure Consumption Commitment(MACC) decrement through the transaction.
func (TransactionPropertiesConsumptionCommitmentDecremented) MarshalJSON ¶ added in v1.0.0
func (t TransactionPropertiesConsumptionCommitmentDecremented) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionPropertiesConsumptionCommitmentDecremented.
func (*TransactionPropertiesConsumptionCommitmentDecremented) UnmarshalJSON ¶ added in v1.0.0
func (t *TransactionPropertiesConsumptionCommitmentDecremented) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionPropertiesConsumptionCommitmentDecremented.
type TransactionPropertiesEffectivePrice ¶ added in v1.0.0
type TransactionPropertiesEffectivePrice struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
TransactionPropertiesEffectivePrice - The price of the product after applying any discounts.
func (TransactionPropertiesEffectivePrice) MarshalJSON ¶ added in v1.0.0
func (t TransactionPropertiesEffectivePrice) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionPropertiesEffectivePrice.
func (*TransactionPropertiesEffectivePrice) UnmarshalJSON ¶ added in v1.0.0
func (t *TransactionPropertiesEffectivePrice) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionPropertiesEffectivePrice.
type TransactionPropertiesMarketPrice ¶ added in v1.0.0
type TransactionPropertiesMarketPrice struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
TransactionPropertiesMarketPrice - The retail price of the product.
func (TransactionPropertiesMarketPrice) MarshalJSON ¶ added in v1.0.0
func (t TransactionPropertiesMarketPrice) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionPropertiesMarketPrice.
func (*TransactionPropertiesMarketPrice) UnmarshalJSON ¶ added in v1.0.0
func (t *TransactionPropertiesMarketPrice) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionPropertiesMarketPrice.
type TransactionPropertiesRefundTransactionDetails ¶ added in v1.0.0
type TransactionPropertiesRefundTransactionDetails struct { // The amount refunded. AmountRefunded *RefundTransactionDetailsAmountRefunded // The amount of refund requested. AmountRequested *RefundTransactionDetailsAmountRequested // The ID of refund operation. RefundOperationID *string }
TransactionPropertiesRefundTransactionDetails - The refund details of a transaction.
func (TransactionPropertiesRefundTransactionDetails) MarshalJSON ¶ added in v1.0.0
func (t TransactionPropertiesRefundTransactionDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionPropertiesRefundTransactionDetails.
func (*TransactionPropertiesRefundTransactionDetails) UnmarshalJSON ¶ added in v1.0.0
func (t *TransactionPropertiesRefundTransactionDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionPropertiesRefundTransactionDetails.
type TransactionPropertiesSubTotal ¶ added in v1.0.0
type TransactionPropertiesSubTotal struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
TransactionPropertiesSubTotal - The pre-tax charged amount for the transaction.
func (TransactionPropertiesSubTotal) MarshalJSON ¶ added in v1.0.0
func (t TransactionPropertiesSubTotal) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionPropertiesSubTotal.
func (*TransactionPropertiesSubTotal) UnmarshalJSON ¶ added in v1.0.0
func (t *TransactionPropertiesSubTotal) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionPropertiesSubTotal.
type TransactionPropertiesTax ¶ added in v1.0.0
type TransactionPropertiesTax struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
TransactionPropertiesTax - The tax amount applied to the transaction.
func (TransactionPropertiesTax) MarshalJSON ¶ added in v1.0.0
func (t TransactionPropertiesTax) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionPropertiesTax.
func (*TransactionPropertiesTax) UnmarshalJSON ¶ added in v1.0.0
func (t *TransactionPropertiesTax) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionPropertiesTax.
type TransactionPropertiesTransactionAmount ¶ added in v1.0.0
type TransactionPropertiesTransactionAmount struct { // READ-ONLY; The currency for the amount value. Currency *string // READ-ONLY; The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. Value *float32 }
TransactionPropertiesTransactionAmount - The charge associated with the transaction.
func (TransactionPropertiesTransactionAmount) MarshalJSON ¶ added in v1.0.0
func (t TransactionPropertiesTransactionAmount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionPropertiesTransactionAmount.
func (*TransactionPropertiesTransactionAmount) UnmarshalJSON ¶ added in v1.0.0
func (t *TransactionPropertiesTransactionAmount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionPropertiesTransactionAmount.
type TransactionSummary ¶ added in v1.0.0
type TransactionSummary struct { // READ-ONLY; The total amount of any Azure credits applied. AzureCreditApplied *float32 // READ-ONLY; The ISO 4217 code for the currency in which the transactions are billed. BillingCurrency *string // READ-ONLY; The total Microsoft Azure Consumption Commitment (MACC) decrement through the invoice. ConsumptionCommitmentDecremented *float32 // READ-ONLY; The total pre-tax charged amount. SubTotal *float32 // READ-ONLY; The total tax amount applied. Tax *float32 // READ-ONLY; The total charges. Total *float32 }
TransactionSummary - A transaction summary.
func (TransactionSummary) MarshalJSON ¶ added in v1.0.0
func (t TransactionSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransactionSummary.
func (*TransactionSummary) UnmarshalJSON ¶ added in v1.0.0
func (t *TransactionSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransactionSummary.
type TransactionType ¶ added in v1.0.0
type TransactionType string
const ( TransactionTypeBilled TransactionType = "Billed" TransactionTypeOther TransactionType = "Other" TransactionTypeUnbilled TransactionType = "Unbilled" )
func PossibleTransactionTypeValues ¶ added in v1.0.0
func PossibleTransactionTypeValues() []TransactionType
PossibleTransactionTypeValues returns the possible values for the TransactionType 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) BeginTransactionsDownloadByInvoice ¶ added in v1.0.0
func (client *TransactionsClient) BeginTransactionsDownloadByInvoice(ctx context.Context, billingAccountName string, invoiceName string, options *TransactionsClientBeginTransactionsDownloadByInvoiceOptions) (*runtime.Poller[TransactionsClientTransactionsDownloadByInvoiceResponse], error)
BeginTransactionsDownloadByInvoice - Gets a URL to download the transactions document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- invoiceName - The ID that uniquely identifies an invoice.
- options - TransactionsClientBeginTransactionsDownloadByInvoiceOptions contains the optional parameters for the TransactionsClient.BeginTransactionsDownloadByInvoice method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsDownloadByInvoice.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.NewTransactionsClient().BeginTransactionsDownloadByInvoice(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "G123456789", 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.DocumentDownloadResult = armbilling.DocumentDownloadResult{ // ExpiryTime: to.Ptr("2023-02-16T17:32:28Z"), // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724_invoice.csv?sv=2019-02-02&sr=b&sp=r"), // } }
Output:
func (*TransactionsClient) GetTransactionSummaryByInvoice ¶ added in v1.0.0
func (client *TransactionsClient) GetTransactionSummaryByInvoice(ctx context.Context, billingAccountName string, invoiceName string, options *TransactionsClientGetTransactionSummaryByInvoiceOptions) (TransactionsClientGetTransactionSummaryByInvoiceResponse, error)
GetTransactionSummaryByInvoice - Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- invoiceName - The ID that uniquely identifies an invoice.
- options - TransactionsClientGetTransactionSummaryByInvoiceOptions contains the optional parameters for the TransactionsClient.GetTransactionSummaryByInvoice method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionSummaryGetByInvoice.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.NewTransactionsClient().GetTransactionSummaryByInvoice(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "G123456789", &armbilling.TransactionsClientGetTransactionSummaryByInvoiceOptions{Filter: nil, Search: 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.TransactionSummary = armbilling.TransactionSummary{ // AzureCreditApplied: to.Ptr[float32](100), // BillingCurrency: to.Ptr("USD"), // ConsumptionCommitmentDecremented: to.Ptr[float32](1000), // SubTotal: to.Ptr[float32](1000), // Tax: to.Ptr[float32](500), // Total: to.Ptr[float32](5400), // } }
Output:
func (*TransactionsClient) NewListByBillingProfilePager ¶ added in v1.0.0
func (client *TransactionsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, periodStartDate time.Time, periodEndDate time.Time, typeParam TransactionType, options *TransactionsClientListByBillingProfileOptions) *runtime.Pager[TransactionsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the billed or unbilled transactions by billing profile name for given start and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated.
Generated from API version 2024-04-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 transactions. The date should be specified in MM-DD-YYYY format.
- periodEndDate - The end date to fetch the transactions. The date should be specified in MM-DD-YYYY format.
- typeParam - The type of transaction.
- options - TransactionsClientListByBillingProfileOptions contains the optional parameters for the TransactionsClient.NewListByBillingProfilePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByBillingProfile.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) } pager := clientFactory.NewTransactionsClient().NewListByBillingProfilePager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", func() time.Time { t, _ := time.Parse("2006-01-02", "2024-04-01"); return t }(), func() time.Time { t, _ := time.Parse("2006-01-02", "2023-05-30"); return t }(), armbilling.TransactionTypeBilled, &armbilling.TransactionsClientListByBillingProfileOptions{Filter: to.Ptr("properties/date gt '2020-10-01'"), OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: to.Ptr("storage"), }) 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/billingProfiles/transactions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/41000000-0000-0000-0000-000000000000"), // Properties: &armbilling.TransactionProperties{ // AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // BillingCurrency: to.Ptr("USD"), // BillingProfileDisplayName: "Contoso operations billing", // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](100), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // Discount: to.Ptr[float32](0.1), // EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](10), // }, // ExchangeRate: to.Ptr[float32](1), // Invoice: to.Ptr("G123456789"), // InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"), // MarketPrice: &armbilling.TransactionPropertiesMarketPrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // PartNumber: to.Ptr("0001"), // 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, "2023-09-30T00:00:00.000Z"); return t}()), // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // SubTotal: &armbilling.TransactionPropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](4500), // }, // Tax: &armbilling.TransactionPropertiesTax{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](500), // }, // TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // TransactionType: to.Ptr("Purchase"), // 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/billingProfiles/transactions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/51000000-0000-0000-0000-000000000000"), // Properties: &armbilling.TransactionProperties{ // AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // BillingCurrency: to.Ptr("USD"), // BillingProfileDisplayName: "Contoso operations billing", // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T00:00:00.000Z"); return t}()), // Discount: to.Ptr[float32](0.1), // EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{ // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"), // MarketPrice: &armbilling.TransactionPropertiesMarketPrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // PartNumber: to.Ptr("0002"), // 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, "2023-09-30T00:00:00.000Z"); return t}()), // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // SubTotal: &armbilling.TransactionPropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](45), // }, // Tax: &armbilling.TransactionPropertiesTax{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5), // }, // TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // TransactionType: to.Ptr("Cancel"), // UnitOfMeasure: to.Ptr("1 Minute"), // UnitType: to.Ptr("1 Runtime Minute"), // Units: to.Ptr[float32](1.25), // }, // }}, // } } }
Output:
func (*TransactionsClient) NewListByCustomerPager ¶ added in v1.0.0
func (client *TransactionsClient) NewListByCustomerPager(billingAccountName string, billingProfileName string, customerName string, periodStartDate time.Time, periodEndDate time.Time, typeParam TransactionType, options *TransactionsClientListByCustomerOptions) *runtime.Pager[TransactionsClientListByCustomerResponse]
NewListByCustomerPager - Lists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated.
Generated from API version 2024-04-01
- billingAccountName - The ID that uniquely identifies a billing account.
- billingProfileName - The ID that uniquely identifies a billing profile.
- customerName - The ID that uniquely identifies a customer.
- periodStartDate - The start date to fetch the transactions. The date should be specified in MM-DD-YYYY format.
- periodEndDate - The end date to fetch the transactions. The date should be specified in MM-DD-YYYY format.
- typeParam - The type of transaction.
- options - TransactionsClientListByCustomerOptions contains the optional parameters for the TransactionsClient.NewListByCustomerPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByCustomer.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) } pager := clientFactory.NewTransactionsClient().NewListByCustomerPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "22000000-0000-0000-0000-000000000000", func() time.Time { t, _ := time.Parse("2006-01-02", "2024-04-01"); return t }(), func() time.Time { t, _ := time.Parse("2006-01-02", "2023-05-30"); return t }(), armbilling.TransactionTypeBilled, &armbilling.TransactionsClientListByCustomerOptions{Filter: to.Ptr("properties/date gt '2020-10-01'"), OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: to.Ptr("storage"), }) 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/billingProfiles/transactions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/41000000-0000-0000-0000-000000000000"), // Properties: &armbilling.TransactionProperties{ // AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // BillingCurrency: to.Ptr("USD"), // BillingProfileDisplayName: "Contoso operations billing", // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](100), // }, // CustomerDisplayName: to.Ptr("Contoso operations customer"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/22000000-0000-0000-0000-000000000000"), // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // Discount: to.Ptr[float32](0.1), // EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](10), // }, // ExchangeRate: to.Ptr[float32](1), // Invoice: to.Ptr("G123456789"), // InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"), // MarketPrice: &armbilling.TransactionPropertiesMarketPrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // PartNumber: to.Ptr("0001"), // 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, "2023-09-30T00:00:00.000Z"); return t}()), // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // SubTotal: &armbilling.TransactionPropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](4500), // }, // Tax: &armbilling.TransactionPropertiesTax{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](500), // }, // TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // TransactionType: to.Ptr("Purchase"), // 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/billingProfiles/transactions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/51000000-0000-0000-0000-000000000000"), // Properties: &armbilling.TransactionProperties{ // AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // BillingCurrency: to.Ptr("USD"), // BillingProfileDisplayName: "Contoso operations billing", // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // CustomerDisplayName: to.Ptr("Contoso operations customer"), // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/22000000-0000-0000-0000-000000000000"), // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T00:00:00.000Z"); return t}()), // Discount: to.Ptr[float32](0.1), // EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](10), // }, // ExchangeRate: to.Ptr[float32](1), // Invoice: to.Ptr("pending"), // MarketPrice: &armbilling.TransactionPropertiesMarketPrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // PartNumber: to.Ptr("0002"), // 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, "2023-09-30T00:00:00.000Z"); return t}()), // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // SubTotal: &armbilling.TransactionPropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](45), // }, // Tax: &armbilling.TransactionPropertiesTax{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5), // }, // TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // TransactionType: to.Ptr("Cancel"), // UnitOfMeasure: to.Ptr("1 Minute"), // UnitType: to.Ptr("1 Runtime Minute"), // Units: to.Ptr[float32](1.25), // }, // }}, // } } }
Output:
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 2024-04-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/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-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("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "G123456789", &armbilling.TransactionsClientListByInvoiceOptions{Filter: nil, OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: 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/billingProfiles/transactions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/41000000-0000-0000-0000-000000000000"), // Properties: &armbilling.TransactionProperties{ // AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // BillingCurrency: to.Ptr("USD"), // BillingProfileDisplayName: "Contoso operations billing", // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](100), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // Discount: to.Ptr[float32](0.1), // EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](10), // }, // ExchangeRate: to.Ptr[float32](1), // Invoice: to.Ptr("G123456789"), // InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"), // MarketPrice: &armbilling.TransactionPropertiesMarketPrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // PartNumber: to.Ptr("0001"), // 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, "2023-09-30T00:00:00.000Z"); return t}()), // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // SubTotal: &armbilling.TransactionPropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](4500), // }, // Tax: &armbilling.TransactionPropertiesTax{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](500), // }, // TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // TransactionType: to.Ptr("Purchase"), // 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/billingProfiles/transactions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/51000000-0000-0000-0000-000000000000"), // Properties: &armbilling.TransactionProperties{ // AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // BillingCurrency: to.Ptr("USD"), // BillingProfileDisplayName: "Contoso operations billing", // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T00:00:00.000Z"); return t}()), // Discount: to.Ptr[float32](0.1), // EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{ // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"), // MarketPrice: &armbilling.TransactionPropertiesMarketPrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // PartNumber: to.Ptr("0002"), // 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, "2023-09-30T00:00:00.000Z"); return t}()), // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // SubTotal: &armbilling.TransactionPropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](45), // }, // Tax: &armbilling.TransactionPropertiesTax{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5), // }, // TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // TransactionType: to.Ptr("Cancel"), // UnitOfMeasure: to.Ptr("1 Minute"), // UnitType: to.Ptr("1 Runtime Minute"), // Units: to.Ptr[float32](1.25), // }, // }}, // } } }
Output:
func (*TransactionsClient) NewListByInvoiceSectionPager ¶ added in v1.0.0
func (client *TransactionsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, invoiceSectionName string, periodStartDate time.Time, periodEndDate time.Time, typeParam TransactionType, options *TransactionsClientListByInvoiceSectionOptions) *runtime.Pager[TransactionsClientListByInvoiceSectionResponse]
NewListByInvoiceSectionPager - Lists the billed or unbilled transactions by invoice section name for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated.
Generated from API version 2024-04-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.
- periodStartDate - The start date to fetch the transactions. The date should be specified in MM-DD-YYYY format.
- periodEndDate - The end date to fetch the transactions. The date should be specified in MM-DD-YYYY format.
- typeParam - The type of transaction.
- options - TransactionsClientListByInvoiceSectionOptions contains the optional parameters for the TransactionsClient.NewListByInvoiceSectionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoiceSection.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) } pager := clientFactory.NewTransactionsClient().NewListByInvoiceSectionPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "22000000-0000-0000-0000-000000000000", func() time.Time { t, _ := time.Parse("2006-01-02", "2024-04-01"); return t }(), func() time.Time { t, _ := time.Parse("2006-01-02", "2023-05-30"); return t }(), armbilling.TransactionTypeBilled, &armbilling.TransactionsClientListByInvoiceSectionOptions{Filter: to.Ptr("properties/date gt '2020-10-01'"), OrderBy: nil, Top: nil, Skip: nil, Count: nil, Search: to.Ptr("storage"), }) 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/billingProfiles/transactions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/41000000-0000-0000-0000-000000000000"), // Properties: &armbilling.TransactionProperties{ // AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](2000), // }, // BillingCurrency: to.Ptr("USD"), // BillingProfileDisplayName: "Contoso operations billing", // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](100), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // Discount: to.Ptr[float32](0.1), // EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](10), // }, // ExchangeRate: to.Ptr[float32](1), // Invoice: to.Ptr("G123456789"), // InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"), // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"), // MarketPrice: &armbilling.TransactionPropertiesMarketPrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // PartNumber: to.Ptr("0001"), // 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, "2023-09-30T00:00:00.000Z"); return t}()), // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // SubTotal: &armbilling.TransactionPropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](4500), // }, // Tax: &armbilling.TransactionPropertiesTax{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](500), // }, // TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5000), // }, // TransactionType: to.Ptr("Purchase"), // 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/billingProfiles/transactions"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/51000000-0000-0000-0000-000000000000"), // Properties: &armbilling.TransactionProperties{ // AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // BillingCurrency: to.Ptr("USD"), // BillingProfileDisplayName: "Contoso operations billing", // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"), // ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T00:00:00.000Z"); return t}()), // Discount: to.Ptr[float32](0.1), // EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{ // 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/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"), // MarketPrice: &armbilling.TransactionPropertiesMarketPrice{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](20), // }, // PartNumber: to.Ptr("0002"), // 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, "2023-09-30T00:00:00.000Z"); return t}()), // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00.000Z"); return t}()), // SubTotal: &armbilling.TransactionPropertiesSubTotal{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](45), // }, // Tax: &armbilling.TransactionPropertiesTax{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](5), // }, // TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{ // Currency: to.Ptr("USD"), // Value: to.Ptr[float32](50), // }, // TransactionType: to.Ptr("Cancel"), // UnitOfMeasure: to.Ptr("1 Minute"), // UnitType: to.Ptr("1 Runtime Minute"), // Units: to.Ptr[float32](1.25), // }, // }}, // } } }
Output:
type TransactionsClientBeginTransactionsDownloadByInvoiceOptions ¶ added in v1.0.0
type TransactionsClientBeginTransactionsDownloadByInvoiceOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
TransactionsClientBeginTransactionsDownloadByInvoiceOptions contains the optional parameters for the TransactionsClient.BeginTransactionsDownloadByInvoice method.
type TransactionsClientGetTransactionSummaryByInvoiceOptions ¶ added in v1.0.0
type TransactionsClientGetTransactionSummaryByInvoiceOptions struct { // The filter query option allows clients to filter the line items that are aggregated to create the line item summary. Filter *string // The search query option allows clients to filter the line items that are aggregated to create the line item summary. Search *string }
TransactionsClientGetTransactionSummaryByInvoiceOptions contains the optional parameters for the TransactionsClient.GetTransactionSummaryByInvoice method.
type TransactionsClientGetTransactionSummaryByInvoiceResponse ¶ added in v1.0.0
type TransactionsClientGetTransactionSummaryByInvoiceResponse struct { // A transaction summary. TransactionSummary }
TransactionsClientGetTransactionSummaryByInvoiceResponse contains the response from method TransactionsClient.GetTransactionSummaryByInvoice.
type TransactionsClientListByBillingProfileOptions ¶ added in v1.0.0
type TransactionsClientListByBillingProfileOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
TransactionsClientListByBillingProfileOptions contains the optional parameters for the TransactionsClient.NewListByBillingProfilePager method.
type TransactionsClientListByBillingProfileResponse ¶ added in v1.0.0
type TransactionsClientListByBillingProfileResponse struct { // A container for a list of resources TransactionListResult }
TransactionsClientListByBillingProfileResponse contains the response from method TransactionsClient.NewListByBillingProfilePager.
type TransactionsClientListByCustomerOptions ¶ added in v1.0.0
type TransactionsClientListByCustomerOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
TransactionsClientListByCustomerOptions contains the optional parameters for the TransactionsClient.NewListByCustomerPager method.
type TransactionsClientListByCustomerResponse ¶ added in v1.0.0
type TransactionsClientListByCustomerResponse struct { // A container for a list of resources TransactionListResult }
TransactionsClientListByCustomerResponse contains the response from method TransactionsClient.NewListByCustomerPager.
type TransactionsClientListByInvoiceOptions ¶ added in v0.2.0
type TransactionsClientListByInvoiceOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
TransactionsClientListByInvoiceOptions contains the optional parameters for the TransactionsClient.NewListByInvoicePager method.
type TransactionsClientListByInvoiceResponse ¶ added in v0.2.0
type TransactionsClientListByInvoiceResponse struct { // A container for a list of resources TransactionListResult }
TransactionsClientListByInvoiceResponse contains the response from method TransactionsClient.NewListByInvoicePager.
type TransactionsClientListByInvoiceSectionOptions ¶ added in v1.0.0
type TransactionsClientListByInvoiceSectionOptions struct { // The count query option allows clients to request a count of the matching resources included with the resources in the response. Count *bool // The filter query option allows clients to filter a collection of resources that are addressed by a request URL. Filter *string // The orderby query option allows clients to request resources in a particular order. OrderBy *string // The search query option allows clients to request items within a collection matching a free-text search expression. search // is only supported for string fields. Search *string // The skip query option requests the number of items in the queried collection that are to be skipped and not included in // the result. Skip *int64 // The top query option requests the number of items in the queried collection to be included in the result. The maximum supported // value for top is 50. Top *int64 }
TransactionsClientListByInvoiceSectionOptions contains the optional parameters for the TransactionsClient.NewListByInvoiceSectionPager method.
type TransactionsClientListByInvoiceSectionResponse ¶ added in v1.0.0
type TransactionsClientListByInvoiceSectionResponse struct { // A container for a list of resources TransactionListResult }
TransactionsClientListByInvoiceSectionResponse contains the response from method TransactionsClient.NewListByInvoiceSectionPager.
type TransactionsClientTransactionsDownloadByInvoiceResponse ¶ added in v1.0.0
type TransactionsClientTransactionsDownloadByInvoiceResponse struct { // A secure URL that can be used to download a an entity until the URL expires. DocumentDownloadResult }
TransactionsClientTransactionsDownloadByInvoiceResponse contains the response from method TransactionsClient.BeginTransactionsDownloadByInvoice.
type TransferDetails ¶ added in v1.0.0
type TransferDetails struct { // Details of the transfer. Properties *TransferProperties // Dictionary of metadata associated with the resource. It may not be populated for all resource types. 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; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
TransferDetails - Details of the transfer.
func (TransferDetails) MarshalJSON ¶ added in v1.0.0
func (t TransferDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransferDetails.
func (*TransferDetails) UnmarshalJSON ¶ added in v1.0.0
func (t *TransferDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransferDetails.
type TransferDetailsListResult ¶ added in v1.0.0
type TransferDetailsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string // READ-ONLY; The list of transfers initiated by caller. Value []*TransferDetails }
TransferDetailsListResult - The list of transfers initiated by caller.
func (TransferDetailsListResult) MarshalJSON ¶ added in v1.0.0
func (t TransferDetailsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransferDetailsListResult.
func (*TransferDetailsListResult) UnmarshalJSON ¶ added in v1.0.0
func (t *TransferDetailsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransferDetailsListResult.
type TransferError ¶ added in v1.0.0
type TransferError struct { // READ-ONLY; Error code. Code *string // READ-ONLY; Error message. Message *string }
TransferError - Error details for transfer execution.
func (TransferError) MarshalJSON ¶ added in v1.0.0
func (t TransferError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransferError.
func (*TransferError) UnmarshalJSON ¶ added in v1.0.0
func (t *TransferError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransferError.
type TransferItemQueryParameter ¶ added in v1.0.0
type TransferItemQueryParameter struct { // State of the transfer request query filter. State *string }
TransferItemQueryParameter - Query parameter to enumerate transfer requests.
func (TransferItemQueryParameter) MarshalJSON ¶ added in v1.0.0
func (t TransferItemQueryParameter) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransferItemQueryParameter.
func (*TransferItemQueryParameter) UnmarshalJSON ¶ added in v1.0.0
func (t *TransferItemQueryParameter) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransferItemQueryParameter.
type TransferProperties ¶ added in v1.0.0
type TransferProperties struct { // READ-ONLY; The email ID of the user who canceled the transfer request. CanceledBy *string // READ-ONLY; Detailed transfer status. DetailedTransferStatus []*DetailedTransferStatus // READ-ONLY; The time at which the transfer request expires. ExpirationTime *time.Time // READ-ONLY; The email ID of the user who sent the transfer request. InitiatorEmailID *string // READ-ONLY; The email ID of the user to whom the transfer request was sent. RecipientEmailID *string // READ-ONLY; Overall transfer status. TransferStatus *TransferStatus }
TransferProperties - Transfer details
func (TransferProperties) MarshalJSON ¶ added in v1.0.0
func (t TransferProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransferProperties.
func (*TransferProperties) UnmarshalJSON ¶ added in v1.0.0
func (t *TransferProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransferProperties.
type TransferStatus ¶ added in v1.0.0
type TransferStatus string
TransferStatus - The status of a transfer.
const ( TransferStatusCanceled TransferStatus = "Canceled" TransferStatusCompleted TransferStatus = "Completed" TransferStatusCompletedWithErrors TransferStatus = "CompletedWithErrors" TransferStatusDeclined TransferStatus = "Declined" TransferStatusExpired TransferStatus = "Expired" TransferStatusFailed TransferStatus = "Failed" TransferStatusInProgress TransferStatus = "InProgress" TransferStatusPending TransferStatus = "Pending" )
func PossibleTransferStatusValues ¶ added in v1.0.0
func PossibleTransferStatusValues() []TransferStatus
PossibleTransferStatusValues returns the possible values for the TransferStatus const type.
type TransfersClient ¶ added in v1.0.0
type TransfersClient struct {
// contains filtered or unexported fields
}
TransfersClient contains the methods for the Transfers group. Don't use this type directly, use NewTransfersClient() instead.
func NewTransfersClient ¶ added in v1.0.0
func NewTransfersClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*TransfersClient, error)
NewTransfersClient creates a new instance of TransfersClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*TransfersClient) Cancel ¶ added in v1.0.0
func (client *TransfersClient) Cancel(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, transferName string, options *TransfersClientCancelOptions) (TransfersClientCancelResponse, error)
Cancel - Cancels a transfer request. 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 2024-04-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.
- transferName - The ID that uniquely identifies a transfer request.
- options - TransfersClientCancelOptions contains the optional parameters for the TransfersClient.Cancel method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersCancel.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.NewTransfersClient().Cancel(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", "aabb123", 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.TransferDetails = armbilling.TransferDetails{ // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy/transfers/aabb123"), // Properties: &armbilling.TransferProperties{ // CanceledBy: to.Ptr("user@contoso.com"), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusPending), // }, // } }
Output:
func (*TransfersClient) Get ¶ added in v1.0.0
func (client *TransfersClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, transferName string, options *TransfersClientGetOptions) (TransfersClientGetResponse, error)
Get - Gets a transfer request 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 2024-04-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.
- transferName - The ID that uniquely identifies a transfer request.
- options - TransfersClientGetOptions contains the optional parameters for the TransfersClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersGet.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.NewTransfersClient().Get(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", "aabb123", 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.TransferDetails = armbilling.TransferDetails{ // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy/transfers/aabb123"), // Properties: &armbilling.TransferProperties{ // DetailedTransferStatus: []*armbilling.DetailedTransferStatus{ // { // ProductID: to.Ptr("subscriptionId"), // ProductName: to.Ptr("Azure subscription 1"), // ProductType: to.Ptr(armbilling.ProductTypeAzureSubscription), // SKUDescription: to.Ptr("MS-AZR-0017G"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }, // { // ProductID: to.Ptr("reservedInstanceId"), // ProductName: to.Ptr("Reservation name"), // ProductType: to.Ptr(armbilling.ProductTypeAzureReservation), // SKUDescription: to.Ptr("Standard_D2s_v3;VirtualMachines;P1Y"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }}, // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusInProgress), // }, // } }
Output:
func (*TransfersClient) Initiate ¶ added in v1.0.0
func (client *TransfersClient) Initiate(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, transferName string, parameters InitiateTransferRequest, options *TransfersClientInitiateOptions) (TransfersClientInitiateResponse, error)
Initiate - Sends a request to a user in another billing account to transfer billing ownership of their subscriptions. 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 2024-04-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.
- transferName - The ID that uniquely identifies a transfer request.
- parameters - Request parameters that are provided to the initiate transfer operation.
- options - TransfersClientInitiateOptions contains the optional parameters for the TransfersClient.Initiate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersInitiate.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.NewTransfersClient().Initiate(ctx, "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", "aabb123", armbilling.InitiateTransferRequest{ Properties: &armbilling.InitiateTransferProperties{ RecipientEmailID: to.Ptr("user@contoso.com"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.TransferDetails = armbilling.TransferDetails{ // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy/transfers/aabb123"), // Properties: &armbilling.TransferProperties{ // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusPending), // }, // } }
Output:
func (*TransfersClient) NewListPager ¶ added in v1.0.0
func (client *TransfersClient) NewListPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *TransfersClientListOptions) *runtime.Pager[TransfersClientListResponse]
NewListPager - Lists the transfer requests for an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
Generated from API version 2024-04-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 - TransfersClientListOptions contains the optional parameters for the TransfersClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c08ac9813477921ad8295b98ced8f82d11b8f913/specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersList.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.NewTransfersClient().NewListPager("10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "yyyy-yyyy-yyy-yyy", 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.TransferDetailsListResult = armbilling.TransferDetailsListResult{ // Value: []*armbilling.TransferDetails{ // { // Name: to.Ptr("aabb123"), // Type: to.Ptr("Microsoft.Billing/transfers"), // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/yyyy-yyyy-yyy-yyy/transfers/aabb123"), // Properties: &armbilling.TransferProperties{ // DetailedTransferStatus: []*armbilling.DetailedTransferStatus{ // { // ProductID: to.Ptr("subscriptionId"), // ProductName: to.Ptr("Azure subscription 1"), // ProductType: to.Ptr(armbilling.ProductTypeAzureSubscription), // SKUDescription: to.Ptr("MS-AZR-0017G"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }, // { // ProductID: to.Ptr("reservedInstanceId"), // ProductName: to.Ptr("Reservation name"), // ProductType: to.Ptr(armbilling.ProductTypeAzureReservation), // SKUDescription: to.Ptr("Standard_D2s_v3;VirtualMachines;P1Y"), // TransferStatus: to.Ptr(armbilling.ProductTransferStatusInProgress), // }}, // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-05T17:32:28.000Z"); return t}()), // InitiatorEmailID: to.Ptr("xyz@contoso.com"), // RecipientEmailID: to.Ptr("user@contoso.com"), // TransferStatus: to.Ptr(armbilling.TransferStatusInProgress), // }, // }}, // } } }
Output:
type TransfersClientCancelOptions ¶ added in v1.0.0
type TransfersClientCancelOptions struct { }
TransfersClientCancelOptions contains the optional parameters for the TransfersClient.Cancel method.
type TransfersClientCancelResponse ¶ added in v1.0.0
type TransfersClientCancelResponse struct { // Details of the transfer. TransferDetails }
TransfersClientCancelResponse contains the response from method TransfersClient.Cancel.
type TransfersClientGetOptions ¶ added in v1.0.0
type TransfersClientGetOptions struct { }
TransfersClientGetOptions contains the optional parameters for the TransfersClient.Get method.
type TransfersClientGetResponse ¶ added in v1.0.0
type TransfersClientGetResponse struct { // Details of the transfer. TransferDetails }
TransfersClientGetResponse contains the response from method TransfersClient.Get.
type TransfersClientInitiateOptions ¶ added in v1.0.0
type TransfersClientInitiateOptions struct { }
TransfersClientInitiateOptions contains the optional parameters for the TransfersClient.Initiate method.
type TransfersClientInitiateResponse ¶ added in v1.0.0
type TransfersClientInitiateResponse struct { // Details of the transfer. TransferDetails }
TransfersClientInitiateResponse contains the response from method TransfersClient.Initiate.
type TransfersClientListOptions ¶ added in v1.0.0
type TransfersClientListOptions struct { }
TransfersClientListOptions contains the optional parameters for the TransfersClient.NewListPager method.
type TransfersClientListResponse ¶ added in v1.0.0
type TransfersClientListResponse struct { // The list of transfers initiated by caller. TransferDetailsListResult }
TransfersClientListResponse contains the response from method TransfersClient.NewListPager.
type TransitionDetails ¶ added in v1.0.0
type TransitionDetails struct { // READ-ONLY; The anniversary day of the pre-transitioned account of type Microsoft Online Services Program. AnniversaryDay *int32 // READ-ONLY; The transition completion date. TransitionDate *time.Time }
TransitionDetails - The details for a billing account transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement.
func (TransitionDetails) MarshalJSON ¶ added in v1.0.0
func (t TransitionDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TransitionDetails.
func (*TransitionDetails) UnmarshalJSON ¶ added in v1.0.0
func (t *TransitionDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TransitionDetails.
type Utilization ¶ added in v1.0.0
type Utilization struct { // The array of aggregates of a savings plan's utilization Aggregates []*UtilizationAggregates // READ-ONLY; The trend for a savings plan's utilization Trend *string }
Utilization - Savings plan utilization
func (Utilization) MarshalJSON ¶ added in v1.0.0
func (u Utilization) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Utilization.
func (*Utilization) UnmarshalJSON ¶ added in v1.0.0
func (u *Utilization) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Utilization.
type UtilizationAggregates ¶ added in v1.0.0
type UtilizationAggregates 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 }
UtilizationAggregates - The aggregate values of savings plan utilization
func (UtilizationAggregates) MarshalJSON ¶ added in v1.0.0
func (u UtilizationAggregates) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UtilizationAggregates.
func (*UtilizationAggregates) UnmarshalJSON ¶ added in v1.0.0
func (u *UtilizationAggregates) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UtilizationAggregates.
type ValidateTransferListResponse ¶ added in v1.0.0
type ValidateTransferListResponse struct { // READ-ONLY; The list of transfer validation results. Value []*ValidateTransferResponse }
ValidateTransferListResponse - Result of transfer validation.
func (ValidateTransferListResponse) MarshalJSON ¶ added in v1.0.0
func (v ValidateTransferListResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ValidateTransferListResponse.
func (*ValidateTransferListResponse) UnmarshalJSON ¶ added in v1.0.0
func (v *ValidateTransferListResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ValidateTransferListResponse.
type ValidateTransferResponse ¶ added in v1.0.0
type ValidateTransferResponse struct { // The properties of transfer validation response. Properties *ValidateTransferResponseProperties }
ValidateTransferResponse - Transfer validation response.
func (ValidateTransferResponse) MarshalJSON ¶ added in v1.0.0
func (v ValidateTransferResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ValidateTransferResponse.
func (*ValidateTransferResponse) UnmarshalJSON ¶ added in v1.0.0
func (v *ValidateTransferResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ValidateTransferResponse.
type ValidateTransferResponseProperties ¶ added in v1.0.0
type ValidateTransferResponseProperties struct { // The array of validation results. Results []*ValidationResultProperties // READ-ONLY; The product id for which this result applies. ProductID *string // READ-ONLY; The status of validation Status *string }
ValidateTransferResponseProperties - The properties of transfer validation response.
func (ValidateTransferResponseProperties) MarshalJSON ¶ added in v1.0.0
func (v ValidateTransferResponseProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ValidateTransferResponseProperties.
func (*ValidateTransferResponseProperties) UnmarshalJSON ¶ added in v1.0.0
func (v *ValidateTransferResponseProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ValidateTransferResponseProperties.
type ValidationResultProperties ¶ added in v1.0.0
type ValidationResultProperties struct { // READ-ONLY; Result Code. Code *string // READ-ONLY; Result Level. Level *string // READ-ONLY; The validation message. Message *string }
ValidationResultProperties - The properties of the validation result.
func (ValidationResultProperties) MarshalJSON ¶ added in v1.0.0
func (v ValidationResultProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ValidationResultProperties.
func (*ValidationResultProperties) UnmarshalJSON ¶ added in v1.0.0
func (v *ValidationResultProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ValidationResultProperties.
type ViewChargesPolicy ¶
type ViewChargesPolicy string
ViewChargesPolicy - The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices.
const ( ViewChargesPolicyAllowed ViewChargesPolicy = "Allowed" ViewChargesPolicyNotAllowed ViewChargesPolicy = "NotAllowed" ViewChargesPolicyOther ViewChargesPolicy = "Other" )
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
- associatedtenants_client.go
- availablebalances_client.go
- build.go
- client_factory.go
- constants.go
- customers_client.go
- date_type.go
- departments_client.go
- enrollmentaccounts_client.go
- invoices_client.go
- invoicesections_client.go
- models.go
- models_serde.go
- operations_client.go
- options.go
- partnertransfers_client.go
- paymentmethods_client.go
- permissions_client.go
- policies_client.go
- products_client.go
- profiles_client.go
- property_client.go
- recipienttransfers_client.go
- requests_client.go
- reservationorders_client.go
- reservations_client.go
- responses.go
- roleassignments_client.go
- roledefinition_client.go
- savingsplanorders_client.go
- savingsplans_client.go
- subscriptions_client.go
- subscriptionsaliases_client.go
- time_rfc3339.go
- transactions_client.go
- transfers_client.go