costallocationrules

package
v0.20240111.1094251 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MPL-2.0 Imports: 12 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2023-08-01/costallocationrules Documentation

The costallocationrules SDK allows for interaction with the Azure Resource Manager Service costmanagement (API Version 2023-08-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/costmanagement/2023-08-01/costallocationrules"

Client Initialization

client := costallocationrules.NewCostAllocationRulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: CostAllocationRulesClient.CheckNameAvailability

ctx := context.TODO()
id := costallocationrules.NewBillingAccountID("billingAccountIdValue")

payload := costallocationrules.CostAllocationRuleCheckNameAvailabilityRequest{
	// ...
}


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

Example Usage: CostAllocationRulesClient.CreateOrUpdate

ctx := context.TODO()
id := costallocationrules.NewCostAllocationRuleID("billingAccountIdValue", "costAllocationRuleValue")

payload := costallocationrules.CostAllocationRuleDefinition{
	// ...
}


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

Example Usage: CostAllocationRulesClient.Delete

ctx := context.TODO()
id := costallocationrules.NewCostAllocationRuleID("billingAccountIdValue", "costAllocationRuleValue")

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

Example Usage: CostAllocationRulesClient.Get

ctx := context.TODO()
id := costallocationrules.NewCostAllocationRuleID("billingAccountIdValue", "costAllocationRuleValue")

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: CostAllocationRulesClient.List

ctx := context.TODO()
id := costallocationrules.NewBillingAccountID("billingAccountIdValue")

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForCostAllocationPolicyType

func PossibleValuesForCostAllocationPolicyType() []string

func PossibleValuesForCostAllocationResourceType

func PossibleValuesForCostAllocationResourceType() []string

func PossibleValuesForReason

func PossibleValuesForReason() []string

func PossibleValuesForRuleStatus

func PossibleValuesForRuleStatus() []string

func ValidateBillingAccountID

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

ValidateBillingAccountID checks that 'input' can be parsed as a Billing Account ID

func ValidateCostAllocationRuleID

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

ValidateCostAllocationRuleID checks that 'input' can be parsed as a Cost Allocation Rule ID

Types

type BillingAccountId

type BillingAccountId struct {
	BillingAccountId string
}

BillingAccountId is a struct representing the Resource ID for a Billing Account

func NewBillingAccountID

func NewBillingAccountID(billingAccountId string) BillingAccountId

NewBillingAccountID returns a new BillingAccountId struct

func ParseBillingAccountID

func ParseBillingAccountID(input string) (*BillingAccountId, error)

ParseBillingAccountID parses 'input' into a BillingAccountId

func ParseBillingAccountIDInsensitively

func ParseBillingAccountIDInsensitively(input string) (*BillingAccountId, error)

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

func (*BillingAccountId) FromParseResult added in v0.20231127.1171502

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

func (BillingAccountId) ID

func (id BillingAccountId) ID() string

ID returns the formatted Billing Account ID

func (BillingAccountId) Segments

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

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

func (BillingAccountId) String

func (id BillingAccountId) String() string

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

type CheckNameAvailabilityOperationResponse

type CheckNameAvailabilityOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CostAllocationRuleCheckNameAvailabilityResponse
}

type CostAllocationPolicyType

type CostAllocationPolicyType string
const (
	CostAllocationPolicyTypeFixedProportion CostAllocationPolicyType = "FixedProportion"
)

func (*CostAllocationPolicyType) UnmarshalJSON

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

type CostAllocationProportion

type CostAllocationProportion struct {
	Name       string  `json:"name"`
	Percentage float64 `json:"percentage"`
}

type CostAllocationResourceType

type CostAllocationResourceType string
const (
	CostAllocationResourceTypeDimension CostAllocationResourceType = "Dimension"
	CostAllocationResourceTypeTag       CostAllocationResourceType = "Tag"
)

func (*CostAllocationResourceType) UnmarshalJSON

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

type CostAllocationRuleCheckNameAvailabilityRequest

type CostAllocationRuleCheckNameAvailabilityRequest struct {
	Name *string `json:"name,omitempty"`
	Type *string `json:"type,omitempty"`
}

type CostAllocationRuleCheckNameAvailabilityResponse

type CostAllocationRuleCheckNameAvailabilityResponse struct {
	Message       *string `json:"message,omitempty"`
	NameAvailable *bool   `json:"nameAvailable,omitempty"`
	Reason        *Reason `json:"reason,omitempty"`
}

type CostAllocationRuleDefinition

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

type CostAllocationRuleDefinitionOperationPredicate

type CostAllocationRuleDefinitionOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (CostAllocationRuleDefinitionOperationPredicate) Matches

type CostAllocationRuleDetails

type CostAllocationRuleDetails struct {
	SourceResources *[]SourceCostAllocationResource `json:"sourceResources,omitempty"`
	TargetResources *[]TargetCostAllocationResource `json:"targetResources,omitempty"`
}

type CostAllocationRuleId

type CostAllocationRuleId struct {
	BillingAccountId       string
	CostAllocationRuleName string
}

CostAllocationRuleId is a struct representing the Resource ID for a Cost Allocation Rule

func NewCostAllocationRuleID

func NewCostAllocationRuleID(billingAccountId string, costAllocationRuleName string) CostAllocationRuleId

NewCostAllocationRuleID returns a new CostAllocationRuleId struct

func ParseCostAllocationRuleID

func ParseCostAllocationRuleID(input string) (*CostAllocationRuleId, error)

ParseCostAllocationRuleID parses 'input' into a CostAllocationRuleId

func ParseCostAllocationRuleIDInsensitively

func ParseCostAllocationRuleIDInsensitively(input string) (*CostAllocationRuleId, error)

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

func (*CostAllocationRuleId) FromParseResult added in v0.20231127.1171502

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

func (CostAllocationRuleId) ID

func (id CostAllocationRuleId) ID() string

ID returns the formatted Cost Allocation Rule ID

func (CostAllocationRuleId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Cost Allocation Rule ID

func (CostAllocationRuleId) String

func (id CostAllocationRuleId) String() string

String returns a human-readable description of this Cost Allocation Rule ID

type CostAllocationRuleProperties

type CostAllocationRuleProperties struct {
	CreatedDate *string                   `json:"createdDate,omitempty"`
	Description *string                   `json:"description,omitempty"`
	Details     CostAllocationRuleDetails `json:"details"`
	Status      RuleStatus                `json:"status"`
	UpdatedDate *string                   `json:"updatedDate,omitempty"`
}

func (*CostAllocationRuleProperties) GetCreatedDateAsTime

func (o *CostAllocationRuleProperties) GetCreatedDateAsTime() (*time.Time, error)

func (*CostAllocationRuleProperties) GetUpdatedDateAsTime

func (o *CostAllocationRuleProperties) GetUpdatedDateAsTime() (*time.Time, error)

func (*CostAllocationRuleProperties) SetCreatedDateAsTime

func (o *CostAllocationRuleProperties) SetCreatedDateAsTime(input time.Time)

func (*CostAllocationRuleProperties) SetUpdatedDateAsTime

func (o *CostAllocationRuleProperties) SetUpdatedDateAsTime(input time.Time)

type CostAllocationRulesClient

type CostAllocationRulesClient struct {
	Client *resourcemanager.Client
}

func NewCostAllocationRulesClientWithBaseURI

func NewCostAllocationRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*CostAllocationRulesClient, error)

func (CostAllocationRulesClient) CheckNameAvailability

CheckNameAvailability ...

func (CostAllocationRulesClient) CreateOrUpdate

CreateOrUpdate ...

func (CostAllocationRulesClient) Delete

Delete ...

func (CostAllocationRulesClient) Get

Get ...

func (CostAllocationRulesClient) List

List ...

func (CostAllocationRulesClient) ListComplete

ListComplete retrieves all the results into a single object

func (CostAllocationRulesClient) ListCompleteMatchingPredicate

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CostAllocationRuleDefinition
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CostAllocationRuleDefinition
}

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []CostAllocationRuleDefinition
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]CostAllocationRuleDefinition
}

type Reason

type Reason string
const (
	ReasonAlreadyExists Reason = "AlreadyExists"
	ReasonInvalid       Reason = "Invalid"
	ReasonValid         Reason = "Valid"
)

func (*Reason) UnmarshalJSON

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

type RuleStatus

type RuleStatus string
const (
	RuleStatusActive     RuleStatus = "Active"
	RuleStatusNotActive  RuleStatus = "NotActive"
	RuleStatusProcessing RuleStatus = "Processing"
)

func (*RuleStatus) UnmarshalJSON

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

type SourceCostAllocationResource

type SourceCostAllocationResource struct {
	Name         string                     `json:"name"`
	ResourceType CostAllocationResourceType `json:"resourceType"`
	Values       []string                   `json:"values"`
}

type TargetCostAllocationResource

type TargetCostAllocationResource struct {
	Name         string                     `json:"name"`
	PolicyType   CostAllocationPolicyType   `json:"policyType"`
	ResourceType CostAllocationResourceType `json:"resourceType"`
	Values       []CostAllocationProportion `json:"values"`
}

Jump to

Keyboard shortcuts

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