policies

package
v0.20240731.1212841 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/billing/2020-05-01/policies Documentation

The policies 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/policies"

Client Initialization

client := policies.NewPoliciesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: PoliciesClient.GetByBillingProfile

ctx := context.TODO()
id := policies.NewBillingProfileID("billingAccountValue", "billingProfileValue")

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: PoliciesClient.GetByCustomer

ctx := context.TODO()
id := policies.NewCustomerID("billingAccountValue", "customerValue")

read, err := client.GetByCustomer(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: PoliciesClient.Update

ctx := context.TODO()
id := policies.NewBillingProfileID("billingAccountValue", "billingProfileValue")

payload := policies.Policy{
	// ...
}


read, err := client.Update(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: PoliciesClient.UpdateCustomer

ctx := context.TODO()
id := policies.NewCustomerID("billingAccountValue", "customerValue")

payload := policies.CustomerPolicy{
	// ...
}


read, err := client.UpdateCustomer(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForMarketplacePurchasesPolicy

func PossibleValuesForMarketplacePurchasesPolicy() []string

func PossibleValuesForReservationPurchasesPolicy

func PossibleValuesForReservationPurchasesPolicy() []string

func PossibleValuesForViewCharges

func PossibleValuesForViewCharges() []string

func PossibleValuesForViewChargesPolicy

func PossibleValuesForViewChargesPolicy() []string

func ValidateBillingProfileID

func ValidateBillingProfileID(input interface{}, key string) (warnings []string, errors []error)

ValidateBillingProfileID checks that 'input' can be parsed as a Billing Profile ID

func ValidateCustomerID

func ValidateCustomerID(input interface{}, key string) (warnings []string, errors []error)

ValidateCustomerID checks that 'input' can be parsed as a Customer ID

Types

type BillingProfileId

type BillingProfileId struct {
	BillingAccountName string
	BillingProfileName string
}

BillingProfileId is a struct representing the Resource ID for a Billing Profile

func NewBillingProfileID

func NewBillingProfileID(billingAccountName string, billingProfileName string) BillingProfileId

NewBillingProfileID returns a new BillingProfileId struct

func ParseBillingProfileID

func ParseBillingProfileID(input string) (*BillingProfileId, error)

ParseBillingProfileID parses 'input' into a BillingProfileId

func ParseBillingProfileIDInsensitively

func ParseBillingProfileIDInsensitively(input string) (*BillingProfileId, error)

ParseBillingProfileIDInsensitively parses 'input' case-insensitively into a BillingProfileId note: this method should only be used for API response data and not user input

func (*BillingProfileId) FromParseResult

func (id *BillingProfileId) FromParseResult(input resourceids.ParseResult) error

func (BillingProfileId) ID

func (id BillingProfileId) ID() string

ID returns the formatted Billing Profile ID

func (BillingProfileId) Segments

func (id BillingProfileId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Billing Profile ID

func (BillingProfileId) String

func (id BillingProfileId) String() string

String returns a human-readable description of this Billing Profile ID

type CustomerId

type CustomerId struct {
	BillingAccountName string
	CustomerName       string
}

CustomerId is a struct representing the Resource ID for a Customer

func NewCustomerID

func NewCustomerID(billingAccountName string, customerName string) CustomerId

NewCustomerID returns a new CustomerId struct

func ParseCustomerID

func ParseCustomerID(input string) (*CustomerId, error)

ParseCustomerID parses 'input' into a CustomerId

func ParseCustomerIDInsensitively

func ParseCustomerIDInsensitively(input string) (*CustomerId, error)

ParseCustomerIDInsensitively parses 'input' case-insensitively into a CustomerId note: this method should only be used for API response data and not user input

func (*CustomerId) FromParseResult

func (id *CustomerId) FromParseResult(input resourceids.ParseResult) error

func (CustomerId) ID

func (id CustomerId) ID() string

ID returns the formatted Customer ID

func (CustomerId) Segments

func (id CustomerId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Customer ID

func (CustomerId) String

func (id CustomerId) String() string

String returns a human-readable description of this Customer ID

type CustomerPolicy

type CustomerPolicy struct {
	Id         *string                   `json:"id,omitempty"`
	Name       *string                   `json:"name,omitempty"`
	Properties *CustomerPolicyProperties `json:"properties,omitempty"`
	Type       *string                   `json:"type,omitempty"`
}

type CustomerPolicyProperties

type CustomerPolicyProperties struct {
	ViewCharges *ViewCharges `json:"viewCharges,omitempty"`
}

type GetByBillingProfileOperationResponse

type GetByBillingProfileOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Policy
}

type GetByCustomerOperationResponse

type GetByCustomerOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CustomerPolicy
}

type MarketplacePurchasesPolicy

type MarketplacePurchasesPolicy string
const (
	MarketplacePurchasesPolicyAllAllowed      MarketplacePurchasesPolicy = "AllAllowed"
	MarketplacePurchasesPolicyNotAllowed      MarketplacePurchasesPolicy = "NotAllowed"
	MarketplacePurchasesPolicyOnlyFreeAllowed MarketplacePurchasesPolicy = "OnlyFreeAllowed"
)

func (*MarketplacePurchasesPolicy) UnmarshalJSON

func (s *MarketplacePurchasesPolicy) UnmarshalJSON(bytes []byte) error

type PoliciesClient

type PoliciesClient struct {
	Client *resourcemanager.Client
}

func NewPoliciesClientWithBaseURI

func NewPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*PoliciesClient, error)

func (PoliciesClient) GetByBillingProfile

func (c PoliciesClient) GetByBillingProfile(ctx context.Context, id BillingProfileId) (result GetByBillingProfileOperationResponse, err error)

GetByBillingProfile ...

func (PoliciesClient) GetByCustomer

func (c PoliciesClient) GetByCustomer(ctx context.Context, id CustomerId) (result GetByCustomerOperationResponse, err error)

GetByCustomer ...

func (PoliciesClient) Update

func (c PoliciesClient) Update(ctx context.Context, id BillingProfileId, input Policy) (result UpdateOperationResponse, err error)

Update ...

func (PoliciesClient) UpdateCustomer

func (c PoliciesClient) UpdateCustomer(ctx context.Context, id CustomerId, input CustomerPolicy) (result UpdateCustomerOperationResponse, err error)

UpdateCustomer ...

type Policy

type Policy struct {
	Id         *string           `json:"id,omitempty"`
	Name       *string           `json:"name,omitempty"`
	Properties *PolicyProperties `json:"properties,omitempty"`
	Type       *string           `json:"type,omitempty"`
}

type PolicyProperties

type PolicyProperties struct {
	MarketplacePurchases *MarketplacePurchasesPolicy `json:"marketplacePurchases,omitempty"`
	ReservationPurchases *ReservationPurchasesPolicy `json:"reservationPurchases,omitempty"`
	ViewCharges          *ViewChargesPolicy          `json:"viewCharges,omitempty"`
}

type ReservationPurchasesPolicy

type ReservationPurchasesPolicy string
const (
	ReservationPurchasesPolicyAllowed    ReservationPurchasesPolicy = "Allowed"
	ReservationPurchasesPolicyNotAllowed ReservationPurchasesPolicy = "NotAllowed"
)

func (*ReservationPurchasesPolicy) UnmarshalJSON

func (s *ReservationPurchasesPolicy) UnmarshalJSON(bytes []byte) error

type UpdateCustomerOperationResponse

type UpdateCustomerOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CustomerPolicy
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Policy
}

type ViewCharges

type ViewCharges string
const (
	ViewChargesAllowed    ViewCharges = "Allowed"
	ViewChargesNotAllowed ViewCharges = "NotAllowed"
)

func (*ViewCharges) UnmarshalJSON

func (s *ViewCharges) UnmarshalJSON(bytes []byte) error

type ViewChargesPolicy

type ViewChargesPolicy string
const (
	ViewChargesPolicyAllowed    ViewChargesPolicy = "Allowed"
	ViewChargesPolicyNotAllowed ViewChargesPolicy = "NotAllowed"
)

func (*ViewChargesPolicy) UnmarshalJSON

func (s *ViewChargesPolicy) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL