package
0.20240715.1103416
Repository: https://github.com/hashicorp/go-azure-sdk.git
Documentation: pkg.go.dev
# README
github.com/hashicorp/go-azure-sdk/resource-manager/billing/2024-04-01/billingaccount
Documentation
The billingaccount
SDK allows for interaction with the Azure Resource Manager Service billing
(API Version 2024-04-01
).
This readme covers example usages, but further information on using this SDK can be found in the project root.
Import Path
import "github.com/hashicorp/go-azure-sdk/resource-manager/billing/2024-04-01/billingaccount"
Client Initialization
client := billingaccount.NewBillingAccountClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: BillingAccountClient.AddPaymentTerms
ctx := context.TODO()
id := billingaccount.NewBillingAccountID("billingAccountValue")
var payload []PaymentTerm
if err := client.AddPaymentTermsThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: BillingAccountClient.AddressValidate
ctx := context.TODO()
payload := billingaccount.AddressDetails{
// ...
}
read, err := client.AddressValidate(ctx, payload)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: BillingAccountClient.CancelPaymentTerms
ctx := context.TODO()
id := billingaccount.NewBillingAccountID("billingAccountValue")
var payload string
if err := client.CancelPaymentTermsThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: BillingAccountClient.ConfirmTransition
ctx := context.TODO()
id := billingaccount.NewBillingAccountID("billingAccountValue")
read, err := client.ConfirmTransition(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: BillingAccountClient.Get
ctx := context.TODO()
id := billingaccount.NewBillingAccountID("billingAccountValue")
read, err := client.Get(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: BillingAccountClient.List
ctx := context.TODO()
// alternatively `client.List(ctx, billingaccount.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, billingaccount.DefaultListOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: BillingAccountClient.ListInvoiceSectionsByCreateSubscriptionPermission
ctx := context.TODO()
id := billingaccount.NewBillingAccountID("billingAccountValue")
// alternatively `client.ListInvoiceSectionsByCreateSubscriptionPermission(ctx, id, billingaccount.DefaultListInvoiceSectionsByCreateSubscriptionPermissionOperationOptions())` can be used to do batched pagination
items, err := client.ListInvoiceSectionsByCreateSubscriptionPermissionComplete(ctx, id, billingaccount.DefaultListInvoiceSectionsByCreateSubscriptionPermissionOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: BillingAccountClient.Update
ctx := context.TODO()
id := billingaccount.NewBillingAccountID("billingAccountValue")
payload := billingaccount.BillingAccountPatch{
// ...
}
if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: BillingAccountClient.ValidatePaymentTerms
ctx := context.TODO()
id := billingaccount.NewBillingAccountID("billingAccountValue")
var payload []PaymentTerm
read, err := client.ValidatePaymentTerms(ctx, id, payload)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}