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/2020-05-01/invoices
Documentation
The invoices
SDK allows for interaction with the Azure Resource Manager Service billing
(API Version 2020-05-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/2020-05-01/invoices"
Client Initialization
client := invoices.NewInvoicesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: InvoicesClient.DownloadBillingSubscriptionInvoice
ctx := context.TODO()
id := invoices.NewBillingSubscriptionInvoiceID("subscriptionIdValue", "invoiceValue")
if err := client.DownloadBillingSubscriptionInvoiceThenPoll(ctx, id, invoices.DefaultDownloadBillingSubscriptionInvoiceOperationOptions()); err != nil {
// handle the error
}
Example Usage: InvoicesClient.DownloadInvoice
ctx := context.TODO()
id := invoices.NewBillingAccountInvoiceID("billingAccountValue", "invoiceValue")
if err := client.DownloadInvoiceThenPoll(ctx, id, invoices.DefaultDownloadInvoiceOperationOptions()); err != nil {
// handle the error
}
Example Usage: InvoicesClient.DownloadMultipleBillingProfileInvoices
ctx := context.TODO()
id := invoices.NewBillingAccountID("billingAccountValue")
var payload []string
if err := client.DownloadMultipleBillingProfileInvoicesThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: InvoicesClient.DownloadMultipleBillingSubscriptionInvoices
ctx := context.TODO()
id := invoices.NewBillingSubscriptionID("subscriptionIdValue")
var payload []string
if err := client.DownloadMultipleBillingSubscriptionInvoicesThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: InvoicesClient.Get
ctx := context.TODO()
id := invoices.NewBillingAccountInvoiceID("billingAccountValue", "invoiceValue")
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: InvoicesClient.GetById
ctx := context.TODO()
id := invoices.NewInvoiceID("invoiceValue")
read, err := client.GetById(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: InvoicesClient.GetBySubscriptionAndInvoiceId
ctx := context.TODO()
id := invoices.NewBillingSubscriptionInvoiceID("subscriptionIdValue", "invoiceValue")
read, err := client.GetBySubscriptionAndInvoiceId(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: InvoicesClient.ListByBillingAccount
ctx := context.TODO()
id := invoices.NewBillingAccountID("billingAccountValue")
// alternatively `client.ListByBillingAccount(ctx, id, invoices.DefaultListByBillingAccountOperationOptions())` can be used to do batched pagination
items, err := client.ListByBillingAccountComplete(ctx, id, invoices.DefaultListByBillingAccountOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: InvoicesClient.ListByBillingProfile
ctx := context.TODO()
id := invoices.NewBillingProfileID("billingAccountValue", "billingProfileValue")
// alternatively `client.ListByBillingProfile(ctx, id, invoices.DefaultListByBillingProfileOperationOptions())` can be used to do batched pagination
items, err := client.ListByBillingProfileComplete(ctx, id, invoices.DefaultListByBillingProfileOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: InvoicesClient.ListByBillingSubscription
ctx := context.TODO()
id := invoices.NewBillingSubscriptionID("subscriptionIdValue")
// alternatively `client.ListByBillingSubscription(ctx, id, invoices.DefaultListByBillingSubscriptionOperationOptions())` can be used to do batched pagination
items, err := client.ListByBillingSubscriptionComplete(ctx, id, invoices.DefaultListByBillingSubscriptionOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}