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/2021-10-01/paymentmethods
Documentation
The paymentmethods
SDK allows for interaction with the Azure Resource Manager Service billing
(API Version 2021-10-01
).
This readme covers example usages, but further information on using this SDK can be found in the project root.
Import Path
import "github.com/hashicorp/go-azure-sdk/resource-manager/billing/2021-10-01/paymentmethods"
Client Initialization
client := paymentmethods.NewPaymentMethodsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: PaymentMethodsClient.DeleteAtBillingProfile
ctx := context.TODO()
id := paymentmethods.NewPaymentMethodLinkID("billingAccountValue", "billingProfileValue", "paymentMethodLinkValue")
if err := client.DeleteAtBillingProfileThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: PaymentMethodsClient.DeleteByUser
ctx := context.TODO()
id := paymentmethods.NewPaymentMethodID("paymentMethodValue")
read, err := client.DeleteByUser(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: PaymentMethodsClient.GetByBillingAccount
ctx := context.TODO()
id := paymentmethods.NewBillingAccountPaymentMethodID("billingAccountValue", "paymentMethodValue")
read, err := client.GetByBillingAccount(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: PaymentMethodsClient.GetByBillingProfile
ctx := context.TODO()
id := paymentmethods.NewPaymentMethodLinkID("billingAccountValue", "billingProfileValue", "paymentMethodLinkValue")
read, err := client.GetByBillingProfile(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: PaymentMethodsClient.GetByUser
ctx := context.TODO()
id := paymentmethods.NewPaymentMethodID("paymentMethodValue")
read, err := client.GetByUser(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: PaymentMethodsClient.ListByBillingAccount
ctx := context.TODO()
id := paymentmethods.NewBillingAccountID("billingAccountValue")
// alternatively `client.ListByBillingAccount(ctx, id)` can be used to do batched pagination
items, err := client.ListByBillingAccountComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: PaymentMethodsClient.ListByBillingProfile
ctx := context.TODO()
id := paymentmethods.NewBillingProfileID("billingAccountValue", "billingProfileValue")
// alternatively `client.ListByBillingProfile(ctx, id)` can be used to do batched pagination
items, err := client.ListByBillingProfileComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: PaymentMethodsClient.ListByUser
ctx := context.TODO()
// alternatively `client.ListByUser(ctx)` can be used to do batched pagination
items, err := client.ListByUserComplete(ctx)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}