armcostmanagement

package module
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 15 Imported by: 1

README

Azure Costmanagement Module for Go

PkgGoDev

The armcostmanagement module provides operations for working with Azure Costmanagement.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Costmanagement module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Costmanagement. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Costmanagement module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armcostmanagement.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armcostmanagement.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewAlertsClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Costmanagement label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccumulatedType

type AccumulatedType string

AccumulatedType - Show costs accumulated over time.

const (
	AccumulatedTypeFalse AccumulatedType = "false"
	AccumulatedTypeTrue  AccumulatedType = "true"
)

func PossibleAccumulatedTypeValues

func PossibleAccumulatedTypeValues() []AccumulatedType

PossibleAccumulatedTypeValues returns the possible values for the AccumulatedType const type.

type ActionType

type ActionType string

ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type Alert

type Alert struct {
	// eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating
	// the latest version or not.
	ETag *string

	// Alert properties.
	Properties *AlertProperties

	// READ-ONLY; Resource Id.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; Resource type.
	Type *string
}

Alert - An individual alert.

func (Alert) MarshalJSON

func (a Alert) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Alert.

func (*Alert) UnmarshalJSON

func (a *Alert) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Alert.

type AlertCategory

type AlertCategory string

AlertCategory - Alert category

const (
	AlertCategoryBilling AlertCategory = "Billing"
	AlertCategoryCost    AlertCategory = "Cost"
	AlertCategorySystem  AlertCategory = "System"
	AlertCategoryUsage   AlertCategory = "Usage"
)

func PossibleAlertCategoryValues

func PossibleAlertCategoryValues() []AlertCategory

PossibleAlertCategoryValues returns the possible values for the AlertCategory const type.

type AlertCriteria

type AlertCriteria string

AlertCriteria - Criteria that triggered alert

const (
	AlertCriteriaCostThresholdExceeded          AlertCriteria = "CostThresholdExceeded"
	AlertCriteriaCreditThresholdApproaching     AlertCriteria = "CreditThresholdApproaching"
	AlertCriteriaCreditThresholdReached         AlertCriteria = "CreditThresholdReached"
	AlertCriteriaCrossCloudCollectionError      AlertCriteria = "CrossCloudCollectionError"
	AlertCriteriaCrossCloudNewDataAvailable     AlertCriteria = "CrossCloudNewDataAvailable"
	AlertCriteriaForecastCostThresholdExceeded  AlertCriteria = "ForecastCostThresholdExceeded"
	AlertCriteriaForecastUsageThresholdExceeded AlertCriteria = "ForecastUsageThresholdExceeded"
	AlertCriteriaGeneralThresholdError          AlertCriteria = "GeneralThresholdError"
	AlertCriteriaInvoiceDueDateApproaching      AlertCriteria = "InvoiceDueDateApproaching"
	AlertCriteriaInvoiceDueDateReached          AlertCriteria = "InvoiceDueDateReached"
	AlertCriteriaMultiCurrency                  AlertCriteria = "MultiCurrency"
	AlertCriteriaQuotaThresholdApproaching      AlertCriteria = "QuotaThresholdApproaching"
	AlertCriteriaQuotaThresholdReached          AlertCriteria = "QuotaThresholdReached"
	AlertCriteriaUsageThresholdExceeded         AlertCriteria = "UsageThresholdExceeded"
)

func PossibleAlertCriteriaValues

func PossibleAlertCriteriaValues() []AlertCriteria

PossibleAlertCriteriaValues returns the possible values for the AlertCriteria const type.

type AlertOperator

type AlertOperator string

AlertOperator - operator used to compare currentSpend with amount

const (
	AlertOperatorEqualTo              AlertOperator = "EqualTo"
	AlertOperatorGreaterThan          AlertOperator = "GreaterThan"
	AlertOperatorGreaterThanOrEqualTo AlertOperator = "GreaterThanOrEqualTo"
	AlertOperatorLessThan             AlertOperator = "LessThan"
	AlertOperatorLessThanOrEqualTo    AlertOperator = "LessThanOrEqualTo"
	AlertOperatorNone                 AlertOperator = "None"
)

func PossibleAlertOperatorValues

func PossibleAlertOperatorValues() []AlertOperator

PossibleAlertOperatorValues returns the possible values for the AlertOperator const type.

type AlertProperties

type AlertProperties struct {
	// dateTime in which alert was closed
	CloseTime *string

	// related budget
	CostEntityID *string

	// dateTime in which alert was created
	CreationTime *string

	// defines the type of alert
	Definition *AlertPropertiesDefinition

	// Alert description
	Description *string

	// Alert details
	Details *AlertPropertiesDetails

	// dateTime in which alert was last modified
	ModificationTime *string

	// Source of alert
	Source *AlertSource

	// alert status
	Status *AlertStatus

	// dateTime in which the alert status was last modified
	StatusModificationTime *string

	// User who last modified the alert
	StatusModificationUserName *string
}

AlertProperties - Alert properties.

func (AlertProperties) MarshalJSON

func (a AlertProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertProperties.

func (*AlertProperties) UnmarshalJSON

func (a *AlertProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertProperties.

type AlertPropertiesDefinition

type AlertPropertiesDefinition struct {
	// Alert category
	Category *AlertCategory

	// Criteria that triggered alert
	Criteria *AlertCriteria

	// type of alert
	Type *AlertType
}

AlertPropertiesDefinition - defines the type of alert

func (AlertPropertiesDefinition) MarshalJSON

func (a AlertPropertiesDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertPropertiesDefinition.

func (*AlertPropertiesDefinition) UnmarshalJSON

func (a *AlertPropertiesDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertPropertiesDefinition.

type AlertPropertiesDetails

type AlertPropertiesDetails struct {
	// budget threshold amount
	Amount *float64

	// company name
	CompanyName *string

	// list of emails to contact
	ContactEmails []*string

	// list of action groups to broadcast to
	ContactGroups []*string

	// list of contact roles
	ContactRoles []*string

	// current spend
	CurrentSpend *float64

	// department name
	DepartmentName *string

	// datetime of enrollmentEndDate
	EnrollmentEndDate *string

	// enrollment number
	EnrollmentNumber *string

	// datetime of enrollmentStartDate
	EnrollmentStartDate *string

	// invoicing threshold
	InvoicingThreshold *float64

	// array of meters to filter by
	MeterFilter []any

	// operator used to compare currentSpend with amount
	Operator *AlertOperator

	// overriding alert
	OverridingAlert *string

	// datetime of periodStartDate
	PeriodStartDate *string

	// array of resources to filter by
	ResourceFilter []any

	// array of resourceGroups to filter by
	ResourceGroupFilter []any

	// tags to filter by
	TagFilter any

	// notification threshold percentage as a decimal which activated this alert
	Threshold *float64

	// Type of timegrain cadence
	TimeGrainType *AlertTimeGrainType

	// notificationId that triggered this alert
	TriggeredBy *string

	// unit of currency being used
	Unit *string
}

AlertPropertiesDetails - Alert details

func (AlertPropertiesDetails) MarshalJSON

func (a AlertPropertiesDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertPropertiesDetails.

func (*AlertPropertiesDetails) UnmarshalJSON

func (a *AlertPropertiesDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertPropertiesDetails.

type AlertSource

type AlertSource string

AlertSource - Source of alert

const (
	AlertSourcePreset AlertSource = "Preset"
	AlertSourceUser   AlertSource = "User"
)

func PossibleAlertSourceValues

func PossibleAlertSourceValues() []AlertSource

PossibleAlertSourceValues returns the possible values for the AlertSource const type.

type AlertStatus

type AlertStatus string

AlertStatus - alert status

const (
	AlertStatusActive     AlertStatus = "Active"
	AlertStatusDismissed  AlertStatus = "Dismissed"
	AlertStatusNone       AlertStatus = "None"
	AlertStatusOverridden AlertStatus = "Overridden"
	AlertStatusResolved   AlertStatus = "Resolved"
)

func PossibleAlertStatusValues

func PossibleAlertStatusValues() []AlertStatus

PossibleAlertStatusValues returns the possible values for the AlertStatus const type.

type AlertTimeGrainType

type AlertTimeGrainType string

AlertTimeGrainType - Type of timegrain cadence

const (
	AlertTimeGrainTypeAnnually       AlertTimeGrainType = "Annually"
	AlertTimeGrainTypeBillingAnnual  AlertTimeGrainType = "BillingAnnual"
	AlertTimeGrainTypeBillingMonth   AlertTimeGrainType = "BillingMonth"
	AlertTimeGrainTypeBillingQuarter AlertTimeGrainType = "BillingQuarter"
	AlertTimeGrainTypeMonthly        AlertTimeGrainType = "Monthly"
	AlertTimeGrainTypeNone           AlertTimeGrainType = "None"
	AlertTimeGrainTypeQuarterly      AlertTimeGrainType = "Quarterly"
)

func PossibleAlertTimeGrainTypeValues

func PossibleAlertTimeGrainTypeValues() []AlertTimeGrainType

PossibleAlertTimeGrainTypeValues returns the possible values for the AlertTimeGrainType const type.

type AlertType

type AlertType string

AlertType - type of alert

const (
	AlertTypeBudget         AlertType = "Budget"
	AlertTypeBudgetForecast AlertType = "BudgetForecast"
	AlertTypeCredit         AlertType = "Credit"
	AlertTypeGeneral        AlertType = "General"
	AlertTypeInvoice        AlertType = "Invoice"
	AlertTypeQuota          AlertType = "Quota"
	AlertTypeXCloud         AlertType = "xCloud"
)

func PossibleAlertTypeValues

func PossibleAlertTypeValues() []AlertType

PossibleAlertTypeValues returns the possible values for the AlertType const type.

type AlertsClient

type AlertsClient struct {
	// contains filtered or unexported fields
}

AlertsClient contains the methods for the Alerts group. Don't use this type directly, use NewAlertsClient() instead.

func NewAlertsClient

func NewAlertsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertsClient, error)

NewAlertsClient creates a new instance of AlertsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*AlertsClient) Dismiss

func (client *AlertsClient) Dismiss(ctx context.Context, scope string, alertID string, parameters DismissAlertPayload, options *AlertsClientDismissOptions) (AlertsClientDismissResponse, error)

Dismiss - Dismisses the specified alert If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • alertID - Alert ID
  • parameters - Parameters supplied to the Dismiss Alert operation.
  • options - AlertsClientDismissOptions contains the optional parameters for the AlertsClient.Dismiss method.
Example (PatchResourceGroupAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DismissResourceGroupAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().Dismiss(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", "22222222-2222-2222-2222-222222222222", armcostmanagement.DismissAlertPayload{
	Properties: &armcostmanagement.AlertProperties{
		Status: to.Ptr(armcostmanagement.AlertStatusDismissed),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Alert = armcostmanagement.Alert{
// 	Name: to.Ptr("22222222-2222-2222-2222-222222222222"),
// 	Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222"),
// 	Properties: &armcostmanagement.AlertProperties{
// 		Description: to.Ptr(""),
// 		CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 		CostEntityID: to.Ptr("budget1"),
// 		CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 		Definition: &armcostmanagement.AlertPropertiesDefinition{
// 			Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 			Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 			Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 		},
// 		ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 		Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 		Status: to.Ptr(armcostmanagement.AlertStatusDismissed),
// 		StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 		Details: &armcostmanagement.AlertPropertiesDetails{
// 			Amount: to.Ptr[float64](200000),
// 			ContactEmails: []*string{
// 				to.Ptr("1234@contoso.com")},
// 				ContactGroups: []*string{
// 				},
// 				ContactRoles: []*string{
// 				},
// 				CurrentSpend: to.Ptr[float64](161000.12),
// 				MeterFilter: []any{
// 				},
// 				Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 				PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 				ResourceFilter: []any{
// 				},
// 				ResourceGroupFilter: []any{
// 				},
// 				TagFilter: map[string]any{
// 				},
// 				Threshold: to.Ptr[float64](0.8),
// 				TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 				TriggeredBy: to.Ptr("22222222-2222-2222-2222-222222222222_1_01"),
// 				Unit: to.Ptr("USD"),
// 			},
// 		},
// 	}
Output:

Example (PatchSubscriptionAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DismissSubscriptionAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().Dismiss(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "22222222-2222-2222-2222-222222222222", armcostmanagement.DismissAlertPayload{
	Properties: &armcostmanagement.AlertProperties{
		Status: to.Ptr(armcostmanagement.AlertStatusDismissed),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Alert = armcostmanagement.Alert{
// 	Name: to.Ptr("22222222-2222-2222-2222-222222222222"),
// 	Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222"),
// 	Properties: &armcostmanagement.AlertProperties{
// 		Description: to.Ptr(""),
// 		CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 		CostEntityID: to.Ptr("budget1"),
// 		CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 		Definition: &armcostmanagement.AlertPropertiesDefinition{
// 			Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 			Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 			Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 		},
// 		ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 		Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 		Status: to.Ptr(armcostmanagement.AlertStatusDismissed),
// 		StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 		Details: &armcostmanagement.AlertPropertiesDetails{
// 			Amount: to.Ptr[float64](200000),
// 			ContactEmails: []*string{
// 				to.Ptr("1234@contoso.com")},
// 				ContactGroups: []*string{
// 				},
// 				ContactRoles: []*string{
// 				},
// 				CurrentSpend: to.Ptr[float64](161000.12),
// 				MeterFilter: []any{
// 				},
// 				Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 				PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 				ResourceFilter: []any{
// 				},
// 				ResourceGroupFilter: []any{
// 				},
// 				TagFilter: map[string]any{
// 				},
// 				Threshold: to.Ptr[float64](0.8),
// 				TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 				TriggeredBy: to.Ptr("22222222-2222-2222-2222-222222222222_1_01"),
// 				Unit: to.Ptr("USD"),
// 			},
// 		},
// 	}
Output:

func (*AlertsClient) Get

func (client *AlertsClient) Get(ctx context.Context, scope string, alertID string, options *AlertsClientGetOptions) (AlertsClientGetResponse, error)

Get - Gets the alert for the scope by alert ID. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • alertID - Alert ID
  • options - AlertsClientGetOptions contains the optional parameters for the AlertsClient.Get method.
Example (SingleResourceGroupAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SingleResourceGroupAlert.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().Get(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", "22222222-2222-2222-2222-222222222222", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Alert = armcostmanagement.Alert{
// 	Name: to.Ptr("22222222-2222-2222-2222-222222222222"),
// 	Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222"),
// 	Properties: &armcostmanagement.AlertProperties{
// 		Description: to.Ptr(""),
// 		CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 		CostEntityID: to.Ptr("budget1"),
// 		CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 		Definition: &armcostmanagement.AlertPropertiesDefinition{
// 			Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 			Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 			Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 		},
// 		ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 		Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 		Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 		StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 		Details: &armcostmanagement.AlertPropertiesDetails{
// 			Amount: to.Ptr[float64](200000),
// 			ContactEmails: []*string{
// 				to.Ptr("1234@contoso.com")},
// 				ContactGroups: []*string{
// 				},
// 				ContactRoles: []*string{
// 				},
// 				CurrentSpend: to.Ptr[float64](161000.12),
// 				MeterFilter: []any{
// 				},
// 				Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 				PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 				ResourceFilter: []any{
// 				},
// 				ResourceGroupFilter: []any{
// 				},
// 				TagFilter: map[string]any{
// 				},
// 				Threshold: to.Ptr[float64](0.8),
// 				TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 				TriggeredBy: to.Ptr("22222222-2222-2222-2222-222222222222_1_01"),
// 				Unit: to.Ptr("USD"),
// 			},
// 		},
// 	}
Output:

Example (SingleSubscriptionAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SingleSubscriptionAlert.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().Get(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "22222222-2222-2222-2222-222222222222", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Alert = armcostmanagement.Alert{
// 	Name: to.Ptr("22222222-2222-2222-2222-222222222222"),
// 	Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/22222222-2222-2222-2222-222222222222"),
// 	Properties: &armcostmanagement.AlertProperties{
// 		Description: to.Ptr(""),
// 		CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 		CostEntityID: to.Ptr("budget1"),
// 		CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 		Definition: &armcostmanagement.AlertPropertiesDefinition{
// 			Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 			Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 			Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 		},
// 		ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 		Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 		Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 		StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 		Details: &armcostmanagement.AlertPropertiesDetails{
// 			Amount: to.Ptr[float64](200000),
// 			ContactEmails: []*string{
// 				to.Ptr("1234@contoso.com")},
// 				ContactGroups: []*string{
// 				},
// 				ContactRoles: []*string{
// 				},
// 				CurrentSpend: to.Ptr[float64](161000.12),
// 				MeterFilter: []any{
// 				},
// 				Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 				PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 				ResourceFilter: []any{
// 				},
// 				ResourceGroupFilter: []any{
// 				},
// 				TagFilter: map[string]any{
// 				},
// 				Threshold: to.Ptr[float64](0.8),
// 				TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 				TriggeredBy: to.Ptr("22222222-2222-2222-2222-222222222222_1_01"),
// 				Unit: to.Ptr("USD"),
// 			},
// 		},
// 	}
Output:

func (*AlertsClient) List

List - Lists the alerts for scope defined. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • options - AlertsClientListOptions contains the optional parameters for the AlertsClient.List method.
Example (BillingAccountAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AlertsResult = armcostmanagement.AlertsResult{
// 	Value: []*armcostmanagement.Alert{
// 		{
// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 			Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// 			Properties: &armcostmanagement.AlertProperties{
// 				Description: to.Ptr(""),
// 				CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 				CostEntityID: to.Ptr("budget1"),
// 				CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 				Definition: &armcostmanagement.AlertPropertiesDefinition{
// 					Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 					Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 					Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 				},
// 				ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 				Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 				Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 				StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 				Details: &armcostmanagement.AlertPropertiesDetails{
// 					Amount: to.Ptr[float64](200000),
// 					ContactEmails: []*string{
// 						to.Ptr("1234@contoso.com")},
// 						ContactGroups: []*string{
// 						},
// 						ContactRoles: []*string{
// 						},
// 						CurrentSpend: to.Ptr[float64](161000.12),
// 						MeterFilter: []any{
// 						},
// 						Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 						PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 						ResourceFilter: []any{
// 						},
// 						ResourceGroupFilter: []any{
// 						},
// 						TagFilter: map[string]any{
// 						},
// 						Threshold: to.Ptr[float64](0.8),
// 						TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 						TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// 						Unit: to.Ptr("USD"),
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("11111111-1111-1111-111111111111"),
// 				Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// 				Properties: &armcostmanagement.AlertProperties{
// 					Description: to.Ptr(""),
// 					CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 					CostEntityID: to.Ptr("budget1"),
// 					CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// 					Definition: &armcostmanagement.AlertPropertiesDefinition{
// 						Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 						Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 						Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 					},
// 					ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// 					Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 					Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 					StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 					Details: &armcostmanagement.AlertPropertiesDetails{
// 						Amount: to.Ptr[float64](200000),
// 						ContactEmails: []*string{
// 							to.Ptr("1234@contoso.com")},
// 							ContactGroups: []*string{
// 							},
// 							ContactRoles: []*string{
// 							},
// 							CurrentSpend: to.Ptr[float64](171000.32),
// 							MeterFilter: []any{
// 							},
// 							Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 							PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 							ResourceFilter: []any{
// 							},
// 							ResourceGroupFilter: []any{
// 							},
// 							TagFilter: map[string]any{
// 							},
// 							Threshold: to.Ptr[float64](0.8),
// 							TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 							TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// 							Unit: to.Ptr("USD"),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (BillingProfileAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingProfileAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AlertsResult = armcostmanagement.AlertsResult{
// 	Value: []*armcostmanagement.Alert{
// 		{
// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 			Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// 			Properties: &armcostmanagement.AlertProperties{
// 				Description: to.Ptr(""),
// 				CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 				CostEntityID: to.Ptr("budget1"),
// 				CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 				Definition: &armcostmanagement.AlertPropertiesDefinition{
// 					Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 					Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 					Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 				},
// 				ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 				Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 				Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 				StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 				Details: &armcostmanagement.AlertPropertiesDetails{
// 					Amount: to.Ptr[float64](200000),
// 					ContactEmails: []*string{
// 						to.Ptr("1234@contoso.com")},
// 						ContactGroups: []*string{
// 						},
// 						ContactRoles: []*string{
// 						},
// 						CurrentSpend: to.Ptr[float64](161000.12),
// 						MeterFilter: []any{
// 						},
// 						Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 						PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 						ResourceFilter: []any{
// 						},
// 						ResourceGroupFilter: []any{
// 						},
// 						TagFilter: map[string]any{
// 						},
// 						Threshold: to.Ptr[float64](0.8),
// 						TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 						TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// 						Unit: to.Ptr("USD"),
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("11111111-1111-1111-111111111111"),
// 				Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// 				Properties: &armcostmanagement.AlertProperties{
// 					Description: to.Ptr(""),
// 					CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 					CostEntityID: to.Ptr("budget1"),
// 					CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// 					Definition: &armcostmanagement.AlertPropertiesDefinition{
// 						Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 						Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 						Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 					},
// 					ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// 					Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 					Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 					StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 					Details: &armcostmanagement.AlertPropertiesDetails{
// 						Amount: to.Ptr[float64](200000),
// 						ContactEmails: []*string{
// 							to.Ptr("1234@contoso.com")},
// 							ContactGroups: []*string{
// 							},
// 							ContactRoles: []*string{
// 							},
// 							CurrentSpend: to.Ptr[float64](171000.32),
// 							MeterFilter: []any{
// 							},
// 							Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 							PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 							ResourceFilter: []any{
// 							},
// 							ResourceGroupFilter: []any{
// 							},
// 							TagFilter: map[string]any{
// 							},
// 							Threshold: to.Ptr[float64](0.8),
// 							TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 							TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// 							Unit: to.Ptr("USD"),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (DepartmentAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AlertsResult = armcostmanagement.AlertsResult{
// 	Value: []*armcostmanagement.Alert{
// 		{
// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 			Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// 			Properties: &armcostmanagement.AlertProperties{
// 				Description: to.Ptr(""),
// 				CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 				CostEntityID: to.Ptr("budget1"),
// 				CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 				Definition: &armcostmanagement.AlertPropertiesDefinition{
// 					Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 					Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 					Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 				},
// 				ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 				Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 				Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 				StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 				Details: &armcostmanagement.AlertPropertiesDetails{
// 					Amount: to.Ptr[float64](200000),
// 					ContactEmails: []*string{
// 						to.Ptr("1234@contoso.com")},
// 						ContactGroups: []*string{
// 						},
// 						ContactRoles: []*string{
// 						},
// 						CurrentSpend: to.Ptr[float64](161000.12),
// 						MeterFilter: []any{
// 						},
// 						Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 						PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 						ResourceFilter: []any{
// 						},
// 						ResourceGroupFilter: []any{
// 						},
// 						TagFilter: map[string]any{
// 						},
// 						Threshold: to.Ptr[float64](0.8),
// 						TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 						TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// 						Unit: to.Ptr("USD"),
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("11111111-1111-1111-111111111111"),
// 				Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// 				Properties: &armcostmanagement.AlertProperties{
// 					Description: to.Ptr(""),
// 					CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 					CostEntityID: to.Ptr("budget1"),
// 					CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// 					Definition: &armcostmanagement.AlertPropertiesDefinition{
// 						Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 						Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 						Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 					},
// 					ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// 					Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 					Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 					StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 					Details: &armcostmanagement.AlertPropertiesDetails{
// 						Amount: to.Ptr[float64](200000),
// 						ContactEmails: []*string{
// 							to.Ptr("1234@contoso.com")},
// 							ContactGroups: []*string{
// 							},
// 							ContactRoles: []*string{
// 							},
// 							CurrentSpend: to.Ptr[float64](171000.32),
// 							MeterFilter: []any{
// 							},
// 							Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 							PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 							ResourceFilter: []any{
// 							},
// 							ResourceGroupFilter: []any{
// 							},
// 							TagFilter: map[string]any{
// 							},
// 							Threshold: to.Ptr[float64](0.8),
// 							TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 							TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// 							Unit: to.Ptr("USD"),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (EnrollmentAccountAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AlertsResult = armcostmanagement.AlertsResult{
// 	Value: []*armcostmanagement.Alert{
// 		{
// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 			Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// 			Properties: &armcostmanagement.AlertProperties{
// 				Description: to.Ptr(""),
// 				CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 				CostEntityID: to.Ptr("budget1"),
// 				CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 				Definition: &armcostmanagement.AlertPropertiesDefinition{
// 					Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 					Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 					Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 				},
// 				ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 				Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 				Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 				StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 				Details: &armcostmanagement.AlertPropertiesDetails{
// 					Amount: to.Ptr[float64](200000),
// 					ContactEmails: []*string{
// 						to.Ptr("1234@contoso.com")},
// 						ContactGroups: []*string{
// 						},
// 						ContactRoles: []*string{
// 						},
// 						CurrentSpend: to.Ptr[float64](161000.12),
// 						MeterFilter: []any{
// 						},
// 						Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 						PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 						ResourceFilter: []any{
// 						},
// 						ResourceGroupFilter: []any{
// 						},
// 						TagFilter: map[string]any{
// 						},
// 						Threshold: to.Ptr[float64](0.8),
// 						TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 						TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// 						Unit: to.Ptr("USD"),
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("11111111-1111-1111-111111111111"),
// 				Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// 				Properties: &armcostmanagement.AlertProperties{
// 					Description: to.Ptr(""),
// 					CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 					CostEntityID: to.Ptr("budget1"),
// 					CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// 					Definition: &armcostmanagement.AlertPropertiesDefinition{
// 						Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 						Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 						Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 					},
// 					ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// 					Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 					Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 					StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 					Details: &armcostmanagement.AlertPropertiesDetails{
// 						Amount: to.Ptr[float64](200000),
// 						ContactEmails: []*string{
// 							to.Ptr("1234@contoso.com")},
// 							ContactGroups: []*string{
// 							},
// 							ContactRoles: []*string{
// 							},
// 							CurrentSpend: to.Ptr[float64](171000.32),
// 							MeterFilter: []any{
// 							},
// 							Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 							PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 							ResourceFilter: []any{
// 							},
// 							ResourceGroupFilter: []any{
// 							},
// 							TagFilter: map[string]any{
// 							},
// 							Threshold: to.Ptr[float64](0.8),
// 							TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 							TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// 							Unit: to.Ptr("USD"),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (InvoiceSectionAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/InvoiceSectionAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AlertsResult = armcostmanagement.AlertsResult{
// 	Value: []*armcostmanagement.Alert{
// 		{
// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 			Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// 			Properties: &armcostmanagement.AlertProperties{
// 				Description: to.Ptr(""),
// 				CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 				CostEntityID: to.Ptr("budget1"),
// 				CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 				Definition: &armcostmanagement.AlertPropertiesDefinition{
// 					Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 					Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 					Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 				},
// 				ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 				Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 				Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 				StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 				Details: &armcostmanagement.AlertPropertiesDetails{
// 					Amount: to.Ptr[float64](200000),
// 					ContactEmails: []*string{
// 						to.Ptr("1234@contoso.com")},
// 						ContactGroups: []*string{
// 						},
// 						ContactRoles: []*string{
// 						},
// 						CurrentSpend: to.Ptr[float64](161000.12),
// 						MeterFilter: []any{
// 						},
// 						Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 						PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 						ResourceFilter: []any{
// 						},
// 						ResourceGroupFilter: []any{
// 						},
// 						TagFilter: map[string]any{
// 						},
// 						Threshold: to.Ptr[float64](0.8),
// 						TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 						TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// 						Unit: to.Ptr("USD"),
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("11111111-1111-1111-111111111111"),
// 				Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// 				Properties: &armcostmanagement.AlertProperties{
// 					Description: to.Ptr(""),
// 					CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 					CostEntityID: to.Ptr("budget1"),
// 					CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// 					Definition: &armcostmanagement.AlertPropertiesDefinition{
// 						Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 						Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 						Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 					},
// 					ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// 					Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 					Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 					StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 					Details: &armcostmanagement.AlertPropertiesDetails{
// 						Amount: to.Ptr[float64](200000),
// 						ContactEmails: []*string{
// 							to.Ptr("1234@contoso.com")},
// 							ContactGroups: []*string{
// 							},
// 							ContactRoles: []*string{
// 							},
// 							CurrentSpend: to.Ptr[float64](171000.32),
// 							MeterFilter: []any{
// 							},
// 							Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 							PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 							ResourceFilter: []any{
// 							},
// 							ResourceGroupFilter: []any{
// 							},
// 							TagFilter: map[string]any{
// 							},
// 							Threshold: to.Ptr[float64](0.8),
// 							TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 							TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// 							Unit: to.Ptr("USD"),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (ResourceGroupAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ResourceGroupAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AlertsResult = armcostmanagement.AlertsResult{
// 	Value: []*armcostmanagement.Alert{
// 		{
// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 			Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 			ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// 			Properties: &armcostmanagement.AlertProperties{
// 				Description: to.Ptr(""),
// 				CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 				CostEntityID: to.Ptr("budget1"),
// 				CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 				Definition: &armcostmanagement.AlertPropertiesDefinition{
// 					Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 					Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 					Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 				},
// 				ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 				Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 				Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 				StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 				Details: &armcostmanagement.AlertPropertiesDetails{
// 					Amount: to.Ptr[float64](200000),
// 					ContactEmails: []*string{
// 						to.Ptr("1234@contoso.com")},
// 						ContactGroups: []*string{
// 						},
// 						ContactRoles: []*string{
// 						},
// 						CurrentSpend: to.Ptr[float64](161000.12),
// 						MeterFilter: []any{
// 						},
// 						Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 						PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 						ResourceFilter: []any{
// 						},
// 						ResourceGroupFilter: []any{
// 						},
// 						TagFilter: map[string]any{
// 						},
// 						Threshold: to.Ptr[float64](0.8),
// 						TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 						TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// 						Unit: to.Ptr("USD"),
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("11111111-1111-1111-111111111111"),
// 				Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 				ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// 				Properties: &armcostmanagement.AlertProperties{
// 					Description: to.Ptr(""),
// 					CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 					CostEntityID: to.Ptr("budget1"),
// 					CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// 					Definition: &armcostmanagement.AlertPropertiesDefinition{
// 						Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 						Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 						Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 					},
// 					ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// 					Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 					Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 					StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 					Details: &armcostmanagement.AlertPropertiesDetails{
// 						Amount: to.Ptr[float64](200000),
// 						ContactEmails: []*string{
// 							to.Ptr("1234@contoso.com")},
// 							ContactGroups: []*string{
// 							},
// 							ContactRoles: []*string{
// 							},
// 							CurrentSpend: to.Ptr[float64](171000.32),
// 							MeterFilter: []any{
// 							},
// 							Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 							PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 							ResourceFilter: []any{
// 							},
// 							ResourceGroupFilter: []any{
// 							},
// 							TagFilter: map[string]any{
// 							},
// 							Threshold: to.Ptr[float64](0.8),
// 							TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 							TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// 							Unit: to.Ptr("USD"),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (SubscriptionAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SubscriptionAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().List(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AlertsResult = armcostmanagement.AlertsResult{
// 	Value: []*armcostmanagement.Alert{
// 		{
// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 			Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 			ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// 			Properties: &armcostmanagement.AlertProperties{
// 				Description: to.Ptr(""),
// 				CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 				CostEntityID: to.Ptr("budget1"),
// 				CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 				Definition: &armcostmanagement.AlertPropertiesDefinition{
// 					Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 					Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 					Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 				},
// 				ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 				Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 				Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 				StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 				Details: &armcostmanagement.AlertPropertiesDetails{
// 					Amount: to.Ptr[float64](200000),
// 					ContactEmails: []*string{
// 						to.Ptr("1234@contoso.com")},
// 						ContactGroups: []*string{
// 						},
// 						ContactRoles: []*string{
// 						},
// 						CurrentSpend: to.Ptr[float64](161000.12),
// 						MeterFilter: []any{
// 						},
// 						Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 						PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 						ResourceFilter: []any{
// 						},
// 						ResourceGroupFilter: []any{
// 						},
// 						TagFilter: map[string]any{
// 						},
// 						Threshold: to.Ptr[float64](0.8),
// 						TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 						TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// 						Unit: to.Ptr("USD"),
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("11111111-1111-1111-111111111111"),
// 				Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 				ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// 				Properties: &armcostmanagement.AlertProperties{
// 					Description: to.Ptr(""),
// 					CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 					CostEntityID: to.Ptr("budget1"),
// 					CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// 					Definition: &armcostmanagement.AlertPropertiesDefinition{
// 						Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 						Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 						Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 					},
// 					ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// 					Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 					Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 					StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 					Details: &armcostmanagement.AlertPropertiesDetails{
// 						Amount: to.Ptr[float64](200000),
// 						ContactEmails: []*string{
// 							to.Ptr("1234@contoso.com")},
// 							ContactGroups: []*string{
// 							},
// 							ContactRoles: []*string{
// 							},
// 							CurrentSpend: to.Ptr[float64](171000.32),
// 							MeterFilter: []any{
// 							},
// 							Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 							PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 							ResourceFilter: []any{
// 							},
// 							ResourceGroupFilter: []any{
// 							},
// 							TagFilter: map[string]any{
// 							},
// 							Threshold: to.Ptr[float64](0.8),
// 							TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 							TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// 							Unit: to.Ptr("USD"),
// 						},
// 					},
// 			}},
// 		}
Output:

func (*AlertsClient) ListExternal

func (client *AlertsClient) ListExternal(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, options *AlertsClientListExternalOptions) (AlertsClientListExternalResponse, error)

ListExternal - Lists the Alerts for external cloud provider type defined. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • externalCloudProviderType - The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.
  • externalCloudProviderID - This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.
  • options - AlertsClientListExternalOptions contains the optional parameters for the AlertsClient.ListExternal method.
Example (ExternalBillingAccountAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalBillingAccountAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().ListExternal(ctx, armcostmanagement.ExternalCloudProviderTypeExternalBillingAccounts, "100", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AlertsResult = armcostmanagement.AlertsResult{
// 	Value: []*armcostmanagement.Alert{
// 		{
// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 			Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 			ID: to.Ptr("providers/Microsoft.CostManagement/externalBillingAccounts/100/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// 			Properties: &armcostmanagement.AlertProperties{
// 				Description: to.Ptr(""),
// 				CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 				CostEntityID: to.Ptr("budget1"),
// 				CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 				Definition: &armcostmanagement.AlertPropertiesDefinition{
// 					Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 					Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 					Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 				},
// 				ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 				Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 				Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 				StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 				Details: &armcostmanagement.AlertPropertiesDetails{
// 					Amount: to.Ptr[float64](200000),
// 					ContactEmails: []*string{
// 						to.Ptr("1234@contoso.com")},
// 						ContactGroups: []*string{
// 						},
// 						ContactRoles: []*string{
// 						},
// 						CurrentSpend: to.Ptr[float64](161000.12),
// 						MeterFilter: []any{
// 						},
// 						Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 						PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 						ResourceFilter: []any{
// 						},
// 						ResourceGroupFilter: []any{
// 						},
// 						TagFilter: map[string]any{
// 						},
// 						Threshold: to.Ptr[float64](0.8),
// 						TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 						TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// 						Unit: to.Ptr("USD"),
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("11111111-1111-1111-111111111111"),
// 				Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 				ID: to.Ptr("providers/Microsoft.CostManagement/externalBillingAccounts/100/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// 				Properties: &armcostmanagement.AlertProperties{
// 					Description: to.Ptr(""),
// 					CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 					CostEntityID: to.Ptr("budget1"),
// 					CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// 					Definition: &armcostmanagement.AlertPropertiesDefinition{
// 						Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 						Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 						Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 					},
// 					ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// 					Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 					Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 					StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 					Details: &armcostmanagement.AlertPropertiesDetails{
// 						Amount: to.Ptr[float64](200000),
// 						ContactEmails: []*string{
// 							to.Ptr("1234@contoso.com")},
// 							ContactGroups: []*string{
// 							},
// 							ContactRoles: []*string{
// 							},
// 							CurrentSpend: to.Ptr[float64](171000.32),
// 							MeterFilter: []any{
// 							},
// 							Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 							PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 							ResourceFilter: []any{
// 							},
// 							ResourceGroupFilter: []any{
// 							},
// 							TagFilter: map[string]any{
// 							},
// 							Threshold: to.Ptr[float64](0.8),
// 							TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 							TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// 							Unit: to.Ptr("USD"),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (ExternalSubscriptionAlerts)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalSubscriptionAlerts.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().ListExternal(ctx, armcostmanagement.ExternalCloudProviderTypeExternalSubscriptions, "100", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AlertsResult = armcostmanagement.AlertsResult{
// 	Value: []*armcostmanagement.Alert{
// 		{
// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 			Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 			ID: to.Ptr("providers/Microsoft.CostManagement/externalSubscriptions/100/providers/Microsoft.CostManagement/alerts/00000000-0000-0000-0000-000000000000"),
// 			Properties: &armcostmanagement.AlertProperties{
// 				Description: to.Ptr(""),
// 				CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 				CostEntityID: to.Ptr("budget1"),
// 				CreationTime: to.Ptr("2020-04-27T11:07:52.7143901Z"),
// 				Definition: &armcostmanagement.AlertPropertiesDefinition{
// 					Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 					Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 					Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 				},
// 				ModificationTime: to.Ptr("2020-04-28T11:06:02.8999373Z"),
// 				Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 				Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 				StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 				Details: &armcostmanagement.AlertPropertiesDetails{
// 					Amount: to.Ptr[float64](200000),
// 					ContactEmails: []*string{
// 						to.Ptr("1234@contoso.com")},
// 						ContactGroups: []*string{
// 						},
// 						ContactRoles: []*string{
// 						},
// 						CurrentSpend: to.Ptr[float64](161000.12),
// 						MeterFilter: []any{
// 						},
// 						Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 						PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 						ResourceFilter: []any{
// 						},
// 						ResourceGroupFilter: []any{
// 						},
// 						TagFilter: map[string]any{
// 						},
// 						Threshold: to.Ptr[float64](0.8),
// 						TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 						TriggeredBy: to.Ptr("00000000-0000-0000-0000-000000000000_1_01"),
// 						Unit: to.Ptr("USD"),
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("11111111-1111-1111-111111111111"),
// 				Type: to.Ptr("Microsoft.CostManagement/alerts"),
// 				ID: to.Ptr("providers/Microsoft.CostManagement/externalSubscriptions/100/providers/Microsoft.CostManagement/alerts/11111111-1111-1111-111111111111"),
// 				Properties: &armcostmanagement.AlertProperties{
// 					Description: to.Ptr(""),
// 					CloseTime: to.Ptr("0001-01-01T00:00:00"),
// 					CostEntityID: to.Ptr("budget1"),
// 					CreationTime: to.Ptr("2019-06-24T05:51:52.8713179Z"),
// 					Definition: &armcostmanagement.AlertPropertiesDefinition{
// 						Type: to.Ptr(armcostmanagement.AlertTypeBudget),
// 						Category: to.Ptr(armcostmanagement.AlertCategoryCost),
// 						Criteria: to.Ptr(armcostmanagement.AlertCriteriaCostThresholdExceeded),
// 					},
// 					ModificationTime: to.Ptr("2019-08-31T17:51:55.1808807Z"),
// 					Source: to.Ptr(armcostmanagement.AlertSourcePreset),
// 					Status: to.Ptr(armcostmanagement.AlertStatusActive),
// 					StatusModificationTime: to.Ptr("0001-01-01T00:00:00"),
// 					Details: &armcostmanagement.AlertPropertiesDetails{
// 						Amount: to.Ptr[float64](200000),
// 						ContactEmails: []*string{
// 							to.Ptr("1234@contoso.com")},
// 							ContactGroups: []*string{
// 							},
// 							ContactRoles: []*string{
// 							},
// 							CurrentSpend: to.Ptr[float64](171000.32),
// 							MeterFilter: []any{
// 							},
// 							Operator: to.Ptr(armcostmanagement.AlertOperatorGreaterThan),
// 							PeriodStartDate: to.Ptr("2020-03-01T00:00:00Z"),
// 							ResourceFilter: []any{
// 							},
// 							ResourceGroupFilter: []any{
// 							},
// 							TagFilter: map[string]any{
// 							},
// 							Threshold: to.Ptr[float64](0.8),
// 							TimeGrainType: to.Ptr(armcostmanagement.AlertTimeGrainTypeQuarterly),
// 							TriggeredBy: to.Ptr("11111111-1111-1111-111111111111_1_01"),
// 							Unit: to.Ptr("USD"),
// 						},
// 					},
// 			}},
// 		}
Output:

type AlertsClientDismissOptions

type AlertsClientDismissOptions struct {
}

AlertsClientDismissOptions contains the optional parameters for the AlertsClient.Dismiss method.

type AlertsClientDismissResponse

type AlertsClientDismissResponse struct {
	// An individual alert.
	Alert
}

AlertsClientDismissResponse contains the response from method AlertsClient.Dismiss.

type AlertsClientGetOptions

type AlertsClientGetOptions struct {
}

AlertsClientGetOptions contains the optional parameters for the AlertsClient.Get method.

type AlertsClientGetResponse

type AlertsClientGetResponse struct {
	// An individual alert.
	Alert
}

AlertsClientGetResponse contains the response from method AlertsClient.Get.

type AlertsClientListExternalOptions

type AlertsClientListExternalOptions struct {
}

AlertsClientListExternalOptions contains the optional parameters for the AlertsClient.ListExternal method.

type AlertsClientListExternalResponse

type AlertsClientListExternalResponse struct {
	// Result of alerts.
	AlertsResult
}

AlertsClientListExternalResponse contains the response from method AlertsClient.ListExternal.

type AlertsClientListOptions

type AlertsClientListOptions struct {
}

AlertsClientListOptions contains the optional parameters for the AlertsClient.List method.

type AlertsClientListResponse

type AlertsClientListResponse struct {
	// Result of alerts.
	AlertsResult
}

AlertsClientListResponse contains the response from method AlertsClient.List.

type AlertsResult

type AlertsResult struct {
	// READ-ONLY; URL to get the next set of alerts results if there are any.
	NextLink *string

	// READ-ONLY; List of alerts.
	Value []*Alert
}

AlertsResult - Result of alerts.

func (AlertsResult) MarshalJSON

func (a AlertsResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertsResult.

func (*AlertsResult) UnmarshalJSON

func (a *AlertsResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertsResult.

type AllSavingsBenefitDetails

type AllSavingsBenefitDetails struct {
	// READ-ONLY; Estimated average utilization percentage for the 'totalHours' in the look-back period, with this commitment.
	AverageUtilizationPercentage *float64

	// READ-ONLY; The estimated cost with benefit for the 'totalHours' in the look-back period. It's equal to (commitmentAmount
	// * totalHours)
	BenefitCost *float64

	// READ-ONLY; The commitment amount at the commitmentGranularity.
	CommitmentAmount *float64

	// READ-ONLY; Estimated benefit coverage percentage for the 'totalHours' in the look-back period, with this commitment.
	CoveragePercentage *float64

	// READ-ONLY; The difference between total cost and benefit cost for the 'totalHours' in the look-back period.
	OverageCost *float64

	// READ-ONLY; The amount saved for the 'totalHours' in the look-back period, by purchasing the recommended quantity of the
	// benefit.
	SavingsAmount *float64

	// READ-ONLY; The savings in percentage for the 'totalHours' in the look-back period, by purchasing the recommended quantity
	// of benefit.
	SavingsPercentage *float64

	// READ-ONLY; Total cost, which is sum of benefit cost and overage cost.
	TotalCost *float64

	// READ-ONLY; Estimated unused portion of the 'benefitCost'.
	WastageCost *float64
}

AllSavingsBenefitDetails - Benefit recommendation details.

func (AllSavingsBenefitDetails) MarshalJSON

func (a AllSavingsBenefitDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AllSavingsBenefitDetails.

func (*AllSavingsBenefitDetails) UnmarshalJSON

func (a *AllSavingsBenefitDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AllSavingsBenefitDetails.

type AllSavingsList

type AllSavingsList struct {
	// READ-ONLY; The link (URL) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of benefit recommendations with the recommendation details..
	Value []*AllSavingsBenefitDetails
}

AllSavingsList - The list of all benefit recommendations with the recommendation details.

func (AllSavingsList) MarshalJSON

func (a AllSavingsList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AllSavingsList.

func (*AllSavingsList) UnmarshalJSON

func (a *AllSavingsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AllSavingsList.

type BenefitKind

type BenefitKind string

BenefitKind - Kind/type of the benefit.

const (
	// BenefitKindIncludedQuantity - Benefit is IncludedQuantity.
	BenefitKindIncludedQuantity BenefitKind = "IncludedQuantity"
	// BenefitKindReservation - Benefit is Reservation.
	BenefitKindReservation BenefitKind = "Reservation"
	// BenefitKindSavingsPlan - Benefit is SavingsPlan.
	BenefitKindSavingsPlan BenefitKind = "SavingsPlan"
)

func PossibleBenefitKindValues

func PossibleBenefitKindValues() []BenefitKind

PossibleBenefitKindValues returns the possible values for the BenefitKind const type.

type BenefitRecommendationModel

type BenefitRecommendationModel struct {
	// Reservation or SavingsPlan.
	Kind *BenefitKind

	// The properties of the benefit recommendations.
	Properties BenefitRecommendationPropertiesClassification

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

BenefitRecommendationModel - benefit plan recommendation details.

func (BenefitRecommendationModel) MarshalJSON

func (b BenefitRecommendationModel) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BenefitRecommendationModel.

func (*BenefitRecommendationModel) UnmarshalJSON

func (b *BenefitRecommendationModel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BenefitRecommendationModel.

type BenefitRecommendationProperties

type BenefitRecommendationProperties struct {
	// REQUIRED; Benefit scope. For example, Single or Shared.
	Scope *Scope

	// Grain of the proposed commitment amount. Supported values: 'Hourly'
	CommitmentGranularity *Grain

	// The number of days of usage evaluated for computing the recommendations.
	LookBackPeriod *LookBackPeriod

	// The details of the proposed recommendation.
	RecommendationDetails *AllSavingsBenefitDetails

	// Term period of the benefit. For example, P1Y or P3Y.
	Term *Term

	// On-demand charges between firstConsumptionDate and lastConsumptionDate that were used for computing benefit recommendations.
	Usage *RecommendationUsageDetails

	// READ-ONLY; The list of all benefit recommendations with the recommendation details.
	AllRecommendationDetails *AllSavingsList

	// READ-ONLY; ARM SKU name. 'ComputeSavingsPlan' for SavingsPlan.
	ArmSKUName *string

	// READ-ONLY; The current cost without benefit, corresponds to 'totalHours' in the look-back period.
	CostWithoutBenefit *float64

	// READ-ONLY; An ISO 4217 currency code identifier for the costs and savings amounts.
	CurrencyCode *string

	// READ-ONLY; The first usage date used for looking back for computing the recommendations.
	FirstConsumptionDate *time.Time

	// READ-ONLY; The last usage date used for looking back for computing the recommendations.
	LastConsumptionDate *time.Time

	// READ-ONLY; The total hours for which the cost is covered. Its equal to number of records in a property 'properties/usage/charges'.
	TotalHours *int32
}

BenefitRecommendationProperties - The properties of the benefit recommendations.

func (*BenefitRecommendationProperties) GetBenefitRecommendationProperties

func (b *BenefitRecommendationProperties) GetBenefitRecommendationProperties() *BenefitRecommendationProperties

GetBenefitRecommendationProperties implements the BenefitRecommendationPropertiesClassification interface for type BenefitRecommendationProperties.

func (BenefitRecommendationProperties) MarshalJSON

func (b BenefitRecommendationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BenefitRecommendationProperties.

func (*BenefitRecommendationProperties) UnmarshalJSON

func (b *BenefitRecommendationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BenefitRecommendationProperties.

type BenefitRecommendationPropertiesClassification

type BenefitRecommendationPropertiesClassification interface {
	// GetBenefitRecommendationProperties returns the BenefitRecommendationProperties content of the underlying type.
	GetBenefitRecommendationProperties() *BenefitRecommendationProperties
}

BenefitRecommendationPropertiesClassification provides polymorphic access to related types. Call the interface's GetBenefitRecommendationProperties() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *BenefitRecommendationProperties, *SharedScopeBenefitRecommendationProperties, *SingleScopeBenefitRecommendationProperties

type BenefitRecommendationsClient

type BenefitRecommendationsClient struct {
	// contains filtered or unexported fields
}

BenefitRecommendationsClient contains the methods for the BenefitRecommendations group. Don't use this type directly, use NewBenefitRecommendationsClient() instead.

func NewBenefitRecommendationsClient

func NewBenefitRecommendationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*BenefitRecommendationsClient, error)

NewBenefitRecommendationsClient creates a new instance of BenefitRecommendationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*BenefitRecommendationsClient) NewListPager

NewListPager - List of recommendations for purchasing savings plan.

Generated from API version 2022-10-01

  • billingScope - The scope associated with benefit recommendation operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for enterprise agreement scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billing profile scope
  • options - BenefitRecommendationsClientListOptions contains the optional parameters for the BenefitRecommendationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitRecommendationsByBillingAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewBenefitRecommendationsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/123456", &armcostmanagement.BenefitRecommendationsClientListOptions{Filter: to.Ptr("properties/lookBackPeriod eq 'Last7Days' AND properties/term eq 'P1Y'"),
	Orderby: nil,
	Expand:  to.Ptr("properties/usage,properties/allRecommendationDetails"),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.BenefitRecommendationsListResult = armcostmanagement.BenefitRecommendationsListResult{
	// 	Value: []*armcostmanagement.BenefitRecommendationModel{
	// 		{
	// 			Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			Type: to.Ptr("Microsoft.CostManagement/benefitRecommendations"),
	// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/benefitRecommendations/00000000-0000-0000-0000-000000000000"),
	// 			Kind: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 			Properties: &armcostmanagement.SharedScopeBenefitRecommendationProperties{
	// 				AllRecommendationDetails: &armcostmanagement.AllSavingsList{
	// 					Value: []*armcostmanagement.AllSavingsBenefitDetails{
	// 						{
	// 							AverageUtilizationPercentage: to.Ptr[float64](99.33),
	// 							BenefitCost: to.Ptr[float64](52.002),
	// 							CommitmentAmount: to.Ptr[float64](0.164),
	// 							CoveragePercentage: to.Ptr[float64](54.609),
	// 							OverageCost: to.Ptr[float64](144.841),
	// 							SavingsAmount: to.Ptr[float64](21.424),
	// 							SavingsPercentage: to.Ptr[float64](9.815),
	// 							TotalCost: to.Ptr[float64](196.843),
	// 							WastageCost: to.Ptr[float64](0.035),
	// 						},
	// 						{
	// 							AverageUtilizationPercentage: to.Ptr[float64](81.474),
	// 							BenefitCost: to.Ptr[float64](83.754),
	// 							CommitmentAmount: to.Ptr[float64](0.161),
	// 							CoveragePercentage: to.Ptr[float64](56.748),
	// 							OverageCost: to.Ptr[float64](120.389),
	// 							SavingsAmount: to.Ptr[float64](14.124),
	// 							SavingsPercentage: to.Ptr[float64](6.47),
	// 							TotalCost: to.Ptr[float64](204.143),
	// 							WastageCost: to.Ptr[float64](0.1),
	// 					}},
	// 				},
	// 				ArmSKUName: to.Ptr("Compute_Savings_Plan"),
	// 				CommitmentGranularity: to.Ptr(armcostmanagement.GrainHourly),
	// 				CostWithoutBenefit: to.Ptr[float64](218.267),
	// 				CurrencyCode: to.Ptr("USD"),
	// 				FirstConsumptionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-18T00:00:00.000Z"); return t}()),
	// 				LastConsumptionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-25T00:00:00.000Z"); return t}()),
	// 				LookBackPeriod: to.Ptr(armcostmanagement.LookBackPeriodLast7Days),
	// 				RecommendationDetails: &armcostmanagement.AllSavingsBenefitDetails{
	// 					AverageUtilizationPercentage: to.Ptr[float64](99.33),
	// 					BenefitCost: to.Ptr[float64](52.002),
	// 					CommitmentAmount: to.Ptr[float64](0.164),
	// 					CoveragePercentage: to.Ptr[float64](54.609),
	// 					OverageCost: to.Ptr[float64](144.841),
	// 					SavingsAmount: to.Ptr[float64](21.424),
	// 					SavingsPercentage: to.Ptr[float64](9.815),
	// 					TotalCost: to.Ptr[float64](196.843),
	// 					WastageCost: to.Ptr[float64](0.035),
	// 				},
	// 				Scope: to.Ptr(armcostmanagement.ScopeShared),
	// 				Term: to.Ptr(armcostmanagement.TermP1Y),
	// 				TotalHours: to.Ptr[int32](168),
	// 				Usage: &armcostmanagement.RecommendationUsageDetails{
	// 					Charges: []*float64{
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](0),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](1),
	// 						to.Ptr[float64](2),
	// 						to.Ptr[float64](2),
	// 						to.Ptr[float64](2),
	// 						to.Ptr[float64](2)},
	// 						UsageGrain: to.Ptr(armcostmanagement.GrainHourly),
	// 					},
	// 				},
	// 		}},
	// 	}
}
Output:

type BenefitRecommendationsClientListOptions

type BenefitRecommendationsClientListOptions struct {
	// May be used to expand the properties by: properties/usage, properties/allRecommendationDetails
	Expand *string

	// Can be used to filter benefitRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default
	// value 'Shared'; and properties/lookBackPeriod with allowed values ['Last7Days',
	// 'Last30Days', 'Last60Days'] and default value 'Last60Days'; properties/term with allowed values ['P1Y', 'P3Y'] and default
	// value 'P3Y'; properties/subscriptionId; properties/resourceGroup
	Filter *string

	// May be used to order the recommendations by: properties/armSkuName. For the savings plan, the results are in order by default.
	// There is no need to use this clause.
	Orderby *string
}

BenefitRecommendationsClientListOptions contains the optional parameters for the BenefitRecommendationsClient.NewListPager method.

type BenefitRecommendationsClientListResponse

type BenefitRecommendationsClientListResponse struct {
	// Result of listing benefit recommendations.
	BenefitRecommendationsListResult
}

BenefitRecommendationsClientListResponse contains the response from method BenefitRecommendationsClient.NewListPager.

type BenefitRecommendationsListResult

type BenefitRecommendationsListResult struct {
	// READ-ONLY; The link (URL) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of benefit recommendations.
	Value []*BenefitRecommendationModel
}

BenefitRecommendationsListResult - Result of listing benefit recommendations.

func (BenefitRecommendationsListResult) MarshalJSON

func (b BenefitRecommendationsListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BenefitRecommendationsListResult.

func (*BenefitRecommendationsListResult) UnmarshalJSON

func (b *BenefitRecommendationsListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BenefitRecommendationsListResult.

type BenefitUtilizationSummariesClient

type BenefitUtilizationSummariesClient struct {
	// contains filtered or unexported fields
}

BenefitUtilizationSummariesClient contains the methods for the BenefitUtilizationSummaries group. Don't use this type directly, use NewBenefitUtilizationSummariesClient() instead.

func NewBenefitUtilizationSummariesClient

func NewBenefitUtilizationSummariesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*BenefitUtilizationSummariesClient, error)

NewBenefitUtilizationSummariesClient creates a new instance of BenefitUtilizationSummariesClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*BenefitUtilizationSummariesClient) NewListByBillingAccountIDPager

NewListByBillingAccountIDPager - Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' and 'Monthly'.

Generated from API version 2022-10-01

  • billingAccountID - Billing account ID
  • options - BenefitUtilizationSummariesClientListByBillingAccountIDOptions contains the optional parameters for the BenefitUtilizationSummariesClient.NewListByBillingAccountIDPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewBenefitUtilizationSummariesClient().NewListByBillingAccountIDPager("12345", &armcostmanagement.BenefitUtilizationSummariesClientListByBillingAccountIDOptions{GrainParameter: nil,
	Filter: to.Ptr("properties/usageDate ge 2022-10-15 and properties/usageDate le 2022-10-18"),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.BenefitUtilizationSummariesListResult = armcostmanagement.BenefitUtilizationSummariesListResult{
	// 	Value: []armcostmanagement.BenefitUtilizationSummaryClassification{
	// 		&armcostmanagement.SavingsPlanUtilizationSummary{
	// 			Name: to.Ptr("66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116"),
	// 			Type: to.Ptr("Microsoft.CostManagement/benefitUtilizationSummaries"),
	// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345/providers/Microsoft.CostManagement/benefitUtilizationSummaries/66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116"),
	// 			Kind: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 			Properties: &armcostmanagement.SavingsPlanUtilizationSummaryProperties{
	// 				ArmSKUName: to.Ptr("Compute_Savings_Plan"),
	// 				BenefitID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd"),
	// 				BenefitOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6"),
	// 				BenefitType: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 				UsageDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-16T00:00:00.000Z"); return t}()),
	// 				AvgUtilizationPercentage: to.Ptr[float64](90),
	// 				MaxUtilizationPercentage: to.Ptr[float64](100),
	// 				MinUtilizationPercentage: to.Ptr[float64](80),
	// 			},
	// 		},
	// 		&armcostmanagement.SavingsPlanUtilizationSummary{
	// 			Name: to.Ptr("88cccc88-8ccc-8c88-888c-88cc8c8c88c8_444d44dd-d4d4-4dd4-444d-4dd4444ddddd_20211117"),
	// 			Type: to.Ptr("Microsoft.CostManagement/benefitUtilizationSummaries"),
	// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/12345/providers/Microsoft.CostManagement/benefitUtilizationSummaries/88cccc88-8ccc-8c88-888c-88cc8c8c88c8_444d44dd-d4d4-4dd4-444d-4dd4444ddddd_20211117"),
	// 			Kind: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 			Properties: &armcostmanagement.SavingsPlanUtilizationSummaryProperties{
	// 				ArmSKUName: to.Ptr("Compute_Savings_Plan"),
	// 				BenefitID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/88cccc88-8ccc-8c88-888c-88cc8c8c88c8/savingsPlans/444d44dd-d4d4-4dd4-444d-4dd4444ddddd"),
	// 				BenefitOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/88cccc88-8ccc-8c88-888c-88cc8c8c88c8"),
	// 				BenefitType: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 				UsageDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-17T00:00:00.000Z"); return t}()),
	// 				AvgUtilizationPercentage: to.Ptr[float64](60),
	// 				MaxUtilizationPercentage: to.Ptr[float64](70),
	// 				MinUtilizationPercentage: to.Ptr[float64](50),
	// 			},
	// 	}},
	// }
}
Output:

func (*BenefitUtilizationSummariesClient) NewListByBillingProfileIDPager

NewListByBillingProfileIDPager - Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'.

Generated from API version 2022-10-01

  • billingAccountID - Billing account ID
  • billingProfileID - Billing profile ID.
  • options - BenefitUtilizationSummariesClientListByBillingProfileIDOptions contains the optional parameters for the BenefitUtilizationSummariesClient.NewListByBillingProfileIDPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewBenefitUtilizationSummariesClient().NewListByBillingProfileIDPager("c0a00000-0e04-5ee3-000e-f0c6e00000ec:c0a00000-0e04-5ee3-000e-f0c6e00000ec", "200e5e90-000e-4960-8dcd-8d00a02db000", &armcostmanagement.BenefitUtilizationSummariesClientListByBillingProfileIDOptions{GrainParameter: nil,
	Filter: to.Ptr("properties/usageDate ge 2022-10-15 and properties/usageDate le 2022-10-18"),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.BenefitUtilizationSummariesListResult = armcostmanagement.BenefitUtilizationSummariesListResult{
	// 	Value: []armcostmanagement.BenefitUtilizationSummaryClassification{
	// 		&armcostmanagement.SavingsPlanUtilizationSummary{
	// 			Name: to.Ptr("66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116"),
	// 			Type: to.Ptr("Microsoft.CostManagement/benefitUtilizationSummaries"),
	// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/c0a00000-0e04-5ee3-000e-f0c6e00000ec:c0a00000-0e04-5ee3-000e-f0c6e00000ec/billingProfiles/200e5e90-000e-4960-8dcd-8d00a02db000/providers/Microsoft.CostManagement/benefitUtilizationSummaries/66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116"),
	// 			Kind: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 			Properties: &armcostmanagement.SavingsPlanUtilizationSummaryProperties{
	// 				ArmSKUName: to.Ptr("Compute_Savings_Plan"),
	// 				BenefitID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd"),
	// 				BenefitOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6"),
	// 				BenefitType: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 				UsageDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-16T00:00:00.000Z"); return t}()),
	// 				AvgUtilizationPercentage: to.Ptr[float64](90),
	// 				MaxUtilizationPercentage: to.Ptr[float64](100),
	// 				MinUtilizationPercentage: to.Ptr[float64](80),
	// 			},
	// 	}},
	// }
}
Output:

func (*BenefitUtilizationSummariesClient) NewListBySavingsPlanIDPager

NewListBySavingsPlanIDPager - Lists the savings plan utilization summaries for daily or monthly grain.

Generated from API version 2022-10-01

  • savingsPlanOrderID - Savings plan order ID.
  • savingsPlanID - Savings plan ID.
  • options - BenefitUtilizationSummariesClientListBySavingsPlanIDOptions contains the optional parameters for the BenefitUtilizationSummariesClient.NewListBySavingsPlanIDPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewBenefitUtilizationSummariesClient().NewListBySavingsPlanIDPager("66cccc66-6ccc-6c66-666c-66cc6c6c66c6", "222d22dd-d2d2-2dd2-222d-2dd2222ddddd", &armcostmanagement.BenefitUtilizationSummariesClientListBySavingsPlanIDOptions{Filter: nil,
	GrainParameter: nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.BenefitUtilizationSummariesListResult = armcostmanagement.BenefitUtilizationSummariesListResult{
	// 	Value: []armcostmanagement.BenefitUtilizationSummaryClassification{
	// 		&armcostmanagement.SavingsPlanUtilizationSummary{
	// 			Name: to.Ptr("66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_202111"),
	// 			Type: to.Ptr("Microsoft.CostManagement/benefitUtilizationSummaries"),
	// 			ID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd/providers/Microsoft.CostManagement/benefitUtilizationSummaries/66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_202111"),
	// 			Kind: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 			Properties: &armcostmanagement.SavingsPlanUtilizationSummaryProperties{
	// 				ArmSKUName: to.Ptr("Compute_Savings_Plan"),
	// 				BenefitID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd"),
	// 				BenefitOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6"),
	// 				BenefitType: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 				UsageDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-16T00:00:00.000Z"); return t}()),
	// 				AvgUtilizationPercentage: to.Ptr[float64](90),
	// 				MaxUtilizationPercentage: to.Ptr[float64](100),
	// 				MinUtilizationPercentage: to.Ptr[float64](80),
	// 			},
	// 		},
	// 		&armcostmanagement.SavingsPlanUtilizationSummary{
	// 			Name: to.Ptr("66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_202112"),
	// 			Type: to.Ptr("Microsoft.CostManagement/benefitUtilizationSummaries"),
	// 			ID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd/providers/Microsoft.CostManagement/benefitUtilizationSummaries/66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_202112"),
	// 			Kind: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 			Properties: &armcostmanagement.SavingsPlanUtilizationSummaryProperties{
	// 				ArmSKUName: to.Ptr("Compute_Savings_Plan"),
	// 				BenefitID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd"),
	// 				BenefitOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6"),
	// 				BenefitType: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 				UsageDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-17T00:00:00.000Z"); return t}()),
	// 				AvgUtilizationPercentage: to.Ptr[float64](80),
	// 				MaxUtilizationPercentage: to.Ptr[float64](90),
	// 				MinUtilizationPercentage: to.Ptr[float64](70),
	// 			},
	// 	}},
	// }
}
Output:

func (*BenefitUtilizationSummariesClient) NewListBySavingsPlanOrderPager

NewListBySavingsPlanOrderPager - Lists the savings plan utilization summaries for daily or monthly grain.

Generated from API version 2022-10-01

  • savingsPlanOrderID - Savings plan order ID.
  • options - BenefitUtilizationSummariesClientListBySavingsPlanOrderOptions contains the optional parameters for the BenefitUtilizationSummariesClient.NewListBySavingsPlanOrderPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewBenefitUtilizationSummariesClient().NewListBySavingsPlanOrderPager("66cccc66-6ccc-6c66-666c-66cc6c6c66c6", &armcostmanagement.BenefitUtilizationSummariesClientListBySavingsPlanOrderOptions{Filter: nil,
	GrainParameter: nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.BenefitUtilizationSummariesListResult = armcostmanagement.BenefitUtilizationSummariesListResult{
	// 	Value: []armcostmanagement.BenefitUtilizationSummaryClassification{
	// 		&armcostmanagement.SavingsPlanUtilizationSummary{
	// 			Name: to.Ptr("66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116"),
	// 			Type: to.Ptr("Microsoft.CostManagement/benefitUtilizationSummaries"),
	// 			ID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/providers/Microsoft.CostManagement/benefitUtilizationSummaries/66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116"),
	// 			Kind: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 			Properties: &armcostmanagement.SavingsPlanUtilizationSummaryProperties{
	// 				ArmSKUName: to.Ptr("Compute_Savings_Plan"),
	// 				BenefitID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd"),
	// 				BenefitOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6"),
	// 				BenefitType: to.Ptr(armcostmanagement.BenefitKindSavingsPlan),
	// 				UsageDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-16T00:00:00.000Z"); return t}()),
	// 				AvgUtilizationPercentage: to.Ptr[float64](90),
	// 				MaxUtilizationPercentage: to.Ptr[float64](100),
	// 				MinUtilizationPercentage: to.Ptr[float64](80),
	// 			},
	// 	}},
	// }
}
Output:

type BenefitUtilizationSummariesClientListByBillingAccountIDOptions

type BenefitUtilizationSummariesClientListByBillingAccountIDOptions struct {
	// Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate.
	Filter *string

	// Grain.
	GrainParameter *GrainParameter
}

BenefitUtilizationSummariesClientListByBillingAccountIDOptions contains the optional parameters for the BenefitUtilizationSummariesClient.NewListByBillingAccountIDPager method.

type BenefitUtilizationSummariesClientListByBillingAccountIDResponse

type BenefitUtilizationSummariesClientListByBillingAccountIDResponse struct {
	// List of benefit utilization summaries.
	BenefitUtilizationSummariesListResult
}

BenefitUtilizationSummariesClientListByBillingAccountIDResponse contains the response from method BenefitUtilizationSummariesClient.NewListByBillingAccountIDPager.

type BenefitUtilizationSummariesClientListByBillingProfileIDOptions

type BenefitUtilizationSummariesClientListByBillingProfileIDOptions struct {
	// Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate.
	Filter *string

	// Grain.
	GrainParameter *GrainParameter
}

BenefitUtilizationSummariesClientListByBillingProfileIDOptions contains the optional parameters for the BenefitUtilizationSummariesClient.NewListByBillingProfileIDPager method.

type BenefitUtilizationSummariesClientListByBillingProfileIDResponse

type BenefitUtilizationSummariesClientListByBillingProfileIDResponse struct {
	// List of benefit utilization summaries.
	BenefitUtilizationSummariesListResult
}

BenefitUtilizationSummariesClientListByBillingProfileIDResponse contains the response from method BenefitUtilizationSummariesClient.NewListByBillingProfileIDPager.

type BenefitUtilizationSummariesClientListBySavingsPlanIDOptions

type BenefitUtilizationSummariesClientListBySavingsPlanIDOptions struct {
	// Supports filtering by properties/usageDate.
	Filter *string

	// Grain.
	GrainParameter *GrainParameter
}

BenefitUtilizationSummariesClientListBySavingsPlanIDOptions contains the optional parameters for the BenefitUtilizationSummariesClient.NewListBySavingsPlanIDPager method.

type BenefitUtilizationSummariesClientListBySavingsPlanIDResponse

type BenefitUtilizationSummariesClientListBySavingsPlanIDResponse struct {
	// List of benefit utilization summaries.
	BenefitUtilizationSummariesListResult
}

BenefitUtilizationSummariesClientListBySavingsPlanIDResponse contains the response from method BenefitUtilizationSummariesClient.NewListBySavingsPlanIDPager.

type BenefitUtilizationSummariesClientListBySavingsPlanOrderOptions

type BenefitUtilizationSummariesClientListBySavingsPlanOrderOptions struct {
	// Supports filtering by properties/usageDate.
	Filter *string

	// Grain.
	GrainParameter *GrainParameter
}

BenefitUtilizationSummariesClientListBySavingsPlanOrderOptions contains the optional parameters for the BenefitUtilizationSummariesClient.NewListBySavingsPlanOrderPager method.

type BenefitUtilizationSummariesClientListBySavingsPlanOrderResponse

type BenefitUtilizationSummariesClientListBySavingsPlanOrderResponse struct {
	// List of benefit utilization summaries.
	BenefitUtilizationSummariesListResult
}

BenefitUtilizationSummariesClientListBySavingsPlanOrderResponse contains the response from method BenefitUtilizationSummariesClient.NewListBySavingsPlanOrderPager.

type BenefitUtilizationSummariesListResult

type BenefitUtilizationSummariesListResult struct {
	// READ-ONLY; The link (URL) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of benefit utilization summaries.
	Value []BenefitUtilizationSummaryClassification
}

BenefitUtilizationSummariesListResult - List of benefit utilization summaries.

func (BenefitUtilizationSummariesListResult) MarshalJSON

func (b BenefitUtilizationSummariesListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BenefitUtilizationSummariesListResult.

func (*BenefitUtilizationSummariesListResult) UnmarshalJSON

func (b *BenefitUtilizationSummariesListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BenefitUtilizationSummariesListResult.

type BenefitUtilizationSummary

type BenefitUtilizationSummary struct {
	// REQUIRED; Supported values: 'SavingsPlan'.
	Kind *BenefitKind

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

BenefitUtilizationSummary - Benefit utilization summary resource.

func (*BenefitUtilizationSummary) GetBenefitUtilizationSummary

func (b *BenefitUtilizationSummary) GetBenefitUtilizationSummary() *BenefitUtilizationSummary

GetBenefitUtilizationSummary implements the BenefitUtilizationSummaryClassification interface for type BenefitUtilizationSummary.

func (BenefitUtilizationSummary) MarshalJSON

func (b BenefitUtilizationSummary) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BenefitUtilizationSummary.

func (*BenefitUtilizationSummary) UnmarshalJSON

func (b *BenefitUtilizationSummary) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BenefitUtilizationSummary.

type BenefitUtilizationSummaryClassification

type BenefitUtilizationSummaryClassification interface {
	// GetBenefitUtilizationSummary returns the BenefitUtilizationSummary content of the underlying type.
	GetBenefitUtilizationSummary() *BenefitUtilizationSummary
}

BenefitUtilizationSummaryClassification provides polymorphic access to related types. Call the interface's GetBenefitUtilizationSummary() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *BenefitUtilizationSummary, *IncludedQuantityUtilizationSummary, *SavingsPlanUtilizationSummary

type BlobInfo

type BlobInfo struct {
	// Link to the blob to download file.
	BlobLink *string

	// Bytes in the blob.
	ByteCount *int64
}

BlobInfo - The blob information generated by this operation.

func (BlobInfo) MarshalJSON

func (b BlobInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BlobInfo.

func (*BlobInfo) UnmarshalJSON

func (b *BlobInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BlobInfo.

type ChartType

type ChartType string

ChartType - Chart type of the main view in Cost Analysis. Required.

const (
	ChartTypeArea          ChartType = "Area"
	ChartTypeGroupedColumn ChartType = "GroupedColumn"
	ChartTypeLine          ChartType = "Line"
	ChartTypeStackedColumn ChartType = "StackedColumn"
	ChartTypeTable         ChartType = "Table"
)

func PossibleChartTypeValues

func PossibleChartTypeValues() []ChartType

PossibleChartTypeValues returns the possible values for the ChartType const type.

type CheckNameAvailabilityReason

type CheckNameAvailabilityReason string

CheckNameAvailabilityReason - The reason why the given name is not available.

const (
	CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists"
	CheckNameAvailabilityReasonInvalid       CheckNameAvailabilityReason = "Invalid"
)

func PossibleCheckNameAvailabilityReasonValues

func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason

PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type.

type CheckNameAvailabilityRequest

type CheckNameAvailabilityRequest struct {
	// The name of the resource for which availability needs to be checked.
	Name *string

	// The resource type.
	Type *string
}

CheckNameAvailabilityRequest - The check availability request body.

func (CheckNameAvailabilityRequest) MarshalJSON

func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest.

func (*CheckNameAvailabilityRequest) UnmarshalJSON

func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest.

type CheckNameAvailabilityResponse

type CheckNameAvailabilityResponse struct {
	// Detailed reason why the given name is available.
	Message *string

	// Indicates if the resource name is available.
	NameAvailable *bool

	// The reason why the given name is not available.
	Reason *CheckNameAvailabilityReason
}

CheckNameAvailabilityResponse - The check availability result.

func (CheckNameAvailabilityResponse) MarshalJSON

func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse.

func (*CheckNameAvailabilityResponse) UnmarshalJSON

func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse.

type ClientFactory

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory

func NewClientFactory(credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewAlertsClient

func (c *ClientFactory) NewAlertsClient() *AlertsClient

NewAlertsClient creates a new instance of AlertsClient.

func (*ClientFactory) NewBenefitRecommendationsClient

func (c *ClientFactory) NewBenefitRecommendationsClient() *BenefitRecommendationsClient

NewBenefitRecommendationsClient creates a new instance of BenefitRecommendationsClient.

func (*ClientFactory) NewBenefitUtilizationSummariesClient

func (c *ClientFactory) NewBenefitUtilizationSummariesClient() *BenefitUtilizationSummariesClient

NewBenefitUtilizationSummariesClient creates a new instance of BenefitUtilizationSummariesClient.

func (*ClientFactory) NewDimensionsClient

func (c *ClientFactory) NewDimensionsClient() *DimensionsClient

NewDimensionsClient creates a new instance of DimensionsClient.

func (*ClientFactory) NewExportsClient

func (c *ClientFactory) NewExportsClient() *ExportsClient

NewExportsClient creates a new instance of ExportsClient.

func (*ClientFactory) NewForecastClient

func (c *ClientFactory) NewForecastClient() *ForecastClient

NewForecastClient creates a new instance of ForecastClient.

func (*ClientFactory) NewGenerateCostDetailsReportClient

func (c *ClientFactory) NewGenerateCostDetailsReportClient() *GenerateCostDetailsReportClient

NewGenerateCostDetailsReportClient creates a new instance of GenerateCostDetailsReportClient.

func (*ClientFactory) NewGenerateDetailedCostReportClient

func (c *ClientFactory) NewGenerateDetailedCostReportClient() *GenerateDetailedCostReportClient

NewGenerateDetailedCostReportClient creates a new instance of GenerateDetailedCostReportClient.

func (*ClientFactory) NewGenerateDetailedCostReportOperationResultsClient

func (c *ClientFactory) NewGenerateDetailedCostReportOperationResultsClient() *GenerateDetailedCostReportOperationResultsClient

NewGenerateDetailedCostReportOperationResultsClient creates a new instance of GenerateDetailedCostReportOperationResultsClient.

func (*ClientFactory) NewGenerateDetailedCostReportOperationStatusClient

func (c *ClientFactory) NewGenerateDetailedCostReportOperationStatusClient() *GenerateDetailedCostReportOperationStatusClient

NewGenerateDetailedCostReportOperationStatusClient creates a new instance of GenerateDetailedCostReportOperationStatusClient.

func (*ClientFactory) NewGenerateReservationDetailsReportClient

func (c *ClientFactory) NewGenerateReservationDetailsReportClient() *GenerateReservationDetailsReportClient

NewGenerateReservationDetailsReportClient creates a new instance of GenerateReservationDetailsReportClient.

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPriceSheetClient

func (c *ClientFactory) NewPriceSheetClient() *PriceSheetClient

NewPriceSheetClient creates a new instance of PriceSheetClient.

func (*ClientFactory) NewQueryClient

func (c *ClientFactory) NewQueryClient() *QueryClient

NewQueryClient creates a new instance of QueryClient.

func (*ClientFactory) NewScheduledActionsClient

func (c *ClientFactory) NewScheduledActionsClient() *ScheduledActionsClient

NewScheduledActionsClient creates a new instance of ScheduledActionsClient.

func (*ClientFactory) NewViewsClient

func (c *ClientFactory) NewViewsClient() *ViewsClient

NewViewsClient creates a new instance of ViewsClient.

type CommonExportProperties

type CommonExportProperties struct {
	// REQUIRED; Has the definition for the export.
	Definition *ExportDefinition

	// REQUIRED; Has delivery information for the export.
	DeliveryInfo *ExportDeliveryInfo

	// The format of the export being delivered. Currently only 'Csv' is supported.
	Format *FormatType

	// If set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file.
	// Note: this option is currently available only for Microsoft Customer Agreement
	// commerce scopes.
	PartitionData *bool

	// If requested, has the most recent run history for the export.
	RunHistory *ExportExecutionListResult

	// READ-ONLY; If the export has an active schedule, provides an estimate of the next run time.
	NextRunTimeEstimate *time.Time
}

CommonExportProperties - The common properties of the export.

func (CommonExportProperties) MarshalJSON

func (c CommonExportProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CommonExportProperties.

func (*CommonExportProperties) UnmarshalJSON

func (c *CommonExportProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CommonExportProperties.

type CostDetailsDataFormat

type CostDetailsDataFormat string

CostDetailsDataFormat - The data format of the report

const (
	// CostDetailsDataFormatCSVCostDetailsDataFormat - Csv data format.
	CostDetailsDataFormatCSVCostDetailsDataFormat CostDetailsDataFormat = "Csv"
)

func PossibleCostDetailsDataFormatValues

func PossibleCostDetailsDataFormatValues() []CostDetailsDataFormat

PossibleCostDetailsDataFormatValues returns the possible values for the CostDetailsDataFormat const type.

type CostDetailsMetricType

type CostDetailsMetricType string

CostDetailsMetricType - The type of the detailed report. By default ActualCost is provided

const (
	// CostDetailsMetricTypeActualCostCostDetailsMetricType - Actual cost data.
	CostDetailsMetricTypeActualCostCostDetailsMetricType CostDetailsMetricType = "ActualCost"
	// CostDetailsMetricTypeAmortizedCostCostDetailsMetricType - Amortized cost data.
	CostDetailsMetricTypeAmortizedCostCostDetailsMetricType CostDetailsMetricType = "AmortizedCost"
)

func PossibleCostDetailsMetricTypeValues

func PossibleCostDetailsMetricTypeValues() []CostDetailsMetricType

PossibleCostDetailsMetricTypeValues returns the possible values for the CostDetailsMetricType const type.

type CostDetailsOperationResults

type CostDetailsOperationResults struct {
	// The details of the error.
	Error *ErrorDetails

	// The id of the long running operation.
	ID *string

	// The manifest of the report generated by the operation.
	Manifest *ReportManifest

	// The name of the long running operation.
	Name *string

	// The status of the cost details operation
	Status *CostDetailsStatusType

	// The type of the long running operation.
	Type *string

	// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z.
	ValidTill *time.Time
}

CostDetailsOperationResults - The result of the long running operation for cost details Api.

func (CostDetailsOperationResults) MarshalJSON

func (c CostDetailsOperationResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CostDetailsOperationResults.

func (*CostDetailsOperationResults) UnmarshalJSON

func (c *CostDetailsOperationResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CostDetailsOperationResults.

type CostDetailsStatusType

type CostDetailsStatusType string

CostDetailsStatusType - The status of the cost details operation

const (
	// CostDetailsStatusTypeCompletedCostDetailsStatusType - Operation is Completed.
	CostDetailsStatusTypeCompletedCostDetailsStatusType CostDetailsStatusType = "Completed"
	// CostDetailsStatusTypeFailedCostDetailsStatusType - Operation Failed.
	CostDetailsStatusTypeFailedCostDetailsStatusType CostDetailsStatusType = "Failed"
	// CostDetailsStatusTypeNoDataFoundCostDetailsStatusType - Operation is Completed and no cost data found.
	CostDetailsStatusTypeNoDataFoundCostDetailsStatusType CostDetailsStatusType = "NoDataFound"
)

func PossibleCostDetailsStatusTypeValues

func PossibleCostDetailsStatusTypeValues() []CostDetailsStatusType

PossibleCostDetailsStatusTypeValues returns the possible values for the CostDetailsStatusType const type.

type CostDetailsTimePeriod

type CostDetailsTimePeriod struct {
	// REQUIRED; The end date to pull data to. example format 2020-03-15
	End *string

	// REQUIRED; The start date to pull data from. example format 2020-03-15
	Start *string
}

CostDetailsTimePeriod - The start and end date for pulling data for the cost detailed report. API only allows data to be pulled for 1 month or less and no older than 13 months.

func (CostDetailsTimePeriod) MarshalJSON

func (c CostDetailsTimePeriod) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CostDetailsTimePeriod.

func (*CostDetailsTimePeriod) UnmarshalJSON

func (c *CostDetailsTimePeriod) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CostDetailsTimePeriod.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DaysOfWeek

type DaysOfWeek string

DaysOfWeek - Days of Week.

const (
	DaysOfWeekFriday    DaysOfWeek = "Friday"
	DaysOfWeekMonday    DaysOfWeek = "Monday"
	DaysOfWeekSaturday  DaysOfWeek = "Saturday"
	DaysOfWeekSunday    DaysOfWeek = "Sunday"
	DaysOfWeekThursday  DaysOfWeek = "Thursday"
	DaysOfWeekTuesday   DaysOfWeek = "Tuesday"
	DaysOfWeekWednesday DaysOfWeek = "Wednesday"
)

func PossibleDaysOfWeekValues

func PossibleDaysOfWeekValues() []DaysOfWeek

PossibleDaysOfWeekValues returns the possible values for the DaysOfWeek const type.

type Dimension

type Dimension struct {
	// Dimension properties.
	Properties *DimensionProperties

	// READ-ONLY; ETag of the resource.
	ETag *string

	// READ-ONLY; Resource Id.
	ID *string

	// READ-ONLY; Location of the resource.
	Location *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; SKU of the resource.
	SKU *string

	// READ-ONLY; Resource tags.
	Tags map[string]*string

	// READ-ONLY; Resource type.
	Type *string
}

Dimension - List of Dimension.

func (Dimension) MarshalJSON

func (d Dimension) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Dimension.

func (*Dimension) UnmarshalJSON

func (d *Dimension) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Dimension.

type DimensionProperties

type DimensionProperties struct {
	// Dimension data.
	Data []*string

	// READ-ONLY; Dimension category.
	Category *string

	// READ-ONLY; Dimension description.
	Description *string

	// READ-ONLY; Filter enabled.
	FilterEnabled *bool

	// READ-ONLY; Grouping enabled.
	GroupingEnabled *bool

	// READ-ONLY; The link (url) to the next page of results.
	NextLink *string

	// READ-ONLY; Total number of data for the dimension.
	Total *int32

	// READ-ONLY; Usage end.
	UsageEnd *time.Time

	// READ-ONLY; Usage start.
	UsageStart *time.Time
}

DimensionProperties - Dimension properties.

func (DimensionProperties) MarshalJSON

func (d DimensionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DimensionProperties.

func (*DimensionProperties) UnmarshalJSON

func (d *DimensionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DimensionProperties.

type DimensionsClient

type DimensionsClient struct {
	// contains filtered or unexported fields
}

DimensionsClient contains the methods for the Dimensions group. Don't use this type directly, use NewDimensionsClient() instead.

func NewDimensionsClient

func NewDimensionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*DimensionsClient, error)

NewDimensionsClient creates a new instance of DimensionsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*DimensionsClient) NewByExternalCloudProviderTypePager

func (client *DimensionsClient) NewByExternalCloudProviderTypePager(externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, options *DimensionsClientByExternalCloudProviderTypeOptions) *runtime.Pager[DimensionsClientByExternalCloudProviderTypeResponse]

NewByExternalCloudProviderTypePager - Lists the dimensions by the external cloud provider type.

Generated from API version 2022-10-01

  • externalCloudProviderType - The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.
  • externalCloudProviderID - This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.
  • options - DimensionsClientByExternalCloudProviderTypeOptions contains the optional parameters for the DimensionsClient.NewByExternalCloudProviderTypePager method.
Example (ExternalBillingAccountDimensionList)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalBillingAccountsDimensions.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewByExternalCloudProviderTypePager(armcostmanagement.ExternalCloudProviderTypeExternalBillingAccounts, "100", &armcostmanagement.DimensionsClientByExternalCloudProviderTypeOptions{Filter: nil,
	Expand:    nil,
	Skiptoken: nil,
	Top:       nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceType_2019-12-01_2019-12-31"),
	// 			Type: to.Ptr("microsoft.consumption/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.CostManagement/externalBillingAccounts/100/dimensions_ResourceType_2019-12-01_2019-12-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource type"),
	// 				Category: to.Ptr("ResourceType"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](0),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-31T00:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceId_2019-12-01_2019-12-31"),
	// 				Type: to.Ptr("microsoft.consumption/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.CostManagement/externalBillingAccounts/100/dimensions_ResourceId_2019-12-01_2019-12-31"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource ID"),
	// 					Category: to.Ptr("ResourceId"),
	// 					Data: []*string{
	// 						to.Ptr("thoroetrg01"),
	// 						to.Ptr("default-notificationhubs-westus"),
	// 						to.Ptr("jedikeyvaultrg"),
	// 						to.Ptr("contosocodeflow8d4a"),
	// 						to.Ptr("noobaa")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](0),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-31T00:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (ExternalSubscriptionDimensionList)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalSubscriptionsDimensions.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewByExternalCloudProviderTypePager(armcostmanagement.ExternalCloudProviderTypeExternalSubscriptions, "100", &armcostmanagement.DimensionsClientByExternalCloudProviderTypeOptions{Filter: nil,
	Expand:    nil,
	Skiptoken: nil,
	Top:       nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceType_2019-12-01_2019-12-31"),
	// 			Type: to.Ptr("microsoft.consumption/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.CostManagement/externalSubscriptions/123/dimensions_ResourceType_2019-12-01_2019-12-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource type"),
	// 				Category: to.Ptr("ResourceType"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](0),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-31T00:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceId_2019-12-01_2019-12-31"),
	// 				Type: to.Ptr("microsoft.consumption/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.CostManagement/externalSubscriptions/123/dimensions_ResourceId_2019-12-01_2019-12-31"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource ID"),
	// 					Category: to.Ptr("ResourceId"),
	// 					Data: []*string{
	// 						to.Ptr("thoroetrg01"),
	// 						to.Ptr("default-notificationhubs-westus"),
	// 						to.Ptr("jedikeyvaultrg"),
	// 						to.Ptr("contosocodeflow8d4a"),
	// 						to.Ptr("noobaa")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](0),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-31T00:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T00:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

func (*DimensionsClient) NewListPager

NewListPager - Lists the dimensions by the defined scope.

Generated from API version 2022-10-01

  • scope - The scope associated with dimension operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • options - DimensionsClientListOptions contains the optional parameters for the DimensionsClient.NewListPager method.
Example (BillingAccountDimensionsListExpandAndTopLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountDimensionsListExpandAndTop.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/100", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2018-05-01_2018-05-31_5"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.CostManagement/dimensions_ResourceGroup_2018-05-01_2018-05-31_5"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](377),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.CostManagement/dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("microsoft.automation/automationaccounts"),
	// 						to.Ptr("microsoft.databricks/workspaces"),
	// 						to.Ptr("microsoft.dbformysql/servers"),
	// 						to.Ptr("microsoft.containerregistry/registries"),
	// 						to.Ptr("microsoft.search/searchservices")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](37),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (BillingAccountDimensionsListExpandAndTopMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingAccountDimensionsListExpandAndTop.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/providers/microsoft.CostManagement/dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](377),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/providers/microsoft.CostManagement/dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("microsoft.automation/automationaccounts"),
	// 						to.Ptr("microsoft.databricks/workspaces"),
	// 						to.Ptr("microsoft.dbformysql/servers"),
	// 						to.Ptr("microsoft.containerregistry/registries"),
	// 						to.Ptr("microsoft.search/searchservices")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](37),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (BillingAccountDimensionsListLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountDimensionsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/100", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    nil,
	Skiptoken: nil,
	Top:       nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2018-05-01_2018-05-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.CostManagement/dimensions_ResourceGroup_2018-05-01_2018-05-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](377),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2018-05-01_2018-05-31"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.CostManagement/dimensions_ResourceType_2018-05-01_2018-05-31"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("thoroetrg01"),
	// 						to.Ptr("default-notificationhubs-westus"),
	// 						to.Ptr("jedikeyvaultrg"),
	// 						to.Ptr("contosocodeflow8d4a"),
	// 						to.Ptr("noobaa")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](37),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (BillingAccountDimensionsListMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingAccountDimensionsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    nil,
	Skiptoken: nil,
	Top:       nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/providers/microsoft.CostManagement/dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](377),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/providers/microsoft.CostManagement/dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource type"),
	// 				Category: to.Ptr("ResourceType"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](37),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 			},
	// 	}},
	// }
}
Output:

Example (BillingAccountDimensionsListWithFilterLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountDimensionsListWithFilter.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/100", &armcostmanagement.DimensionsClientListOptions{Filter: to.Ptr("properties/category eq 'resourceId'"),
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceId_2018-05-01_2018-05-31_5"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.CostManagement/dimensions_ResourceId_2018-05-01_2018-05-31_5"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource Id"),
	// 				Category: to.Ptr("ResourceId"),
	// 				Data: []*string{
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/urphealthaccount"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount"),
	// 					to.Ptr("/subscriptions/67e24f6b-1ec2-4c90-993a-dc2d25b00b6c/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-67e24f6b-1ec2-4c90-993a-dc2d25b00b6c-eus"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-sql-ha/providers/microsoft.compute/virtualmachines/sql-4qqp1"),
	// 					to.Ptr("/subscriptions/a98d6dc5-eb8f-46cf-8938-f1fb08f03706/resourcegroups/databricks-rg-testwsp-xijmsdubneexm/providers/microsoft.compute/disks/488cdb42bf74474a98075415be3f806c-containerrootvolume")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](1409),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 		}},
	// 	}
}
Output:

Example (BillingAccountDimensionsListWithFilterMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingAccountDimensionsListWithFilter.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789", &armcostmanagement.DimensionsClientListOptions{Filter: to.Ptr("properties/category eq 'resourceId'"),
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceId_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/providers/microsoft.CostManagement/dimensions_ResourceId_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource Id"),
	// 				Category: to.Ptr("ResourceId"),
	// 				Data: []*string{
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/urphealthaccount"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount"),
	// 					to.Ptr("/subscriptions/67e24f6b-1ec2-4c90-993a-dc2d25b00b6c/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-67e24f6b-1ec2-4c90-993a-dc2d25b00b6c-eus"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-sql-ha/providers/microsoft.compute/virtualmachines/sql-4qqp1"),
	// 					to.Ptr("/subscriptions/a98d6dc5-eb8f-46cf-8938-f1fb08f03706/resourcegroups/databricks-rg-testwsp-xijmsdubneexm/providers/microsoft.compute/disks/488cdb42bf74474a98075415be3f806c-containerrootvolume")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](1409),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 				},
	// 		}},
	// 	}
}
Output:

Example (BillingProfileDimensionsListExpandAndTopMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingProfileDimensionsListExpandAndTop.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/microsoft.CostManagement/dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](377),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/microsoft.CostManagement/dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("microsoft.automation/automationaccounts"),
	// 						to.Ptr("microsoft.databricks/workspaces"),
	// 						to.Ptr("microsoft.dbformysql/servers"),
	// 						to.Ptr("microsoft.containerregistry/registries"),
	// 						to.Ptr("microsoft.search/searchservices")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](37),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (BillingProfileDimensionsListMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingProfileDimensionsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    nil,
	Skiptoken: nil,
	Top:       nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/microsoft.CostManagement/dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](377),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/microsoft.CostManagement/dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource type"),
	// 				Category: to.Ptr("ResourceType"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](37),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 			},
	// 	}},
	// }
}
Output:

Example (BillingProfileDimensionsListWithFilterMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingProfileDimensionsListWithFilter.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", &armcostmanagement.DimensionsClientListOptions{Filter: to.Ptr("properties/category eq 'resourceId'"),
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceId_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/microsoft.CostManagement/dimensions_ResourceId_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource Id"),
	// 				Category: to.Ptr("ResourceId"),
	// 				Data: []*string{
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/urphealthaccount"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount"),
	// 					to.Ptr("/subscriptions/67e24f6b-1ec2-4c90-993a-dc2d25b00b6c/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-67e24f6b-1ec2-4c90-993a-dc2d25b00b6c-eus"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-sql-ha/providers/microsoft.compute/virtualmachines/sql-4qqp1"),
	// 					to.Ptr("/subscriptions/a98d6dc5-eb8f-46cf-8938-f1fb08f03706/resourcegroups/databricks-rg-testwsp-xijmsdubneexm/providers/microsoft.compute/disks/488cdb42bf74474a98075415be3f806c-containerrootvolume")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](1409),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 				},
	// 		}},
	// 	}
}
Output:

Example (CustomerDimensionsListExpandAndTopMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCACustomerDimensionsListExpandAndTop.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/microsoft.CostManagement/dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](377),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/microsoft.CostManagement/dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("microsoft.automation/automationaccounts"),
	// 						to.Ptr("microsoft.databricks/workspaces"),
	// 						to.Ptr("microsoft.dbformysql/servers"),
	// 						to.Ptr("microsoft.containerregistry/registries"),
	// 						to.Ptr("microsoft.search/searchservices")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](37),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (CustomerDimensionsListMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCACustomerDimensionsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    nil,
	Skiptoken: nil,
	Top:       nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/microsoft.CostManagement/dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](377),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/microsoft.CostManagement/dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource type"),
	// 				Category: to.Ptr("ResourceType"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](37),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 			},
	// 	}},
	// }
}
Output:

Example (CustomerDimensionsListWithFilterMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCACustomerDimensionsListWithFilter.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", &armcostmanagement.DimensionsClientListOptions{Filter: to.Ptr("properties/category eq 'resourceId'"),
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceId_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/microsoft.CostManagement/dimensions_ResourceId_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource Id"),
	// 				Category: to.Ptr("ResourceId"),
	// 				Data: []*string{
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/urphealthaccount"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount"),
	// 					to.Ptr("/subscriptions/67e24f6b-1ec2-4c90-993a-dc2d25b00b6c/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-67e24f6b-1ec2-4c90-993a-dc2d25b00b6c-eus"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-sql-ha/providers/microsoft.compute/virtualmachines/sql-4qqp1"),
	// 					to.Ptr("/subscriptions/a98d6dc5-eb8f-46cf-8938-f1fb08f03706/resourcegroups/databricks-rg-testwsp-xijmsdubneexm/providers/microsoft.compute/disks/488cdb42bf74474a98075415be3f806c-containerrootvolume")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](1409),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 				},
	// 		}},
	// 	}
}
Output:

Example (DepartmentDimensionsListExpandAndTopLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentDimensionsListExpandAndTop.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/100/departments/123", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2018-05-01_2018-05-31_5"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/departments/123/providers/microsoft.CostManagement/dimensions_ResourceGroup_2018-05-01_2018-05-31_5"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](377),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/departments/123/providers/microsoft.CostManagement/dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("microsoft.automation/automationaccounts"),
	// 						to.Ptr("microsoft.databricks/workspaces"),
	// 						to.Ptr("microsoft.dbformysql/servers"),
	// 						to.Ptr("microsoft.containerregistry/registries"),
	// 						to.Ptr("microsoft.search/searchservices")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](37),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (DepartmentDimensionsListLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentDimensionsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/100/departments/123", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    nil,
	Skiptoken: nil,
	Top:       nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2018-05-01_2018-05-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/departments/123/providers/microsoft.CostManagement/dimensions_ResourceGroup_2018-05-01_2018-05-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](377),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2018-05-01_2018-05-31"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/departments/123/providers/microsoft.CostManagement/dimensions_ResourceType_2018-05-01_2018-05-31"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("thoroetrg01"),
	// 						to.Ptr("default-notificationhubs-westus"),
	// 						to.Ptr("jedikeyvaultrg"),
	// 						to.Ptr("contosocodeflow8d4a"),
	// 						to.Ptr("noobaa")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](37),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (DepartmentDimensionsListWithFilterLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentDimensionsListWithFilter.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/100/departments/123", &armcostmanagement.DimensionsClientListOptions{Filter: to.Ptr("properties/category eq 'resourceId'"),
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceId_2018-05-01_2018-05-31_5"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/departments/123/providers/microsoft.CostManagement/dimensions_ResourceId_2018-05-01_2018-05-31_5"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource Id"),
	// 				Category: to.Ptr("ResourceId"),
	// 				Data: []*string{
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/urphealthaccount"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount"),
	// 					to.Ptr("/subscriptions/67e24f6b-1ec2-4c90-993a-dc2d25b00b6c/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-67e24f6b-1ec2-4c90-993a-dc2d25b00b6c-eus"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-sql-ha/providers/microsoft.compute/virtualmachines/sql-4qqp1"),
	// 					to.Ptr("/subscriptions/a98d6dc5-eb8f-46cf-8938-f1fb08f03706/resourcegroups/databricks-rg-testwsp-xijmsdubneexm/providers/microsoft.compute/disks/488cdb42bf74474a98075415be3f806c-containerrootvolume")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](1409),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 		}},
	// 	}
}
Output:

Example (EnrollmentAccountDimensionsListExpandAndTopLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountDimensionsListExpandAndTop.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2018-05-01_2018-05-31_5"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/microsoft.CostManagement/dimensions_ResourceGroup_2018-05-01_2018-05-31_5"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](377),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/microsoft.CostManagement/dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("microsoft.automation/automationaccounts"),
	// 						to.Ptr("microsoft.databricks/workspaces"),
	// 						to.Ptr("microsoft.dbformysql/servers"),
	// 						to.Ptr("microsoft.containerregistry/registries"),
	// 						to.Ptr("microsoft.search/searchservices")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](37),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (EnrollmentAccountDimensionsListLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountDimensionsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    nil,
	Skiptoken: nil,
	Top:       nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2018-05-01_2018-05-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/microsoft.CostManagement/dimensions_ResourceGroup_2018-05-01_2018-05-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](377),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceType_2018-05-01_2018-05-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/microsoft.CostManagement/dimensions_ResourceType_2018-05-01_2018-05-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource type"),
	// 				Category: to.Ptr("ResourceType"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](37),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 			},
	// 	}},
	// }
}
Output:

Example (EnrollmentAccountDimensionsListWithFilterLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountDimensionsListWithFilter.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", &armcostmanagement.DimensionsClientListOptions{Filter: to.Ptr("properties/category eq 'resourceId'"),
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceId_2018-05-01_2018-05-31_5"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/microsoft.CostManagement/dimensions_ResourceId_2018-05-01_2018-05-31_5"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource Id"),
	// 				Category: to.Ptr("ResourceId"),
	// 				Data: []*string{
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/urphealthaccount"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount"),
	// 					to.Ptr("/subscriptions/67e24f6b-1ec2-4c90-993a-dc2d25b00b6c/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-67e24f6b-1ec2-4c90-993a-dc2d25b00b6c-eus"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-sql-ha/providers/microsoft.compute/virtualmachines/sql-4qqp1"),
	// 					to.Ptr("/subscriptions/a98d6dc5-eb8f-46cf-8938-f1fb08f03706/resourcegroups/databricks-rg-testwsp-xijmsdubneexm/providers/microsoft.compute/disks/488cdb42bf74474a98075415be3f806c-containerrootvolume")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](1409),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 		}},
	// 	}
}
Output:

Example (InvoiceSectionDimensionsListExpandAndTopMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCAInvoiceSectionDimensionsListExpandAndTop.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/microsoft.CostManagement/dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](377),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/microsoft.CostManagement/dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("microsoft.automation/automationaccounts"),
	// 						to.Ptr("microsoft.databricks/workspaces"),
	// 						to.Ptr("microsoft.dbformysql/servers"),
	// 						to.Ptr("microsoft.containerregistry/registries"),
	// 						to.Ptr("microsoft.search/searchservices")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](37),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (InvoiceSectionDimensionsListMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCAInvoiceSectionDimensionsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    nil,
	Skiptoken: nil,
	Top:       nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/microsoft.CostManagement/dimensions_ResourceGroup_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](377),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/microsoft.CostManagement/dimensions_ResourceType_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource type"),
	// 				Category: to.Ptr("ResourceType"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](37),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 			},
	// 	}},
	// }
}
Output:

Example (InvoiceSectionDimensionsListWithFilterMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCAInvoiceSectionDimensionsListWithFilter.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", &armcostmanagement.DimensionsClientListOptions{Filter: to.Ptr("properties/category eq 'resourceId'"),
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceId_2019-10-01_2019-10-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/microsoft.CostManagement/dimensions_ResourceId_2019-10-01_2019-10-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource Id"),
	// 				Category: to.Ptr("ResourceId"),
	// 				Data: []*string{
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/urphealthaccount"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount"),
	// 					to.Ptr("/subscriptions/67e24f6b-1ec2-4c90-993a-dc2d25b00b6c/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-67e24f6b-1ec2-4c90-993a-dc2d25b00b6c-eus"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-sql-ha/providers/microsoft.compute/virtualmachines/sql-4qqp1"),
	// 					to.Ptr("/subscriptions/a98d6dc5-eb8f-46cf-8938-f1fb08f03706/resourcegroups/databricks-rg-testwsp-xijmsdubneexm/providers/microsoft.compute/disks/488cdb42bf74474a98075415be3f806c-containerrootvolume")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](1409),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-01T07:00:00.000Z"); return t}()),
	// 				},
	// 		}},
	// 	}
}
Output:

Example (ManagementGroupDimensionsListExpandAndTopLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ManagementGroupDimensionsListExpandAndTop.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Management/managementGroups/MyMgId", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2018-05-01_2018-05-31_5"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Management/managementGroups/MyMgId/providers/microsoft.CostManagement/dimensions_ResourceGroup_2018-05-01_2018-05-31_5"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("thoroetrg01"),
	// 					to.Ptr("default-notificationhubs-westus"),
	// 					to.Ptr("jedikeyvaultrg"),
	// 					to.Ptr("contosocodeflow8d4a"),
	// 					to.Ptr("noobaa")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](377),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("providers/Microsoft.Management/managementGroups/MyMgId/providers/microsoft.CostManagement/dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("microsoft.automation/automationaccounts"),
	// 						to.Ptr("microsoft.databricks/workspaces"),
	// 						to.Ptr("microsoft.dbformysql/servers"),
	// 						to.Ptr("microsoft.containerregistry/registries"),
	// 						to.Ptr("microsoft.search/searchservices")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](37),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (ManagementGroupDimensionsListLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ManagementGroupDimensionsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Management/managementGroups/MyMgId", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    nil,
	Skiptoken: nil,
	Top:       nil,
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2018-05-01_2018-05-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Management/managementGroups/MyMgId/providers/microsoft.CostManagement/dimensions_ResourceGroup_2018-05-01_2018-05-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](377),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceType_2018-05-01_2018-05-31"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Management/managementGroups/MyMgId/providers/microsoft.CostManagement/dimensions_ResourceType_2018-05-01_2018-05-31"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource type"),
	// 				Category: to.Ptr("ResourceType"),
	// 				Data: []*string{
	// 				},
	// 				FilterEnabled: to.Ptr(true),
	// 				GroupingEnabled: to.Ptr(true),
	// 				Total: to.Ptr[int32](37),
	// 				UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 				UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 			},
	// 	}},
	// }
}
Output:

Example (ManagementGroupDimensionsListWithFilterLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ManagementGroupDimensionsListWithFilter.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("providers/Microsoft.Management/managementGroups/MyMgId", &armcostmanagement.DimensionsClientListOptions{Filter: to.Ptr("properties/category eq 'resourceId'"),
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceId_2018-05-01_2018-05-31_5"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("providers/Microsoft.Management/managementGroups/MyMgId/providers/microsoft.CostManagement/dimensions_ResourceId_2018-05-01_2018-05-31_5"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource Id"),
	// 				Category: to.Ptr("ResourceId"),
	// 				Data: []*string{
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/urphealthaccount"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount"),
	// 					to.Ptr("/subscriptions/67e24f6b-1ec2-4c90-993a-dc2d25b00b6c/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-67e24f6b-1ec2-4c90-993a-dc2d25b00b6c-eus"),
	// 					to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-sql-ha/providers/microsoft.compute/virtualmachines/sql-4qqp1"),
	// 					to.Ptr("/subscriptions/a98d6dc5-eb8f-46cf-8938-f1fb08f03706/resourcegroups/databricks-rg-testwsp-xijmsdubneexm/providers/microsoft.compute/disks/488cdb42bf74474a98075415be3f806c-containerrootvolume")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](1409),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 		}},
	// 	}
}
Output:

Example (ResourceGroupDimensionsListLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ResourceGroupDimensionsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/system.orlando", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/system.orlando/providers/microsoft.CostManagement/dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource type"),
	// 				Category: to.Ptr("ResourceType"),
	// 				Data: []*string{
	// 					to.Ptr("microsoft.storage/storageaccounts")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](1),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceId_2018-05-01_2018-05-31_5"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/system.orlando/providers/microsoft.CostManagement/dimensions_ResourceId_2018-05-01_2018-05-31_5"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource Id"),
	// 					Category: to.Ptr("ResourceId"),
	// 					Data: []*string{
	// 						to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/authprod"),
	// 						to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/systemevents"),
	// 						to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/armadminprod"),
	// 						to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount"),
	// 						to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/publicsystemportal")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](27),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

Example (SubscriptionDimensionsListLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SubscriptionDimensionsList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDimensionsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", &armcostmanagement.DimensionsClientListOptions{Filter: nil,
	Expand:    to.Ptr("properties/data"),
	Skiptoken: nil,
	Top:       to.Ptr[int32](5),
})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.DimensionsListResult = armcostmanagement.DimensionsListResult{
	// 	Value: []*armcostmanagement.Dimension{
	// 		{
	// 			Name: to.Ptr("dimensions_ResourceGroup_2018-05-01_2018-05-31_5"),
	// 			Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 			ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/dimensions_ResourceGroup_2018-05-01_2018-05-31_5"),
	// 			Properties: &armcostmanagement.DimensionProperties{
	// 				Description: to.Ptr("Resource group"),
	// 				Category: to.Ptr("ResourceGroup"),
	// 				Data: []*string{
	// 					to.Ptr("dcrg"),
	// 					to.Ptr("rg"),
	// 					to.Ptr("offlinegalleryrg"),
	// 					to.Ptr("system.orlando.adminkeyvault"),
	// 					to.Ptr("system.orlando.keyvault")},
	// 					FilterEnabled: to.Ptr(true),
	// 					GroupingEnabled: to.Ptr(true),
	// 					Total: to.Ptr[int32](68),
	// 					UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 					UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 				Type: to.Ptr("microsoft.CostManagement/dimensions"),
	// 				ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/dimensions_ResourceType_2018-05-01_2018-05-31_5"),
	// 				Properties: &armcostmanagement.DimensionProperties{
	// 					Description: to.Ptr("Resource type"),
	// 					Category: to.Ptr("ResourceType"),
	// 					Data: []*string{
	// 						to.Ptr("microsoft.storage/storageaccounts"),
	// 						to.Ptr("microsoft.web.admin/role"),
	// 						to.Ptr("microsoft.sql/servers"),
	// 						to.Ptr("microsoft.compute/virtualmachines")},
	// 						FilterEnabled: to.Ptr(true),
	// 						GroupingEnabled: to.Ptr(true),
	// 						Total: to.Ptr[int32](4),
	// 						UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-31T07:00:00.000Z"); return t}()),
	// 						UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T07:00:00.000Z"); return t}()),
	// 					},
	// 			}},
	// 		}
}
Output:

type DimensionsClientByExternalCloudProviderTypeOptions

type DimensionsClientByExternalCloudProviderTypeOptions struct {
	// May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.
	Expand *string

	// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators
	// are 'eq','lt', 'gt', 'le', 'ge'.
	Filter *string

	// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element,
	// the value of the nextLink element will include a skiptoken parameter that
	// specifies a starting point to use for subsequent calls.
	Skiptoken *string

	// May be used to limit the number of results to the most recent N dimension data.
	Top *int32
}

DimensionsClientByExternalCloudProviderTypeOptions contains the optional parameters for the DimensionsClient.NewByExternalCloudProviderTypePager method.

type DimensionsClientByExternalCloudProviderTypeResponse

type DimensionsClientByExternalCloudProviderTypeResponse struct {
	// Result of listing dimensions. It contains a list of available dimensions.
	DimensionsListResult
}

DimensionsClientByExternalCloudProviderTypeResponse contains the response from method DimensionsClient.NewByExternalCloudProviderTypePager.

type DimensionsClientListOptions

type DimensionsClientListOptions struct {
	// May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.
	Expand *string

	// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators
	// are 'eq','lt', 'gt', 'le', 'ge'.
	Filter *string

	// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element,
	// the value of the nextLink element will include a skiptoken parameter that
	// specifies a starting point to use for subsequent calls.
	Skiptoken *string

	// May be used to limit the number of results to the most recent N dimension data.
	Top *int32
}

DimensionsClientListOptions contains the optional parameters for the DimensionsClient.NewListPager method.

type DimensionsClientListResponse

type DimensionsClientListResponse struct {
	// Result of listing dimensions. It contains a list of available dimensions.
	DimensionsListResult
}

DimensionsClientListResponse contains the response from method DimensionsClient.NewListPager.

type DimensionsListResult

type DimensionsListResult struct {
	// READ-ONLY; The list of dimensions.
	Value []*Dimension
}

DimensionsListResult - Result of listing dimensions. It contains a list of available dimensions.

func (DimensionsListResult) MarshalJSON

func (d DimensionsListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DimensionsListResult.

func (*DimensionsListResult) UnmarshalJSON

func (d *DimensionsListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DimensionsListResult.

type DismissAlertPayload

type DismissAlertPayload struct {
	// Alert properties.
	Properties *AlertProperties
}

DismissAlertPayload - The request payload to update an alert

func (DismissAlertPayload) MarshalJSON

func (d DismissAlertPayload) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DismissAlertPayload.

func (*DismissAlertPayload) UnmarshalJSON

func (d *DismissAlertPayload) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DismissAlertPayload.

type DownloadURL

type DownloadURL struct {
	// The URL to download the generated report.
	DownloadURL *string

	// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z.
	ValidTill *time.Time

	// READ-ONLY; The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z.
	ExpiryTime *time.Time
}

DownloadURL - The URL to download the generated report.

func (DownloadURL) MarshalJSON

func (d DownloadURL) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DownloadURL.

func (*DownloadURL) UnmarshalJSON

func (d *DownloadURL) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DownloadURL.

type ErrorDetails

type ErrorDetails struct {
	// READ-ONLY; Error code.
	Code *string

	// READ-ONLY; Error message indicating why the operation failed.
	Message *string
}

ErrorDetails - The details of the error.

func (ErrorDetails) MarshalJSON

func (e ErrorDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorDetails.

func (*ErrorDetails) UnmarshalJSON

func (e *ErrorDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails.

type ExecutionStatus

type ExecutionStatus string

ExecutionStatus - The last known status of the export run.

const (
	ExecutionStatusCompleted           ExecutionStatus = "Completed"
	ExecutionStatusDataNotAvailable    ExecutionStatus = "DataNotAvailable"
	ExecutionStatusFailed              ExecutionStatus = "Failed"
	ExecutionStatusInProgress          ExecutionStatus = "InProgress"
	ExecutionStatusNewDataNotAvailable ExecutionStatus = "NewDataNotAvailable"
	ExecutionStatusQueued              ExecutionStatus = "Queued"
	ExecutionStatusTimeout             ExecutionStatus = "Timeout"
)

func PossibleExecutionStatusValues

func PossibleExecutionStatusValues() []ExecutionStatus

PossibleExecutionStatusValues returns the possible values for the ExecutionStatus const type.

type ExecutionType

type ExecutionType string

ExecutionType - The type of the export run.

const (
	ExecutionTypeOnDemand  ExecutionType = "OnDemand"
	ExecutionTypeScheduled ExecutionType = "Scheduled"
)

func PossibleExecutionTypeValues

func PossibleExecutionTypeValues() []ExecutionType

PossibleExecutionTypeValues returns the possible values for the ExecutionType const type.

type Export

type Export struct {
	// eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating
	// the latest version or not.
	ETag *string

	// The properties of the export.
	Properties *ExportProperties

	// READ-ONLY; Resource Id.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; Resource type.
	Type *string
}

Export - An export resource.

func (Export) MarshalJSON

func (e Export) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Export.

func (*Export) UnmarshalJSON

func (e *Export) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Export.

type ExportDataset

type ExportDataset struct {
	// The export dataset configuration.
	Configuration *ExportDatasetConfiguration

	// The granularity of rows in the export. Currently only 'Daily' is supported.
	Granularity *GranularityType
}

ExportDataset - The definition for data in the export.

func (ExportDataset) MarshalJSON

func (e ExportDataset) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportDataset.

func (*ExportDataset) UnmarshalJSON

func (e *ExportDataset) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportDataset.

type ExportDatasetConfiguration

type ExportDatasetConfiguration struct {
	// Array of column names to be included in the export. If not provided then the export will include all available columns.
	// The available columns can vary by customer channel (see examples).
	Columns []*string
}

ExportDatasetConfiguration - The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns.

func (ExportDatasetConfiguration) MarshalJSON

func (e ExportDatasetConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportDatasetConfiguration.

func (*ExportDatasetConfiguration) UnmarshalJSON

func (e *ExportDatasetConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportDatasetConfiguration.

type ExportDefinition

type ExportDefinition struct {
	// REQUIRED; The time frame for pulling data for the export. If custom, then a specific time period must be provided.
	Timeframe *TimeframeType

	// REQUIRED; The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do
	// not yet provide data for charges or amortization for service reservations.
	Type *ExportType

	// The definition for data in the export.
	DataSet *ExportDataset

	// Has time period for pulling data for the export.
	TimePeriod *ExportTimePeriod
}

ExportDefinition - The definition of an export.

func (ExportDefinition) MarshalJSON

func (e ExportDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportDefinition.

func (*ExportDefinition) UnmarshalJSON

func (e *ExportDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportDefinition.

type ExportDeliveryDestination

type ExportDeliveryDestination struct {
	// REQUIRED; The name of the container where exports will be uploaded. If the container does not exist it will be created.
	Container *string

	// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount
	// are specified.
	ResourceID *string

	// The name of the directory where exports will be uploaded.
	RootFolderPath *string

	// A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified
	// instead of resourceId. Note: the value returned by the API for this
	// property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated.
	// To update this value a new SAS token must be specified.
	SasToken *string

	// The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken
	// can be specified instead of resourceId.
	StorageAccount *string
}

ExportDeliveryDestination - This represents the blob storage account location where exports of costs will be delivered. There are two ways to configure the destination. The approach recommended for most customers is to specify the resourceId of the storage account. This requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider in order to give Cost Management services access to the storage. When creating an export in the Azure portal this registration is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key ).

func (ExportDeliveryDestination) MarshalJSON

func (e ExportDeliveryDestination) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportDeliveryDestination.

func (*ExportDeliveryDestination) UnmarshalJSON

func (e *ExportDeliveryDestination) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportDeliveryDestination.

type ExportDeliveryInfo

type ExportDeliveryInfo struct {
	// REQUIRED; Has destination for the export being delivered.
	Destination *ExportDeliveryDestination
}

ExportDeliveryInfo - The delivery information associated with a export.

func (ExportDeliveryInfo) MarshalJSON

func (e ExportDeliveryInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportDeliveryInfo.

func (*ExportDeliveryInfo) UnmarshalJSON

func (e *ExportDeliveryInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportDeliveryInfo.

type ExportExecutionListResult

type ExportExecutionListResult struct {
	// READ-ONLY; A list of export runs.
	Value []*ExportRun
}

ExportExecutionListResult - Result of listing the run history of an export.

func (ExportExecutionListResult) MarshalJSON

func (e ExportExecutionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportExecutionListResult.

func (*ExportExecutionListResult) UnmarshalJSON

func (e *ExportExecutionListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportExecutionListResult.

type ExportListResult

type ExportListResult struct {
	// READ-ONLY; The list of exports.
	Value []*Export
}

ExportListResult - Result of listing exports. It contains a list of available exports in the scope provided.

func (ExportListResult) MarshalJSON

func (e ExportListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportListResult.

func (*ExportListResult) UnmarshalJSON

func (e *ExportListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportListResult.

type ExportProperties

type ExportProperties struct {
	// REQUIRED; Has the definition for the export.
	Definition *ExportDefinition

	// REQUIRED; Has delivery information for the export.
	DeliveryInfo *ExportDeliveryInfo

	// The format of the export being delivered. Currently only 'Csv' is supported.
	Format *FormatType

	// If set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file.
	// Note: this option is currently available only for Microsoft Customer Agreement
	// commerce scopes.
	PartitionData *bool

	// If requested, has the most recent run history for the export.
	RunHistory *ExportExecutionListResult

	// Has schedule information for the export.
	Schedule *ExportSchedule

	// READ-ONLY; If the export has an active schedule, provides an estimate of the next run time.
	NextRunTimeEstimate *time.Time
}

ExportProperties - The properties of the export.

func (ExportProperties) MarshalJSON

func (e ExportProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportProperties.

func (*ExportProperties) UnmarshalJSON

func (e *ExportProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportProperties.

type ExportRecurrencePeriod

type ExportRecurrencePeriod struct {
	// REQUIRED; The start date of recurrence.
	From *time.Time

	// The end date of recurrence.
	To *time.Time
}

ExportRecurrencePeriod - The start and end date for recurrence schedule.

func (ExportRecurrencePeriod) MarshalJSON

func (e ExportRecurrencePeriod) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportRecurrencePeriod.

func (*ExportRecurrencePeriod) UnmarshalJSON

func (e *ExportRecurrencePeriod) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportRecurrencePeriod.

type ExportRun

type ExportRun struct {
	// eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating
	// the latest version or not.
	ETag *string

	// The properties of the export run.
	Properties *ExportRunProperties

	// READ-ONLY; Resource Id.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; Resource type.
	Type *string
}

ExportRun - An export run.

func (ExportRun) MarshalJSON

func (e ExportRun) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportRun.

func (*ExportRun) UnmarshalJSON

func (e *ExportRun) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportRun.

type ExportRunProperties

type ExportRunProperties struct {
	// The details of any error.
	Error *ErrorDetails

	// The type of the export run.
	ExecutionType *ExecutionType

	// The name of the exported file.
	FileName *string

	// The time when the export run finished.
	ProcessingEndTime *time.Time

	// The time when export was picked up to be run.
	ProcessingStartTime *time.Time

	// The export settings that were in effect for this run.
	RunSettings *CommonExportProperties

	// The last known status of the export run.
	Status *ExecutionStatus

	// The identifier for the entity that triggered the export. For on-demand runs it is the user email. For scheduled runs it
	// is 'System'.
	SubmittedBy *string

	// The time when export was queued to be run.
	SubmittedTime *time.Time
}

ExportRunProperties - The properties of the export run.

func (ExportRunProperties) MarshalJSON

func (e ExportRunProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportRunProperties.

func (*ExportRunProperties) UnmarshalJSON

func (e *ExportRunProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportRunProperties.

type ExportSchedule

type ExportSchedule struct {
	// The schedule recurrence.
	Recurrence *RecurrenceType

	// Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than
	// start date.
	RecurrencePeriod *ExportRecurrencePeriod

	// The status of the export's schedule. If 'Inactive', the export's schedule is paused.
	Status *StatusType
}

ExportSchedule - The schedule associated with the export.

func (ExportSchedule) MarshalJSON

func (e ExportSchedule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportSchedule.

func (*ExportSchedule) UnmarshalJSON

func (e *ExportSchedule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportSchedule.

type ExportTimePeriod

type ExportTimePeriod struct {
	// REQUIRED; The start date for export data.
	From *time.Time

	// REQUIRED; The end date for export data.
	To *time.Time
}

ExportTimePeriod - The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months.

func (ExportTimePeriod) MarshalJSON

func (e ExportTimePeriod) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportTimePeriod.

func (*ExportTimePeriod) UnmarshalJSON

func (e *ExportTimePeriod) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportTimePeriod.

type ExportType

type ExportType string

ExportType - The type of the query.

const (
	ExportTypeActualCost    ExportType = "ActualCost"
	ExportTypeAmortizedCost ExportType = "AmortizedCost"
	ExportTypeUsage         ExportType = "Usage"
)

func PossibleExportTypeValues

func PossibleExportTypeValues() []ExportType

PossibleExportTypeValues returns the possible values for the ExportType const type.

type ExportsClient

type ExportsClient struct {
	// contains filtered or unexported fields
}

ExportsClient contains the methods for the Exports group. Don't use this type directly, use NewExportsClient() instead.

func NewExportsClient

func NewExportsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ExportsClient, error)

NewExportsClient creates a new instance of ExportsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ExportsClient) CreateOrUpdate

func (client *ExportsClient) CreateOrUpdate(ctx context.Context, scope string, exportName string, parameters Export, options *ExportsClientCreateOrUpdateOptions) (ExportsClientCreateOrUpdateResponse, error)

CreateOrUpdate - The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • exportName - Export Name.
  • parameters - Parameters supplied to the CreateOrUpdate Export operation.
  • options - ExportsClientCreateOrUpdateOptions contains the optional parameters for the ExportsClient.CreateOrUpdate method.
Example (ExportCreateOrUpdateByBillingAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateByBillingAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().CreateOrUpdate(ctx, "providers/Microsoft.Billing/billingAccounts/123456", "TestExport", armcostmanagement.Export{
	Properties: &armcostmanagement.ExportProperties{
		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
		Definition: &armcostmanagement.ExportDefinition{
			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
			DataSet: &armcostmanagement.ExportDataset{
				Configuration: &armcostmanagement.ExportDatasetConfiguration{
					Columns: []*string{
						to.Ptr("Date"),
						to.Ptr("MeterId"),
						to.Ptr("ResourceId"),
						to.Ptr("ResourceLocation"),
						to.Ptr("Quantity")},
				},
				Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
			},
			Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
		},
		DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
			Destination: &armcostmanagement.ExportDeliveryDestination{
				Container:      to.Ptr("exports"),
				ResourceID:     to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
				RootFolderPath: to.Ptr("ad-hoc"),
			},
		},
		Schedule: &armcostmanagement.ExportSchedule{
			Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
			RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
				From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t }()),
				To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t }()),
			},
			Status: to.Ptr(armcostmanagement.StatusTypeActive),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 			Schedule: &armcostmanagement.ExportSchedule{
// 				Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 				RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 				},
// 				Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 			},
// 		},
// 	}
Output:

Example (ExportCreateOrUpdateByDepartment)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateByDepartment.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().CreateOrUpdate(ctx, "providers/Microsoft.Billing/billingAccounts/12/departments/1234", "TestExport", armcostmanagement.Export{
	Properties: &armcostmanagement.ExportProperties{
		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
		Definition: &armcostmanagement.ExportDefinition{
			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
			DataSet: &armcostmanagement.ExportDataset{
				Configuration: &armcostmanagement.ExportDatasetConfiguration{
					Columns: []*string{
						to.Ptr("Date"),
						to.Ptr("MeterId"),
						to.Ptr("ResourceId"),
						to.Ptr("ResourceLocation"),
						to.Ptr("Quantity")},
				},
				Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
			},
			Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
		},
		DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
			Destination: &armcostmanagement.ExportDeliveryDestination{
				Container:      to.Ptr("exports"),
				ResourceID:     to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
				RootFolderPath: to.Ptr("ad-hoc"),
			},
		},
		Schedule: &armcostmanagement.ExportSchedule{
			Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
			RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
				From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t }()),
				To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t }()),
			},
			Status: to.Ptr(armcostmanagement.StatusTypeActive),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 			Schedule: &armcostmanagement.ExportSchedule{
// 				Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 				RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 				},
// 				Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 			},
// 		},
// 	}
Output:

Example (ExportCreateOrUpdateByEnrollmentAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateByEnrollmentAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().CreateOrUpdate(ctx, "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", "TestExport", armcostmanagement.Export{
	Properties: &armcostmanagement.ExportProperties{
		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
		Definition: &armcostmanagement.ExportDefinition{
			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
			DataSet: &armcostmanagement.ExportDataset{
				Configuration: &armcostmanagement.ExportDatasetConfiguration{
					Columns: []*string{
						to.Ptr("Date"),
						to.Ptr("MeterId"),
						to.Ptr("ResourceId"),
						to.Ptr("ResourceLocation"),
						to.Ptr("Quantity")},
				},
				Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
			},
			Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
		},
		DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
			Destination: &armcostmanagement.ExportDeliveryDestination{
				Container:      to.Ptr("exports"),
				ResourceID:     to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
				RootFolderPath: to.Ptr("ad-hoc"),
			},
		},
		Schedule: &armcostmanagement.ExportSchedule{
			Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
			RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
				From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t }()),
				To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t }()),
			},
			Status: to.Ptr(armcostmanagement.StatusTypeActive),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 			Schedule: &armcostmanagement.ExportSchedule{
// 				Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 				RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 				},
// 				Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 			},
// 		},
// 	}
Output:

Example (ExportCreateOrUpdateByManagementGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateByManagementGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().CreateOrUpdate(ctx, "providers/Microsoft.Management/managementGroups/TestMG", "TestExport", armcostmanagement.Export{
	Properties: &armcostmanagement.ExportProperties{
		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
		Definition: &armcostmanagement.ExportDefinition{
			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
			DataSet: &armcostmanagement.ExportDataset{
				Configuration: &armcostmanagement.ExportDatasetConfiguration{
					Columns: []*string{
						to.Ptr("Date"),
						to.Ptr("MeterId"),
						to.Ptr("ResourceId"),
						to.Ptr("ResourceLocation"),
						to.Ptr("Quantity")},
				},
				Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
			},
			Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
		},
		DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
			Destination: &armcostmanagement.ExportDeliveryDestination{
				Container:      to.Ptr("exports"),
				ResourceID:     to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
				RootFolderPath: to.Ptr("ad-hoc"),
			},
		},
		Schedule: &armcostmanagement.ExportSchedule{
			Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
			RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
				From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t }()),
				To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t }()),
			},
			Status: to.Ptr(armcostmanagement.StatusTypeActive),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 			Schedule: &armcostmanagement.ExportSchedule{
// 				Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 				RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 				},
// 				Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 			},
// 		},
// 	}
Output:

Example (ExportCreateOrUpdateByResourceGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().CreateOrUpdate(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", "TestExport", armcostmanagement.Export{
	Properties: &armcostmanagement.ExportProperties{
		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
		Definition: &armcostmanagement.ExportDefinition{
			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
			DataSet: &armcostmanagement.ExportDataset{
				Configuration: &armcostmanagement.ExportDatasetConfiguration{
					Columns: []*string{
						to.Ptr("Date"),
						to.Ptr("MeterId"),
						to.Ptr("ResourceId"),
						to.Ptr("ResourceLocation"),
						to.Ptr("Quantity")},
				},
				Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
			},
			Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
		},
		DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
			Destination: &armcostmanagement.ExportDeliveryDestination{
				Container:      to.Ptr("exports"),
				ResourceID:     to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
				RootFolderPath: to.Ptr("ad-hoc"),
			},
		},
		Schedule: &armcostmanagement.ExportSchedule{
			Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
			RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
				From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t }()),
				To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t }()),
			},
			Status: to.Ptr(armcostmanagement.StatusTypeActive),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 			Schedule: &armcostmanagement.ExportSchedule{
// 				Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 				RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 				},
// 				Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 			},
// 		},
// 	}
Output:

Example (ExportCreateOrUpdateBySubscription)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportCreateOrUpdateBySubscription.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().CreateOrUpdate(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "TestExport", armcostmanagement.Export{
	Properties: &armcostmanagement.ExportProperties{
		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
		Definition: &armcostmanagement.ExportDefinition{
			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
			DataSet: &armcostmanagement.ExportDataset{
				Configuration: &armcostmanagement.ExportDatasetConfiguration{
					Columns: []*string{
						to.Ptr("Date"),
						to.Ptr("MeterId"),
						to.Ptr("ResourceId"),
						to.Ptr("ResourceLocation"),
						to.Ptr("Quantity")},
				},
				Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
			},
			Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
		},
		DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
			Destination: &armcostmanagement.ExportDeliveryDestination{
				Container:      to.Ptr("exports"),
				ResourceID:     to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
				RootFolderPath: to.Ptr("ad-hoc"),
			},
		},
		Schedule: &armcostmanagement.ExportSchedule{
			Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
			RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
				From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t }()),
				To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t }()),
			},
			Status: to.Ptr(armcostmanagement.StatusTypeActive),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 			Schedule: &armcostmanagement.ExportSchedule{
// 				Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 				RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 				},
// 				Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 			},
// 		},
// 	}
Output:

func (*ExportsClient) Delete

func (client *ExportsClient) Delete(ctx context.Context, scope string, exportName string, options *ExportsClientDeleteOptions) (ExportsClientDeleteResponse, error)

Delete - The operation to delete a export. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • exportName - Export Name.
  • options - ExportsClientDeleteOptions contains the optional parameters for the ExportsClient.Delete method.
Example (ExportDeleteByBillingAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteByBillingAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Delete(ctx, "providers/Microsoft.Billing/billingAccounts/123456", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

Example (ExportDeleteByDepartment)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteByDepartment.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Delete(ctx, "providers/Microsoft.Billing/billingAccounts/12/departments/1234", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

Example (ExportDeleteByEnrollmentAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteByEnrollmentAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Delete(ctx, "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

Example (ExportDeleteByManagementGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteByManagementGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Delete(ctx, "providers/Microsoft.Management/managementGroups/TestMG", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

Example (ExportDeleteByResourceGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Delete(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

Example (ExportDeleteBySubscription)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportDeleteBySubscription.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Delete(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

func (*ExportsClient) Execute

func (client *ExportsClient) Execute(ctx context.Context, scope string, exportName string, options *ExportsClientExecuteOptions) (ExportsClientExecuteResponse, error)

Execute - The operation to run an export. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • exportName - Export Name.
  • options - ExportsClientExecuteOptions contains the optional parameters for the ExportsClient.Execute method.
Example (ExportRunByBillingAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunByBillingAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Execute(ctx, "providers/Microsoft.Billing/billingAccounts/123456", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

Example (ExportRunByDepartment)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunByDepartment.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Execute(ctx, "providers/Microsoft.Billing/billingAccounts/12/departments/1234", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

Example (ExportRunByEnrollmentAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunByEnrollmentAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Execute(ctx, "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

Example (ExportRunByManagementGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunByManagementGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Execute(ctx, "providers/Microsoft.Management/managementGroups/TestMG", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

Example (ExportRunByResourceGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Execute(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

Example (ExportRunBySubscription)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunBySubscription.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewExportsClient().Execute(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

func (*ExportsClient) Get

func (client *ExportsClient) Get(ctx context.Context, scope string, exportName string, options *ExportsClientGetOptions) (ExportsClientGetResponse, error)

Get - The operation to get the export for the defined scope by export name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • exportName - Export Name.
  • options - ExportsClientGetOptions contains the optional parameters for the ExportsClient.Get method.
Example (ExportGetByBillingAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetByBillingAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().Get(ctx, "providers/Microsoft.Billing/billingAccounts/123456", "TestExport", &armcostmanagement.ExportsClientGetOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccount-Id}/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				TimePeriod: &armcostmanagement.ExportTimePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-31T00:00:00.000Z"); return t}()),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 		},
// 	}
Output:

Example (ExportGetByDepartment)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetByDepartment.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().Get(ctx, "providers/Microsoft.Billing/billingAccounts/12/departments/1234", "TestExport", &armcostmanagement.ExportsClientGetOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				TimePeriod: &armcostmanagement.ExportTimePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-30T00:00:00.000Z"); return t}()),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 		},
// 	}
Output:

Example (ExportGetByEnrollmentAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetByEnrollmentAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().Get(ctx, "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", "TestExport", &armcostmanagement.ExportsClientGetOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				TimePeriod: &armcostmanagement.ExportTimePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-31T00:00:00.000Z"); return t}()),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 		},
// 	}
Output:

Example (ExportGetByManagementGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetByManagementGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().Get(ctx, "providers/Microsoft.Management/managementGroups/TestMG", "TestExport", &armcostmanagement.ExportsClientGetOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("UsageDate"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("InstanceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("UsageQuantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				TimePeriod: &armcostmanagement.ExportTimePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 		},
// 	}
Output:

Example (ExportGetByResourceGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().Get(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", "TestExport", &armcostmanagement.ExportsClientGetOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				TimePeriod: &armcostmanagement.ExportTimePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-30T00:00:00.000Z"); return t}()),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 		},
// 	}
Output:

Example (ExportGetBySubscription)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportGetBySubscription.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().Get(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "TestExport", &armcostmanagement.ExportsClientGetOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Export = armcostmanagement.Export{
// 	Name: to.Ptr("TestExport"),
// 	Type: to.Ptr("Microsoft.CostManagement/exports"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/TestExport"),
// 	Properties: &armcostmanagement.ExportProperties{
// 		Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 		Definition: &armcostmanagement.ExportDefinition{
// 			Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 			DataSet: &armcostmanagement.ExportDataset{
// 				Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 					Columns: []*string{
// 						to.Ptr("Date"),
// 						to.Ptr("MeterId"),
// 						to.Ptr("ResourceId"),
// 						to.Ptr("ResourceLocation"),
// 						to.Ptr("Quantity")},
// 					},
// 					Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 				},
// 				TimePeriod: &armcostmanagement.ExportTimePeriod{
// 					From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-01T00:00:00.000Z"); return t}()),
// 					To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T00:00:00.000Z"); return t}()),
// 				},
// 				Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 			},
// 			DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 				Destination: &armcostmanagement.ExportDeliveryDestination{
// 					Container: to.Ptr("exports"),
// 					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 					RootFolderPath: to.Ptr("ad-hoc"),
// 				},
// 			},
// 		},
// 	}
Output:

func (*ExportsClient) GetExecutionHistory

GetExecutionHistory - The operation to get the run history of an export for the defined scope and export name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • exportName - Export Name.
  • options - ExportsClientGetExecutionHistoryOptions contains the optional parameters for the ExportsClient.GetExecutionHistory method.
Example (ExportRunHistoryGetByBillingAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetByBillingAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().GetExecutionHistory(ctx, "providers/Microsoft.Billing/billingAccounts/123456", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportExecutionListResult = armcostmanagement.ExportExecutionListResult{
// 	Value: []*armcostmanagement.ExportRun{
// 		{
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccount-id}/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100"),
// 			Properties: &armcostmanagement.ExportRunProperties{
// 				ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeOnDemand),
// 				FileName: to.Ptr("ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv"),
// 				ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:28.037Z"); return t}()),
// 				ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:16.912Z"); return t}()),
// 				RunSettings: &armcostmanagement.CommonExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							TimePeriod: &armcostmanagement.ExportTimePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 							},
// 						},
// 					},
// 					Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 					SubmittedBy: to.Ptr("john.doe@gmail.com"),
// 					SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:15.601Z"); return t}()),
// 				},
// 			},
// 			{
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccount-id}/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef"),
// 				Properties: &armcostmanagement.ExportRunProperties{
// 					ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeScheduled),
// 					FileName: to.Ptr("ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv"),
// 					ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:04:19.722Z"); return t}()),
// 					ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					RunSettings: &armcostmanagement.CommonExportProperties{
// 						Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 						Definition: &armcostmanagement.ExportDefinition{
// 							Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 							DataSet: &armcostmanagement.ExportDataset{
// 								Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 									Columns: []*string{
// 										to.Ptr("Date"),
// 										to.Ptr("MeterId"),
// 										to.Ptr("ResourceId"),
// 										to.Ptr("ResourceLocation"),
// 										to.Ptr("Quantity")},
// 									},
// 									Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 								},
// 								TimePeriod: &armcostmanagement.ExportTimePeriod{
// 									From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 									To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 								},
// 								Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 							},
// 							DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 								Destination: &armcostmanagement.ExportDeliveryDestination{
// 									Container: to.Ptr("exports"),
// 									ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 									RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 								},
// 							},
// 						},
// 						Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 						SubmittedBy: to.Ptr("System"),
// 						SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					},
// 			}},
// 		}
Output:

Example (ExportRunHistoryGetByDepartment)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetByDepartment.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().GetExecutionHistory(ctx, "providers/Microsoft.Billing/billingAccounts/12/departments/1234", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportExecutionListResult = armcostmanagement.ExportExecutionListResult{
// 	Value: []*armcostmanagement.ExportRun{
// 		{
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100"),
// 			Properties: &armcostmanagement.ExportRunProperties{
// 				ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeOnDemand),
// 				FileName: to.Ptr("ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv"),
// 				ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:28.037Z"); return t}()),
// 				ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:16.912Z"); return t}()),
// 				RunSettings: &armcostmanagement.CommonExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							TimePeriod: &armcostmanagement.ExportTimePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 							},
// 						},
// 					},
// 					Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 					SubmittedBy: to.Ptr("john.doe@gmail.com"),
// 					SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:15.601Z"); return t}()),
// 				},
// 			},
// 			{
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef"),
// 				Properties: &armcostmanagement.ExportRunProperties{
// 					ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeScheduled),
// 					FileName: to.Ptr("ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv"),
// 					ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:04:19.722Z"); return t}()),
// 					ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					RunSettings: &armcostmanagement.CommonExportProperties{
// 						Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 						Definition: &armcostmanagement.ExportDefinition{
// 							Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 							DataSet: &armcostmanagement.ExportDataset{
// 								Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 									Columns: []*string{
// 										to.Ptr("Date"),
// 										to.Ptr("MeterId"),
// 										to.Ptr("ResourceId"),
// 										to.Ptr("ResourceLocation"),
// 										to.Ptr("Quantity")},
// 									},
// 									Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 								},
// 								TimePeriod: &armcostmanagement.ExportTimePeriod{
// 									From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 									To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 								},
// 								Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 							},
// 							DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 								Destination: &armcostmanagement.ExportDeliveryDestination{
// 									Container: to.Ptr("exports"),
// 									ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 									RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 								},
// 							},
// 						},
// 						Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 						SubmittedBy: to.Ptr("System"),
// 						SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					},
// 			}},
// 		}
Output:

Example (ExportRunHistoryGetByEnrollmentAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetByEnrollmentAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().GetExecutionHistory(ctx, "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportExecutionListResult = armcostmanagement.ExportExecutionListResult{
// 	Value: []*armcostmanagement.ExportRun{
// 		{
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100"),
// 			Properties: &armcostmanagement.ExportRunProperties{
// 				ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeOnDemand),
// 				FileName: to.Ptr("ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv"),
// 				ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:28.037Z"); return t}()),
// 				ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:16.912Z"); return t}()),
// 				RunSettings: &armcostmanagement.CommonExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							TimePeriod: &armcostmanagement.ExportTimePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 							},
// 						},
// 					},
// 					Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 					SubmittedBy: to.Ptr("john.doe@gmail.com"),
// 					SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:15.601Z"); return t}()),
// 				},
// 			},
// 			{
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef"),
// 				Properties: &armcostmanagement.ExportRunProperties{
// 					ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeScheduled),
// 					FileName: to.Ptr("ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv"),
// 					ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:04:19.722Z"); return t}()),
// 					ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					RunSettings: &armcostmanagement.CommonExportProperties{
// 						Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 						Definition: &armcostmanagement.ExportDefinition{
// 							Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 							DataSet: &armcostmanagement.ExportDataset{
// 								Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 									Columns: []*string{
// 										to.Ptr("Date"),
// 										to.Ptr("MeterId"),
// 										to.Ptr("ResourceId"),
// 										to.Ptr("ResourceLocation"),
// 										to.Ptr("Quantity")},
// 									},
// 									Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 								},
// 								TimePeriod: &armcostmanagement.ExportTimePeriod{
// 									From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 									To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 								},
// 								Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 							},
// 							DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 								Destination: &armcostmanagement.ExportDeliveryDestination{
// 									Container: to.Ptr("exports"),
// 									ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 									RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 								},
// 							},
// 						},
// 						Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 						SubmittedBy: to.Ptr("System"),
// 						SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					},
// 			}},
// 		}
Output:

Example (ExportRunHistoryGetByManagementGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetByManagementGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().GetExecutionHistory(ctx, "providers/Microsoft.Management/managementGroups/TestMG", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportExecutionListResult = armcostmanagement.ExportExecutionListResult{
// 	Value: []*armcostmanagement.ExportRun{
// 		{
// 			ID: to.Ptr("providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100"),
// 			Properties: &armcostmanagement.ExportRunProperties{
// 				ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeOnDemand),
// 				FileName: to.Ptr("ScheduledForTestExport/TestExportSchedule/20180729-20180804/TestExportSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv"),
// 				ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:28.037Z"); return t}()),
// 				ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:16.912Z"); return t}()),
// 				RunSettings: &armcostmanagement.CommonExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							TimePeriod: &armcostmanagement.ExportTimePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 							},
// 						},
// 					},
// 					Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 					SubmittedBy: to.Ptr("john.doe@gmail.com"),
// 					SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:15.601Z"); return t}()),
// 				},
// 			},
// 			{
// 				ID: to.Ptr("providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef"),
// 				Properties: &armcostmanagement.ExportRunProperties{
// 					ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeScheduled),
// 					FileName: to.Ptr("ScheduledForTestExport/TestExportSchedule/20180729-20180804/TestExportSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv"),
// 					ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:04:19.722Z"); return t}()),
// 					ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					RunSettings: &armcostmanagement.CommonExportProperties{
// 						Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 						Definition: &armcostmanagement.ExportDefinition{
// 							Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 							DataSet: &armcostmanagement.ExportDataset{
// 								Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 									Columns: []*string{
// 										to.Ptr("Date"),
// 										to.Ptr("MeterId"),
// 										to.Ptr("ResourceId"),
// 										to.Ptr("ResourceLocation"),
// 										to.Ptr("Quantity")},
// 									},
// 									Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 								},
// 								TimePeriod: &armcostmanagement.ExportTimePeriod{
// 									From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 									To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 								},
// 								Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 							},
// 							DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 								Destination: &armcostmanagement.ExportDeliveryDestination{
// 									Container: to.Ptr("exports"),
// 									ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 									RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 								},
// 							},
// 						},
// 						Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 						SubmittedBy: to.Ptr("System"),
// 						SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					},
// 			}},
// 		}
Output:

Example (ExportRunHistoryGetByResourceGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().GetExecutionHistory(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportExecutionListResult = armcostmanagement.ExportExecutionListResult{
// 	Value: []*armcostmanagement.ExportRun{
// 		{
// 			ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100"),
// 			Properties: &armcostmanagement.ExportRunProperties{
// 				ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeOnDemand),
// 				FileName: to.Ptr("ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv"),
// 				ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:28.037Z"); return t}()),
// 				ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:16.912Z"); return t}()),
// 				RunSettings: &armcostmanagement.CommonExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							TimePeriod: &armcostmanagement.ExportTimePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 							},
// 						},
// 					},
// 					Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 					SubmittedBy: to.Ptr("john.doe@gmail.com"),
// 					SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:15.601Z"); return t}()),
// 				},
// 			},
// 			{
// 				ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef"),
// 				Properties: &armcostmanagement.ExportRunProperties{
// 					ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeScheduled),
// 					FileName: to.Ptr("ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv"),
// 					ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:04:19.722Z"); return t}()),
// 					ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					RunSettings: &armcostmanagement.CommonExportProperties{
// 						Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 						Definition: &armcostmanagement.ExportDefinition{
// 							Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 							DataSet: &armcostmanagement.ExportDataset{
// 								Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 									Columns: []*string{
// 										to.Ptr("Date"),
// 										to.Ptr("MeterId"),
// 										to.Ptr("ResourceId"),
// 										to.Ptr("ResourceLocation"),
// 										to.Ptr("Quantity")},
// 									},
// 									Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 								},
// 								TimePeriod: &armcostmanagement.ExportTimePeriod{
// 									From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 									To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 								},
// 								Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 							},
// 							DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 								Destination: &armcostmanagement.ExportDeliveryDestination{
// 									Container: to.Ptr("exports"),
// 									ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 									RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 								},
// 							},
// 						},
// 						Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 						SubmittedBy: to.Ptr("System"),
// 						SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					},
// 			}},
// 		}
Output:

Example (ExportRunHistoryGetBySubscription)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportRunHistoryGetBySubscription.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().GetExecutionHistory(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "TestExport", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportExecutionListResult = armcostmanagement.ExportExecutionListResult{
// 	Value: []*armcostmanagement.ExportRun{
// 		{
// 			ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100"),
// 			Properties: &armcostmanagement.ExportRunProperties{
// 				ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeOnDemand),
// 				FileName: to.Ptr("ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv"),
// 				ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:28.037Z"); return t}()),
// 				ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:16.912Z"); return t}()),
// 				RunSettings: &armcostmanagement.CommonExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							TimePeriod: &armcostmanagement.ExportTimePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 							},
// 						},
// 					},
// 					Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 					SubmittedBy: to.Ptr("john.doe@gmail.com"),
// 					SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T07:52:15.601Z"); return t}()),
// 				},
// 			},
// 			{
// 				ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef"),
// 				Properties: &armcostmanagement.ExportRunProperties{
// 					ExecutionType: to.Ptr(armcostmanagement.ExecutionTypeScheduled),
// 					FileName: to.Ptr("ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv"),
// 					ProcessingEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:04:19.722Z"); return t}()),
// 					ProcessingStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					RunSettings: &armcostmanagement.CommonExportProperties{
// 						Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 						Definition: &armcostmanagement.ExportDefinition{
// 							Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 							DataSet: &armcostmanagement.ExportDataset{
// 								Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 									Columns: []*string{
// 										to.Ptr("Date"),
// 										to.Ptr("MeterId"),
// 										to.Ptr("ResourceId"),
// 										to.Ptr("ResourceLocation"),
// 										to.Ptr("Quantity")},
// 									},
// 									Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 								},
// 								TimePeriod: &armcostmanagement.ExportTimePeriod{
// 									From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 									To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 								},
// 								Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 							},
// 							DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 								Destination: &armcostmanagement.ExportDeliveryDestination{
// 									Container: to.Ptr("exports"),
// 									ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 									RootFolderPath: to.Ptr("ScheduledTestsForJohnDoe"),
// 								},
// 							},
// 						},
// 						Status: to.Ptr(armcostmanagement.ExecutionStatusCompleted),
// 						SubmittedBy: to.Ptr("System"),
// 						SubmittedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-03T09:03:58.571Z"); return t}()),
// 					},
// 			}},
// 		}
Output:

func (*ExportsClient) List

List - The operation to list all exports at the given scope. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • options - ExportsClientListOptions contains the optional parameters for the ExportsClient.List method.
Example (ExportsGetByBillingAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetByBillingAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/123456", &armcostmanagement.ExportsClientListOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportListResult = armcostmanagement.ExportListResult{
// 	Value: []*armcostmanagement.Export{
// 		{
// 			Name: to.Ptr("TestExport1"),
// 			Type: to.Ptr("Microsoft.CostManagement/exports"),
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport1"),
// 			Properties: &armcostmanagement.ExportProperties{
// 				Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 				Definition: &armcostmanagement.ExportDefinition{
// 					Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 					DataSet: &armcostmanagement.ExportDataset{
// 						Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 							Columns: []*string{
// 								to.Ptr("Date"),
// 								to.Ptr("MeterId"),
// 								to.Ptr("ResourceId"),
// 								to.Ptr("ResourceLocation"),
// 								to.Ptr("Quantity")},
// 							},
// 							Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 						},
// 						TimePeriod: &armcostmanagement.ExportTimePeriod{
// 							From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 							To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 						},
// 						Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 					},
// 					DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 						Destination: &armcostmanagement.ExportDeliveryDestination{
// 							Container: to.Ptr("exports"),
// 							ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 							RootFolderPath: to.Ptr("ad-hoc"),
// 						},
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("TestExport2"),
// 				Type: to.Ptr("Microsoft.CostManagement/exports"),
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport2"),
// 				Properties: &armcostmanagement.ExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeWeekToDate),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ad-hoc"),
// 							},
// 						},
// 						Schedule: &armcostmanagement.ExportSchedule{
// 							Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 							RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (ExportsGetByDepartment)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetByDepartment.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/12/departments/123", &armcostmanagement.ExportsClientListOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportListResult = armcostmanagement.ExportListResult{
// 	Value: []*armcostmanagement.Export{
// 		{
// 			Name: to.Ptr("TestExport1"),
// 			Type: to.Ptr("Microsoft.CostManagement/exports"),
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport1"),
// 			Properties: &armcostmanagement.ExportProperties{
// 				Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 				Definition: &armcostmanagement.ExportDefinition{
// 					Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 					DataSet: &armcostmanagement.ExportDataset{
// 						Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 							Columns: []*string{
// 								to.Ptr("Date"),
// 								to.Ptr("MeterId"),
// 								to.Ptr("ResourceId"),
// 								to.Ptr("ResourceLocation"),
// 								to.Ptr("Quantity")},
// 							},
// 							Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 						},
// 						TimePeriod: &armcostmanagement.ExportTimePeriod{
// 							From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 							To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 						},
// 						Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 					},
// 					DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 						Destination: &armcostmanagement.ExportDeliveryDestination{
// 							Container: to.Ptr("exports"),
// 							ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 							RootFolderPath: to.Ptr("ad-hoc"),
// 						},
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("TestExport2"),
// 				Type: to.Ptr("Microsoft.CostManagement/exports"),
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport2"),
// 				Properties: &armcostmanagement.ExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeWeekToDate),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ad-hoc"),
// 							},
// 						},
// 						Schedule: &armcostmanagement.ExportSchedule{
// 							Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 							RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (ExportsGetByEnrollmentAccount)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetByEnrollmentAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().List(ctx, "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", &armcostmanagement.ExportsClientListOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportListResult = armcostmanagement.ExportListResult{
// 	Value: []*armcostmanagement.Export{
// 		{
// 			Name: to.Ptr("TestExport1"),
// 			Type: to.Ptr("Microsoft.CostManagement/exports"),
// 			ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport1"),
// 			Properties: &armcostmanagement.ExportProperties{
// 				Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 				Definition: &armcostmanagement.ExportDefinition{
// 					Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 					DataSet: &armcostmanagement.ExportDataset{
// 						Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 							Columns: []*string{
// 								to.Ptr("Date"),
// 								to.Ptr("MeterId"),
// 								to.Ptr("ResourceId"),
// 								to.Ptr("ResourceLocation"),
// 								to.Ptr("Quantity")},
// 							},
// 							Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 						},
// 						TimePeriod: &armcostmanagement.ExportTimePeriod{
// 							From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 							To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 						},
// 						Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 					},
// 					DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 						Destination: &armcostmanagement.ExportDeliveryDestination{
// 							Container: to.Ptr("exports"),
// 							ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 							RootFolderPath: to.Ptr("ad-hoc"),
// 						},
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("TestExport2"),
// 				Type: to.Ptr("Microsoft.CostManagement/exports"),
// 				ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport2"),
// 				Properties: &armcostmanagement.ExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeWeekToDate),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ad-hoc"),
// 							},
// 						},
// 						Schedule: &armcostmanagement.ExportSchedule{
// 							Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 							RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (ExportsGetByManagementGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetByManagementGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().List(ctx, "providers/Microsoft.Management/managementGroups/TestMG", &armcostmanagement.ExportsClientListOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportListResult = armcostmanagement.ExportListResult{
// 	Value: []*armcostmanagement.Export{
// 		{
// 			Name: to.Ptr("TestExport1"),
// 			Type: to.Ptr("Microsoft.CostManagement/exports"),
// 			ID: to.Ptr("providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport1"),
// 			Properties: &armcostmanagement.ExportProperties{
// 				Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 				Definition: &armcostmanagement.ExportDefinition{
// 					Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 					DataSet: &armcostmanagement.ExportDataset{
// 						Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 							Columns: []*string{
// 								to.Ptr("Date"),
// 								to.Ptr("MeterId"),
// 								to.Ptr("ResourceId"),
// 								to.Ptr("ResourceLocation"),
// 								to.Ptr("Quantity")},
// 							},
// 							Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 						},
// 						TimePeriod: &armcostmanagement.ExportTimePeriod{
// 							From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 							To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 						},
// 						Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 					},
// 					DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 						Destination: &armcostmanagement.ExportDeliveryDestination{
// 							Container: to.Ptr("exports"),
// 							ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 							RootFolderPath: to.Ptr("ad-hoc"),
// 						},
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("TestExport2"),
// 				Type: to.Ptr("Microsoft.CostManagement/exports"),
// 				ID: to.Ptr("providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport2"),
// 				Properties: &armcostmanagement.ExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeWeekToDate),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ad-hoc"),
// 							},
// 						},
// 						Schedule: &armcostmanagement.ExportSchedule{
// 							Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 							RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (ExportsGetByResourceGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().List(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", &armcostmanagement.ExportsClientListOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportListResult = armcostmanagement.ExportListResult{
// 	Value: []*armcostmanagement.Export{
// 		{
// 			Name: to.Ptr("TestExport1"),
// 			Type: to.Ptr("Microsoft.CostManagement/exports"),
// 			ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport1"),
// 			Properties: &armcostmanagement.ExportProperties{
// 				Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 				Definition: &armcostmanagement.ExportDefinition{
// 					Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 					DataSet: &armcostmanagement.ExportDataset{
// 						Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 							Columns: []*string{
// 								to.Ptr("Date"),
// 								to.Ptr("MeterId"),
// 								to.Ptr("ResourceId"),
// 								to.Ptr("ResourceLocation"),
// 								to.Ptr("Quantity")},
// 							},
// 							Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 						},
// 						TimePeriod: &armcostmanagement.ExportTimePeriod{
// 							From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 							To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 						},
// 						Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 					},
// 					DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 						Destination: &armcostmanagement.ExportDeliveryDestination{
// 							Container: to.Ptr("exports"),
// 							ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 							RootFolderPath: to.Ptr("ad-hoc"),
// 						},
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("TestExport2"),
// 				Type: to.Ptr("Microsoft.CostManagement/exports"),
// 				ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport2"),
// 				Properties: &armcostmanagement.ExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeWeekToDate),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ad-hoc"),
// 							},
// 						},
// 						Schedule: &armcostmanagement.ExportSchedule{
// 							Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 							RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 						},
// 					},
// 			}},
// 		}
Output:

Example (ExportsGetBySubscription)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExportsGetBySubscription.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExportsClient().List(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", &armcostmanagement.ExportsClientListOptions{Expand: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ExportListResult = armcostmanagement.ExportListResult{
// 	Value: []*armcostmanagement.Export{
// 		{
// 			Name: to.Ptr("TestExport1"),
// 			Type: to.Ptr("Microsoft.CostManagement/exports"),
// 			ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/TestExport1"),
// 			Properties: &armcostmanagement.ExportProperties{
// 				Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 				Definition: &armcostmanagement.ExportDefinition{
// 					Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 					DataSet: &armcostmanagement.ExportDataset{
// 						Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 							Columns: []*string{
// 								to.Ptr("Date"),
// 								to.Ptr("MeterId"),
// 								to.Ptr("ResourceId"),
// 								to.Ptr("ResourceLocation"),
// 								to.Ptr("Quantity")},
// 							},
// 							Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 						},
// 						TimePeriod: &armcostmanagement.ExportTimePeriod{
// 							From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 							To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 						},
// 						Timeframe: to.Ptr(armcostmanagement.TimeframeTypeCustom),
// 					},
// 					DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 						Destination: &armcostmanagement.ExportDeliveryDestination{
// 							Container: to.Ptr("exports"),
// 							ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 							RootFolderPath: to.Ptr("ad-hoc"),
// 						},
// 					},
// 				},
// 			},
// 			{
// 				Name: to.Ptr("TestExport2"),
// 				Type: to.Ptr("Microsoft.CostManagement/exports"),
// 				ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/TestExport2"),
// 				Properties: &armcostmanagement.ExportProperties{
// 					Format: to.Ptr(armcostmanagement.FormatTypeCSV),
// 					Definition: &armcostmanagement.ExportDefinition{
// 						Type: to.Ptr(armcostmanagement.ExportTypeActualCost),
// 						DataSet: &armcostmanagement.ExportDataset{
// 							Configuration: &armcostmanagement.ExportDatasetConfiguration{
// 								Columns: []*string{
// 									to.Ptr("Date"),
// 									to.Ptr("MeterId"),
// 									to.Ptr("ResourceId"),
// 									to.Ptr("ResourceLocation"),
// 									to.Ptr("Quantity")},
// 								},
// 								Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
// 							},
// 							Timeframe: to.Ptr(armcostmanagement.TimeframeTypeWeekToDate),
// 						},
// 						DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{
// 							Destination: &armcostmanagement.ExportDeliveryDestination{
// 								Container: to.Ptr("exports"),
// 								ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182"),
// 								RootFolderPath: to.Ptr("ad-hoc"),
// 							},
// 						},
// 						Schedule: &armcostmanagement.ExportSchedule{
// 							Recurrence: to.Ptr(armcostmanagement.RecurrenceTypeWeekly),
// 							RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{
// 								From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00.000Z"); return t}()),
// 								To: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00.000Z"); return t}()),
// 							},
// 							Status: to.Ptr(armcostmanagement.StatusTypeActive),
// 						},
// 					},
// 			}},
// 		}
Output:

type ExportsClientCreateOrUpdateOptions

type ExportsClientCreateOrUpdateOptions struct {
}

ExportsClientCreateOrUpdateOptions contains the optional parameters for the ExportsClient.CreateOrUpdate method.

type ExportsClientCreateOrUpdateResponse

type ExportsClientCreateOrUpdateResponse struct {
	// An export resource.
	Export
}

ExportsClientCreateOrUpdateResponse contains the response from method ExportsClient.CreateOrUpdate.

type ExportsClientDeleteOptions

type ExportsClientDeleteOptions struct {
}

ExportsClientDeleteOptions contains the optional parameters for the ExportsClient.Delete method.

type ExportsClientDeleteResponse

type ExportsClientDeleteResponse struct {
}

ExportsClientDeleteResponse contains the response from method ExportsClient.Delete.

type ExportsClientExecuteOptions

type ExportsClientExecuteOptions struct {
}

ExportsClientExecuteOptions contains the optional parameters for the ExportsClient.Execute method.

type ExportsClientExecuteResponse

type ExportsClientExecuteResponse struct {
}

ExportsClientExecuteResponse contains the response from method ExportsClient.Execute.

type ExportsClientGetExecutionHistoryOptions

type ExportsClientGetExecutionHistoryOptions struct {
}

ExportsClientGetExecutionHistoryOptions contains the optional parameters for the ExportsClient.GetExecutionHistory method.

type ExportsClientGetExecutionHistoryResponse

type ExportsClientGetExecutionHistoryResponse struct {
	// Result of listing the run history of an export.
	ExportExecutionListResult
}

ExportsClientGetExecutionHistoryResponse contains the response from method ExportsClient.GetExecutionHistory.

type ExportsClientGetOptions

type ExportsClientGetOptions struct {
	// May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information
	// for the last 10 runs of the export.
	Expand *string
}

ExportsClientGetOptions contains the optional parameters for the ExportsClient.Get method.

type ExportsClientGetResponse

type ExportsClientGetResponse struct {
	// An export resource.
	Export
}

ExportsClientGetResponse contains the response from method ExportsClient.Get.

type ExportsClientListOptions

type ExportsClientListOptions struct {
	// May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information
	// for the last run of each export.
	Expand *string
}

ExportsClientListOptions contains the optional parameters for the ExportsClient.List method.

type ExportsClientListResponse

type ExportsClientListResponse struct {
	// Result of listing exports. It contains a list of available exports in the scope provided.
	ExportListResult
}

ExportsClientListResponse contains the response from method ExportsClient.List.

type ExternalCloudProviderType

type ExternalCloudProviderType string
const (
	ExternalCloudProviderTypeExternalBillingAccounts ExternalCloudProviderType = "externalBillingAccounts"
	ExternalCloudProviderTypeExternalSubscriptions   ExternalCloudProviderType = "externalSubscriptions"
)

func PossibleExternalCloudProviderTypeValues

func PossibleExternalCloudProviderTypeValues() []ExternalCloudProviderType

PossibleExternalCloudProviderTypeValues returns the possible values for the ExternalCloudProviderType const type.

type FileDestination

type FileDestination struct {
	// Destination of the view data. Currently only CSV format is supported.
	FileFormats []*FileFormat
}

FileDestination - Destination of the view data. This is optional. Currently only CSV format is supported.

func (FileDestination) MarshalJSON

func (f FileDestination) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FileDestination.

func (*FileDestination) UnmarshalJSON

func (f *FileDestination) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FileDestination.

type FileFormat

type FileFormat string

FileFormat - Destination of the view data. Currently only CSV format is supported.

const (
	FileFormatCSV FileFormat = "Csv"
)

func PossibleFileFormatValues

func PossibleFileFormatValues() []FileFormat

PossibleFileFormatValues returns the possible values for the FileFormat const type.

type ForecastAggregation

type ForecastAggregation struct {
	// REQUIRED; The name of the aggregation function to use.
	Function *FunctionType

	// REQUIRED; The name of the column to aggregate.
	Name *FunctionName
}

ForecastAggregation - The aggregation expression to be used in the forecast.

func (ForecastAggregation) MarshalJSON

func (f ForecastAggregation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForecastAggregation.

func (*ForecastAggregation) UnmarshalJSON

func (f *ForecastAggregation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForecastAggregation.

type ForecastClient

type ForecastClient struct {
	// contains filtered or unexported fields
}

ForecastClient contains the methods for the Forecast group. Don't use this type directly, use NewForecastClient() instead.

func NewForecastClient

func NewForecastClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ForecastClient, error)

NewForecastClient creates a new instance of ForecastClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ForecastClient) ExternalCloudProviderUsage

func (client *ForecastClient) ExternalCloudProviderUsage(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, parameters ForecastDefinition, options *ForecastClientExternalCloudProviderUsageOptions) (ForecastClientExternalCloudProviderUsageResponse, error)

ExternalCloudProviderUsage - Lists the forecast charges for external cloud provider type defined. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • externalCloudProviderType - The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.
  • externalCloudProviderID - This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.
  • parameters - Parameters supplied to the CreateOrUpdate Forecast Config operation.
  • options - ForecastClientExternalCloudProviderUsageOptions contains the optional parameters for the ForecastClient.ExternalCloudProviderUsage method.
Example (ExternalBillingAccountForecast)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalBillingAccountForecast.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewForecastClient().ExternalCloudProviderUsage(ctx, armcostmanagement.ExternalCloudProviderTypeExternalBillingAccounts, "100", armcostmanagement.ForecastDefinition{
	Type: to.Ptr(armcostmanagement.ForecastTypeUsage),
	Dataset: &armcostmanagement.ForecastDataset{
		Aggregation: map[string]*armcostmanagement.ForecastAggregation{
			"totalCost": {
				Name:     to.Ptr(armcostmanagement.FunctionNameCost),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Filter: &armcostmanagement.ForecastFilter{
			And: []*armcostmanagement.ForecastFilter{
				{
					Or: []*armcostmanagement.ForecastFilter{
						{
							Dimensions: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.ForecastComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	TimePeriod: &armcostmanagement.ForecastTimePeriod{
		From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-01T00:00:00.000Z"); return t }()),
		To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-31T23:59:59.000Z"); return t }()),
	},
	Timeframe: to.Ptr(armcostmanagement.ForecastTimeframeCustom),
}, &armcostmanagement.ForecastClientExternalCloudProviderUsageOptions{Filter: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ForecastResult = armcostmanagement.ForecastResult{
// 	Name: to.Ptr("6dc7b06a-d90a-4df5-b655-ce6cf1c0814d"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("providers/Microsoft.CostManagement/externalBillingAccounts/100/query/6dc7b06a-d90a-4df5-b655-ce6cf1c0814d"),
// 	Properties: &armcostmanagement.ForecastProperties{
// 		Columns: []*armcostmanagement.ForecastColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("CostStatus"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(0),
// 				"Forecast",
// 				"USD"},
// 				[]any{
// 					float64(30.2572751438),
// 					"Forecast",
// 					"USD"},
// 					[]any{
// 						float64(0.07675760200000002),
// 						"Forecast",
// 						"USD"},
// 						[]any{
// 							float64(50.43096419040001),
// 							"Forecast",
// 							"USD"}},
// 						},
// 					}
Output:

Example (ExternalSubscriptionForecast)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalSubscriptionForecast.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewForecastClient().ExternalCloudProviderUsage(ctx, armcostmanagement.ExternalCloudProviderTypeExternalSubscriptions, "100", armcostmanagement.ForecastDefinition{
	Type: to.Ptr(armcostmanagement.ForecastTypeUsage),
	Dataset: &armcostmanagement.ForecastDataset{
		Aggregation: map[string]*armcostmanagement.ForecastAggregation{
			"totalCost": {
				Name:     to.Ptr(armcostmanagement.FunctionNameCost),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Filter: &armcostmanagement.ForecastFilter{
			And: []*armcostmanagement.ForecastFilter{
				{
					Or: []*armcostmanagement.ForecastFilter{
						{
							Dimensions: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.ForecastComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	TimePeriod: &armcostmanagement.ForecastTimePeriod{
		From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-01T00:00:00.000Z"); return t }()),
		To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-31T23:59:59.000Z"); return t }()),
	},
	Timeframe: to.Ptr(armcostmanagement.ForecastTimeframeCustom),
}, &armcostmanagement.ForecastClientExternalCloudProviderUsageOptions{Filter: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ForecastResult = armcostmanagement.ForecastResult{
// 	Name: to.Ptr("d99477af-7510-40ee-aca2-e59bdca0d10d"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("providers/Microsoft.CostManagement/externalSubscriptions/100/query/d99477af-7510-40ee-aca2-e59bdca0d10d"),
// 	Properties: &armcostmanagement.ForecastProperties{
// 		Columns: []*armcostmanagement.ForecastColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("CostStatus"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 		},
// 	},
// }
Output:

func (*ForecastClient) Usage

Usage - Lists the forecast charges for scope defined. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • parameters - Parameters supplied to the CreateOrUpdate Forecast Config operation.
  • options - ForecastClientUsageOptions contains the optional parameters for the ForecastClient.Usage method.
Example (BillingAccountForecast)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountForecast.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewForecastClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789", armcostmanagement.ForecastDefinition{
	Type: to.Ptr(armcostmanagement.ForecastTypeUsage),
	Dataset: &armcostmanagement.ForecastDataset{
		Aggregation: map[string]*armcostmanagement.ForecastAggregation{
			"totalCost": {
				Name:     to.Ptr(armcostmanagement.FunctionNameCost),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Filter: &armcostmanagement.ForecastFilter{
			And: []*armcostmanagement.ForecastFilter{
				{
					Or: []*armcostmanagement.ForecastFilter{
						{
							Dimensions: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.ForecastComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	IncludeActualCost:       to.Ptr(false),
	IncludeFreshPartialCost: to.Ptr(false),
	TimePeriod: &armcostmanagement.ForecastTimePeriod{
		From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-01T00:00:00.000Z"); return t }()),
		To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-31T23:59:59.000Z"); return t }()),
	},
	Timeframe: to.Ptr(armcostmanagement.ForecastTimeframeCustom),
}, &armcostmanagement.ForecastClientUsageOptions{Filter: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ForecastResult = armcostmanagement.ForecastResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.ForecastProperties{
// 		Columns: []*armcostmanagement.ForecastColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("CostStatus"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(2.10333307059661),
// 				float64(20180331),
// 				"Forecast",
// 				"USD"},
// 				[]any{
// 					float64(218.68795741935486),
// 					float64(20180331),
// 					"Forecast",
// 					"USD"},
// 					[]any{
// 						float64(0.14384913581657052),
// 						float64(20180401),
// 						"Forecast",
// 						"USD"},
// 						[]any{
// 							float64(0.009865586851323632),
// 							float64(20180429),
// 							"Forecast",
// 							"USD"}},
// 						},
// 					}
Output:

Example (BillingProfileForecast)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingProfileForecast.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewForecastClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", armcostmanagement.ForecastDefinition{
	Type: to.Ptr(armcostmanagement.ForecastTypeUsage),
	Dataset: &armcostmanagement.ForecastDataset{
		Aggregation: map[string]*armcostmanagement.ForecastAggregation{
			"totalCost": {
				Name:     to.Ptr(armcostmanagement.FunctionNameCost),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Filter: &armcostmanagement.ForecastFilter{
			And: []*armcostmanagement.ForecastFilter{
				{
					Or: []*armcostmanagement.ForecastFilter{
						{
							Dimensions: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.ForecastComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	IncludeActualCost:       to.Ptr(false),
	IncludeFreshPartialCost: to.Ptr(false),
	TimePeriod: &armcostmanagement.ForecastTimePeriod{
		From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-01T00:00:00.000Z"); return t }()),
		To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-31T23:59:59.000Z"); return t }()),
	},
	Timeframe: to.Ptr(armcostmanagement.ForecastTimeframeCustom),
}, &armcostmanagement.ForecastClientUsageOptions{Filter: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ForecastResult = armcostmanagement.ForecastResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.ForecastProperties{
// 		Columns: []*armcostmanagement.ForecastColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("CostStatus"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(2.10333307059661),
// 				float64(20180331),
// 				"Forecast",
// 				"USD"},
// 				[]any{
// 					float64(218.68795741935486),
// 					float64(20180331),
// 					"Forecast",
// 					"USD"},
// 					[]any{
// 						float64(0.14384913581657052),
// 						float64(20180401),
// 						"Forecast",
// 						"USD"},
// 						[]any{
// 							float64(0.009865586851323632),
// 							float64(20180429),
// 							"Forecast",
// 							"USD"}},
// 						},
// 					}
Output:

Example (DepartmentForecast)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentForecast.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewForecastClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123", armcostmanagement.ForecastDefinition{
	Type: to.Ptr(armcostmanagement.ForecastTypeUsage),
	Dataset: &armcostmanagement.ForecastDataset{
		Aggregation: map[string]*armcostmanagement.ForecastAggregation{
			"totalCost": {
				Name:     to.Ptr(armcostmanagement.FunctionNameCost),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Filter: &armcostmanagement.ForecastFilter{
			And: []*armcostmanagement.ForecastFilter{
				{
					Or: []*armcostmanagement.ForecastFilter{
						{
							Dimensions: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.ForecastComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	IncludeActualCost:       to.Ptr(false),
	IncludeFreshPartialCost: to.Ptr(false),
	TimePeriod: &armcostmanagement.ForecastTimePeriod{
		From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-01T00:00:00.000Z"); return t }()),
		To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-31T23:59:59.000Z"); return t }()),
	},
	Timeframe: to.Ptr(armcostmanagement.ForecastTimeframeCustom),
}, &armcostmanagement.ForecastClientUsageOptions{Filter: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ForecastResult = armcostmanagement.ForecastResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.ForecastProperties{
// 		Columns: []*armcostmanagement.ForecastColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("CostStatus"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(2.10333307059661),
// 				float64(20180331),
// 				"Forecast",
// 				"USD"},
// 				[]any{
// 					float64(218.68795741935486),
// 					float64(20180331),
// 					"Forecast",
// 					"USD"},
// 					[]any{
// 						float64(0.14384913581657052),
// 						float64(20180401),
// 						"Forecast",
// 						"USD"},
// 						[]any{
// 							float64(0.009865586851323632),
// 							float64(20180429),
// 							"Forecast",
// 							"USD"}},
// 						},
// 					}
Output:

Example (EnrollmentAccountForecast)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountForecast.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewForecastClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456", armcostmanagement.ForecastDefinition{
	Type: to.Ptr(armcostmanagement.ForecastTypeUsage),
	Dataset: &armcostmanagement.ForecastDataset{
		Aggregation: map[string]*armcostmanagement.ForecastAggregation{
			"totalCost": {
				Name:     to.Ptr(armcostmanagement.FunctionNameCost),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Filter: &armcostmanagement.ForecastFilter{
			And: []*armcostmanagement.ForecastFilter{
				{
					Or: []*armcostmanagement.ForecastFilter{
						{
							Dimensions: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.ForecastComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	IncludeActualCost:       to.Ptr(false),
	IncludeFreshPartialCost: to.Ptr(false),
	TimePeriod: &armcostmanagement.ForecastTimePeriod{
		From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-01T00:00:00.000Z"); return t }()),
		To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-31T23:59:59.000Z"); return t }()),
	},
	Timeframe: to.Ptr(armcostmanagement.ForecastTimeframeCustom),
}, &armcostmanagement.ForecastClientUsageOptions{Filter: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ForecastResult = armcostmanagement.ForecastResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.ForecastProperties{
// 		Columns: []*armcostmanagement.ForecastColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("CostStatus"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(2.10333307059661),
// 				float64(20180331),
// 				"Forecast",
// 				"USD"},
// 				[]any{
// 					float64(218.68795741935486),
// 					float64(20180331),
// 					"Forecast",
// 					"USD"},
// 					[]any{
// 						float64(0.14384913581657052),
// 						float64(20180401),
// 						"Forecast",
// 						"USD"},
// 						[]any{
// 							float64(0.009865586851323632),
// 							float64(20180429),
// 							"Forecast",
// 							"USD"}},
// 						},
// 					}
Output:

Example (InvoiceSectionForecast)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/InvoiceSectionForecast.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewForecastClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", armcostmanagement.ForecastDefinition{
	Type: to.Ptr(armcostmanagement.ForecastTypeUsage),
	Dataset: &armcostmanagement.ForecastDataset{
		Aggregation: map[string]*armcostmanagement.ForecastAggregation{
			"totalCost": {
				Name:     to.Ptr(armcostmanagement.FunctionNameCost),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Filter: &armcostmanagement.ForecastFilter{
			And: []*armcostmanagement.ForecastFilter{
				{
					Or: []*armcostmanagement.ForecastFilter{
						{
							Dimensions: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.ForecastComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	IncludeActualCost:       to.Ptr(false),
	IncludeFreshPartialCost: to.Ptr(false),
	TimePeriod: &armcostmanagement.ForecastTimePeriod{
		From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-01T00:00:00.000Z"); return t }()),
		To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-31T23:59:59.000Z"); return t }()),
	},
	Timeframe: to.Ptr(armcostmanagement.ForecastTimeframeCustom),
}, &armcostmanagement.ForecastClientUsageOptions{Filter: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ForecastResult = armcostmanagement.ForecastResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.ForecastProperties{
// 		Columns: []*armcostmanagement.ForecastColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("CostStatus"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(2.10333307059661),
// 				float64(20180331),
// 				"Forecast",
// 				"USD"},
// 				[]any{
// 					float64(218.68795741935486),
// 					float64(20180331),
// 					"Forecast",
// 					"USD"},
// 					[]any{
// 						float64(0.14384913581657052),
// 						float64(20180401),
// 						"Forecast",
// 						"USD"},
// 						[]any{
// 							float64(0.009865586851323632),
// 							float64(20180429),
// 							"Forecast",
// 							"USD"}},
// 						},
// 					}
Output:

Example (ResourceGroupForecast)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ResourceGroupForecast.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewForecastClient().Usage(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", armcostmanagement.ForecastDefinition{
	Type: to.Ptr(armcostmanagement.ForecastTypeUsage),
	Dataset: &armcostmanagement.ForecastDataset{
		Aggregation: map[string]*armcostmanagement.ForecastAggregation{
			"totalCost": {
				Name:     to.Ptr(armcostmanagement.FunctionNameCost),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Filter: &armcostmanagement.ForecastFilter{
			And: []*armcostmanagement.ForecastFilter{
				{
					Or: []*armcostmanagement.ForecastFilter{
						{
							Dimensions: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.ForecastComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	IncludeActualCost:       to.Ptr(false),
	IncludeFreshPartialCost: to.Ptr(false),
	TimePeriod: &armcostmanagement.ForecastTimePeriod{
		From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-01T00:00:00.000Z"); return t }()),
		To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-31T23:59:59.000Z"); return t }()),
	},
	Timeframe: to.Ptr(armcostmanagement.ForecastTimeframeCustom),
}, &armcostmanagement.ForecastClientUsageOptions{Filter: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ForecastResult = armcostmanagement.ForecastResult{
// 	Name: to.Ptr("55312978-ba1b-415c-9304-cfd9c43c0481"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.ForecastProperties{
// 		Columns: []*armcostmanagement.ForecastColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("CostStatus"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(2.10333307059661),
// 				float64(20180331),
// 				"Forecast",
// 				"USD"}},
// 			},
// 		}
Output:

Example (SubscriptionForecast)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SubscriptionForecast.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewForecastClient().Usage(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", armcostmanagement.ForecastDefinition{
	Type: to.Ptr(armcostmanagement.ForecastTypeUsage),
	Dataset: &armcostmanagement.ForecastDataset{
		Aggregation: map[string]*armcostmanagement.ForecastAggregation{
			"totalCost": {
				Name:     to.Ptr(armcostmanagement.FunctionNameCost),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Filter: &armcostmanagement.ForecastFilter{
			And: []*armcostmanagement.ForecastFilter{
				{
					Or: []*armcostmanagement.ForecastFilter{
						{
							Dimensions: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.ForecastComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.ForecastComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.ForecastOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	IncludeActualCost:       to.Ptr(false),
	IncludeFreshPartialCost: to.Ptr(false),
	TimePeriod: &armcostmanagement.ForecastTimePeriod{
		From: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-01T00:00:00.000Z"); return t }()),
		To:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-31T23:59:59.000Z"); return t }()),
	},
	Timeframe: to.Ptr(armcostmanagement.ForecastTimeframeCustom),
}, &armcostmanagement.ForecastClientUsageOptions{Filter: nil})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ForecastResult = armcostmanagement.ForecastResult{
// 	Name: to.Ptr("55312978-ba1b-415c-9304-cfd9c43c0481"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.ForecastProperties{
// 		Columns: []*armcostmanagement.ForecastColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("CostStatus"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(2.10333307059661),
// 				float64(20180331),
// 				"Forecast",
// 				"USD"},
// 				[]any{
// 					float64(218.68795741935486),
// 					float64(20180331),
// 					"Forecast",
// 					"USD"},
// 					[]any{
// 						float64(0.14384913581657052),
// 						float64(20180401),
// 						"Forecast",
// 						"USD"},
// 						[]any{
// 							float64(0.009865586851323632),
// 							float64(20180429),
// 							"Forecast",
// 							"USD"}},
// 						},
// 					}
Output:

type ForecastClientExternalCloudProviderUsageOptions

type ForecastClientExternalCloudProviderUsageOptions struct {
	// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter
	// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently
	// support 'ne', 'or', or 'not'.
	Filter *string
}

ForecastClientExternalCloudProviderUsageOptions contains the optional parameters for the ForecastClient.ExternalCloudProviderUsage method.

type ForecastClientExternalCloudProviderUsageResponse

type ForecastClientExternalCloudProviderUsageResponse struct {
	// Result of forecast. It contains all columns listed under groupings and aggregation.
	ForecastResult
}

ForecastClientExternalCloudProviderUsageResponse contains the response from method ForecastClient.ExternalCloudProviderUsage.

type ForecastClientUsageOptions

type ForecastClientUsageOptions struct {
	// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter
	// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently
	// support 'ne', 'or', or 'not'.
	Filter *string
}

ForecastClientUsageOptions contains the optional parameters for the ForecastClient.Usage method.

type ForecastClientUsageResponse

type ForecastClientUsageResponse struct {
	// Result of forecast. It contains all columns listed under groupings and aggregation.
	ForecastResult
}

ForecastClientUsageResponse contains the response from method ForecastClient.Usage.

type ForecastColumn

type ForecastColumn struct {
	// The name of column.
	Name *string

	// The type of column.
	Type *string
}

ForecastColumn - Forecast column properties

func (ForecastColumn) MarshalJSON

func (f ForecastColumn) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForecastColumn.

func (*ForecastColumn) UnmarshalJSON

func (f *ForecastColumn) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForecastColumn.

type ForecastComparisonExpression

type ForecastComparisonExpression struct {
	// REQUIRED; The name of the column to use in comparison.
	Name *string

	// REQUIRED; The operator to use for comparison.
	Operator *ForecastOperatorType

	// REQUIRED; Array of values to use for comparison
	Values []*string
}

ForecastComparisonExpression - The comparison expression to be used in the forecast.

func (ForecastComparisonExpression) MarshalJSON

func (f ForecastComparisonExpression) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForecastComparisonExpression.

func (*ForecastComparisonExpression) UnmarshalJSON

func (f *ForecastComparisonExpression) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForecastComparisonExpression.

type ForecastDataset

type ForecastDataset struct {
	// REQUIRED; Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias
	// for the aggregated column. forecast can have up to 2 aggregation clauses.
	Aggregation map[string]*ForecastAggregation

	// Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping
	// are provided.
	Configuration *ForecastDatasetConfiguration

	// Has filter expression to use in the forecast.
	Filter *ForecastFilter

	// The granularity of rows in the forecast.
	Granularity *GranularityType
}

ForecastDataset - The definition of data present in the forecast.

func (ForecastDataset) MarshalJSON

func (f ForecastDataset) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForecastDataset.

func (*ForecastDataset) UnmarshalJSON

func (f *ForecastDataset) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForecastDataset.

type ForecastDatasetConfiguration

type ForecastDatasetConfiguration struct {
	// Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then
	// forecast includes all columns.
	Columns []*string
}

ForecastDatasetConfiguration - The configuration of dataset in the forecast.

func (ForecastDatasetConfiguration) MarshalJSON

func (f ForecastDatasetConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForecastDatasetConfiguration.

func (*ForecastDatasetConfiguration) UnmarshalJSON

func (f *ForecastDatasetConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForecastDatasetConfiguration.

type ForecastDefinition

type ForecastDefinition struct {
	// REQUIRED; Has definition for data in this forecast.
	Dataset *ForecastDataset

	// REQUIRED; The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.
	Timeframe *ForecastTimeframe

	// REQUIRED; The type of the forecast.
	Type *ForecastType

	// A boolean determining if actualCost will be included.
	IncludeActualCost *bool

	// A boolean determining if FreshPartialCost will be included.
	IncludeFreshPartialCost *bool

	// Has time period for pulling data for the forecast.
	TimePeriod *ForecastTimePeriod
}

ForecastDefinition - The definition of a forecast.

func (ForecastDefinition) MarshalJSON

func (f ForecastDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForecastDefinition.

func (*ForecastDefinition) UnmarshalJSON

func (f *ForecastDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForecastDefinition.

type ForecastFilter

type ForecastFilter struct {
	// The logical "AND" expression. Must have at least 2 items.
	And []*ForecastFilter

	// Has comparison expression for a dimension
	Dimensions *ForecastComparisonExpression

	// The logical "OR" expression. Must have at least 2 items.
	Or []*ForecastFilter

	// Has comparison expression for a tag
	Tags *ForecastComparisonExpression
}

ForecastFilter - The filter expression to be used in the export.

func (ForecastFilter) MarshalJSON

func (f ForecastFilter) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForecastFilter.

func (*ForecastFilter) UnmarshalJSON

func (f *ForecastFilter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForecastFilter.

type ForecastOperatorType

type ForecastOperatorType string

ForecastOperatorType - The operator to use for comparison.

const (
	ForecastOperatorTypeIn ForecastOperatorType = "In"
)

func PossibleForecastOperatorTypeValues

func PossibleForecastOperatorTypeValues() []ForecastOperatorType

PossibleForecastOperatorTypeValues returns the possible values for the ForecastOperatorType const type.

type ForecastProperties

type ForecastProperties struct {
	// Array of columns
	Columns []*ForecastColumn

	// The link (url) to the next page of results.
	NextLink *string

	// Array of rows
	Rows [][]any
}

ForecastProperties - Forecast properties

func (ForecastProperties) MarshalJSON

func (f ForecastProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForecastProperties.

func (*ForecastProperties) UnmarshalJSON

func (f *ForecastProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForecastProperties.

type ForecastResult

type ForecastResult struct {
	// Forecast properties
	Properties *ForecastProperties

	// READ-ONLY; ETag of the resource.
	ETag *string

	// READ-ONLY; Resource Id.
	ID *string

	// READ-ONLY; Location of the resource.
	Location *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; SKU of the resource.
	SKU *string

	// READ-ONLY; Resource tags.
	Tags map[string]*string

	// READ-ONLY; Resource type.
	Type *string
}

ForecastResult - Result of forecast. It contains all columns listed under groupings and aggregation.

func (ForecastResult) MarshalJSON

func (f ForecastResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForecastResult.

func (*ForecastResult) UnmarshalJSON

func (f *ForecastResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForecastResult.

type ForecastTimePeriod

type ForecastTimePeriod struct {
	// REQUIRED; The start date to pull data from.
	From *time.Time

	// REQUIRED; The end date to pull data to.
	To *time.Time
}

ForecastTimePeriod - Has time period for pulling data for the forecast.

func (ForecastTimePeriod) MarshalJSON

func (f ForecastTimePeriod) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ForecastTimePeriod.

func (*ForecastTimePeriod) UnmarshalJSON

func (f *ForecastTimePeriod) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ForecastTimePeriod.

type ForecastTimeframe

type ForecastTimeframe string

ForecastTimeframe - The time frame for pulling data for the forecast.

const (
	ForecastTimeframeCustom ForecastTimeframe = "Custom"
)

func PossibleForecastTimeframeValues

func PossibleForecastTimeframeValues() []ForecastTimeframe

PossibleForecastTimeframeValues returns the possible values for the ForecastTimeframe const type.

type ForecastType

type ForecastType string

ForecastType - The type of the forecast.

const (
	ForecastTypeActualCost    ForecastType = "ActualCost"
	ForecastTypeAmortizedCost ForecastType = "AmortizedCost"
	ForecastTypeUsage         ForecastType = "Usage"
)

func PossibleForecastTypeValues

func PossibleForecastTypeValues() []ForecastType

PossibleForecastTypeValues returns the possible values for the ForecastType const type.

type FormatType

type FormatType string

FormatType - The format of the export being delivered. Currently only 'Csv' is supported.

const (
	FormatTypeCSV FormatType = "Csv"
)

func PossibleFormatTypeValues

func PossibleFormatTypeValues() []FormatType

PossibleFormatTypeValues returns the possible values for the FormatType const type.

type FunctionName

type FunctionName string

FunctionName - The name of the column to aggregate.

const (
	FunctionNameCost          FunctionName = "Cost"
	FunctionNameCostUSD       FunctionName = "CostUSD"
	FunctionNamePreTaxCost    FunctionName = "PreTaxCost"
	FunctionNamePreTaxCostUSD FunctionName = "PreTaxCostUSD"
)

func PossibleFunctionNameValues

func PossibleFunctionNameValues() []FunctionName

PossibleFunctionNameValues returns the possible values for the FunctionName const type.

type FunctionType

type FunctionType string

FunctionType - The name of the aggregation function to use.

const (
	FunctionTypeSum FunctionType = "Sum"
)

func PossibleFunctionTypeValues

func PossibleFunctionTypeValues() []FunctionType

PossibleFunctionTypeValues returns the possible values for the FunctionType const type.

type GenerateCostDetailsReportClient

type GenerateCostDetailsReportClient struct {
	// contains filtered or unexported fields
}

GenerateCostDetailsReportClient contains the methods for the GenerateCostDetailsReport group. Don't use this type directly, use NewGenerateCostDetailsReportClient() instead.

func NewGenerateCostDetailsReportClient

func NewGenerateCostDetailsReportClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GenerateCostDetailsReportClient, error)

NewGenerateCostDetailsReportClient creates a new instance of GenerateCostDetailsReportClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GenerateCostDetailsReportClient) BeginCreateOperation

BeginCreateOperation - This API is the replacement for all previously release Usage Details APIs. Request to generate a cost details report for the provided date range, billing period (Only enterprise customers) or Invoice Id asynchronously at a certain scope. The initial call to request a report will return a 202 with a 'Location' and 'Retry-After' header. The 'Location' header will provide the endpoint to poll to get the result of the report generation. The 'Retry-After' provides the duration to wait before polling for the generated report. A call to poll the report operation will provide a 202 response with a 'Location' header if the operation is still in progress. Once the report generation operation completes, the polling endpoint will provide a 200 response along with details on the report blob(s) that are available for download. The details on the file(s) available for download will be available in the polling response body. To Understand cost details (formerly known as usage details) fields found in files ,see https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes.
  • parameters - Parameters supplied to the Create cost details operation.
  • options - GenerateCostDetailsReportClientBeginCreateOperationOptions contains the optional parameters for the GenerateCostDetailsReportClient.BeginCreateOperation method.
Example (GenerateCostDetailsReportByBillingAccountEnterpriseAgreementCustomerAndBillingPeriod)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByBillingAccountEnterpriseAgreementCustomerAndBillingPeriod.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateCostDetailsReportClient().BeginCreateOperation(ctx, "providers/Microsoft.Billing/billingAccounts/12345", armcostmanagement.GenerateCostDetailsReportRequestDefinition{
	BillingPeriod: to.Ptr("202205"),
	Metric:        to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CostDetailsOperationResults = armcostmanagement.CostDetailsOperationResults{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000"),
// 	Manifest: &armcostmanagement.ReportManifest{
// 		BlobCount: to.Ptr[int32](1),
// 		Blobs: []*armcostmanagement.BlobInfo{
// 			{
// 				BlobLink: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/00000/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 				ByteCount: to.Ptr[int64](32741),
// 		}},
// 		ByteCount: to.Ptr[int64](32741),
// 		CompressData: to.Ptr(false),
// 		DataFormat: to.Ptr(armcostmanagement.CostDetailsDataFormatCSVCostDetailsDataFormat),
// 		ManifestVersion: to.Ptr("2022-10-01"),
// 		RequestContext: &armcostmanagement.RequestContext{
// 			RequestBody: &armcostmanagement.GenerateCostDetailsReportRequestDefinition{
// 				BillingPeriod: to.Ptr("202205"),
// 				Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
// 			},
// 			RequestScope: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345"),
// 		},
// 	},
// 	Status: to.Ptr(armcostmanagement.CostDetailsStatusTypeCompletedCostDetailsStatusType),
// 	ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-10T08:08:46.197Z"); return t}()),
// }
Output:

Example (GenerateCostDetailsReportByBillingProfileAndInvoiceId)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByBillingProfileAndInvoiceId.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateCostDetailsReportClient().BeginCreateOperation(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", armcostmanagement.GenerateCostDetailsReportRequestDefinition{
	InvoiceID: to.Ptr("M1234567"),
	Metric:    to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CostDetailsOperationResults = armcostmanagement.CostDetailsOperationResults{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000"),
// 	Manifest: &armcostmanagement.ReportManifest{
// 		BlobCount: to.Ptr[int32](1),
// 		Blobs: []*armcostmanagement.BlobInfo{
// 			{
// 				BlobLink: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/00000/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 				ByteCount: to.Ptr[int64](32741),
// 		}},
// 		ByteCount: to.Ptr[int64](32741),
// 		CompressData: to.Ptr(false),
// 		DataFormat: to.Ptr(armcostmanagement.CostDetailsDataFormatCSVCostDetailsDataFormat),
// 		ManifestVersion: to.Ptr("2022-10-01"),
// 		RequestContext: &armcostmanagement.RequestContext{
// 			RequestBody: &armcostmanagement.GenerateCostDetailsReportRequestDefinition{
// 				BillingPeriod: to.Ptr("202205"),
// 				Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
// 			},
// 			RequestScope: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"),
// 		},
// 	},
// 	Status: to.Ptr(armcostmanagement.CostDetailsStatusTypeCompletedCostDetailsStatusType),
// 	ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-10T08:08:46.197Z"); return t}()),
// }
Output:

Example (GenerateCostDetailsReportByBillingProfileAndInvoiceIdAndCustomerId)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByBillingProfileAndInvoiceIdAndCustomerId.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateCostDetailsReportClient().BeginCreateOperation(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/13579", armcostmanagement.GenerateCostDetailsReportRequestDefinition{
	InvoiceID: to.Ptr("M1234567"),
	Metric:    to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CostDetailsOperationResults = armcostmanagement.CostDetailsOperationResults{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/13579/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000"),
// 	Manifest: &armcostmanagement.ReportManifest{
// 		BlobCount: to.Ptr[int32](1),
// 		Blobs: []*armcostmanagement.BlobInfo{
// 			{
// 				BlobLink: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/00000/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 				ByteCount: to.Ptr[int64](32741),
// 		}},
// 		ByteCount: to.Ptr[int64](32741),
// 		CompressData: to.Ptr(false),
// 		DataFormat: to.Ptr(armcostmanagement.CostDetailsDataFormatCSVCostDetailsDataFormat),
// 		ManifestVersion: to.Ptr("2022-10-01"),
// 		RequestContext: &armcostmanagement.RequestContext{
// 			RequestBody: &armcostmanagement.GenerateCostDetailsReportRequestDefinition{
// 				BillingPeriod: to.Ptr("202205"),
// 				Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
// 			},
// 			RequestScope: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/13579"),
// 		},
// 	},
// 	Status: to.Ptr(armcostmanagement.CostDetailsStatusTypeCompletedCostDetailsStatusType),
// 	ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-10T08:08:46.197Z"); return t}()),
// }
Output:

Example (GenerateCostDetailsReportByCustomerAndTimePeriod)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByCustomerAndTimePeriod.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateCostDetailsReportClient().BeginCreateOperation(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/13579", armcostmanagement.GenerateCostDetailsReportRequestDefinition{
	Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
	TimePeriod: &armcostmanagement.CostDetailsTimePeriod{
		End:   to.Ptr("2020-03-15"),
		Start: to.Ptr("2020-03-01"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CostDetailsOperationResults = armcostmanagement.CostDetailsOperationResults{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/13579/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000"),
// 	Manifest: &armcostmanagement.ReportManifest{
// 		BlobCount: to.Ptr[int32](1),
// 		Blobs: []*armcostmanagement.BlobInfo{
// 			{
// 				BlobLink: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/00000/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 				ByteCount: to.Ptr[int64](32741),
// 		}},
// 		ByteCount: to.Ptr[int64](32741),
// 		CompressData: to.Ptr(false),
// 		DataFormat: to.Ptr(armcostmanagement.CostDetailsDataFormatCSVCostDetailsDataFormat),
// 		ManifestVersion: to.Ptr("2022-10-01"),
// 		RequestContext: &armcostmanagement.RequestContext{
// 			RequestBody: &armcostmanagement.GenerateCostDetailsReportRequestDefinition{
// 				Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
// 				TimePeriod: &armcostmanagement.CostDetailsTimePeriod{
// 					End: to.Ptr("2020-03-15"),
// 					Start: to.Ptr("2020-03-01"),
// 				},
// 			},
// 			RequestScope: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/13579"),
// 		},
// 	},
// 	Status: to.Ptr(armcostmanagement.CostDetailsStatusTypeCompletedCostDetailsStatusType),
// 	ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-10T08:08:46.197Z"); return t}()),
// }
Output:

Example (GenerateCostDetailsReportByDepartmentsAndTimePeriod)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByDepartmentsAndTimePeriod.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateCostDetailsReportClient().BeginCreateOperation(ctx, "providers/Microsoft.Billing/departments/12345", armcostmanagement.GenerateCostDetailsReportRequestDefinition{
	Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
	TimePeriod: &armcostmanagement.CostDetailsTimePeriod{
		End:   to.Ptr("2020-03-15"),
		Start: to.Ptr("2020-03-01"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CostDetailsOperationResults = armcostmanagement.CostDetailsOperationResults{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	ID: to.Ptr("providers/Microsoft.Billing/departments/12345/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000"),
// 	Manifest: &armcostmanagement.ReportManifest{
// 		BlobCount: to.Ptr[int32](1),
// 		Blobs: []*armcostmanagement.BlobInfo{
// 			{
// 				BlobLink: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/00000/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 				ByteCount: to.Ptr[int64](32741),
// 		}},
// 		ByteCount: to.Ptr[int64](32741),
// 		CompressData: to.Ptr(false),
// 		DataFormat: to.Ptr(armcostmanagement.CostDetailsDataFormatCSVCostDetailsDataFormat),
// 		ManifestVersion: to.Ptr("2022-10-01"),
// 		RequestContext: &armcostmanagement.RequestContext{
// 			RequestBody: &armcostmanagement.GenerateCostDetailsReportRequestDefinition{
// 				Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
// 				TimePeriod: &armcostmanagement.CostDetailsTimePeriod{
// 					End: to.Ptr("2020-03-15"),
// 					Start: to.Ptr("2020-03-01"),
// 				},
// 			},
// 			RequestScope: to.Ptr("providers/Microsoft.Billing/departments/12345"),
// 		},
// 	},
// 	Status: to.Ptr(armcostmanagement.CostDetailsStatusTypeCompletedCostDetailsStatusType),
// 	ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-10T08:08:46.197Z"); return t}()),
// }
Output:

Example (GenerateCostDetailsReportByEnrollmentAccountsAndTimePeriod)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportByEnrollmentAccountsAndTimePeriod.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateCostDetailsReportClient().BeginCreateOperation(ctx, "providers/Microsoft.Billing/enrollmentAccounts/1234", armcostmanagement.GenerateCostDetailsReportRequestDefinition{
	Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
	TimePeriod: &armcostmanagement.CostDetailsTimePeriod{
		End:   to.Ptr("2020-03-15"),
		Start: to.Ptr("2020-03-01"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CostDetailsOperationResults = armcostmanagement.CostDetailsOperationResults{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	ID: to.Ptr("providers/Microsoft.Billing/enrollmentAccounts/1234/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000"),
// 	Manifest: &armcostmanagement.ReportManifest{
// 		BlobCount: to.Ptr[int32](1),
// 		Blobs: []*armcostmanagement.BlobInfo{
// 			{
// 				BlobLink: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/00000/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 				ByteCount: to.Ptr[int64](32741),
// 		}},
// 		ByteCount: to.Ptr[int64](32741),
// 		CompressData: to.Ptr(false),
// 		DataFormat: to.Ptr(armcostmanagement.CostDetailsDataFormatCSVCostDetailsDataFormat),
// 		ManifestVersion: to.Ptr("2022-10-01"),
// 		RequestContext: &armcostmanagement.RequestContext{
// 			RequestBody: &armcostmanagement.GenerateCostDetailsReportRequestDefinition{
// 				Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
// 				TimePeriod: &armcostmanagement.CostDetailsTimePeriod{
// 					End: to.Ptr("2020-03-15"),
// 					Start: to.Ptr("2020-03-01"),
// 				},
// 			},
// 			RequestScope: to.Ptr("providers/Microsoft.Billing/enrollmentAccounts/1234"),
// 		},
// 	},
// 	Status: to.Ptr(armcostmanagement.CostDetailsStatusTypeCompletedCostDetailsStatusType),
// 	ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-10T08:08:46.197Z"); return t}()),
// }
Output:

Example (GenerateCostDetailsReportBySubscriptionAndTimePeriod)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateCostDetailsReportBySubscriptionAndTimePeriod.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateCostDetailsReportClient().BeginCreateOperation(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", armcostmanagement.GenerateCostDetailsReportRequestDefinition{
	Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
	TimePeriod: &armcostmanagement.CostDetailsTimePeriod{
		End:   to.Ptr("2020-03-15"),
		Start: to.Ptr("2020-03-01"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CostDetailsOperationResults = armcostmanagement.CostDetailsOperationResults{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000"),
// 	Manifest: &armcostmanagement.ReportManifest{
// 		BlobCount: to.Ptr[int32](1),
// 		Blobs: []*armcostmanagement.BlobInfo{
// 			{
// 				BlobLink: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/00000/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 				ByteCount: to.Ptr[int64](32741),
// 		}},
// 		ByteCount: to.Ptr[int64](32741),
// 		CompressData: to.Ptr(false),
// 		DataFormat: to.Ptr(armcostmanagement.CostDetailsDataFormatCSVCostDetailsDataFormat),
// 		ManifestVersion: to.Ptr("2022-10-01"),
// 		RequestContext: &armcostmanagement.RequestContext{
// 			RequestBody: &armcostmanagement.GenerateCostDetailsReportRequestDefinition{
// 				Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
// 				TimePeriod: &armcostmanagement.CostDetailsTimePeriod{
// 					End: to.Ptr("2020-03-15"),
// 					Start: to.Ptr("2020-03-01"),
// 				},
// 			},
// 			RequestScope: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"),
// 		},
// 	},
// 	Status: to.Ptr(armcostmanagement.CostDetailsStatusTypeCompletedCostDetailsStatusType),
// 	ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-10T08:08:46.197Z"); return t}()),
// }
Output:

func (*GenerateCostDetailsReportClient) BeginGetOperationResults

BeginGetOperationResults - Get the result of the specified operation. This link is provided in the CostDetails creation request response Location header. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes.
  • operationID - The target operation Id.
  • options - GenerateCostDetailsReportClientBeginGetOperationResultsOptions contains the optional parameters for the GenerateCostDetailsReportClient.BeginGetOperationResults method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/CostDetailsOperationResultsBySubscriptionScope.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateCostDetailsReportClient().BeginGetOperationResults(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CostDetailsOperationResults = armcostmanagement.CostDetailsOperationResults{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/costDetailsOperationResults/00000000-0000-0000-0000-000000000000"),
// 	Manifest: &armcostmanagement.ReportManifest{
// 		BlobCount: to.Ptr[int32](1),
// 		Blobs: []*armcostmanagement.BlobInfo{
// 			{
// 				BlobLink: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/00000/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 				ByteCount: to.Ptr[int64](32741),
// 		}},
// 		ByteCount: to.Ptr[int64](32741),
// 		CompressData: to.Ptr(false),
// 		DataFormat: to.Ptr(armcostmanagement.CostDetailsDataFormatCSVCostDetailsDataFormat),
// 		ManifestVersion: to.Ptr("2022-10-01"),
// 		RequestContext: &armcostmanagement.RequestContext{
// 			RequestBody: &armcostmanagement.GenerateCostDetailsReportRequestDefinition{
// 				Metric: to.Ptr(armcostmanagement.CostDetailsMetricTypeActualCostCostDetailsMetricType),
// 				TimePeriod: &armcostmanagement.CostDetailsTimePeriod{
// 					End: to.Ptr("2020-03-15"),
// 					Start: to.Ptr("2020-03-01"),
// 				},
// 			},
// 			RequestScope: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"),
// 		},
// 	},
// 	Status: to.Ptr(armcostmanagement.CostDetailsStatusTypeCompletedCostDetailsStatusType),
// 	ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-10T08:08:46.197Z"); return t}()),
// }
Output:

type GenerateCostDetailsReportClientBeginCreateOperationOptions

type GenerateCostDetailsReportClientBeginCreateOperationOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GenerateCostDetailsReportClientBeginCreateOperationOptions contains the optional parameters for the GenerateCostDetailsReportClient.BeginCreateOperation method.

type GenerateCostDetailsReportClientBeginGetOperationResultsOptions

type GenerateCostDetailsReportClientBeginGetOperationResultsOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GenerateCostDetailsReportClientBeginGetOperationResultsOptions contains the optional parameters for the GenerateCostDetailsReportClient.BeginGetOperationResults method.

type GenerateCostDetailsReportClientCreateOperationResponse

type GenerateCostDetailsReportClientCreateOperationResponse struct {
	// The result of the long running operation for cost details Api.
	CostDetailsOperationResults
}

GenerateCostDetailsReportClientCreateOperationResponse contains the response from method GenerateCostDetailsReportClient.BeginCreateOperation.

type GenerateCostDetailsReportClientGetOperationResultsResponse

type GenerateCostDetailsReportClientGetOperationResultsResponse struct {
	// The result of the long running operation for cost details Api.
	CostDetailsOperationResults
}

GenerateCostDetailsReportClientGetOperationResultsResponse contains the response from method GenerateCostDetailsReportClient.BeginGetOperationResults.

type GenerateCostDetailsReportRequestDefinition

type GenerateCostDetailsReportRequestDefinition struct {
	// This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter
	// cannot be used alongside either the invoiceId or timePeriod parameters. If a
	// timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's
	// cost.
	BillingPeriod *string

	// This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing
	// Profile or Customer scope. This parameter cannot be used alongside either
	// the billingPeriod or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the
	// request body the API will return the current month's cost.
	InvoiceID *string

	// The type of the detailed report. By default ActualCost is provided
	Metric *CostDetailsMetricType

	// The specific date range of cost details requested for the report. This parameter cannot be used alongside either the invoiceId
	// or billingPeriod parameters. If a timePeriod, invoiceId or billingPeriod
	// parameter is not provided in the request body the API will return the current month's cost. API only allows data to be
	// pulled for 1 month or less and no older than 13 months. If no timePeriod or
	// billingPeriod or invoiceId is provided the API defaults to the open month time period
	TimePeriod *CostDetailsTimePeriod
}

GenerateCostDetailsReportRequestDefinition - The definition of a cost detailed report.

func (GenerateCostDetailsReportRequestDefinition) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type GenerateCostDetailsReportRequestDefinition.

func (*GenerateCostDetailsReportRequestDefinition) UnmarshalJSON

func (g *GenerateCostDetailsReportRequestDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCostDetailsReportRequestDefinition.

type GenerateDetailedCostReportClient

type GenerateDetailedCostReportClient struct {
	// contains filtered or unexported fields
}

GenerateDetailedCostReportClient contains the methods for the GenerateDetailedCostReport group. Don't use this type directly, use NewGenerateDetailedCostReportClient() instead.

func NewGenerateDetailedCostReportClient

func NewGenerateDetailedCostReportClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GenerateDetailedCostReportClient, error)

NewGenerateDetailedCostReportClient creates a new instance of GenerateDetailedCostReportClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GenerateDetailedCostReportClient) BeginCreateOperation

BeginCreateOperation - Generates the detailed cost report for provided date range, billing period(only enterprise customers) or Invoice ID asynchronously at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes.
  • parameters - Parameters supplied to the Create detailed cost report operation.
  • options - GenerateDetailedCostReportClientBeginCreateOperationOptions contains the optional parameters for the GenerateDetailedCostReportClient.BeginCreateOperation method.
Example (GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateDetailedCostReportClient().BeginCreateOperation(ctx, "providers/Microsoft.Billing/billingAccounts/12345", armcostmanagement.GenerateDetailedCostReportDefinition{
	BillingPeriod: to.Ptr("202008"),
	Metric:        to.Ptr(armcostmanagement.GenerateDetailedCostReportMetricTypeActualCost),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.GenerateDetailedCostReportOperationResult = armcostmanagement.GenerateDetailedCostReportOperationResult{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.Consumption/operationResult"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/operationResults/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.DownloadURL{
// 		DownloadURL: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/20201207/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 		ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-08T05:55:59.439Z"); return t}()),
// 	},
// }
Output:

Example (GenerateDetailedCostReportByBillingProfileAndInvoiceId)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportByBillingProfileAndInvoiceId.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateDetailedCostReportClient().BeginCreateOperation(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", armcostmanagement.GenerateDetailedCostReportDefinition{
	InvoiceID: to.Ptr("M1234567"),
	Metric:    to.Ptr(armcostmanagement.GenerateDetailedCostReportMetricTypeActualCost),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.GenerateDetailedCostReportOperationResult = armcostmanagement.GenerateDetailedCostReportOperationResult{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.Consumption/operationResult"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/operationResults/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.DownloadURL{
// 		DownloadURL: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/20201207/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 		ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-08T05:55:59.439Z"); return t}()),
// 	},
// }
Output:

Example (GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateDetailedCostReportClient().BeginCreateOperation(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", armcostmanagement.GenerateDetailedCostReportDefinition{
	CustomerID: to.Ptr("456789"),
	InvoiceID:  to.Ptr("M1234567"),
	Metric:     to.Ptr(armcostmanagement.GenerateDetailedCostReportMetricTypeActualCost),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.GenerateDetailedCostReportOperationResult = armcostmanagement.GenerateDetailedCostReportOperationResult{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.Consumption/operationResult"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/operationResults/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.DownloadURL{
// 		DownloadURL: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/20201207/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 		ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-08T05:55:59.439Z"); return t}()),
// 	},
// }
Output:

Example (GenerateDetailedCostReportByCustomerAndTimePeriod)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportByCustomerAndTimePeriod.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateDetailedCostReportClient().BeginCreateOperation(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/13579", armcostmanagement.GenerateDetailedCostReportDefinition{
	Metric: to.Ptr(armcostmanagement.GenerateDetailedCostReportMetricTypeActualCost),
	TimePeriod: &armcostmanagement.GenerateDetailedCostReportTimePeriod{
		End:   to.Ptr("2020-03-15"),
		Start: to.Ptr("2020-03-01"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.GenerateDetailedCostReportOperationResult = armcostmanagement.GenerateDetailedCostReportOperationResult{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.Consumption/operationResult"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/operationResults/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.DownloadURL{
// 		DownloadURL: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/20201207/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 		ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-08T05:55:59.439Z"); return t}()),
// 	},
// }
Output:

Example (GenerateDetailedCostReportBySubscriptionAndTimePeriod)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportBySubscriptionAndTimePeriod.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateDetailedCostReportClient().BeginCreateOperation(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", armcostmanagement.GenerateDetailedCostReportDefinition{
	Metric: to.Ptr(armcostmanagement.GenerateDetailedCostReportMetricTypeActualCost),
	TimePeriod: &armcostmanagement.GenerateDetailedCostReportTimePeriod{
		End:   to.Ptr("2020-03-15"),
		Start: to.Ptr("2020-03-01"),
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.GenerateDetailedCostReportOperationResult = armcostmanagement.GenerateDetailedCostReportOperationResult{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.Consumption/operationResult"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/operationResults/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.DownloadURL{
// 		DownloadURL: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/20201207/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 		ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-08T05:55:59.439Z"); return t}()),
// 	},
// }
Output:

type GenerateDetailedCostReportClientBeginCreateOperationOptions

type GenerateDetailedCostReportClientBeginCreateOperationOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GenerateDetailedCostReportClientBeginCreateOperationOptions contains the optional parameters for the GenerateDetailedCostReportClient.BeginCreateOperation method.

type GenerateDetailedCostReportClientCreateOperationResponse

type GenerateDetailedCostReportClientCreateOperationResponse struct {
	// The result of the long running operation for cost detailed report.
	GenerateDetailedCostReportOperationResult
}

GenerateDetailedCostReportClientCreateOperationResponse contains the response from method GenerateDetailedCostReportClient.BeginCreateOperation.

type GenerateDetailedCostReportDefinition

type GenerateDetailedCostReportDefinition struct {
	// Billing period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one of
	// either timePeriod or invoiceId or billingPeriod parameters. If none provided
	// current month cost is provided.
	BillingPeriod *string

	// Customer ID for Microsoft Customer Agreement scopes (Invoice Id is also required for this).
	CustomerID *string

	// Invoice ID for Pay-as-you-go and Microsoft Customer Agreement scopes. Can only have one of either timePeriod or invoiceId
	// or billingPeriod parameters. If none provided current month cost is provided.
	InvoiceID *string

	// The type of the detailed report. By default ActualCost is provided
	Metric *GenerateDetailedCostReportMetricType

	// Has time period for pulling data for the cost detailed report. Can only have one of either timePeriod or invoiceId or billingPeriod
	// parameters. If none provided current month cost is provided.
	TimePeriod *GenerateDetailedCostReportTimePeriod
}

GenerateDetailedCostReportDefinition - The definition of a cost detailed report.

func (GenerateDetailedCostReportDefinition) MarshalJSON

func (g GenerateDetailedCostReportDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GenerateDetailedCostReportDefinition.

func (*GenerateDetailedCostReportDefinition) UnmarshalJSON

func (g *GenerateDetailedCostReportDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateDetailedCostReportDefinition.

type GenerateDetailedCostReportMetricType

type GenerateDetailedCostReportMetricType string

GenerateDetailedCostReportMetricType - The type of the detailed report. By default ActualCost is provided

const (
	GenerateDetailedCostReportMetricTypeActualCost    GenerateDetailedCostReportMetricType = "ActualCost"
	GenerateDetailedCostReportMetricTypeAmortizedCost GenerateDetailedCostReportMetricType = "AmortizedCost"
)

func PossibleGenerateDetailedCostReportMetricTypeValues

func PossibleGenerateDetailedCostReportMetricTypeValues() []GenerateDetailedCostReportMetricType

PossibleGenerateDetailedCostReportMetricTypeValues returns the possible values for the GenerateDetailedCostReportMetricType const type.

type GenerateDetailedCostReportOperationResult

type GenerateDetailedCostReportOperationResult struct {
	// The ARM resource id of the long running operation.
	ID *string

	// The name of the long running operation.
	Name *string

	// The properties of the resource generated.
	Properties *DownloadURL

	// The type of the long running operation.
	Type *string
}

GenerateDetailedCostReportOperationResult - The result of the long running operation for cost detailed report.

func (GenerateDetailedCostReportOperationResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type GenerateDetailedCostReportOperationResult.

func (*GenerateDetailedCostReportOperationResult) UnmarshalJSON

func (g *GenerateDetailedCostReportOperationResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateDetailedCostReportOperationResult.

type GenerateDetailedCostReportOperationResultsClient

type GenerateDetailedCostReportOperationResultsClient struct {
	// contains filtered or unexported fields
}

GenerateDetailedCostReportOperationResultsClient contains the methods for the GenerateDetailedCostReportOperationResults group. Don't use this type directly, use NewGenerateDetailedCostReportOperationResultsClient() instead.

func NewGenerateDetailedCostReportOperationResultsClient

func NewGenerateDetailedCostReportOperationResultsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GenerateDetailedCostReportOperationResultsClient, error)

NewGenerateDetailedCostReportOperationResultsClient creates a new instance of GenerateDetailedCostReportOperationResultsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GenerateDetailedCostReportOperationResultsClient) BeginGet

BeginGet - Gets the result of the specified operation. The link with this operationId is provided as a response header of the initial request. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • operationID - The target operation Id.
  • scope - The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes.
  • options - GenerateDetailedCostReportOperationResultsClientBeginGetOptions contains the optional parameters for the GenerateDetailedCostReportOperationResultsClient.BeginGet method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportOperationResultsBySubscriptionScope.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateDetailedCostReportOperationResultsClient().BeginGet(ctx, "00000000-0000-0000-0000-000000000000", "subscriptions/00000000-0000-0000-0000-000000000000", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.GenerateDetailedCostReportOperationResult = armcostmanagement.GenerateDetailedCostReportOperationResult{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.Consumption/operationResult"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/operationResults/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.DownloadURL{
// 		DownloadURL: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/20201207/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 		ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-08T05:55:59.439Z"); return t}()),
// 	},
// }
Output:

type GenerateDetailedCostReportOperationResultsClientBeginGetOptions

type GenerateDetailedCostReportOperationResultsClientBeginGetOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GenerateDetailedCostReportOperationResultsClientBeginGetOptions contains the optional parameters for the GenerateDetailedCostReportOperationResultsClient.BeginGet method.

type GenerateDetailedCostReportOperationResultsClientGetResponse

type GenerateDetailedCostReportOperationResultsClientGetResponse struct {
	// The result of the long running operation for cost detailed report.
	GenerateDetailedCostReportOperationResult
}

GenerateDetailedCostReportOperationResultsClientGetResponse contains the response from method GenerateDetailedCostReportOperationResultsClient.BeginGet.

type GenerateDetailedCostReportOperationStatusClient

type GenerateDetailedCostReportOperationStatusClient struct {
	// contains filtered or unexported fields
}

GenerateDetailedCostReportOperationStatusClient contains the methods for the GenerateDetailedCostReportOperationStatus group. Don't use this type directly, use NewGenerateDetailedCostReportOperationStatusClient() instead.

func NewGenerateDetailedCostReportOperationStatusClient

func NewGenerateDetailedCostReportOperationStatusClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GenerateDetailedCostReportOperationStatusClient, error)

NewGenerateDetailedCostReportOperationStatusClient creates a new instance of GenerateDetailedCostReportOperationStatusClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GenerateDetailedCostReportOperationStatusClient) Get

Get - Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • operationID - The target operation Id.
  • scope - The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes.
  • options - GenerateDetailedCostReportOperationStatusClientGetOptions contains the optional parameters for the GenerateDetailedCostReportOperationStatusClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateDetailedCostReportOperationStatusBySubscriptionScope.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGenerateDetailedCostReportOperationStatusClient().Get(ctx, "00000000-0000-0000-0000-000000000000", "subscriptions/00000000-0000-0000-0000-000000000000", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.GenerateDetailedCostReportOperationStatuses = armcostmanagement.GenerateDetailedCostReportOperationStatuses{
// 	Name: to.Ptr("00000000-0000-0000-0000-000000000000"),
// 	Type: to.Ptr("Microsoft.Consumption/operationStatus"),
// 	Error: &armcostmanagement.ErrorDetails{
// 		Code: to.Ptr("0"),
// 	},
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/operationStatus/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.DownloadURL{
// 		DownloadURL: to.Ptr("https://ccmreportstorageeastus.blob.core.windows.net/armreports/20201207/00000000-0000-0000-0000-000000000000?sv=2020-05-31&sr=b&sig=abcd"),
// 		ValidTill: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-08T05:55:59.439Z"); return t}()),
// 	},
// 	Status: &armcostmanagement.Status{
// 	},
// }
Output:

type GenerateDetailedCostReportOperationStatusClientGetOptions

type GenerateDetailedCostReportOperationStatusClientGetOptions struct {
}

GenerateDetailedCostReportOperationStatusClientGetOptions contains the optional parameters for the GenerateDetailedCostReportOperationStatusClient.Get method.

type GenerateDetailedCostReportOperationStatusClientGetResponse

type GenerateDetailedCostReportOperationStatusClientGetResponse struct {
	// The status of the long running operation for cost detailed report.
	GenerateDetailedCostReportOperationStatuses
}

GenerateDetailedCostReportOperationStatusClientGetResponse contains the response from method GenerateDetailedCostReportOperationStatusClient.Get.

type GenerateDetailedCostReportOperationStatuses

type GenerateDetailedCostReportOperationStatuses struct {
	// The endTime of the operation.
	EndTime *string

	// The details of the error.
	Error *ErrorDetails

	// The ID of the long running operation.
	ID *string

	// The name of the long running operation.
	Name *string

	// The properties of the usage file generated.
	Properties *DownloadURL

	// The startTime of the operation.
	StartTime *string

	// The status of the long running operation.
	Status *Status

	// The type of the long running operation.
	Type *string
}

GenerateDetailedCostReportOperationStatuses - The status of the long running operation for cost detailed report.

func (GenerateDetailedCostReportOperationStatuses) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type GenerateDetailedCostReportOperationStatuses.

func (*GenerateDetailedCostReportOperationStatuses) UnmarshalJSON

func (g *GenerateDetailedCostReportOperationStatuses) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateDetailedCostReportOperationStatuses.

type GenerateDetailedCostReportTimePeriod

type GenerateDetailedCostReportTimePeriod struct {
	// REQUIRED; The end date to pull data to. example format 2020-03-15
	End *string

	// REQUIRED; The start date to pull data from. example format 2020-03-15
	Start *string
}

GenerateDetailedCostReportTimePeriod - The start and end date for pulling data for the cost detailed report.

func (GenerateDetailedCostReportTimePeriod) MarshalJSON

func (g GenerateDetailedCostReportTimePeriod) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GenerateDetailedCostReportTimePeriod.

func (*GenerateDetailedCostReportTimePeriod) UnmarshalJSON

func (g *GenerateDetailedCostReportTimePeriod) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateDetailedCostReportTimePeriod.

type GenerateReservationDetailsReportClient

type GenerateReservationDetailsReportClient struct {
	// contains filtered or unexported fields
}

GenerateReservationDetailsReportClient contains the methods for the GenerateReservationDetailsReport group. Don't use this type directly, use NewGenerateReservationDetailsReportClient() instead.

func NewGenerateReservationDetailsReportClient

func NewGenerateReservationDetailsReportClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GenerateReservationDetailsReportClient, error)

NewGenerateReservationDetailsReportClient creates a new instance of GenerateReservationDetailsReportClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GenerateReservationDetailsReportClient) BeginByBillingAccountID

BeginByBillingAccountID - Generates the reservations details report for provided date range asynchronously based on enrollment id. The Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • billingAccountID - Enrollment ID (Legacy BillingAccount ID)
  • startDate - Start Date
  • endDate - End Date
  • options - GenerateReservationDetailsReportClientBeginByBillingAccountIDOptions contains the optional parameters for the GenerateReservationDetailsReportClient.BeginByBillingAccountID method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateReservationDetailsReportByBillingAccount.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateReservationDetailsReportClient().BeginByBillingAccountID(ctx, "9845612", "2020-01-01", "2020-01-30", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.OperationStatus = armcostmanagement.OperationStatus{
// 	Properties: &armcostmanagement.ReportURL{
// 		ReportURL: to.Ptr(armcostmanagement.ReservationReportSchema("https://storage.blob.core.windows.net/details/20200911/00000000-0000-0000-0000-000000000000?sv=2016-05-31&sr=b&sig=jep8HT2aphfUkyERRZa5LRfd9RPzjXbzB%2F9TNiQ")),
// 		ValidUntil: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-12T02:56:55.502Z"); return t}()),
// 	},
// 	Status: to.Ptr(armcostmanagement.OperationStatusTypeCompleted),
// }
Output:

func (*GenerateReservationDetailsReportClient) BeginByBillingProfileID

BeginByBillingProfileID - Generates the reservations details report for provided date range asynchronously by billing profile. The Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • billingAccountID - Billing account ID
  • billingProfileID - Billing profile ID.
  • startDate - Start Date
  • endDate - End Date
  • options - GenerateReservationDetailsReportClientBeginByBillingProfileIDOptions contains the optional parameters for the GenerateReservationDetailsReportClient.BeginByBillingProfileID method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/GenerateReservationDetailsReportByBillingProfile.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGenerateReservationDetailsReportClient().BeginByBillingProfileID(ctx, "00000000-0000-0000-0000-000000000000", "CZSFR-SDFXC-DSDF", "2020-01-01", "2020-01-30", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.OperationStatus = armcostmanagement.OperationStatus{
// 	Properties: &armcostmanagement.ReportURL{
// 		ReportURL: to.Ptr(armcostmanagement.ReservationReportSchema("https://storage.blob.core.windows.net/details/20200911/00000000-0000-0000-0000-000000000000?sv=2016-05-31&sr=b&sig=jep8HT2aphfUkyERRZa5LRfd9RPzjXbzB%2F9TNiQ")),
// 		ValidUntil: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-12T02:56:55.502Z"); return t}()),
// 	},
// 	Status: to.Ptr(armcostmanagement.OperationStatusTypeCompleted),
// }
Output:

type GenerateReservationDetailsReportClientBeginByBillingAccountIDOptions

type GenerateReservationDetailsReportClientBeginByBillingAccountIDOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GenerateReservationDetailsReportClientBeginByBillingAccountIDOptions contains the optional parameters for the GenerateReservationDetailsReportClient.BeginByBillingAccountID method.

type GenerateReservationDetailsReportClientBeginByBillingProfileIDOptions

type GenerateReservationDetailsReportClientBeginByBillingProfileIDOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GenerateReservationDetailsReportClientBeginByBillingProfileIDOptions contains the optional parameters for the GenerateReservationDetailsReportClient.BeginByBillingProfileID method.

type GenerateReservationDetailsReportClientByBillingAccountIDResponse

type GenerateReservationDetailsReportClientByBillingAccountIDResponse struct {
	// The status of the long running operation.
	OperationStatus
}

GenerateReservationDetailsReportClientByBillingAccountIDResponse contains the response from method GenerateReservationDetailsReportClient.BeginByBillingAccountID.

type GenerateReservationDetailsReportClientByBillingProfileIDResponse

type GenerateReservationDetailsReportClientByBillingProfileIDResponse struct {
	// The status of the long running operation.
	OperationStatus
}

GenerateReservationDetailsReportClientByBillingProfileIDResponse contains the response from method GenerateReservationDetailsReportClient.BeginByBillingProfileID.

type Grain

type Grain string

Grain - Grain which corresponds to value.

const (
	// GrainDaily - Hourly grain corresponds to value per day.
	GrainDaily Grain = "Daily"
	// GrainHourly - Hourly grain corresponds to value per hour.
	GrainHourly Grain = "Hourly"
	// GrainMonthly - Hourly grain corresponds to value per month.
	GrainMonthly Grain = "Monthly"
)

func PossibleGrainValues

func PossibleGrainValues() []Grain

PossibleGrainValues returns the possible values for the Grain const type.

type GrainParameter

type GrainParameter string
const (
	// GrainParameterDaily - Hourly grain corresponds to value per day.
	GrainParameterDaily GrainParameter = "Daily"
	// GrainParameterHourly - Hourly grain corresponds to value per hour.
	GrainParameterHourly GrainParameter = "Hourly"
	// GrainParameterMonthly - Hourly grain corresponds to value per month.
	GrainParameterMonthly GrainParameter = "Monthly"
)

func PossibleGrainParameterValues

func PossibleGrainParameterValues() []GrainParameter

PossibleGrainParameterValues returns the possible values for the GrainParameter const type.

type GranularityType

type GranularityType string

GranularityType - The granularity of rows in the forecast.

const (
	GranularityTypeDaily GranularityType = "Daily"
)

func PossibleGranularityTypeValues

func PossibleGranularityTypeValues() []GranularityType

PossibleGranularityTypeValues returns the possible values for the GranularityType const type.

type IncludedQuantityUtilizationSummary

type IncludedQuantityUtilizationSummary struct {
	// REQUIRED; Supported values: 'SavingsPlan'.
	Kind *BenefitKind

	// Included Quantity utilization summary properties.
	Properties *IncludedQuantityUtilizationSummaryProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

IncludedQuantityUtilizationSummary - Included Quantity utilization summary resource.

func (*IncludedQuantityUtilizationSummary) GetBenefitUtilizationSummary

func (i *IncludedQuantityUtilizationSummary) GetBenefitUtilizationSummary() *BenefitUtilizationSummary

GetBenefitUtilizationSummary implements the BenefitUtilizationSummaryClassification interface for type IncludedQuantityUtilizationSummary.

func (IncludedQuantityUtilizationSummary) MarshalJSON

func (i IncludedQuantityUtilizationSummary) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IncludedQuantityUtilizationSummary.

func (*IncludedQuantityUtilizationSummary) UnmarshalJSON

func (i *IncludedQuantityUtilizationSummary) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IncludedQuantityUtilizationSummary.

type IncludedQuantityUtilizationSummaryProperties

type IncludedQuantityUtilizationSummaryProperties struct {
	// The benefit type. Supported values: 'SavingsPlan'.
	BenefitType *BenefitKind

	// READ-ONLY; ARM SKU name. For example, 'ComputeSavingsPlan' for savings plan.
	ArmSKUName *string

	// READ-ONLY; The benefit ID is the identifier of the benefit.
	BenefitID *string

	// READ-ONLY; The benefit order ID is the identifier for a benefit purchase.
	BenefitOrderID *string

	// READ-ONLY; Date corresponding to the utilization summary record. If the grain of data is monthly, value for this field
	// will be first day of the month.
	UsageDate *time.Time

	// READ-ONLY; This is the utilized percentage for the benefit ID.
	UtilizationPercentage *float64
}

IncludedQuantityUtilizationSummaryProperties - Included Quantity utilization summary properties.

func (IncludedQuantityUtilizationSummaryProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type IncludedQuantityUtilizationSummaryProperties.

func (*IncludedQuantityUtilizationSummaryProperties) UnmarshalJSON

func (i *IncludedQuantityUtilizationSummaryProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IncludedQuantityUtilizationSummaryProperties.

type KpiProperties

type KpiProperties struct {
	// show the KPI in the UI?
	Enabled *bool

	// ID of resource related to metric (budget).
	ID *string

	// KPI type (Forecast, Budget).
	Type *KpiType
}

KpiProperties - Each KPI must contain a 'type' and 'enabled' key.

func (KpiProperties) MarshalJSON

func (k KpiProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KpiProperties.

func (*KpiProperties) UnmarshalJSON

func (k *KpiProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KpiProperties.

type KpiType

type KpiType string

KpiType - KPI type (Forecast, Budget).

const (
	KpiTypeBudget   KpiType = "Budget"
	KpiTypeForecast KpiType = "Forecast"
)

func PossibleKpiTypeValues

func PossibleKpiTypeValues() []KpiType

PossibleKpiTypeValues returns the possible values for the KpiType const type.

type LookBackPeriod

type LookBackPeriod string

LookBackPeriod - The number of days used to look back.

const (
	// LookBackPeriodLast30Days - 30 days used to look back.
	LookBackPeriodLast30Days LookBackPeriod = "Last30Days"
	// LookBackPeriodLast60Days - 60 days used to look back.
	LookBackPeriodLast60Days LookBackPeriod = "Last60Days"
	// LookBackPeriodLast7Days - 7 days used to look back.
	LookBackPeriodLast7Days LookBackPeriod = "Last7Days"
)

func PossibleLookBackPeriodValues

func PossibleLookBackPeriodValues() []LookBackPeriod

PossibleLookBackPeriodValues returns the possible values for the LookBackPeriod const type.

type MetricType

type MetricType string

MetricType - Metric to use when displaying costs.

const (
	MetricTypeAHUB          MetricType = "AHUB"
	MetricTypeActualCost    MetricType = "ActualCost"
	MetricTypeAmortizedCost MetricType = "AmortizedCost"
)

func PossibleMetricTypeValues

func PossibleMetricTypeValues() []MetricType

PossibleMetricTypeValues returns the possible values for the MetricType const type.

type NotificationProperties

type NotificationProperties struct {
	// REQUIRED; Subject of the email. Length is limited to 70 characters.
	Subject *string

	// REQUIRED; Array of email addresses.
	To []*string

	// Locale of the email.
	Language *string

	// Optional message to be added in the email. Length is limited to 250 characters.
	Message *string

	// Regional format used for formatting date/time and currency values in the email.
	RegionalFormat *string
}

NotificationProperties - The properties of the scheduled action notification.

func (NotificationProperties) MarshalJSON

func (n NotificationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotificationProperties.

func (*NotificationProperties) UnmarshalJSON

func (n *NotificationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotificationProperties.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
	Description *string

	// READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
	// Machine", "Restart Virtual Machine".
	Operation *string

	// READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
	// Compute".
	Provider *string

	// READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
	// Schedule Collections".
	Resource *string
}

OperationDisplay - Localized display information for this particular operation.

func (OperationDisplay) MarshalJSON

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationForCostManagement

type OperationForCostManagement struct {
	// Localized display information for this particular operation.
	Display *OperationDisplay

	// READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
	ActionType *ActionType

	// READ-ONLY; Operation id: {provider}/{resource}/{operation}.
	ID *string

	// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane
	// operations.
	IsDataAction *bool

	// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
	// "Microsoft.Compute/virtualMachines/capture/action"
	Name *string

	// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
	// value is "user,system"
	Origin *Origin
}

OperationForCostManagement - A Cost management REST API operation.

func (OperationForCostManagement) MarshalJSON

func (o OperationForCostManagement) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationForCostManagement.

func (*OperationForCostManagement) UnmarshalJSON

func (o *OperationForCostManagement) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationForCostManagement.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; URL to get the next set of operation list results if there are any.
	NextLink *string

	// READ-ONLY; List of cost management operations supported by the Microsoft.CostManagement resource provider.
	Value []*OperationForCostManagement
}

OperationListResult - Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results.

func (OperationListResult) MarshalJSON

func (o OperationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

func (o *OperationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationStatus

type OperationStatus struct {
	// The properties of the resource generated.
	Properties *ReportURL

	// The status of the long running operation.
	Status *OperationStatusType
}

OperationStatus - The status of the long running operation.

func (OperationStatus) MarshalJSON

func (o OperationStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationStatus.

func (*OperationStatus) UnmarshalJSON

func (o *OperationStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus.

type OperationStatusType

type OperationStatusType string

OperationStatusType - The status of the long running operation.

const (
	OperationStatusTypeCompleted OperationStatusType = "Completed"
	OperationStatusTypeFailed    OperationStatusType = "Failed"
	OperationStatusTypeRunning   OperationStatusType = "Running"
)

func PossibleOperationStatusTypeValues

func PossibleOperationStatusTypeValues() []OperationStatusType

PossibleOperationStatusTypeValues returns the possible values for the OperationStatusType const type.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager

NewListPager - Lists all of the available cost management REST API operations.

Generated from API version 2022-10-01

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/OperationList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewOperationsClient().NewListPager(nil)
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.OperationListResult = armcostmanagement.OperationListResult{
	// 	Value: []*armcostmanagement.OperationForCostManagement{
	// 		{
	// 			Name: to.Ptr("Microsoft.CostManagement/budgets/read"),
	// 			Display: &armcostmanagement.OperationDisplay{
	// 				Description: to.Ptr("List the budgets by a subscription or a management group."),
	// 				Operation: to.Ptr("List budgets"),
	// 				Provider: to.Ptr("Microsoft.CostManagement"),
	// 				Resource: to.Ptr("Budgets"),
	// 			},
	// 			ID: to.Ptr("Microsoft.CostManagement/budgets/read"),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.CostManagement/query/action"),
	// 			Display: &armcostmanagement.OperationDisplay{
	// 				Description: to.Ptr("Query usage data by a scope."),
	// 				Operation: to.Ptr("Query usage data"),
	// 				Provider: to.Ptr("Microsoft.CostManagement"),
	// 				Resource: to.Ptr("Query"),
	// 			},
	// 			ID: to.Ptr("Microsoft.CostManagement/query/action"),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.CostManagement/exports/read"),
	// 			Display: &armcostmanagement.OperationDisplay{
	// 				Description: to.Ptr("List the exports by scope."),
	// 				Operation: to.Ptr("List exports"),
	// 				Provider: to.Ptr("Microsoft.CostManagement"),
	// 				Resource: to.Ptr("Exports"),
	// 			},
	// 			ID: to.Ptr("Microsoft.CostManagement/exports/read"),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.CostManagement/exports/write"),
	// 			Display: &armcostmanagement.OperationDisplay{
	// 				Description: to.Ptr("Create or update the specified export."),
	// 				Operation: to.Ptr("Create and update export"),
	// 				Provider: to.Ptr("Microsoft.CostManagement"),
	// 				Resource: to.Ptr("Exports"),
	// 			},
	// 			ID: to.Ptr("Microsoft.CostManagement/exports/write"),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.CostManagement/exports/action"),
	// 			Display: &armcostmanagement.OperationDisplay{
	// 				Description: to.Ptr("Run the specified export."),
	// 				Operation: to.Ptr("Run export"),
	// 				Provider: to.Ptr("Microsoft.CostManagement"),
	// 				Resource: to.Ptr("Exports"),
	// 			},
	// 			ID: to.Ptr("Microsoft.CostManagement/exports/action"),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.CostManagement/exports/run/action"),
	// 			Display: &armcostmanagement.OperationDisplay{
	// 				Description: to.Ptr("Run exports."),
	// 				Operation: to.Ptr("Run exports"),
	// 				Provider: to.Ptr("Microsoft.CostManagement"),
	// 				Resource: to.Ptr("exports/run"),
	// 			},
	// 			ID: to.Ptr("Microsoft.CostManagement/exports/run/action"),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.CostManagement/alerts/read"),
	// 			Display: &armcostmanagement.OperationDisplay{
	// 				Description: to.Ptr("List alerts."),
	// 				Operation: to.Ptr("List Alerts"),
	// 				Provider: to.Ptr("Microsoft.CostManagement"),
	// 				Resource: to.Ptr("Alerts"),
	// 			},
	// 			ID: to.Ptr("Microsoft.CostManagement/alerts/read"),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.CostManagement/operations/read"),
	// 			Display: &armcostmanagement.OperationDisplay{
	// 				Description: to.Ptr("List all supported operations by Microsoft.CostManagement resource provider."),
	// 				Operation: to.Ptr("List supported operations"),
	// 				Provider: to.Ptr("Microsoft.CostManagement"),
	// 				Resource: to.Ptr("Operations"),
	// 			},
	// 			ID: to.Ptr("Microsoft.CostManagement/operations/read"),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.CostManagement/views/action"),
	// 			Display: &armcostmanagement.OperationDisplay{
	// 				Description: to.Ptr("Create view."),
	// 				Operation: to.Ptr("Create views"),
	// 				Provider: to.Ptr("Microsoft.CostManagement"),
	// 				Resource: to.Ptr("Views"),
	// 			},
	// 			ID: to.Ptr("Microsoft.CostManagement/views/action"),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.CostManagement/views/write"),
	// 			Display: &armcostmanagement.OperationDisplay{
	// 				Description: to.Ptr("Update view."),
	// 				Operation: to.Ptr("Update views"),
	// 				Provider: to.Ptr("Microsoft.CostManagement"),
	// 				Resource: to.Ptr("Views"),
	// 			},
	// 			ID: to.Ptr("Microsoft.CostManagement/views/write"),
	// 	}},
	// }
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type OperatorType

type OperatorType string

OperatorType - The operator to use for comparison.

const (
	OperatorTypeContains OperatorType = "Contains"
	OperatorTypeIn       OperatorType = "In"
)

func PossibleOperatorTypeValues

func PossibleOperatorTypeValues() []OperatorType

PossibleOperatorTypeValues returns the possible values for the OperatorType const type.

type Origin

type Origin string

Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"

const (
	OriginSystem     Origin = "system"
	OriginUser       Origin = "user"
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type PivotProperties

type PivotProperties struct {
	// Data field to show in view.
	Name *string

	// Data type to show in view.
	Type *PivotType
}

PivotProperties - Each pivot must contain a 'type' and 'name'.

func (PivotProperties) MarshalJSON

func (p PivotProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PivotProperties.

func (*PivotProperties) UnmarshalJSON

func (p *PivotProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PivotProperties.

type PivotType

type PivotType string

PivotType - Data type to show in view.

const (
	PivotTypeDimension PivotType = "Dimension"
	PivotTypeTagKey    PivotType = "TagKey"
)

func PossiblePivotTypeValues

func PossiblePivotTypeValues() []PivotType

PossiblePivotTypeValues returns the possible values for the PivotType const type.

type PriceSheetClient

type PriceSheetClient struct {
	// contains filtered or unexported fields
}

PriceSheetClient contains the methods for the PriceSheet group. Don't use this type directly, use NewPriceSheetClient() instead.

func NewPriceSheetClient

func NewPriceSheetClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PriceSheetClient, error)

NewPriceSheetClient creates a new instance of PriceSheetClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PriceSheetClient) BeginDownload

func (client *PriceSheetClient) BeginDownload(ctx context.Context, billingAccountName string, billingProfileName string, invoiceName string, options *PriceSheetClientBeginDownloadOptions) (*runtime.Poller[PriceSheetClientDownloadResponse], error)

BeginDownload - Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • billingAccountName - The ID that uniquely identifies a billing account.
  • billingProfileName - The ID that uniquely identifies a billing profile.
  • invoiceName - The ID that uniquely identifies an invoice.
  • options - PriceSheetClientBeginDownloadOptions contains the optional parameters for the PriceSheetClient.BeginDownload method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PricesheetDownload.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewPriceSheetClient().BeginDownload(ctx, "7c05a543-80ff-571e-9f98-1063b3b53cf2:99ad03ad-2d1b-4889-a452-090ad407d25f_2019-05-31", "2USN-TPCD-BG7-TGB", "T000940677", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.DownloadURL = armcostmanagement.DownloadURL{
// 	DownloadURL: to.Ptr("https://myaccount.blob.core.windows.net/?restype=service&comp=properties&sv=2015-04-05&ss=bf&srt=s&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&spr=https&sig=G%2TEST%4B"),
// 	ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T17:32:28.000Z"); return t}()),
// }
Output:

func (*PriceSheetClient) BeginDownloadByBillingProfile

func (client *PriceSheetClient) BeginDownloadByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, options *PriceSheetClientBeginDownloadByBillingProfileOptions) (*runtime.Poller[PriceSheetClientDownloadByBillingProfileResponse], error)

BeginDownloadByBillingProfile - Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated from a single csv file to a Zip file containing multiple csv files, each with max 200k records. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • billingAccountName - The ID that uniquely identifies a billing account.
  • billingProfileName - The ID that uniquely identifies a billing profile.
  • options - PriceSheetClientBeginDownloadByBillingProfileOptions contains the optional parameters for the PriceSheetClient.BeginDownloadByBillingProfile method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PricesheetDownloadByBillingProfile.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewPriceSheetClient().BeginDownloadByBillingProfile(ctx, "7c05a543-80ff-571e-9f98-1063b3b53cf2:99ad03ad-2d1b-4889-a452-090ad407d25f_2019-05-31", "2USN-TPCD-BG7-TGB", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
	log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.DownloadURL = armcostmanagement.DownloadURL{
// 	DownloadURL: to.Ptr("https://myaccount.blob.core.windows.net/?restype=service&comp=properties&sv=2015-04-05&ss=bf&srt=s&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&spr=https&sig=G%2TEST%4B"),
// 	ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-21T17:32:28.000Z"); return t}()),
// }
Output:

type PriceSheetClientBeginDownloadByBillingProfileOptions

type PriceSheetClientBeginDownloadByBillingProfileOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

PriceSheetClientBeginDownloadByBillingProfileOptions contains the optional parameters for the PriceSheetClient.BeginDownloadByBillingProfile method.

type PriceSheetClientBeginDownloadOptions

type PriceSheetClientBeginDownloadOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

PriceSheetClientBeginDownloadOptions contains the optional parameters for the PriceSheetClient.BeginDownload method.

type PriceSheetClientDownloadByBillingProfileResponse

type PriceSheetClientDownloadByBillingProfileResponse struct {
	// The URL to download the generated report.
	DownloadURL
}

PriceSheetClientDownloadByBillingProfileResponse contains the response from method PriceSheetClient.BeginDownloadByBillingProfile.

type PriceSheetClientDownloadResponse

type PriceSheetClientDownloadResponse struct {
	// The URL to download the generated report.
	DownloadURL
}

PriceSheetClientDownloadResponse contains the response from method PriceSheetClient.BeginDownload.

type QueryAggregation

type QueryAggregation struct {
	// REQUIRED; The name of the aggregation function to use.
	Function *FunctionType

	// REQUIRED; The name of the column to aggregate.
	Name *string
}

QueryAggregation - The aggregation expression to be used in the query.

func (QueryAggregation) MarshalJSON

func (q QueryAggregation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryAggregation.

func (*QueryAggregation) UnmarshalJSON

func (q *QueryAggregation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryAggregation.

type QueryClient

type QueryClient struct {
	// contains filtered or unexported fields
}

QueryClient contains the methods for the Query group. Don't use this type directly, use NewQueryClient() instead.

func NewQueryClient

func NewQueryClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*QueryClient, error)

NewQueryClient creates a new instance of QueryClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*QueryClient) Usage

func (client *QueryClient) Usage(ctx context.Context, scope string, parameters QueryDefinition, options *QueryClientUsageOptions) (QueryClientUsageResponse, error)

Usage - Query the usage data for scope defined. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
  • parameters - Parameters supplied to the CreateOrUpdate Query Config operation.
  • options - QueryClientUsageOptions contains the optional parameters for the QueryClient.Usage method.
Example (BillingAccountQueryGroupingLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountQueryGrouping.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/70664866", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Aggregation: map[string]*armcostmanagement.QueryAggregation{
			"totalCost": {
				Name:     to.Ptr("PreTaxCost"),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityType("None")),
		Grouping: []*armcostmanagement.QueryGrouping{
			{
				Name: to.Ptr("ResourceGroup"),
				Type: to.Ptr(armcostmanagement.QueryColumnTypeDimension),
			}},
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeTheLastMonth),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						"USD"}},
// 					},
// 				}
Output:

Example (BillingAccountQueryGroupingMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingAccountQueryGrouping.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Aggregation: map[string]*armcostmanagement.QueryAggregation{
			"totalCost": {
				Name:     to.Ptr("PreTaxCost"),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityType("None")),
		Grouping: []*armcostmanagement.QueryGrouping{
			{
				Name: to.Ptr("ResourceGroup"),
				Type: to.Ptr(armcostmanagement.QueryColumnTypeDimension),
			}},
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeTheLastMonth),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						"USD"}},
// 					},
// 				}
Output:

Example (BillingAccountQueryLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BillingAccountQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/70664866", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						float64(20180331),
// 						"USD"},
// 						[]any{
// 							float64(0.16677720329728665),
// 							"gs-stms-dev",
// 							float64(20180331),
// 							"USD"}},
// 						},
// 					}
Output:

Example (BillingAccountQueryMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingAccountQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						float64(20180331),
// 						"USD"},
// 						[]any{
// 							float64(0.16677720329728665),
// 							"gs-stms-dev",
// 							float64(20180331),
// 							"USD"}},
// 						},
// 					}
Output:

Example (BillingProfileQueryGroupingMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingProfileQueryGrouping.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Aggregation: map[string]*armcostmanagement.QueryAggregation{
			"totalCost": {
				Name:     to.Ptr("PreTaxCost"),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityType("None")),
		Grouping: []*armcostmanagement.QueryGrouping{
			{
				Name: to.Ptr("ResourceGroup"),
				Type: to.Ptr(armcostmanagement.QueryColumnTypeDimension),
			}},
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeTheLastMonth),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						"USD"}},
// 					},
// 				}
Output:

Example (BillingProfileQueryMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCABillingProfileQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						float64(20180331),
// 						"USD"},
// 						[]any{
// 							float64(0.16677720329728665),
// 							"gs-stms-dev",
// 							float64(20180331),
// 							"USD"}},
// 						},
// 					}
Output:

Example (CustomerQueryGroupingMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCACustomerQueryGrouping.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Aggregation: map[string]*armcostmanagement.QueryAggregation{
			"totalCost": {
				Name:     to.Ptr("PreTaxCost"),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityType("None")),
		Grouping: []*armcostmanagement.QueryGrouping{
			{
				Name: to.Ptr("ResourceGroup"),
				Type: to.Ptr(armcostmanagement.QueryColumnTypeDimension),
			}},
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeTheLastMonth),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						"USD"}},
// 					},
// 				}
Output:

Example (CustomerQueryMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCACustomerQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						float64(20180331),
// 						"USD"},
// 						[]any{
// 							float64(0.16677720329728665),
// 							"gs-stms-dev",
// 							float64(20180331),
// 							"USD"}},
// 						},
// 					}
Output:

Example (DepartmentQueryGroupingLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentQueryGrouping.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/100/departments/123", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Aggregation: map[string]*armcostmanagement.QueryAggregation{
			"totalCost": {
				Name:     to.Ptr("PreTaxCost"),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityType("None")),
		Grouping: []*armcostmanagement.QueryGrouping{
			{
				Name: to.Ptr("ResourceGroup"),
				Type: to.Ptr(armcostmanagement.QueryColumnTypeDimension),
			}},
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeTheLastMonth),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/70664866/departments/123/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						"USD"}},
// 					},
// 				}
Output:

Example (DepartmentQueryLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/DepartmentQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/100/departments/123", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/70664866/departments/123/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						float64(20180331),
// 						"USD"},
// 						[]any{
// 							float64(0.16677720329728665),
// 							"gs-stms-dev",
// 							float64(20180331),
// 							"USD"}},
// 						},
// 					}
Output:

Example (EnrollmentAccountQueryGroupingLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountQueryGrouping.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Aggregation: map[string]*armcostmanagement.QueryAggregation{
			"totalCost": {
				Name:     to.Ptr("PreTaxCost"),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
		Grouping: []*armcostmanagement.QueryGrouping{
			{
				Name: to.Ptr("ResourceGroup"),
				Type: to.Ptr(armcostmanagement.QueryColumnTypeDimension),
			}},
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeTheLastMonth),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/70664866/enrollmentAccounts/456/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						float64(20180331),
// 						"USD"}},
// 					},
// 				}
Output:

Example (EnrollmentAccountQueryLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/EnrollmentAccountQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/70664866/enrollmentAccounts/456/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						float64(20180331),
// 						"USD"},
// 						[]any{
// 							float64(0.16677720329728665),
// 							"gs-stms-dev",
// 							float64(20180331),
// 							"USD"}},
// 						},
// 					}
Output:

Example (InvoiceSectionQueryGroupingMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCAInvoiceSectionQueryGrouping.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Aggregation: map[string]*armcostmanagement.QueryAggregation{
			"totalCost": {
				Name:     to.Ptr("PreTaxCost"),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityType("None")),
		Grouping: []*armcostmanagement.QueryGrouping{
			{
				Name: to.Ptr("ResourceGroup"),
				Type: to.Ptr(armcostmanagement.QueryColumnTypeDimension),
			}},
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeTheLastMonth),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						"USD"}},
// 					},
// 				}
Output:

Example (InvoiceSectionQueryMca)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/MCAInvoiceSectionQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						float64(20180331),
// 						"USD"},
// 						[]any{
// 							float64(0.16677720329728665),
// 							"gs-stms-dev",
// 							float64(20180331),
// 							"USD"}},
// 						},
// 					}
Output:

Example (ManagementGroupQueryGroupingLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ManagementGroupQueryGrouping.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Management/managementGroups/MyMgId", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Aggregation: map[string]*armcostmanagement.QueryAggregation{
			"totalCost": {
				Name:     to.Ptr("PreTaxCost"),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityType("None")),
		Grouping: []*armcostmanagement.QueryGrouping{
			{
				Name: to.Ptr("ResourceGroup"),
				Type: to.Ptr(armcostmanagement.QueryColumnTypeDimension),
			}},
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeTheLastMonth),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Management/managementGroups/MyMgId/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(20.35941656262545),
// 				"VSTSHOL-1595322048000",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(19.545363672276512),
// 						"JapanUnifia-Trial",
// 						float64(20180331),
// 						"USD"}},
// 					},
// 				}
Output:

Example (ManagementGroupQueryLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ManagementGroupQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "providers/Microsoft.Management/managementGroups/MyMgId", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("providers/Microsoft.Management/managementGroups/MyMgId/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(19.545363672276512),
// 				"JapanUnifia-Trial",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(173.41979241290323),
// 					"RVIIOT-TRIAL",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(20.35941656262545),
// 						"VSTSHOL-1595322048000",
// 						float64(20180331),
// 						"USD"},
// 						[]any{
// 							float64(0.16677720329728665),
// 							"gs-stms-dev",
// 							float64(20180331),
// 							"USD"}},
// 						},
// 					}
Output:

Example (ResourceGroupQueryGroupingLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ResourceGroupQueryGrouping.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Aggregation: map[string]*armcostmanagement.QueryAggregation{
			"totalCost": {
				Name:     to.Ptr("PreTaxCost"),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
		Grouping: []*armcostmanagement.QueryGrouping{
			{
				Name: to.Ptr("ResourceType"),
				Type: to.Ptr(armcostmanagement.QueryColumnTypeDimension),
			}},
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeTheLastMonth),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("9af9459d-441d-4055-9ed0-83d4c4a363fb"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/Query/9af9459d-441d-4055-9ed0-83d4c4a363fb"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceType"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(2.10333307059661),
// 				"Microsoft.SqlServer",
// 				float64(20180417),
// 				"USD"},
// 				[]any{
// 					float64(20.10333307059661),
// 					"Microsoft.Compute",
// 					float64(20180418),
// 					"USD"}},
// 				},
// 			}
Output:

Example (ResourceGroupQueryLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ResourceGroupQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("9af9459d-441d-4055-9ed0-83d4c4a363fb"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("subscriptions/55312978-ba1b-415c-9304-c4b9c43c0481/resourcegroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/Query/9af9459d-441d-4055-9ed0-83d4c4a363fb"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(2.10333307059661),
// 				"ScreenSharingTest-peer",
// 				float64(20180417),
// 				"USD"},
// 				[]any{
// 					float64(20.10333307059661),
// 					"ScreenSharingTest-peer",
// 					float64(20180418),
// 					"USD"}},
// 				},
// 			}
Output:

Example (SubscriptionQueryGroupingLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SubscriptionQueryGrouping.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Aggregation: map[string]*armcostmanagement.QueryAggregation{
			"totalCost": {
				Name:     to.Ptr("PreTaxCost"),
				Function: to.Ptr(armcostmanagement.FunctionTypeSum),
			},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityType("None")),
		Grouping: []*armcostmanagement.QueryGrouping{
			{
				Name: to.Ptr("ResourceGroup"),
				Type: to.Ptr(armcostmanagement.QueryColumnTypeDimension),
			}},
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeTheLastMonth),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("55312978-ba1b-415c-9304-cfd9c43c0481"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/Query/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(0.009865586851323632),
// 				"Ict_StratAndPlan_GoldSprova_Prod_0",
// 				"USD"},
// 				[]any{
// 					float64(218.68795741935486),
// 					"Ict_StratAndPlan_GoldSprova_Prod_1",
// 					"USD"},
// 					[]any{
// 						float64(2.10333307059661),
// 						"ScreenSharingTest-peer1",
// 						"USD"},
// 						[]any{
// 							float64(0.14384913581657052),
// 							"Ssbciotelement01",
// 							"USD"}},
// 						},
// 					}
Output:

Example (SubscriptionQueryLegacy)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/SubscriptionQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().Usage(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("55312978-ba1b-415c-9304-cfd9c43c0481"),
// 	Type: to.Ptr("microsoft.costmanagement/Query"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/Query/00000000-0000-0000-0000-000000000000"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ResourceGroup"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(2.10333307059661),
// 				"ScreenSharingTest-peer",
// 				float64(20180331),
// 				"USD"},
// 				[]any{
// 					float64(218.68795741935486),
// 					"Ict_StratAndPlan_GoldSprova_Prod",
// 					float64(20180331),
// 					"USD"},
// 					[]any{
// 						float64(0.14384913581657052),
// 						"ssbciotelement01",
// 						float64(20180401),
// 						"USD"},
// 						[]any{
// 							float64(0.009865586851323632),
// 							"ict_stratandplan_goldsprova_prod",
// 							float64(20180429),
// 							"USD"}},
// 						},
// 					}
Output:

func (*QueryClient) UsageByExternalCloudProviderType

func (client *QueryClient) UsageByExternalCloudProviderType(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, parameters QueryDefinition, options *QueryClientUsageByExternalCloudProviderTypeOptions) (QueryClientUsageByExternalCloudProviderTypeResponse, error)

UsageByExternalCloudProviderType - Query the usage data for external cloud provider type defined. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • externalCloudProviderType - The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.
  • externalCloudProviderID - This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.
  • parameters - Parameters supplied to the CreateOrUpdate Query Config operation.
  • options - QueryClientUsageByExternalCloudProviderTypeOptions contains the optional parameters for the QueryClient.UsageByExternalCloudProviderType method.
Example (ExternalBillingAccountQueryList)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalBillingAccountsQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().UsageByExternalCloudProviderType(ctx, armcostmanagement.ExternalCloudProviderTypeExternalBillingAccounts, "100", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("6dc7b06a-d90a-4df5-b655-ce6cf1c0814d"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("providers/Microsoft.CostManagement/externalBillingAccounts/100/query/6dc7b06a-d90a-4df5-b655-ce6cf1c0814d"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("ServiceName"),
// 				Type: to.Ptr("String"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 			[]any{
// 				float64(0),
// 				"abc db",
// 				"USD"},
// 				[]any{
// 					float64(30.2572751438),
// 					"abc compute cloud",
// 					"USD"},
// 					[]any{
// 						float64(0.07675760200000002),
// 						"abc file system",
// 						"USD"},
// 						[]any{
// 							float64(50.43096419040001),
// 							"abc elasticache",
// 							"USD"}},
// 						},
// 					}
Output:

Example (ExternalSubscriptionsQuery)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ExternalSubscriptionsQuery.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewQueryClient().UsageByExternalCloudProviderType(ctx, armcostmanagement.ExternalCloudProviderTypeExternalSubscriptions, "100", armcostmanagement.QueryDefinition{
	Type: to.Ptr(armcostmanagement.ExportTypeUsage),
	Dataset: &armcostmanagement.QueryDataset{
		Filter: &armcostmanagement.QueryFilter{
			And: []*armcostmanagement.QueryFilter{
				{
					Or: []*armcostmanagement.QueryFilter{
						{
							Dimensions: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("ResourceLocation"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("East US"),
									to.Ptr("West Europe")},
							},
						},
						{
							Tags: &armcostmanagement.QueryComparisonExpression{
								Name:     to.Ptr("Environment"),
								Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
								Values: []*string{
									to.Ptr("UAT"),
									to.Ptr("Prod")},
							},
						}},
				},
				{
					Dimensions: &armcostmanagement.QueryComparisonExpression{
						Name:     to.Ptr("ResourceGroup"),
						Operator: to.Ptr(armcostmanagement.QueryOperatorTypeIn),
						Values: []*string{
							to.Ptr("API")},
					},
				}},
		},
		Granularity: to.Ptr(armcostmanagement.GranularityTypeDaily),
	},
	Timeframe: to.Ptr(armcostmanagement.TimeframeTypeMonthToDate),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.QueryResult = armcostmanagement.QueryResult{
// 	Name: to.Ptr("d99477af-7510-40ee-aca2-e59bdca0d10d"),
// 	Type: to.Ptr("Microsoft.CostManagement/query"),
// 	ID: to.Ptr("providers/Microsoft.CostManagement/externalSubscriptions/100/query/d99477af-7510-40ee-aca2-e59bdca0d10d"),
// 	Properties: &armcostmanagement.QueryProperties{
// 		Columns: []*armcostmanagement.QueryColumn{
// 			{
// 				Name: to.Ptr("PreTaxCost"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("UsageDate"),
// 				Type: to.Ptr("Number"),
// 			},
// 			{
// 				Name: to.Ptr("Currency"),
// 				Type: to.Ptr("String"),
// 		}},
// 		Rows: [][]any{
// 		},
// 	},
// }
Output:

type QueryClientUsageByExternalCloudProviderTypeOptions

type QueryClientUsageByExternalCloudProviderTypeOptions struct {
}

QueryClientUsageByExternalCloudProviderTypeOptions contains the optional parameters for the QueryClient.UsageByExternalCloudProviderType method.

type QueryClientUsageByExternalCloudProviderTypeResponse

type QueryClientUsageByExternalCloudProviderTypeResponse struct {
	// Result of query. It contains all columns listed under groupings and aggregation.
	QueryResult
}

QueryClientUsageByExternalCloudProviderTypeResponse contains the response from method QueryClient.UsageByExternalCloudProviderType.

type QueryClientUsageOptions

type QueryClientUsageOptions struct {
}

QueryClientUsageOptions contains the optional parameters for the QueryClient.Usage method.

type QueryClientUsageResponse

type QueryClientUsageResponse struct {
	// Result of query. It contains all columns listed under groupings and aggregation.
	QueryResult
}

QueryClientUsageResponse contains the response from method QueryClient.Usage.

type QueryColumn

type QueryColumn struct {
	// The name of column.
	Name *string

	// The type of column.
	Type *string
}

QueryColumn properties

func (QueryColumn) MarshalJSON

func (q QueryColumn) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryColumn.

func (*QueryColumn) UnmarshalJSON

func (q *QueryColumn) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryColumn.

type QueryColumnType

type QueryColumnType string

QueryColumnType - The type of the column in the report.

const (
	// QueryColumnTypeDimension - The dimension of cost data.
	QueryColumnTypeDimension QueryColumnType = "Dimension"
	// QueryColumnTypeTagKey - The tag associated with the cost data.
	QueryColumnTypeTagKey QueryColumnType = "TagKey"
)

func PossibleQueryColumnTypeValues

func PossibleQueryColumnTypeValues() []QueryColumnType

PossibleQueryColumnTypeValues returns the possible values for the QueryColumnType const type.

type QueryComparisonExpression

type QueryComparisonExpression struct {
	// REQUIRED; The name of the column to use in comparison.
	Name *string

	// REQUIRED; The operator to use for comparison.
	Operator *QueryOperatorType

	// REQUIRED; Array of values to use for comparison
	Values []*string
}

QueryComparisonExpression - The comparison expression to be used in the query.

func (QueryComparisonExpression) MarshalJSON

func (q QueryComparisonExpression) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryComparisonExpression.

func (*QueryComparisonExpression) UnmarshalJSON

func (q *QueryComparisonExpression) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryComparisonExpression.

type QueryDataset

type QueryDataset struct {
	// Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated
	// column. Query can have up to 2 aggregation clauses.
	Aggregation map[string]*QueryAggregation

	// Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping
	// are provided.
	Configuration *QueryDatasetConfiguration

	// The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format
	// the filter.
	Filter *QueryFilter

	// The granularity of rows in the query.
	Granularity *GranularityType

	// Array of group by expression to use in the query. Query can have up to 2 group by clauses.
	Grouping []*QueryGrouping
}

QueryDataset - The definition of data present in the query.

func (QueryDataset) MarshalJSON

func (q QueryDataset) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryDataset.

func (*QueryDataset) UnmarshalJSON

func (q *QueryDataset) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryDataset.

type QueryDatasetConfiguration

type QueryDatasetConfiguration struct {
	// Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query
	// includes all columns.
	Columns []*string
}

QueryDatasetConfiguration - The configuration of dataset in the query.

func (QueryDatasetConfiguration) MarshalJSON

func (q QueryDatasetConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryDatasetConfiguration.

func (*QueryDatasetConfiguration) UnmarshalJSON

func (q *QueryDatasetConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryDatasetConfiguration.

type QueryDefinition

type QueryDefinition struct {
	// REQUIRED; Has definition for data in this query.
	Dataset *QueryDataset

	// REQUIRED; The time frame for pulling data for the query. If custom, then a specific time period must be provided.
	Timeframe *TimeframeType

	// REQUIRED; The type of the query.
	Type *ExportType

	// Has time period for pulling data for the query.
	TimePeriod *QueryTimePeriod
}

QueryDefinition - The definition of a query.

func (QueryDefinition) MarshalJSON

func (q QueryDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryDefinition.

func (*QueryDefinition) UnmarshalJSON

func (q *QueryDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryDefinition.

type QueryFilter

type QueryFilter struct {
	// The logical "AND" expression. Must have at least 2 items.
	And []*QueryFilter

	// Has comparison expression for a dimension
	Dimensions *QueryComparisonExpression

	// The logical "OR" expression. Must have at least 2 items.
	Or []*QueryFilter

	// Has comparison expression for a tag
	Tags *QueryComparisonExpression
}

QueryFilter - The filter expression to be used in the export.

func (QueryFilter) MarshalJSON

func (q QueryFilter) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryFilter.

func (*QueryFilter) UnmarshalJSON

func (q *QueryFilter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryFilter.

type QueryGrouping

type QueryGrouping struct {
	// REQUIRED; The name of the column to group.
	Name *string

	// REQUIRED; Has type of the column to group.
	Type *QueryColumnType
}

QueryGrouping - The group by expression to be used in the query.

func (QueryGrouping) MarshalJSON

func (q QueryGrouping) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryGrouping.

func (*QueryGrouping) UnmarshalJSON

func (q *QueryGrouping) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryGrouping.

type QueryOperatorType

type QueryOperatorType string

QueryOperatorType - The operator to use for comparison.

const (
	QueryOperatorTypeIn QueryOperatorType = "In"
)

func PossibleQueryOperatorTypeValues

func PossibleQueryOperatorTypeValues() []QueryOperatorType

PossibleQueryOperatorTypeValues returns the possible values for the QueryOperatorType const type.

type QueryProperties

type QueryProperties struct {
	// Array of columns
	Columns []*QueryColumn

	// The link (url) to the next page of results.
	NextLink *string

	// Array of rows
	Rows [][]any
}

QueryProperties - Query properties

func (QueryProperties) MarshalJSON

func (q QueryProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryProperties.

func (*QueryProperties) UnmarshalJSON

func (q *QueryProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryProperties.

type QueryResult

type QueryResult struct {
	// Query properties
	Properties *QueryProperties

	// READ-ONLY; ETag of the resource.
	ETag *string

	// READ-ONLY; Resource Id.
	ID *string

	// READ-ONLY; Location of the resource.
	Location *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; SKU of the resource.
	SKU *string

	// READ-ONLY; Resource tags.
	Tags map[string]*string

	// READ-ONLY; Resource type.
	Type *string
}

QueryResult - Result of query. It contains all columns listed under groupings and aggregation.

func (QueryResult) MarshalJSON

func (q QueryResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryResult.

func (*QueryResult) UnmarshalJSON

func (q *QueryResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryResult.

type QueryTimePeriod

type QueryTimePeriod struct {
	// REQUIRED; The start date to pull data from.
	From *time.Time

	// REQUIRED; The end date to pull data to.
	To *time.Time
}

QueryTimePeriod - The start and end date for pulling data for the query.

func (QueryTimePeriod) MarshalJSON

func (q QueryTimePeriod) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryTimePeriod.

func (*QueryTimePeriod) UnmarshalJSON

func (q *QueryTimePeriod) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryTimePeriod.

type RecommendationUsageDetails

type RecommendationUsageDetails struct {
	// The grain of the usage. Supported values: 'Hourly'
	UsageGrain *Grain

	// READ-ONLY; On-demand charges for each hour between firstConsumptionDate and lastConsumptionDate that were used for computing
	// benefit recommendations.
	Charges []*float64
}

RecommendationUsageDetails - On-demand charges between firstConsumptionDate and lastConsumptionDate that were used for computing benefit recommendations.

func (RecommendationUsageDetails) MarshalJSON

func (r RecommendationUsageDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RecommendationUsageDetails.

func (*RecommendationUsageDetails) UnmarshalJSON

func (r *RecommendationUsageDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RecommendationUsageDetails.

type RecurrenceType

type RecurrenceType string

RecurrenceType - The schedule recurrence.

const (
	RecurrenceTypeAnnually RecurrenceType = "Annually"
	RecurrenceTypeDaily    RecurrenceType = "Daily"
	RecurrenceTypeMonthly  RecurrenceType = "Monthly"
	RecurrenceTypeWeekly   RecurrenceType = "Weekly"
)

func PossibleRecurrenceTypeValues

func PossibleRecurrenceTypeValues() []RecurrenceType

PossibleRecurrenceTypeValues returns the possible values for the RecurrenceType const type.

type ReportConfigAggregation

type ReportConfigAggregation struct {
	// REQUIRED; The name of the aggregation function to use.
	Function *FunctionType

	// REQUIRED; The name of the column to aggregate.
	Name *string
}

ReportConfigAggregation - The aggregation expression to be used in the report.

func (ReportConfigAggregation) MarshalJSON

func (r ReportConfigAggregation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportConfigAggregation.

func (*ReportConfigAggregation) UnmarshalJSON

func (r *ReportConfigAggregation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportConfigAggregation.

type ReportConfigComparisonExpression

type ReportConfigComparisonExpression struct {
	// REQUIRED; The name of the column to use in comparison.
	Name *string

	// REQUIRED; The operator to use for comparison.
	Operator *OperatorType

	// REQUIRED; Array of values to use for comparison
	Values []*string
}

ReportConfigComparisonExpression - The comparison expression to be used in the report.

func (ReportConfigComparisonExpression) MarshalJSON

func (r ReportConfigComparisonExpression) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportConfigComparisonExpression.

func (*ReportConfigComparisonExpression) UnmarshalJSON

func (r *ReportConfigComparisonExpression) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportConfigComparisonExpression.

type ReportConfigDataset

type ReportConfigDataset struct {
	// Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the
	// aggregated column. Report can have up to 2 aggregation clauses.
	Aggregation map[string]*ReportConfigAggregation

	// Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping
	// are provided.
	Configuration *ReportConfigDatasetConfiguration

	// Has filter expression to use in the report.
	Filter *ReportConfigFilter

	// The granularity of rows in the report.
	Granularity *ReportGranularityType

	// Array of group by expression to use in the report. Report can have up to 2 group by clauses.
	Grouping []*ReportConfigGrouping

	// Array of order by expression to use in the report.
	Sorting []*ReportConfigSorting
}

ReportConfigDataset - The definition of data present in the report.

func (ReportConfigDataset) MarshalJSON

func (r ReportConfigDataset) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportConfigDataset.

func (*ReportConfigDataset) UnmarshalJSON

func (r *ReportConfigDataset) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportConfigDataset.

type ReportConfigDatasetConfiguration

type ReportConfigDatasetConfiguration struct {
	// Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report
	// includes all columns.
	Columns []*string
}

ReportConfigDatasetConfiguration - The configuration of dataset in the report.

func (ReportConfigDatasetConfiguration) MarshalJSON

func (r ReportConfigDatasetConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportConfigDatasetConfiguration.

func (*ReportConfigDatasetConfiguration) UnmarshalJSON

func (r *ReportConfigDatasetConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportConfigDatasetConfiguration.

type ReportConfigDefinition

type ReportConfigDefinition struct {
	// REQUIRED; The time frame for pulling data for the report. If custom, then a specific time period must be provided.
	Timeframe *ReportTimeframeType

	// REQUIRED; The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast
	// represents both usage and forecasted data. Actual usage and forecasted data can be
	// differentiated based on dates.
	Type *ReportType

	// Has definition for data in this report config.
	DataSet *ReportConfigDataset

	// If true, report includes monetary commitment.
	IncludeMonetaryCommitment *bool

	// Has time period for pulling data for the report.
	TimePeriod *ReportConfigTimePeriod
}

ReportConfigDefinition - The definition of a report config.

func (ReportConfigDefinition) MarshalJSON

func (r ReportConfigDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportConfigDefinition.

func (*ReportConfigDefinition) UnmarshalJSON

func (r *ReportConfigDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportConfigDefinition.

type ReportConfigFilter

type ReportConfigFilter struct {
	// The logical "AND" expression. Must have at least 2 items.
	And []*ReportConfigFilter

	// Has comparison expression for a dimension
	Dimensions *ReportConfigComparisonExpression

	// The logical "OR" expression. Must have at least 2 items.
	Or []*ReportConfigFilter

	// Has comparison expression for a tag
	Tags *ReportConfigComparisonExpression
}

ReportConfigFilter - The filter expression to be used in the report.

func (ReportConfigFilter) MarshalJSON

func (r ReportConfigFilter) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportConfigFilter.

func (*ReportConfigFilter) UnmarshalJSON

func (r *ReportConfigFilter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportConfigFilter.

type ReportConfigGrouping

type ReportConfigGrouping struct {
	// REQUIRED; The name of the column to group. This version supports subscription lowest possible grain.
	Name *string

	// REQUIRED; Has type of the column to group.
	Type *QueryColumnType
}

ReportConfigGrouping - The group by expression to be used in the report.

func (ReportConfigGrouping) MarshalJSON

func (r ReportConfigGrouping) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportConfigGrouping.

func (*ReportConfigGrouping) UnmarshalJSON

func (r *ReportConfigGrouping) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportConfigGrouping.

type ReportConfigSorting

type ReportConfigSorting struct {
	// REQUIRED; The name of the column to sort.
	Name *string

	// Direction of sort.
	Direction *ReportConfigSortingType
}

ReportConfigSorting - The order by expression to be used in the report.

func (ReportConfigSorting) MarshalJSON

func (r ReportConfigSorting) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportConfigSorting.

func (*ReportConfigSorting) UnmarshalJSON

func (r *ReportConfigSorting) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportConfigSorting.

type ReportConfigSortingType

type ReportConfigSortingType string

ReportConfigSortingType - Direction of sort.

const (
	ReportConfigSortingTypeAscending  ReportConfigSortingType = "Ascending"
	ReportConfigSortingTypeDescending ReportConfigSortingType = "Descending"
)

func PossibleReportConfigSortingTypeValues

func PossibleReportConfigSortingTypeValues() []ReportConfigSortingType

PossibleReportConfigSortingTypeValues returns the possible values for the ReportConfigSortingType const type.

type ReportConfigTimePeriod

type ReportConfigTimePeriod struct {
	// REQUIRED; The start date to pull data from.
	From *time.Time

	// REQUIRED; The end date to pull data to.
	To *time.Time
}

ReportConfigTimePeriod - The start and end date for pulling data for the report.

func (ReportConfigTimePeriod) MarshalJSON

func (r ReportConfigTimePeriod) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportConfigTimePeriod.

func (*ReportConfigTimePeriod) UnmarshalJSON

func (r *ReportConfigTimePeriod) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportConfigTimePeriod.

type ReportGranularityType

type ReportGranularityType string

ReportGranularityType - The granularity of rows in the report.

const (
	ReportGranularityTypeDaily   ReportGranularityType = "Daily"
	ReportGranularityTypeMonthly ReportGranularityType = "Monthly"
)

func PossibleReportGranularityTypeValues

func PossibleReportGranularityTypeValues() []ReportGranularityType

PossibleReportGranularityTypeValues returns the possible values for the ReportGranularityType const type.

type ReportManifest

type ReportManifest struct {
	// The total number of blobs.
	BlobCount *int32

	// List of blob information generated by this operation.
	Blobs []*BlobInfo

	// The total number of bytes in all blobs.
	ByteCount *int64

	// Is the data in compressed format.
	CompressData *bool

	// The data format of the report
	DataFormat *CostDetailsDataFormat

	// The Manifest version.
	ManifestVersion *string

	// The context of the Cost Details request.
	RequestContext *RequestContext
}

ReportManifest - The manifest of the report generated by the operation.

func (ReportManifest) MarshalJSON

func (r ReportManifest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportManifest.

func (*ReportManifest) UnmarshalJSON

func (r *ReportManifest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportManifest.

type ReportOperationStatusType

type ReportOperationStatusType string

ReportOperationStatusType - The status of the long running operation.

const (
	ReportOperationStatusTypeCompleted       ReportOperationStatusType = "Completed"
	ReportOperationStatusTypeFailed          ReportOperationStatusType = "Failed"
	ReportOperationStatusTypeInProgress      ReportOperationStatusType = "InProgress"
	ReportOperationStatusTypeNoDataFound     ReportOperationStatusType = "NoDataFound"
	ReportOperationStatusTypeQueued          ReportOperationStatusType = "Queued"
	ReportOperationStatusTypeReadyToDownload ReportOperationStatusType = "ReadyToDownload"
	ReportOperationStatusTypeTimedOut        ReportOperationStatusType = "TimedOut"
)

func PossibleReportOperationStatusTypeValues

func PossibleReportOperationStatusTypeValues() []ReportOperationStatusType

PossibleReportOperationStatusTypeValues returns the possible values for the ReportOperationStatusType const type.

type ReportTimeframeType

type ReportTimeframeType string

ReportTimeframeType - The time frame for pulling data for the report. If custom, then a specific time period must be provided.

const (
	ReportTimeframeTypeCustom      ReportTimeframeType = "Custom"
	ReportTimeframeTypeMonthToDate ReportTimeframeType = "MonthToDate"
	ReportTimeframeTypeWeekToDate  ReportTimeframeType = "WeekToDate"
	ReportTimeframeTypeYearToDate  ReportTimeframeType = "YearToDate"
)

func PossibleReportTimeframeTypeValues

func PossibleReportTimeframeTypeValues() []ReportTimeframeType

PossibleReportTimeframeTypeValues returns the possible values for the ReportTimeframeType const type.

type ReportType

type ReportType string

ReportType - The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.

const (
	ReportTypeUsage ReportType = "Usage"
)

func PossibleReportTypeValues

func PossibleReportTypeValues() []ReportType

PossibleReportTypeValues returns the possible values for the ReportType const type.

type ReportURL

type ReportURL struct {
	// The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity
	ReportURL *ReservationReportSchema

	// The time at which report URL becomes invalid.
	ValidUntil *time.Time
}

ReportURL - The URL to download the generated report.

func (ReportURL) MarshalJSON

func (r ReportURL) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReportURL.

func (*ReportURL) UnmarshalJSON

func (r *ReportURL) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReportURL.

type RequestContext

type RequestContext struct {
	// The request payload body provided in Cost Details call
	RequestBody *GenerateCostDetailsReportRequestDefinition

	// The request scope of the request.
	RequestScope *string
}

RequestContext - The context of the Cost Details request.

func (RequestContext) MarshalJSON

func (r RequestContext) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RequestContext.

func (*RequestContext) UnmarshalJSON

func (r *RequestContext) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RequestContext.

type ReservationReportSchema

type ReservationReportSchema string

ReservationReportSchema - The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity

const (
	ReservationReportSchemaInstanceFlexibilityGroup ReservationReportSchema = "InstanceFlexibilityGroup"
	ReservationReportSchemaInstanceFlexibilityRatio ReservationReportSchema = "InstanceFlexibilityRatio"
	ReservationReportSchemaInstanceID               ReservationReportSchema = "InstanceId"
	ReservationReportSchemaKind                     ReservationReportSchema = "Kind"
	ReservationReportSchemaReservationID            ReservationReportSchema = "ReservationId"
	ReservationReportSchemaReservationOrderID       ReservationReportSchema = "ReservationOrderId"
	ReservationReportSchemaReservedHours            ReservationReportSchema = "ReservedHours"
	ReservationReportSchemaSKUName                  ReservationReportSchema = "SkuName"
	ReservationReportSchemaTotalReservedQuantity    ReservationReportSchema = "TotalReservedQuantity"
	ReservationReportSchemaUsageDate                ReservationReportSchema = "UsageDate"
	ReservationReportSchemaUsedHours                ReservationReportSchema = "UsedHours"
)

func PossibleReservationReportSchemaValues

func PossibleReservationReportSchemaValues() []ReservationReportSchema

PossibleReservationReportSchemaValues returns the possible values for the ReservationReportSchema const type.

type SavingsPlanUtilizationSummary

type SavingsPlanUtilizationSummary struct {
	// REQUIRED; Supported values: 'SavingsPlan'.
	Kind *BenefitKind

	// Savings plan utilization summary properties.
	Properties *SavingsPlanUtilizationSummaryProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

SavingsPlanUtilizationSummary - Savings plan utilization summary resource.

func (*SavingsPlanUtilizationSummary) GetBenefitUtilizationSummary

func (s *SavingsPlanUtilizationSummary) GetBenefitUtilizationSummary() *BenefitUtilizationSummary

GetBenefitUtilizationSummary implements the BenefitUtilizationSummaryClassification interface for type SavingsPlanUtilizationSummary.

func (SavingsPlanUtilizationSummary) MarshalJSON

func (s SavingsPlanUtilizationSummary) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanUtilizationSummary.

func (*SavingsPlanUtilizationSummary) UnmarshalJSON

func (s *SavingsPlanUtilizationSummary) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUtilizationSummary.

type SavingsPlanUtilizationSummaryProperties

type SavingsPlanUtilizationSummaryProperties struct {
	// The benefit type. Supported values: 'SavingsPlan'.
	BenefitType *BenefitKind

	// READ-ONLY; ARM SKU name. For example, 'ComputeSavingsPlan' for savings plan.
	ArmSKUName *string

	// READ-ONLY; This is the average hourly utilization for each date range that corresponds to given grain (Daily, Monthly).
	// Suppose the API call is for usageDate > 2022-10-01 and usageDate < 2022-10-31 at a daily
	// granularity. There will be one record per benefit id for each day. For a single day, the avgUtilizationPercentage value
	// will be equal to the average of the set of values where the set contains 24
	// utilization percentage entries one for each hour in a specific day.
	AvgUtilizationPercentage *float64

	// READ-ONLY; The benefit ID is the identifier of the benefit.
	BenefitID *string

	// READ-ONLY; The benefit order ID is the identifier for a benefit purchase.
	BenefitOrderID *string

	// READ-ONLY; This is the maximum hourly utilization for each date range that corresponds to given grain (Daily, Monthly).
	// Suppose the API call is for usageDate > 2022-10-01 and usageDate < 2022-10-31 at a daily
	// granularity. There will be one record per benefit id for each day. For a single day, the maxUtilizationPercentage value
	// will be equal to the largest in the set of values where the set contains 24
	// utilization percentage entries one for each hour in a specific day. If on the day 2022-10-18, the largest utilization percentage
	// was 90% at hour 5, then the value for the maxUtilizationPercentage in
	// the response will be 90%.
	MaxUtilizationPercentage *float64

	// READ-ONLY; This is the minimum hourly utilization for each date range that corresponds to given grain (Daily, Monthly).
	// Suppose the API call is for usageDate > 2022-10-01 and usageDate < 2022-10-31 at a daily
	// granularity. There will be one record per benefit id for each day. For a single day, the minUtilizationPercentage value
	// will be equal to the smallest in the set of values where the set contains 24
	// utilization percentage entries one for each hour in a specific day. If on the day 2022-10-18, the lowest utilization percentage
	// was 10% at hour 4, then the value for the minUtilizationPercentage in
	// the response will be 10%.
	MinUtilizationPercentage *float64

	// READ-ONLY; Date corresponding to the utilization summary record. If the grain of data is monthly, value for this field
	// will be first day of the month.
	UsageDate *time.Time
}

SavingsPlanUtilizationSummaryProperties - Savings plan utilization summary properties.

func (SavingsPlanUtilizationSummaryProperties) MarshalJSON

func (s SavingsPlanUtilizationSummaryProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SavingsPlanUtilizationSummaryProperties.

func (*SavingsPlanUtilizationSummaryProperties) UnmarshalJSON

func (s *SavingsPlanUtilizationSummaryProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SavingsPlanUtilizationSummaryProperties.

type ScheduleFrequency

type ScheduleFrequency string

ScheduleFrequency - Frequency of the schedule.

const (
	// ScheduleFrequencyDaily - Cost analysis data will be emailed every day.
	ScheduleFrequencyDaily ScheduleFrequency = "Daily"
	// ScheduleFrequencyMonthly - Cost analysis data will be emailed every month.
	ScheduleFrequencyMonthly ScheduleFrequency = "Monthly"
	// ScheduleFrequencyWeekly - Cost analysis data will be emailed every week.
	ScheduleFrequencyWeekly ScheduleFrequency = "Weekly"
)

func PossibleScheduleFrequencyValues

func PossibleScheduleFrequencyValues() []ScheduleFrequency

PossibleScheduleFrequencyValues returns the possible values for the ScheduleFrequency const type.

type ScheduleProperties

type ScheduleProperties struct {
	// REQUIRED; The end date and time of the scheduled action (UTC).
	EndDate *time.Time

	// REQUIRED; Frequency of the schedule.
	Frequency *ScheduleFrequency

	// REQUIRED; The start date and time of the scheduled action (UTC).
	StartDate *time.Time

	// UTC day on which cost analysis data will be emailed. Must be between 1 and 31. This property is applicable when frequency
	// is Monthly and overrides weeksOfMonth or daysOfWeek.
	DayOfMonth *int32

	// Day names in english on which cost analysis data will be emailed. This property is applicable when frequency is Weekly
	// or Monthly.
	DaysOfWeek []*DaysOfWeek

	// UTC time at which cost analysis data will be emailed.
	HourOfDay *int32

	// Weeks in which cost analysis data will be emailed. This property is applicable when frequency is Monthly and used in combination
	// with daysOfWeek.
	WeeksOfMonth []*WeeksOfMonth
}

ScheduleProperties - The properties of the schedule.

func (ScheduleProperties) MarshalJSON

func (s ScheduleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScheduleProperties.

func (*ScheduleProperties) UnmarshalJSON

func (s *ScheduleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleProperties.

type ScheduledAction

type ScheduledAction struct {
	// Kind of the scheduled action.
	Kind *ScheduledActionKind

	// The properties of the scheduled action.
	Properties *ScheduledActionProperties

	// READ-ONLY; Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch
	// the resource's eTag by doing a 'GET' call first and then including the latest eTag as
	// part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not required.
	ETag *string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Kind of the scheduled action.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ScheduledAction - Scheduled action definition.

func (ScheduledAction) MarshalJSON

func (s ScheduledAction) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScheduledAction.

func (*ScheduledAction) UnmarshalJSON

func (s *ScheduledAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledAction.

type ScheduledActionKind

type ScheduledActionKind string

ScheduledActionKind - Kind of the scheduled action.

const (
	// ScheduledActionKindEmail - Cost analysis data will be emailed.
	ScheduledActionKindEmail ScheduledActionKind = "Email"
	// ScheduledActionKindInsightAlert - Cost anomaly information will be emailed. Available only on subscription scope at daily
	// frequency. If no anomaly is detected on the resource, an email won't be sent.
	ScheduledActionKindInsightAlert ScheduledActionKind = "InsightAlert"
)

func PossibleScheduledActionKindValues

func PossibleScheduledActionKindValues() []ScheduledActionKind

PossibleScheduledActionKindValues returns the possible values for the ScheduledActionKind const type.

type ScheduledActionListResult

type ScheduledActionListResult struct {
	// READ-ONLY; The link (url) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of scheduled actions.
	Value []*ScheduledAction
}

ScheduledActionListResult - Scheduled actions list result. It contains a list of scheduled actions.

func (ScheduledActionListResult) MarshalJSON

func (s ScheduledActionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScheduledActionListResult.

func (*ScheduledActionListResult) UnmarshalJSON

func (s *ScheduledActionListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledActionListResult.

type ScheduledActionProperties

type ScheduledActionProperties struct {
	// REQUIRED; Scheduled action name.
	DisplayName *string

	// REQUIRED; Notification properties based on scheduled action kind.
	Notification *NotificationProperties

	// REQUIRED; Schedule of the scheduled action.
	Schedule *ScheduleProperties

	// REQUIRED; Status of the scheduled action.
	Status *ScheduledActionStatus

	// REQUIRED; Cost analysis viewId used for scheduled action. For example, '/providers/Microsoft.CostManagement/views/swaggerExample'
	ViewID *string

	// Destination format of the view data. This is optional.
	FileDestination *FileDestination

	// Email address of the point of contact that should get the unsubscribe requests and notification emails.
	NotificationEmail *string

	// Cost Management scope like 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
	// for resourceGroup scope,
	// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
	// for Department
	// scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount
	// scope,
	// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile
	// scope,
	// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection
	// scope,
	// '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope,
	// and
	// '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.
	Scope *string
}

ScheduledActionProperties - The properties of the scheduled action.

func (ScheduledActionProperties) MarshalJSON

func (s ScheduledActionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScheduledActionProperties.

func (*ScheduledActionProperties) UnmarshalJSON

func (s *ScheduledActionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledActionProperties.

type ScheduledActionStatus

type ScheduledActionStatus string

ScheduledActionStatus - Status of the scheduled action.

const (
	// ScheduledActionStatusDisabled - Scheduled action is saved but will not be run.
	ScheduledActionStatusDisabled ScheduledActionStatus = "Disabled"
	// ScheduledActionStatusEnabled - Scheduled action is saved and will be run.
	ScheduledActionStatusEnabled ScheduledActionStatus = "Enabled"
	// ScheduledActionStatusExpired - Scheduled action is expired.
	ScheduledActionStatusExpired ScheduledActionStatus = "Expired"
)

func PossibleScheduledActionStatusValues

func PossibleScheduledActionStatusValues() []ScheduledActionStatus

PossibleScheduledActionStatusValues returns the possible values for the ScheduledActionStatus const type.

type ScheduledActionsClient

type ScheduledActionsClient struct {
	// contains filtered or unexported fields
}

ScheduledActionsClient contains the methods for the ScheduledActions group. Don't use this type directly, use NewScheduledActionsClient() instead.

func NewScheduledActionsClient

func NewScheduledActionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ScheduledActionsClient, error)

NewScheduledActionsClient creates a new instance of ScheduledActionsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ScheduledActionsClient) CheckNameAvailability

CheckNameAvailability - Checks availability and correctness of the name for a scheduled action. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • checkNameAvailabilityRequest - Scheduled action to be created or updated.
  • options - ScheduledActionsClientCheckNameAvailabilityOptions contains the optional parameters for the ScheduledActionsClient.CheckNameAvailability method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/checkNameAvailability-private-scheduledAction.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewScheduledActionsClient().CheckNameAvailability(ctx, armcostmanagement.CheckNameAvailabilityRequest{
	Name: to.Ptr("testName"),
	Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CheckNameAvailabilityResponse = armcostmanagement.CheckNameAvailabilityResponse{
// 	Message: to.Ptr("A private scheduled action with name 'testName' is already present. Please specify a differnt name."),
// 	NameAvailable: to.Ptr(false),
// 	Reason: to.Ptr(armcostmanagement.CheckNameAvailabilityReasonAlreadyExists),
// }
Output:

func (*ScheduledActionsClient) CheckNameAvailabilityByScope

CheckNameAvailabilityByScope - Checks availability and correctness of the name for a scheduled action within the given scope. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope.
  • checkNameAvailabilityRequest - Scheduled action to be created or updated.
  • options - ScheduledActionsClientCheckNameAvailabilityByScopeOptions contains the optional parameters for the ScheduledActionsClient.CheckNameAvailabilityByScope method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/checkNameAvailability-shared-scheduledAction.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewScheduledActionsClient().CheckNameAvailabilityByScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", armcostmanagement.CheckNameAvailabilityRequest{
	Name: to.Ptr("testName"),
	Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CheckNameAvailabilityResponse = armcostmanagement.CheckNameAvailabilityResponse{
// 	NameAvailable: to.Ptr(true),
// }
Output:

func (*ScheduledActionsClient) CreateOrUpdate

CreateOrUpdate - Create or update a private scheduled action. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • name - Scheduled action name.
  • scheduledAction - Scheduled action to be created or updated.
  • options - ScheduledActionsClientCreateOrUpdateOptions contains the optional parameters for the ScheduledActionsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-createOrUpdate-private.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewScheduledActionsClient().CreateOrUpdate(ctx, "monthlyCostByResource", armcostmanagement.ScheduledAction{
	Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
	Properties: &armcostmanagement.ScheduledActionProperties{
		DisplayName: to.Ptr("Monthly Cost By Resource"),
		Notification: &armcostmanagement.NotificationProperties{
			Subject: to.Ptr("Cost by resource this month"),
			To: []*string{
				to.Ptr("user@gmail.com"),
				to.Ptr("team@gmail.com")},
		},
		Schedule: &armcostmanagement.ScheduleProperties{
			DaysOfWeek: []*armcostmanagement.DaysOfWeek{
				to.Ptr(armcostmanagement.DaysOfWeekMonday)},
			EndDate:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t }()),
			Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyMonthly),
			HourOfDay: to.Ptr[int32](10),
			StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t }()),
			WeeksOfMonth: []*armcostmanagement.WeeksOfMonth{
				to.Ptr(armcostmanagement.WeeksOfMonthFirst),
				to.Ptr(armcostmanagement.WeeksOfMonthThird)},
		},
		Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
		ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	},
}, &armcostmanagement.ScheduledActionsClientCreateOrUpdateOptions{IfMatch: to.Ptr("")})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ScheduledAction = armcostmanagement.ScheduledAction{
// 	Name: to.Ptr("monthlyCostByResource"),
// 	Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
// 	ID: to.Ptr("providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource"),
// 	ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
// 	Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
// 	SystemData: &armcostmanagement.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
// 		CreatedBy: to.Ptr("testuser"),
// 		CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
// 		LastModifiedBy: to.Ptr("testuser"),
// 		LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
// 	},
// 	Properties: &armcostmanagement.ScheduledActionProperties{
// 		DisplayName: to.Ptr("Monthly Cost By Resource"),
// 		Notification: &armcostmanagement.NotificationProperties{
// 			RegionalFormat: to.Ptr("fr"),
// 			Subject: to.Ptr("Cost by resource this month"),
// 			To: []*string{
// 				to.Ptr("user@gmail.com"),
// 				to.Ptr("team@gmail.com")},
// 				Language: to.Ptr("fr"),
// 			},
// 			Schedule: &armcostmanagement.ScheduleProperties{
// 				DaysOfWeek: []*armcostmanagement.DaysOfWeek{
// 					to.Ptr(armcostmanagement.DaysOfWeekMonday)},
// 					EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
// 					Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyMonthly),
// 					HourOfDay: to.Ptr[int32](10),
// 					StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
// 					WeeksOfMonth: []*armcostmanagement.WeeksOfMonth{
// 						to.Ptr(armcostmanagement.WeeksOfMonthFirst),
// 						to.Ptr(armcostmanagement.WeeksOfMonthThird)},
// 					},
// 					Scope: to.Ptr(""),
// 					Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
// 					ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
// 				},
// 			}
Output:

func (*ScheduledActionsClient) CreateOrUpdateByScope

CreateOrUpdateByScope - Create or update a shared scheduled action within the given scope. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope.
  • name - Scheduled action name.
  • scheduledAction - Scheduled action to be created or updated.
  • options - ScheduledActionsClientCreateOrUpdateByScopeOptions contains the optional parameters for the ScheduledActionsClient.CreateOrUpdateByScope method.
Example (CreateOrUpdateInsightAlertScheduledActionByScope)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewScheduledActionsClient().CreateOrUpdateByScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "dailyAnomalyByResource", armcostmanagement.ScheduledAction{
	Kind: to.Ptr(armcostmanagement.ScheduledActionKindInsightAlert),
	Properties: &armcostmanagement.ScheduledActionProperties{
		DisplayName: to.Ptr("Daily anomaly by resource"),
		Notification: &armcostmanagement.NotificationProperties{
			Subject: to.Ptr("Cost anomaly detected in the resource"),
			To: []*string{
				to.Ptr("user@gmail.com"),
				to.Ptr("team@gmail.com")},
		},
		Schedule: &armcostmanagement.ScheduleProperties{
			EndDate:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t }()),
			Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyDaily),
			StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t }()),
		},
		Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
		ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	},
}, &armcostmanagement.ScheduledActionsClientCreateOrUpdateByScopeOptions{IfMatch: to.Ptr("")})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ScheduledAction = armcostmanagement.ScheduledAction{
// 	Name: to.Ptr("dailyAnomalyByResource"),
// 	Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyAnomalyByResource"),
// 	ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
// 	Kind: to.Ptr(armcostmanagement.ScheduledActionKindInsightAlert),
// 	SystemData: &armcostmanagement.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
// 		CreatedBy: to.Ptr("testuser"),
// 		CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
// 		LastModifiedBy: to.Ptr("testuser"),
// 		LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
// 	},
// 	Properties: &armcostmanagement.ScheduledActionProperties{
// 		DisplayName: to.Ptr("Daily anomaly by resource"),
// 		FileDestination: &armcostmanagement.FileDestination{
// 			FileFormats: []*armcostmanagement.FileFormat{
// 			},
// 		},
// 		Notification: &armcostmanagement.NotificationProperties{
// 			Subject: to.Ptr("Cost anomaly detected in the resource"),
// 			To: []*string{
// 				to.Ptr("user@gmail.com"),
// 				to.Ptr("team@gmail.com")},
// 			},
// 			Schedule: &armcostmanagement.ScheduleProperties{
// 				EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
// 				Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyDaily),
// 				StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
// 			},
// 			Scope: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"),
// 			Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
// 			ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
// 		},
// 	}
Output:

Example (CreateOrUpdateScheduledActionByScope)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-createOrUpdate-shared.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewScheduledActionsClient().CreateOrUpdateByScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "monthlyCostByResource", armcostmanagement.ScheduledAction{
	Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
	Properties: &armcostmanagement.ScheduledActionProperties{
		DisplayName: to.Ptr("Monthly Cost By Resource"),
		FileDestination: &armcostmanagement.FileDestination{
			FileFormats: []*armcostmanagement.FileFormat{
				to.Ptr(armcostmanagement.FileFormatCSV)},
		},
		Notification: &armcostmanagement.NotificationProperties{
			Subject: to.Ptr("Cost by resource this month"),
			To: []*string{
				to.Ptr("user@gmail.com"),
				to.Ptr("team@gmail.com")},
		},
		Schedule: &armcostmanagement.ScheduleProperties{
			DaysOfWeek: []*armcostmanagement.DaysOfWeek{
				to.Ptr(armcostmanagement.DaysOfWeekMonday)},
			EndDate:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t }()),
			Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyMonthly),
			HourOfDay: to.Ptr[int32](10),
			StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t }()),
			WeeksOfMonth: []*armcostmanagement.WeeksOfMonth{
				to.Ptr(armcostmanagement.WeeksOfMonthFirst),
				to.Ptr(armcostmanagement.WeeksOfMonthThird)},
		},
		Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
		ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	},
}, &armcostmanagement.ScheduledActionsClientCreateOrUpdateByScopeOptions{IfMatch: to.Ptr("")})
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ScheduledAction = armcostmanagement.ScheduledAction{
// 	Name: to.Ptr("monthlyCostByResource"),
// 	Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource"),
// 	ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
// 	Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
// 	SystemData: &armcostmanagement.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
// 		CreatedBy: to.Ptr("testuser"),
// 		CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
// 		LastModifiedBy: to.Ptr("testuser"),
// 		LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
// 	},
// 	Properties: &armcostmanagement.ScheduledActionProperties{
// 		DisplayName: to.Ptr("Monthly Cost By Resource"),
// 		Notification: &armcostmanagement.NotificationProperties{
// 			Subject: to.Ptr("Cost by resource this month"),
// 			To: []*string{
// 				to.Ptr("user@gmail.com"),
// 				to.Ptr("team@gmail.com")},
// 			},
// 			Schedule: &armcostmanagement.ScheduleProperties{
// 				DaysOfWeek: []*armcostmanagement.DaysOfWeek{
// 					to.Ptr(armcostmanagement.DaysOfWeekMonday)},
// 					EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
// 					Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyMonthly),
// 					HourOfDay: to.Ptr[int32](10),
// 					StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
// 					WeeksOfMonth: []*armcostmanagement.WeeksOfMonth{
// 						to.Ptr(armcostmanagement.WeeksOfMonthFirst),
// 						to.Ptr(armcostmanagement.WeeksOfMonthThird)},
// 					},
// 					Scope: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"),
// 					Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
// 					ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
// 				},
// 			}
Output:

func (*ScheduledActionsClient) Delete

Delete - Delete a private scheduled action. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • name - Scheduled action name.
  • options - ScheduledActionsClientDeleteOptions contains the optional parameters for the ScheduledActionsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-delete-private.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewScheduledActionsClient().Delete(ctx, "monthlyCostByResource", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

func (*ScheduledActionsClient) DeleteByScope

DeleteByScope - Delete a scheduled action within the given scope. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope.
  • name - Scheduled action name.
  • options - ScheduledActionsClientDeleteByScopeOptions contains the optional parameters for the ScheduledActionsClient.DeleteByScope method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-delete-shared.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewScheduledActionsClient().DeleteByScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "monthlyCostByResource", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

func (*ScheduledActionsClient) Get

Get - Get the private scheduled action by name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • name - Scheduled action name.
  • options - ScheduledActionsClientGetOptions contains the optional parameters for the ScheduledActionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-get-private.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewScheduledActionsClient().Get(ctx, "monthlyCostByResource", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ScheduledAction = armcostmanagement.ScheduledAction{
// 	Name: to.Ptr("monthlyCostByResource"),
// 	Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
// 	ID: to.Ptr("providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource"),
// 	ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
// 	Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
// 	SystemData: &armcostmanagement.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
// 		CreatedBy: to.Ptr("testuser"),
// 		CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
// 		LastModifiedBy: to.Ptr("testuser"),
// 		LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
// 	},
// 	Properties: &armcostmanagement.ScheduledActionProperties{
// 		DisplayName: to.Ptr("Monthly Cost By Resource"),
// 		Notification: &armcostmanagement.NotificationProperties{
// 			Subject: to.Ptr("Cost by resource this month"),
// 			To: []*string{
// 				to.Ptr("user@gmail.com"),
// 				to.Ptr("team@gmail.com")},
// 			},
// 			Schedule: &armcostmanagement.ScheduleProperties{
// 				DaysOfWeek: []*armcostmanagement.DaysOfWeek{
// 					to.Ptr(armcostmanagement.DaysOfWeekMonday)},
// 					EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
// 					Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyMonthly),
// 					HourOfDay: to.Ptr[int32](10),
// 					StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
// 					WeeksOfMonth: []*armcostmanagement.WeeksOfMonth{
// 						to.Ptr(armcostmanagement.WeeksOfMonthFirst),
// 						to.Ptr(armcostmanagement.WeeksOfMonthThird)},
// 					},
// 					Scope: to.Ptr(""),
// 					Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
// 					ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
// 				},
// 			}
Output:

func (*ScheduledActionsClient) GetByScope

GetByScope - Get the shared scheduled action from the given scope by name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope.
  • name - Scheduled action name.
  • options - ScheduledActionsClientGetByScopeOptions contains the optional parameters for the ScheduledActionsClient.GetByScope method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-get-shared.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewScheduledActionsClient().GetByScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "monthlyCostByResource", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ScheduledAction = armcostmanagement.ScheduledAction{
// 	Name: to.Ptr("monthlyCostByResource"),
// 	Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource"),
// 	ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
// 	Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
// 	SystemData: &armcostmanagement.SystemData{
// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
// 		CreatedBy: to.Ptr("testuser"),
// 		CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
// 		LastModifiedBy: to.Ptr("testuser"),
// 		LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
// 	},
// 	Properties: &armcostmanagement.ScheduledActionProperties{
// 		DisplayName: to.Ptr("Monthly Cost By Resource"),
// 		Notification: &armcostmanagement.NotificationProperties{
// 			Subject: to.Ptr("Cost by resource this month"),
// 			To: []*string{
// 				to.Ptr("user@gmail.com"),
// 				to.Ptr("team@gmail.com")},
// 			},
// 			Schedule: &armcostmanagement.ScheduleProperties{
// 				DaysOfWeek: []*armcostmanagement.DaysOfWeek{
// 					to.Ptr(armcostmanagement.DaysOfWeekMonday)},
// 					EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
// 					Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyMonthly),
// 					HourOfDay: to.Ptr[int32](10),
// 					StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
// 					WeeksOfMonth: []*armcostmanagement.WeeksOfMonth{
// 						to.Ptr(armcostmanagement.WeeksOfMonthFirst),
// 						to.Ptr(armcostmanagement.WeeksOfMonthThird)},
// 					},
// 					Scope: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"),
// 					Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
// 					ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
// 				},
// 			}
Output:

func (*ScheduledActionsClient) NewListByScopePager

NewListByScopePager - List all shared scheduled actions within the given scope.

Generated from API version 2022-10-01

  • scope - The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope.
  • options - ScheduledActionsClientListByScopeOptions contains the optional parameters for the ScheduledActionsClient.NewListByScopePager method.
Example (ScheduledActionsListByScope)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-list-shared.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewScheduledActionsClient().NewListByScopePager("subscriptions/00000000-0000-0000-0000-000000000000", &armcostmanagement.ScheduledActionsClientListByScopeOptions{Filter: nil})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.ScheduledActionListResult = armcostmanagement.ScheduledActionListResult{
	// 	Value: []*armcostmanagement.ScheduledAction{
	// 		{
	// 			Name: to.Ptr("monthlyCostByResource"),
	// 			Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
	// 			ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource"),
	// 			ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
	// 			Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
	// 			SystemData: &armcostmanagement.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 				CreatedBy: to.Ptr("testuser"),
	// 				CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("testuser"),
	// 				LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 			},
	// 			Properties: &armcostmanagement.ScheduledActionProperties{
	// 				DisplayName: to.Ptr("Monthly Cost By Resource"),
	// 				Notification: &armcostmanagement.NotificationProperties{
	// 					Subject: to.Ptr("Cost by resource this month"),
	// 					To: []*string{
	// 						to.Ptr("user@gmail.com"),
	// 						to.Ptr("team@gmail.com")},
	// 					},
	// 					Schedule: &armcostmanagement.ScheduleProperties{
	// 						DaysOfWeek: []*armcostmanagement.DaysOfWeek{
	// 							to.Ptr(armcostmanagement.DaysOfWeekMonday)},
	// 							EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
	// 							Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyMonthly),
	// 							HourOfDay: to.Ptr[int32](10),
	// 							StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
	// 							WeeksOfMonth: []*armcostmanagement.WeeksOfMonth{
	// 								to.Ptr(armcostmanagement.WeeksOfMonthFirst),
	// 								to.Ptr(armcostmanagement.WeeksOfMonthThird)},
	// 							},
	// 							Scope: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"),
	// 							Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
	// 							ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	// 						},
	// 					},
	// 					{
	// 						Name: to.Ptr("dailyCostByResource"),
	// 						Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
	// 						ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyCostByResource"),
	// 						ETag: to.Ptr("\"1d4ff9fe66f1d15\""),
	// 						Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
	// 						SystemData: &armcostmanagement.SystemData{
	// 							CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 							CreatedBy: to.Ptr("testuser"),
	// 							CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 							LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 							LastModifiedBy: to.Ptr("testuser"),
	// 							LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 						},
	// 						Properties: &armcostmanagement.ScheduledActionProperties{
	// 							DisplayName: to.Ptr("Daily Cost By Resource"),
	// 							Notification: &armcostmanagement.NotificationProperties{
	// 								Subject: to.Ptr("Daily Cost By Resource"),
	// 								To: []*string{
	// 									to.Ptr("user@gmail.com"),
	// 									to.Ptr("team@gmail.com")},
	// 								},
	// 								Schedule: &armcostmanagement.ScheduleProperties{
	// 									EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
	// 									Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyDaily),
	// 									HourOfDay: to.Ptr[int32](12),
	// 									StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
	// 								},
	// 								Scope: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"),
	// 								Status: to.Ptr(armcostmanagement.ScheduledActionStatusDisabled),
	// 								ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	// 							},
	// 					}},
	// 				}
}
Output:

Example (ScheduledActionsListByScopeFilterByViewId)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-listWithFilter-shared.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewScheduledActionsClient().NewListByScopePager("subscriptions/00000000-0000-0000-0000-000000000000", &armcostmanagement.ScheduledActionsClientListByScopeOptions{Filter: to.Ptr("properties/viewId eq '/providers/Microsoft.CostManagement/views/swaggerExample'")})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.ScheduledActionListResult = armcostmanagement.ScheduledActionListResult{
	// 	Value: []*armcostmanagement.ScheduledAction{
	// 		{
	// 			Name: to.Ptr("monthlyCostByResource"),
	// 			Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
	// 			ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource"),
	// 			ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
	// 			Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
	// 			SystemData: &armcostmanagement.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 				CreatedBy: to.Ptr("testuser"),
	// 				CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("testuser"),
	// 				LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 			},
	// 			Properties: &armcostmanagement.ScheduledActionProperties{
	// 				DisplayName: to.Ptr("Monthly Cost By Resource"),
	// 				Notification: &armcostmanagement.NotificationProperties{
	// 					Subject: to.Ptr("Cost by resource this month"),
	// 					To: []*string{
	// 						to.Ptr("user@gmail.com"),
	// 						to.Ptr("team@gmail.com")},
	// 					},
	// 					Schedule: &armcostmanagement.ScheduleProperties{
	// 						DaysOfWeek: []*armcostmanagement.DaysOfWeek{
	// 							to.Ptr(armcostmanagement.DaysOfWeekMonday)},
	// 							EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
	// 							Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyMonthly),
	// 							HourOfDay: to.Ptr[int32](10),
	// 							StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
	// 							WeeksOfMonth: []*armcostmanagement.WeeksOfMonth{
	// 								to.Ptr(armcostmanagement.WeeksOfMonthFirst),
	// 								to.Ptr(armcostmanagement.WeeksOfMonthThird)},
	// 							},
	// 							Scope: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"),
	// 							Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
	// 							ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	// 						},
	// 					},
	// 					{
	// 						Name: to.Ptr("dailyCostByResource"),
	// 						Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
	// 						ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyCostByResource"),
	// 						ETag: to.Ptr("\"1d4ff9fe66f1d15\""),
	// 						Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
	// 						SystemData: &armcostmanagement.SystemData{
	// 							CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 							CreatedBy: to.Ptr("testuser"),
	// 							CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 							LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 							LastModifiedBy: to.Ptr("testuser"),
	// 							LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 						},
	// 						Properties: &armcostmanagement.ScheduledActionProperties{
	// 							DisplayName: to.Ptr("Daily Cost By Resource"),
	// 							Notification: &armcostmanagement.NotificationProperties{
	// 								Subject: to.Ptr("Daily Cost By Resource"),
	// 								To: []*string{
	// 									to.Ptr("user@gmail.com"),
	// 									to.Ptr("team@gmail.com")},
	// 								},
	// 								Schedule: &armcostmanagement.ScheduleProperties{
	// 									EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
	// 									Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyDaily),
	// 									HourOfDay: to.Ptr[int32](12),
	// 									StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
	// 								},
	// 								Scope: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"),
	// 								Status: to.Ptr(armcostmanagement.ScheduledActionStatusDisabled),
	// 								ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	// 							},
	// 					}},
	// 				}
}
Output:

func (*ScheduledActionsClient) NewListPager

NewListPager - List all private scheduled actions.

Generated from API version 2022-10-01

  • options - ScheduledActionsClientListOptions contains the optional parameters for the ScheduledActionsClient.NewListPager method.
Example (PrivateScheduledActionsList)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-list-private.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewScheduledActionsClient().NewListPager(&armcostmanagement.ScheduledActionsClientListOptions{Filter: nil})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.ScheduledActionListResult = armcostmanagement.ScheduledActionListResult{
	// 	Value: []*armcostmanagement.ScheduledAction{
	// 		{
	// 			Name: to.Ptr("monthlyCostByResource"),
	// 			Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
	// 			ID: to.Ptr("providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource"),
	// 			ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
	// 			Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
	// 			SystemData: &armcostmanagement.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 				CreatedBy: to.Ptr("testuser"),
	// 				CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("testuser"),
	// 				LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 			},
	// 			Properties: &armcostmanagement.ScheduledActionProperties{
	// 				DisplayName: to.Ptr("Monthly Cost By Resource"),
	// 				Notification: &armcostmanagement.NotificationProperties{
	// 					Subject: to.Ptr("Cost by resource this month"),
	// 					To: []*string{
	// 						to.Ptr("user@gmail.com"),
	// 						to.Ptr("team@gmail.com")},
	// 					},
	// 					Schedule: &armcostmanagement.ScheduleProperties{
	// 						DaysOfWeek: []*armcostmanagement.DaysOfWeek{
	// 							to.Ptr(armcostmanagement.DaysOfWeekMonday)},
	// 							EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
	// 							Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyMonthly),
	// 							HourOfDay: to.Ptr[int32](10),
	// 							StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
	// 							WeeksOfMonth: []*armcostmanagement.WeeksOfMonth{
	// 								to.Ptr(armcostmanagement.WeeksOfMonthFirst),
	// 								to.Ptr(armcostmanagement.WeeksOfMonthThird)},
	// 							},
	// 							Scope: to.Ptr(""),
	// 							Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
	// 							ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	// 						},
	// 					},
	// 					{
	// 						Name: to.Ptr("dailyCostByResource"),
	// 						Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
	// 						ID: to.Ptr("providers/Microsoft.CostManagement/scheduledActions/dailyCostByResource"),
	// 						ETag: to.Ptr("\"1d4ff9fe66f1d15\""),
	// 						Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
	// 						SystemData: &armcostmanagement.SystemData{
	// 							CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 							CreatedBy: to.Ptr("testuser"),
	// 							CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 							LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 							LastModifiedBy: to.Ptr("testuser"),
	// 							LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 						},
	// 						Properties: &armcostmanagement.ScheduledActionProperties{
	// 							DisplayName: to.Ptr("Daily Cost By Resource"),
	// 							Notification: &armcostmanagement.NotificationProperties{
	// 								Subject: to.Ptr("Daily Cost By Resource"),
	// 								To: []*string{
	// 									to.Ptr("user@gmail.com"),
	// 									to.Ptr("team@gmail.com")},
	// 								},
	// 								Schedule: &armcostmanagement.ScheduleProperties{
	// 									EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
	// 									Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyDaily),
	// 									HourOfDay: to.Ptr[int32](12),
	// 									StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
	// 								},
	// 								Scope: to.Ptr(""),
	// 								Status: to.Ptr(armcostmanagement.ScheduledActionStatusDisabled),
	// 								ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	// 							},
	// 					}},
	// 				}
}
Output:

Example (PrivateScheduledActionsListFilterByViewId)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-listWithFilter-private.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewScheduledActionsClient().NewListPager(&armcostmanagement.ScheduledActionsClientListOptions{Filter: to.Ptr("properties/viewId eq '/providers/Microsoft.CostManagement/views/swaggerExample'")})
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.ScheduledActionListResult = armcostmanagement.ScheduledActionListResult{
	// 	Value: []*armcostmanagement.ScheduledAction{
	// 		{
	// 			Name: to.Ptr("monthlyCostByResource"),
	// 			Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
	// 			ID: to.Ptr("providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource"),
	// 			ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
	// 			Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
	// 			SystemData: &armcostmanagement.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 				CreatedBy: to.Ptr("testuser"),
	// 				CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("testuser"),
	// 				LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 			},
	// 			Properties: &armcostmanagement.ScheduledActionProperties{
	// 				DisplayName: to.Ptr("Monthly Cost By Resource"),
	// 				Notification: &armcostmanagement.NotificationProperties{
	// 					Subject: to.Ptr("Cost by resource this month"),
	// 					To: []*string{
	// 						to.Ptr("user@gmail.com"),
	// 						to.Ptr("team@gmail.com")},
	// 					},
	// 					Schedule: &armcostmanagement.ScheduleProperties{
	// 						DaysOfWeek: []*armcostmanagement.DaysOfWeek{
	// 							to.Ptr(armcostmanagement.DaysOfWeekMonday)},
	// 							EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
	// 							Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyMonthly),
	// 							HourOfDay: to.Ptr[int32](10),
	// 							StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
	// 							WeeksOfMonth: []*armcostmanagement.WeeksOfMonth{
	// 								to.Ptr(armcostmanagement.WeeksOfMonthFirst),
	// 								to.Ptr(armcostmanagement.WeeksOfMonthThird)},
	// 							},
	// 							Scope: to.Ptr(""),
	// 							Status: to.Ptr(armcostmanagement.ScheduledActionStatusEnabled),
	// 							ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	// 						},
	// 					},
	// 					{
	// 						Name: to.Ptr("dailyCostByResource"),
	// 						Type: to.Ptr("Microsoft.CostManagement/ScheduledActions"),
	// 						ID: to.Ptr("providers/Microsoft.CostManagement/scheduledActions/dailyCostByResource"),
	// 						ETag: to.Ptr("\"1d4ff9fe66f1d15\""),
	// 						Kind: to.Ptr(armcostmanagement.ScheduledActionKindEmail),
	// 						SystemData: &armcostmanagement.SystemData{
	// 							CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 							CreatedBy: to.Ptr("testuser"),
	// 							CreatedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 							LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-18T22:21:51.128Z"); return t}()),
	// 							LastModifiedBy: to.Ptr("testuser"),
	// 							LastModifiedByType: to.Ptr(armcostmanagement.CreatedByTypeUser),
	// 						},
	// 						Properties: &armcostmanagement.ScheduledActionProperties{
	// 							DisplayName: to.Ptr("Daily Cost By Resource"),
	// 							Notification: &armcostmanagement.NotificationProperties{
	// 								Subject: to.Ptr("Daily Cost By Resource"),
	// 								To: []*string{
	// 									to.Ptr("user@gmail.com"),
	// 									to.Ptr("team@gmail.com")},
	// 								},
	// 								Schedule: &armcostmanagement.ScheduleProperties{
	// 									EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-19T22:21:51.128Z"); return t}()),
	// 									Frequency: to.Ptr(armcostmanagement.ScheduleFrequencyDaily),
	// 									HourOfDay: to.Ptr[int32](12),
	// 									StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-19T22:21:51.128Z"); return t}()),
	// 								},
	// 								Scope: to.Ptr(""),
	// 								Status: to.Ptr(armcostmanagement.ScheduledActionStatusDisabled),
	// 								ViewID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	// 							},
	// 					}},
	// 				}
}
Output:

func (*ScheduledActionsClient) Run

Run - Processes a private scheduled action. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • name - Scheduled action name.
  • options - ScheduledActionsClientRunOptions contains the optional parameters for the ScheduledActionsClient.Run method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-sendNow-private.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewScheduledActionsClient().Run(ctx, "monthlyCostByResource", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

func (*ScheduledActionsClient) RunByScope

RunByScope - Runs a shared scheduled action within the given scope. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope.
  • name - Scheduled action name.
  • options - ScheduledActionsClientRunByScopeOptions contains the optional parameters for the ScheduledActionsClient.RunByScope method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-sendNow-shared.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewScheduledActionsClient().RunByScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "monthlyCostByResource", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

type ScheduledActionsClientCheckNameAvailabilityByScopeOptions

type ScheduledActionsClientCheckNameAvailabilityByScopeOptions struct {
}

ScheduledActionsClientCheckNameAvailabilityByScopeOptions contains the optional parameters for the ScheduledActionsClient.CheckNameAvailabilityByScope method.

type ScheduledActionsClientCheckNameAvailabilityByScopeResponse

type ScheduledActionsClientCheckNameAvailabilityByScopeResponse struct {
	// The check availability result.
	CheckNameAvailabilityResponse
}

ScheduledActionsClientCheckNameAvailabilityByScopeResponse contains the response from method ScheduledActionsClient.CheckNameAvailabilityByScope.

type ScheduledActionsClientCheckNameAvailabilityOptions

type ScheduledActionsClientCheckNameAvailabilityOptions struct {
}

ScheduledActionsClientCheckNameAvailabilityOptions contains the optional parameters for the ScheduledActionsClient.CheckNameAvailability method.

type ScheduledActionsClientCheckNameAvailabilityResponse

type ScheduledActionsClientCheckNameAvailabilityResponse struct {
	// The check availability result.
	CheckNameAvailabilityResponse
}

ScheduledActionsClientCheckNameAvailabilityResponse contains the response from method ScheduledActionsClient.CheckNameAvailability.

type ScheduledActionsClientCreateOrUpdateByScopeOptions

type ScheduledActionsClientCreateOrUpdateByScopeOptions struct {
	// ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can be specified to achieve
	// optimistic concurrency.
	IfMatch *string
}

ScheduledActionsClientCreateOrUpdateByScopeOptions contains the optional parameters for the ScheduledActionsClient.CreateOrUpdateByScope method.

type ScheduledActionsClientCreateOrUpdateByScopeResponse

type ScheduledActionsClientCreateOrUpdateByScopeResponse struct {
	// Scheduled action definition.
	ScheduledAction
}

ScheduledActionsClientCreateOrUpdateByScopeResponse contains the response from method ScheduledActionsClient.CreateOrUpdateByScope.

type ScheduledActionsClientCreateOrUpdateOptions

type ScheduledActionsClientCreateOrUpdateOptions struct {
	// ETag of the Entity. Not required when creating an entity. Optional when updating an entity and can be specified to achieve
	// optimistic concurrency.
	IfMatch *string
}

ScheduledActionsClientCreateOrUpdateOptions contains the optional parameters for the ScheduledActionsClient.CreateOrUpdate method.

type ScheduledActionsClientCreateOrUpdateResponse

type ScheduledActionsClientCreateOrUpdateResponse struct {
	// Scheduled action definition.
	ScheduledAction
}

ScheduledActionsClientCreateOrUpdateResponse contains the response from method ScheduledActionsClient.CreateOrUpdate.

type ScheduledActionsClientDeleteByScopeOptions

type ScheduledActionsClientDeleteByScopeOptions struct {
}

ScheduledActionsClientDeleteByScopeOptions contains the optional parameters for the ScheduledActionsClient.DeleteByScope method.

type ScheduledActionsClientDeleteByScopeResponse

type ScheduledActionsClientDeleteByScopeResponse struct {
}

ScheduledActionsClientDeleteByScopeResponse contains the response from method ScheduledActionsClient.DeleteByScope.

type ScheduledActionsClientDeleteOptions

type ScheduledActionsClientDeleteOptions struct {
}

ScheduledActionsClientDeleteOptions contains the optional parameters for the ScheduledActionsClient.Delete method.

type ScheduledActionsClientDeleteResponse

type ScheduledActionsClientDeleteResponse struct {
}

ScheduledActionsClientDeleteResponse contains the response from method ScheduledActionsClient.Delete.

type ScheduledActionsClientGetByScopeOptions

type ScheduledActionsClientGetByScopeOptions struct {
}

ScheduledActionsClientGetByScopeOptions contains the optional parameters for the ScheduledActionsClient.GetByScope method.

type ScheduledActionsClientGetByScopeResponse

type ScheduledActionsClientGetByScopeResponse struct {
	// Scheduled action definition.
	ScheduledAction
}

ScheduledActionsClientGetByScopeResponse contains the response from method ScheduledActionsClient.GetByScope.

type ScheduledActionsClientGetOptions

type ScheduledActionsClientGetOptions struct {
}

ScheduledActionsClientGetOptions contains the optional parameters for the ScheduledActionsClient.Get method.

type ScheduledActionsClientGetResponse

type ScheduledActionsClientGetResponse struct {
	// Scheduled action definition.
	ScheduledAction
}

ScheduledActionsClientGetResponse contains the response from method ScheduledActionsClient.Get.

type ScheduledActionsClientListByScopeOptions

type ScheduledActionsClientListByScopeOptions struct {
	// May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'.
	Filter *string
}

ScheduledActionsClientListByScopeOptions contains the optional parameters for the ScheduledActionsClient.NewListByScopePager method.

type ScheduledActionsClientListByScopeResponse

type ScheduledActionsClientListByScopeResponse struct {
	// Scheduled actions list result. It contains a list of scheduled actions.
	ScheduledActionListResult
}

ScheduledActionsClientListByScopeResponse contains the response from method ScheduledActionsClient.NewListByScopePager.

type ScheduledActionsClientListOptions

type ScheduledActionsClientListOptions struct {
	// May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'.
	Filter *string
}

ScheduledActionsClientListOptions contains the optional parameters for the ScheduledActionsClient.NewListPager method.

type ScheduledActionsClientListResponse

type ScheduledActionsClientListResponse struct {
	// Scheduled actions list result. It contains a list of scheduled actions.
	ScheduledActionListResult
}

ScheduledActionsClientListResponse contains the response from method ScheduledActionsClient.NewListPager.

type ScheduledActionsClientRunByScopeOptions

type ScheduledActionsClientRunByScopeOptions struct {
}

ScheduledActionsClientRunByScopeOptions contains the optional parameters for the ScheduledActionsClient.RunByScope method.

type ScheduledActionsClientRunByScopeResponse

type ScheduledActionsClientRunByScopeResponse struct {
}

ScheduledActionsClientRunByScopeResponse contains the response from method ScheduledActionsClient.RunByScope.

type ScheduledActionsClientRunOptions

type ScheduledActionsClientRunOptions struct {
}

ScheduledActionsClientRunOptions contains the optional parameters for the ScheduledActionsClient.Run method.

type ScheduledActionsClientRunResponse

type ScheduledActionsClientRunResponse struct {
}

ScheduledActionsClientRunResponse contains the response from method ScheduledActionsClient.Run.

type Scope

type Scope string

Scope - Kind of the recommendation scope.

const (
	// ScopeShared - Shared scope recommendation.
	ScopeShared Scope = "Shared"
	// ScopeSingle - Single scope recommendation.
	ScopeSingle Scope = "Single"
)

func PossibleScopeValues

func PossibleScopeValues() []Scope

PossibleScopeValues returns the possible values for the Scope const type.

type SharedScopeBenefitRecommendationProperties

type SharedScopeBenefitRecommendationProperties struct {
	// REQUIRED; Benefit scope. For example, Single or Shared.
	Scope *Scope

	// Grain of the proposed commitment amount. Supported values: 'Hourly'
	CommitmentGranularity *Grain

	// The number of days of usage evaluated for computing the recommendations.
	LookBackPeriod *LookBackPeriod

	// The details of the proposed recommendation.
	RecommendationDetails *AllSavingsBenefitDetails

	// Term period of the benefit. For example, P1Y or P3Y.
	Term *Term

	// On-demand charges between firstConsumptionDate and lastConsumptionDate that were used for computing benefit recommendations.
	Usage *RecommendationUsageDetails

	// READ-ONLY; The list of all benefit recommendations with the recommendation details.
	AllRecommendationDetails *AllSavingsList

	// READ-ONLY; ARM SKU name. 'ComputeSavingsPlan' for SavingsPlan.
	ArmSKUName *string

	// READ-ONLY; The current cost without benefit, corresponds to 'totalHours' in the look-back period.
	CostWithoutBenefit *float64

	// READ-ONLY; An ISO 4217 currency code identifier for the costs and savings amounts.
	CurrencyCode *string

	// READ-ONLY; The first usage date used for looking back for computing the recommendations.
	FirstConsumptionDate *time.Time

	// READ-ONLY; The last usage date used for looking back for computing the recommendations.
	LastConsumptionDate *time.Time

	// READ-ONLY; The total hours for which the cost is covered. Its equal to number of records in a property 'properties/usage/charges'.
	TotalHours *int32
}

SharedScopeBenefitRecommendationProperties - The properties of the benefit recommendation when scope is 'Shared'.

func (*SharedScopeBenefitRecommendationProperties) GetBenefitRecommendationProperties

func (s *SharedScopeBenefitRecommendationProperties) GetBenefitRecommendationProperties() *BenefitRecommendationProperties

GetBenefitRecommendationProperties implements the BenefitRecommendationPropertiesClassification interface for type SharedScopeBenefitRecommendationProperties.

func (SharedScopeBenefitRecommendationProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SharedScopeBenefitRecommendationProperties.

func (*SharedScopeBenefitRecommendationProperties) UnmarshalJSON

func (s *SharedScopeBenefitRecommendationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SharedScopeBenefitRecommendationProperties.

type SingleScopeBenefitRecommendationProperties

type SingleScopeBenefitRecommendationProperties struct {
	// REQUIRED; Benefit scope. For example, Single or Shared.
	Scope *Scope

	// Grain of the proposed commitment amount. Supported values: 'Hourly'
	CommitmentGranularity *Grain

	// The number of days of usage evaluated for computing the recommendations.
	LookBackPeriod *LookBackPeriod

	// The details of the proposed recommendation.
	RecommendationDetails *AllSavingsBenefitDetails

	// Term period of the benefit. For example, P1Y or P3Y.
	Term *Term

	// On-demand charges between firstConsumptionDate and lastConsumptionDate that were used for computing benefit recommendations.
	Usage *RecommendationUsageDetails

	// READ-ONLY; The list of all benefit recommendations with the recommendation details.
	AllRecommendationDetails *AllSavingsList

	// READ-ONLY; ARM SKU name. 'ComputeSavingsPlan' for SavingsPlan.
	ArmSKUName *string

	// READ-ONLY; The current cost without benefit, corresponds to 'totalHours' in the look-back period.
	CostWithoutBenefit *float64

	// READ-ONLY; An ISO 4217 currency code identifier for the costs and savings amounts.
	CurrencyCode *string

	// READ-ONLY; The first usage date used for looking back for computing the recommendations.
	FirstConsumptionDate *time.Time

	// READ-ONLY; The last usage date used for looking back for computing the recommendations.
	LastConsumptionDate *time.Time

	// READ-ONLY; The resource group that this single scope recommendation is for. Applicable only if recommendation is for 'Single'
	// scope and 'ResourceGroup' request scope.
	ResourceGroup *string

	// READ-ONLY; The subscription ID that this single scope recommendation is for. Applicable only if recommendation is for 'Single'
	// scope.
	SubscriptionID *string

	// READ-ONLY; The total hours for which the cost is covered. Its equal to number of records in a property 'properties/usage/charges'.
	TotalHours *int32
}

SingleScopeBenefitRecommendationProperties - The properties of the benefit recommendations when scope is 'Single'.

func (*SingleScopeBenefitRecommendationProperties) GetBenefitRecommendationProperties

func (s *SingleScopeBenefitRecommendationProperties) GetBenefitRecommendationProperties() *BenefitRecommendationProperties

GetBenefitRecommendationProperties implements the BenefitRecommendationPropertiesClassification interface for type SingleScopeBenefitRecommendationProperties.

func (SingleScopeBenefitRecommendationProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SingleScopeBenefitRecommendationProperties.

func (*SingleScopeBenefitRecommendationProperties) UnmarshalJSON

func (s *SingleScopeBenefitRecommendationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SingleScopeBenefitRecommendationProperties.

type Status

type Status struct {
	// The status of the long running operation.
	Status *ReportOperationStatusType
}

Status - The status of the long running operation.

func (Status) MarshalJSON

func (s Status) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Status.

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Status.

type StatusType

type StatusType string

StatusType - The status of the export's schedule. If 'Inactive', the export's schedule is paused.

const (
	StatusTypeActive   StatusType = "Active"
	StatusTypeInactive StatusType = "Inactive"
)

func PossibleStatusTypeValues

func PossibleStatusTypeValues() []StatusType

PossibleStatusTypeValues returns the possible values for the StatusType const type.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type Term

type Term string

Term - Grain which corresponds to value.

const (
	// TermP1Y - Benefit term is 1 year.
	TermP1Y Term = "P1Y"
	// TermP3Y - Benefit term is 3 years.
	TermP3Y Term = "P3Y"
)

func PossibleTermValues

func PossibleTermValues() []Term

PossibleTermValues returns the possible values for the Term const type.

type TimeframeType

type TimeframeType string

TimeframeType - The time frame for pulling data for the query. If custom, then a specific time period must be provided.

const (
	TimeframeTypeBillingMonthToDate  TimeframeType = "BillingMonthToDate"
	TimeframeTypeCustom              TimeframeType = "Custom"
	TimeframeTypeMonthToDate         TimeframeType = "MonthToDate"
	TimeframeTypeTheLastBillingMonth TimeframeType = "TheLastBillingMonth"
	TimeframeTypeTheLastMonth        TimeframeType = "TheLastMonth"
	TimeframeTypeWeekToDate          TimeframeType = "WeekToDate"
)

func PossibleTimeframeTypeValues

func PossibleTimeframeTypeValues() []TimeframeType

PossibleTimeframeTypeValues returns the possible values for the TimeframeType const type.

type View

type View struct {
	// eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating
	// the latest version or not.
	ETag *string

	// The properties of the view.
	Properties *ViewProperties

	// READ-ONLY; Resource Id.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; Resource type.
	Type *string
}

View - States and configurations of Cost Analysis.

func (View) MarshalJSON

func (v View) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type View.

func (*View) UnmarshalJSON

func (v *View) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type View.

type ViewListResult

type ViewListResult struct {
	// READ-ONLY; The link (url) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of views.
	Value []*View
}

ViewListResult - Result of listing views. It contains a list of available views.

func (ViewListResult) MarshalJSON

func (v ViewListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ViewListResult.

func (*ViewListResult) UnmarshalJSON

func (v *ViewListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ViewListResult.

type ViewProperties

type ViewProperties struct {
	// Show costs accumulated over time.
	Accumulated *AccumulatedType

	// Chart type of the main view in Cost Analysis. Required.
	Chart *ChartType

	// User input name of the view. Required.
	DisplayName *string

	// List of KPIs to show in Cost Analysis UI.
	Kpis []*KpiProperties

	// Metric to use when displaying costs.
	Metric *MetricType

	// Configuration of 3 sub-views in the Cost Analysis UI.
	Pivots []*PivotProperties

	// Query body configuration. Required.
	Query *ReportConfigDefinition

	// Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
	// for resourceGroup
	// scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
	// for
	// Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
	// for EnrollmentAccount scope,
	// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile
	// scope,
	// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection
	// scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for
	// Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
	// ExternalBillingAccount scope, and
	// '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.
	Scope *string

	// READ-ONLY; Date the user created this view.
	CreatedOn *time.Time

	// READ-ONLY; Currency of the current view.
	Currency *string

	// READ-ONLY; Date range of the current view.
	DateRange *string

	// READ-ONLY; Date when the user last modified this view.
	ModifiedOn *time.Time
}

ViewProperties - The properties of the view.

func (ViewProperties) MarshalJSON

func (v ViewProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ViewProperties.

func (*ViewProperties) UnmarshalJSON

func (v *ViewProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ViewProperties.

type ViewsClient

type ViewsClient struct {
	// contains filtered or unexported fields
}

ViewsClient contains the methods for the Views group. Don't use this type directly, use NewViewsClient() instead.

func NewViewsClient

func NewViewsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ViewsClient, error)

NewViewsClient creates a new instance of ViewsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ViewsClient) CreateOrUpdate

func (client *ViewsClient) CreateOrUpdate(ctx context.Context, viewName string, parameters View, options *ViewsClientCreateOrUpdateOptions) (ViewsClientCreateOrUpdateResponse, error)

CreateOrUpdate - The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • viewName - View name
  • parameters - Parameters supplied to the CreateOrUpdate View operation.
  • options - ViewsClientCreateOrUpdateOptions contains the optional parameters for the ViewsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PrivateViewCreateOrUpdate.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewViewsClient().CreateOrUpdate(ctx, "swaggerExample", armcostmanagement.View{
	ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
	Properties: &armcostmanagement.ViewProperties{
		Accumulated: to.Ptr(armcostmanagement.AccumulatedTypeTrue),
		Chart:       to.Ptr(armcostmanagement.ChartTypeTable),
		DisplayName: to.Ptr("swagger Example"),
		Kpis: []*armcostmanagement.KpiProperties{
			{
				Type:    to.Ptr(armcostmanagement.KpiTypeForecast),
				Enabled: to.Ptr(true),
			},
			{
				Type:    to.Ptr(armcostmanagement.KpiTypeBudget),
				Enabled: to.Ptr(true),
				ID:      to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo"),
			}},
		Metric: to.Ptr(armcostmanagement.MetricTypeActualCost),
		Pivots: []*armcostmanagement.PivotProperties{
			{
				Name: to.Ptr("ServiceName"),
				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
			},
			{
				Name: to.Ptr("MeterCategory"),
				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
			},
			{
				Name: to.Ptr("swaggerTagKey"),
				Type: to.Ptr(armcostmanagement.PivotTypeTagKey),
			}},
		Query: &armcostmanagement.ReportConfigDefinition{
			Type: to.Ptr(armcostmanagement.ReportTypeUsage),
			DataSet: &armcostmanagement.ReportConfigDataset{
				Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{
					"totalCost": {
						Name:     to.Ptr("PreTaxCost"),
						Function: to.Ptr(armcostmanagement.FunctionTypeSum),
					},
				},
				Granularity: to.Ptr(armcostmanagement.ReportGranularityTypeDaily),
				Grouping:    []*armcostmanagement.ReportConfigGrouping{},
				Sorting: []*armcostmanagement.ReportConfigSorting{
					{
						Name:      to.Ptr("UsageDate"),
						Direction: to.Ptr(armcostmanagement.ReportConfigSortingTypeAscending),
					}},
			},
			Timeframe: to.Ptr(armcostmanagement.ReportTimeframeTypeMonthToDate),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.View = armcostmanagement.View{
// 	Name: to.Ptr("swaggerExample"),
// 	Type: to.Ptr("Microsoft.CostManagement/Views"),
// 	ETag: to.Ptr("\"1d4ffa5a9c2430c\""),
// 	ID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
// 	Properties: &armcostmanagement.ViewProperties{
// 		Accumulated: to.Ptr(armcostmanagement.AccumulatedTypeTrue),
// 		Chart: to.Ptr(armcostmanagement.ChartTypeTable),
// 		DisplayName: to.Ptr("swagger Example"),
// 		Kpis: []*armcostmanagement.KpiProperties{
// 			{
// 				Type: to.Ptr(armcostmanagement.KpiTypeForecast),
// 				Enabled: to.Ptr(true),
// 			},
// 			{
// 				Type: to.Ptr(armcostmanagement.KpiTypeBudget),
// 				Enabled: to.Ptr(true),
// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo"),
// 		}},
// 		Metric: to.Ptr(armcostmanagement.MetricTypeActualCost),
// 		Pivots: []*armcostmanagement.PivotProperties{
// 			{
// 				Name: to.Ptr("ServiceName"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
// 			},
// 			{
// 				Name: to.Ptr("MeterCategory"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
// 			},
// 			{
// 				Name: to.Ptr("swaggerTagKey"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeTagKey),
// 		}},
// 		Query: &armcostmanagement.ReportConfigDefinition{
// 			Type: to.Ptr(armcostmanagement.ReportTypeUsage),
// 			DataSet: &armcostmanagement.ReportConfigDataset{
// 				Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{
// 					"totalCost": &armcostmanagement.ReportConfigAggregation{
// 						Name: to.Ptr("PreTaxCost"),
// 						Function: to.Ptr(armcostmanagement.FunctionTypeSum),
// 					},
// 				},
// 				Granularity: to.Ptr(armcostmanagement.ReportGranularityTypeDaily),
// 				Grouping: []*armcostmanagement.ReportConfigGrouping{
// 				},
// 				Sorting: []*armcostmanagement.ReportConfigSorting{
// 					{
// 						Name: to.Ptr("UsageDate"),
// 						Direction: to.Ptr(armcostmanagement.ReportConfigSortingTypeAscending),
// 				}},
// 			},
// 			Timeframe: to.Ptr(armcostmanagement.ReportTimeframeTypeMonthToDate),
// 		},
// 		Scope: to.Ptr(""),
// 	},
// }
Output:

func (*ViewsClient) CreateOrUpdateByScope

func (client *ViewsClient) CreateOrUpdateByScope(ctx context.Context, scope string, viewName string, parameters View, options *ViewsClientCreateOrUpdateByScopeOptions) (ViewsClientCreateOrUpdateByScopeResponse, error)

CreateOrUpdateByScope - The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.
  • viewName - View name
  • parameters - Parameters supplied to the CreateOrUpdate View operation.
  • options - ViewsClientCreateOrUpdateByScopeOptions contains the optional parameters for the ViewsClient.CreateOrUpdateByScope method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ViewCreateOrUpdateByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewViewsClient().CreateOrUpdateByScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", "swaggerExample", armcostmanagement.View{
	ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
	Properties: &armcostmanagement.ViewProperties{
		Accumulated: to.Ptr(armcostmanagement.AccumulatedTypeTrue),
		Chart:       to.Ptr(armcostmanagement.ChartTypeTable),
		DisplayName: to.Ptr("swagger Example"),
		Kpis: []*armcostmanagement.KpiProperties{
			{
				Type:    to.Ptr(armcostmanagement.KpiTypeForecast),
				Enabled: to.Ptr(true),
			},
			{
				Type:    to.Ptr(armcostmanagement.KpiTypeBudget),
				Enabled: to.Ptr(true),
				ID:      to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo"),
			}},
		Metric: to.Ptr(armcostmanagement.MetricTypeActualCost),
		Pivots: []*armcostmanagement.PivotProperties{
			{
				Name: to.Ptr("ServiceName"),
				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
			},
			{
				Name: to.Ptr("MeterCategory"),
				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
			},
			{
				Name: to.Ptr("swaggerTagKey"),
				Type: to.Ptr(armcostmanagement.PivotTypeTagKey),
			}},
		Query: &armcostmanagement.ReportConfigDefinition{
			Type: to.Ptr(armcostmanagement.ReportTypeUsage),
			DataSet: &armcostmanagement.ReportConfigDataset{
				Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{
					"totalCost": {
						Name:     to.Ptr("PreTaxCost"),
						Function: to.Ptr(armcostmanagement.FunctionTypeSum),
					},
				},
				Granularity: to.Ptr(armcostmanagement.ReportGranularityTypeDaily),
				Grouping:    []*armcostmanagement.ReportConfigGrouping{},
				Sorting: []*armcostmanagement.ReportConfigSorting{
					{
						Name:      to.Ptr("UsageDate"),
						Direction: to.Ptr(armcostmanagement.ReportConfigSortingTypeAscending),
					}},
			},
			Timeframe: to.Ptr(armcostmanagement.ReportTimeframeTypeMonthToDate),
		},
	},
}, nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.View = armcostmanagement.View{
// 	Name: to.Ptr("swaggerExample"),
// 	Type: to.Ptr("Microsoft.CostManagement/Views"),
// 	ETag: to.Ptr("\"1d4ffa5a9c2430c\""),
// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample"),
// 	Properties: &armcostmanagement.ViewProperties{
// 		Accumulated: to.Ptr(armcostmanagement.AccumulatedTypeTrue),
// 		Chart: to.Ptr(armcostmanagement.ChartTypeTable),
// 		DisplayName: to.Ptr("swagger Example"),
// 		Kpis: []*armcostmanagement.KpiProperties{
// 			{
// 				Type: to.Ptr(armcostmanagement.KpiTypeForecast),
// 				Enabled: to.Ptr(true),
// 			},
// 			{
// 				Type: to.Ptr(armcostmanagement.KpiTypeBudget),
// 				Enabled: to.Ptr(true),
// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo"),
// 		}},
// 		Metric: to.Ptr(armcostmanagement.MetricTypeActualCost),
// 		Pivots: []*armcostmanagement.PivotProperties{
// 			{
// 				Name: to.Ptr("ServiceName"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
// 			},
// 			{
// 				Name: to.Ptr("MeterCategory"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
// 			},
// 			{
// 				Name: to.Ptr("swaggerTagKey"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeTagKey),
// 		}},
// 		Query: &armcostmanagement.ReportConfigDefinition{
// 			Type: to.Ptr(armcostmanagement.ReportTypeUsage),
// 			DataSet: &armcostmanagement.ReportConfigDataset{
// 				Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{
// 					"totalCost": &armcostmanagement.ReportConfigAggregation{
// 						Name: to.Ptr("PreTaxCost"),
// 						Function: to.Ptr(armcostmanagement.FunctionTypeSum),
// 					},
// 				},
// 				Granularity: to.Ptr(armcostmanagement.ReportGranularityTypeDaily),
// 				Grouping: []*armcostmanagement.ReportConfigGrouping{
// 				},
// 				Sorting: []*armcostmanagement.ReportConfigSorting{
// 					{
// 						Name: to.Ptr("UsageDate"),
// 						Direction: to.Ptr(armcostmanagement.ReportConfigSortingTypeAscending),
// 				}},
// 			},
// 			Timeframe: to.Ptr(armcostmanagement.ReportTimeframeTypeMonthToDate),
// 		},
// 		Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"),
// 	},
// }
Output:

func (*ViewsClient) Delete

func (client *ViewsClient) Delete(ctx context.Context, viewName string, options *ViewsClientDeleteOptions) (ViewsClientDeleteResponse, error)

Delete - The operation to delete a view. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • viewName - View name
  • options - ViewsClientDeleteOptions contains the optional parameters for the ViewsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PrivateViewDelete.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewViewsClient().Delete(ctx, "TestView", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

func (*ViewsClient) DeleteByScope

func (client *ViewsClient) DeleteByScope(ctx context.Context, scope string, viewName string, options *ViewsClientDeleteByScopeOptions) (ViewsClientDeleteByScopeResponse, error)

DeleteByScope - The operation to delete a view. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.
  • viewName - View name
  • options - ViewsClientDeleteByScopeOptions contains the optional parameters for the ViewsClient.DeleteByScope method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ViewDeleteByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewViewsClient().DeleteByScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", "TestView", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
Output:

func (*ViewsClient) Get

func (client *ViewsClient) Get(ctx context.Context, viewName string, options *ViewsClientGetOptions) (ViewsClientGetResponse, error)

Get - Gets the view by view name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • viewName - View name
  • options - ViewsClientGetOptions contains the optional parameters for the ViewsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PrivateView.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewViewsClient().Get(ctx, "swaggerExample", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.View = armcostmanagement.View{
// 	Name: to.Ptr("swaggerExample"),
// 	Type: to.Ptr("Microsoft.CostManagement/Views"),
// 	ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
// 	ID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
// 	Properties: &armcostmanagement.ViewProperties{
// 		Accumulated: to.Ptr(armcostmanagement.AccumulatedTypeTrue),
// 		Chart: to.Ptr(armcostmanagement.ChartTypeTable),
// 		DisplayName: to.Ptr("swagger Example"),
// 		Kpis: []*armcostmanagement.KpiProperties{
// 			{
// 				Type: to.Ptr(armcostmanagement.KpiTypeForecast),
// 				Enabled: to.Ptr(true),
// 			},
// 			{
// 				Type: to.Ptr(armcostmanagement.KpiTypeBudget),
// 				Enabled: to.Ptr(true),
// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo"),
// 		}},
// 		Metric: to.Ptr(armcostmanagement.MetricTypeActualCost),
// 		Pivots: []*armcostmanagement.PivotProperties{
// 			{
// 				Name: to.Ptr("ServiceName"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
// 			},
// 			{
// 				Name: to.Ptr("MeterCategory"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
// 			},
// 			{
// 				Name: to.Ptr("swaggerTagKey"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeTagKey),
// 		}},
// 		Query: &armcostmanagement.ReportConfigDefinition{
// 			Type: to.Ptr(armcostmanagement.ReportTypeUsage),
// 			DataSet: &armcostmanagement.ReportConfigDataset{
// 				Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{
// 					"totalCost": &armcostmanagement.ReportConfigAggregation{
// 						Name: to.Ptr("PreTaxCost"),
// 						Function: to.Ptr(armcostmanagement.FunctionTypeSum),
// 					},
// 				},
// 				Granularity: to.Ptr(armcostmanagement.ReportGranularityTypeDaily),
// 				Grouping: []*armcostmanagement.ReportConfigGrouping{
// 				},
// 				Sorting: []*armcostmanagement.ReportConfigSorting{
// 					{
// 						Name: to.Ptr("UsageDate"),
// 						Direction: to.Ptr(armcostmanagement.ReportConfigSortingTypeAscending),
// 				}},
// 			},
// 			Timeframe: to.Ptr(armcostmanagement.ReportTimeframeTypeMonthToDate),
// 		},
// 		Scope: to.Ptr(""),
// 	},
// }
Output:

func (*ViewsClient) GetByScope

func (client *ViewsClient) GetByScope(ctx context.Context, scope string, viewName string, options *ViewsClientGetByScopeOptions) (ViewsClientGetByScopeResponse, error)

GetByScope - Gets the view for the defined scope by view name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-01

  • scope - The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.
  • viewName - View name
  • options - ViewsClientGetByScopeOptions contains the optional parameters for the ViewsClient.GetByScope method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ViewByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewViewsClient().GetByScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", "swaggerExample", nil)
if err != nil {
	log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.View = armcostmanagement.View{
// 	Name: to.Ptr("swaggerExample"),
// 	Type: to.Ptr("Microsoft.CostManagement/Views"),
// 	ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample"),
// 	Properties: &armcostmanagement.ViewProperties{
// 		Accumulated: to.Ptr(armcostmanagement.AccumulatedTypeTrue),
// 		Chart: to.Ptr(armcostmanagement.ChartTypeTable),
// 		DisplayName: to.Ptr("swagger Example"),
// 		Kpis: []*armcostmanagement.KpiProperties{
// 			{
// 				Type: to.Ptr(armcostmanagement.KpiTypeForecast),
// 				Enabled: to.Ptr(true),
// 			},
// 			{
// 				Type: to.Ptr(armcostmanagement.KpiTypeBudget),
// 				Enabled: to.Ptr(true),
// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo"),
// 		}},
// 		Metric: to.Ptr(armcostmanagement.MetricTypeActualCost),
// 		Pivots: []*armcostmanagement.PivotProperties{
// 			{
// 				Name: to.Ptr("ServiceName"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
// 			},
// 			{
// 				Name: to.Ptr("MeterCategory"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeDimension),
// 			},
// 			{
// 				Name: to.Ptr("swaggerTagKey"),
// 				Type: to.Ptr(armcostmanagement.PivotTypeTagKey),
// 		}},
// 		Query: &armcostmanagement.ReportConfigDefinition{
// 			Type: to.Ptr(armcostmanagement.ReportTypeUsage),
// 			DataSet: &armcostmanagement.ReportConfigDataset{
// 				Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{
// 					"totalCost": &armcostmanagement.ReportConfigAggregation{
// 						Name: to.Ptr("PreTaxCost"),
// 						Function: to.Ptr(armcostmanagement.FunctionTypeSum),
// 					},
// 				},
// 				Granularity: to.Ptr(armcostmanagement.ReportGranularityTypeDaily),
// 				Grouping: []*armcostmanagement.ReportConfigGrouping{
// 				},
// 				Sorting: []*armcostmanagement.ReportConfigSorting{
// 					{
// 						Name: to.Ptr("UsageDate"),
// 						Direction: to.Ptr(armcostmanagement.ReportConfigSortingTypeAscending),
// 				}},
// 			},
// 			Timeframe: to.Ptr(armcostmanagement.ReportTimeframeTypeMonthToDate),
// 		},
// 		Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"),
// 	},
// }
Output:

func (*ViewsClient) NewListByScopePager

func (client *ViewsClient) NewListByScopePager(scope string, options *ViewsClientListByScopeOptions) *runtime.Pager[ViewsClientListByScopeResponse]

NewListByScopePager - Lists all views at the given scope.

Generated from API version 2022-10-01

  • scope - The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.
  • options - ViewsClientListByScopeOptions contains the optional parameters for the ViewsClient.NewListByScopePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/ViewListByResourceGroup.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewViewsClient().NewListByScopePager("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", nil)
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.ViewListResult = armcostmanagement.ViewListResult{
	// 	Value: []*armcostmanagement.View{
	// 		{
	// 			Name: to.Ptr("swaggerExample"),
	// 			Type: to.Ptr("Microsoft.CostManagement/Views"),
	// 			ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample"),
	// 			Properties: &armcostmanagement.ViewProperties{
	// 				Accumulated: to.Ptr(armcostmanagement.AccumulatedTypeTrue),
	// 				Chart: to.Ptr(armcostmanagement.ChartTypeTable),
	// 				DisplayName: to.Ptr("swagger Example"),
	// 				Kpis: []*armcostmanagement.KpiProperties{
	// 					{
	// 						Type: to.Ptr(armcostmanagement.KpiTypeForecast),
	// 						Enabled: to.Ptr(true),
	// 					},
	// 					{
	// 						Type: to.Ptr(armcostmanagement.KpiTypeBudget),
	// 						Enabled: to.Ptr(true),
	// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo"),
	// 				}},
	// 				Metric: to.Ptr(armcostmanagement.MetricTypeActualCost),
	// 				Pivots: []*armcostmanagement.PivotProperties{
	// 					{
	// 						Name: to.Ptr("ServiceName"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeDimension),
	// 					},
	// 					{
	// 						Name: to.Ptr("MeterCategory"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeDimension),
	// 					},
	// 					{
	// 						Name: to.Ptr("swaggerTagKey"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeTagKey),
	// 				}},
	// 				Query: &armcostmanagement.ReportConfigDefinition{
	// 					Type: to.Ptr(armcostmanagement.ReportTypeUsage),
	// 					DataSet: &armcostmanagement.ReportConfigDataset{
	// 						Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{
	// 							"totalCost": &armcostmanagement.ReportConfigAggregation{
	// 								Name: to.Ptr("PreTaxCost"),
	// 								Function: to.Ptr(armcostmanagement.FunctionTypeSum),
	// 							},
	// 						},
	// 						Granularity: to.Ptr(armcostmanagement.ReportGranularityTypeDaily),
	// 						Grouping: []*armcostmanagement.ReportConfigGrouping{
	// 						},
	// 						Sorting: []*armcostmanagement.ReportConfigSorting{
	// 							{
	// 								Name: to.Ptr("UsageDate"),
	// 								Direction: to.Ptr(armcostmanagement.ReportConfigSortingTypeAscending),
	// 						}},
	// 					},
	// 					Timeframe: to.Ptr(armcostmanagement.ReportTimeframeTypeMonthToDate),
	// 				},
	// 				Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("swaggerExample2"),
	// 			Type: to.Ptr("Microsoft.CostManagement/Views"),
	// 			ETag: to.Ptr("\"1d4ffa5a9c2430c\""),
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample2"),
	// 			Properties: &armcostmanagement.ViewProperties{
	// 				Accumulated: to.Ptr(armcostmanagement.AccumulatedTypeTrue),
	// 				Chart: to.Ptr(armcostmanagement.ChartTypeGroupedColumn),
	// 				DisplayName: to.Ptr("swagger Example 2"),
	// 				Kpis: []*armcostmanagement.KpiProperties{
	// 					{
	// 						Type: to.Ptr(armcostmanagement.KpiTypeForecast),
	// 						Enabled: to.Ptr(true),
	// 					},
	// 					{
	// 						Type: to.Ptr(armcostmanagement.KpiTypeBudget),
	// 						Enabled: to.Ptr(true),
	// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo"),
	// 				}},
	// 				Metric: to.Ptr(armcostmanagement.MetricTypeActualCost),
	// 				Pivots: []*armcostmanagement.PivotProperties{
	// 					{
	// 						Name: to.Ptr("ServiceName"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeDimension),
	// 					},
	// 					{
	// 						Name: to.Ptr("MeterCategory"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeDimension),
	// 					},
	// 					{
	// 						Name: to.Ptr("swaggerTagKey"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeTagKey),
	// 				}},
	// 				Query: &armcostmanagement.ReportConfigDefinition{
	// 					Type: to.Ptr(armcostmanagement.ReportTypeUsage),
	// 					DataSet: &armcostmanagement.ReportConfigDataset{
	// 						Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{
	// 							"totalCost": &armcostmanagement.ReportConfigAggregation{
	// 								Name: to.Ptr("PreTaxCost"),
	// 								Function: to.Ptr(armcostmanagement.FunctionTypeSum),
	// 							},
	// 						},
	// 						Granularity: to.Ptr(armcostmanagement.ReportGranularityTypeDaily),
	// 						Grouping: []*armcostmanagement.ReportConfigGrouping{
	// 						},
	// 						Sorting: []*armcostmanagement.ReportConfigSorting{
	// 							{
	// 								Name: to.Ptr("UsageDate"),
	// 								Direction: to.Ptr(armcostmanagement.ReportConfigSortingTypeAscending),
	// 						}},
	// 					},
	// 					Timeframe: to.Ptr(armcostmanagement.ReportTimeframeType("LastMonthToDate")),
	// 				},
	// 				Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"),
	// 			},
	// 	}},
	// }
}
Output:

func (*ViewsClient) NewListPager

func (client *ViewsClient) NewListPager(options *ViewsClientListOptions) *runtime.Pager[ViewsClientListResponse]

NewListPager - Lists all views by tenant and object.

Generated from API version 2022-10-01

  • options - ViewsClientListOptions contains the optional parameters for the ViewsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/PrivateViewList.json

cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
	log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcostmanagement.NewClientFactory(cred, nil)
if err != nil {
	log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewViewsClient().NewListPager(nil)
for pager.More() {
	page, err := pager.NextPage(ctx)
	if err != nil {
		log.Fatalf("failed to advance page: %v", err)
	}
	for _, v := range page.Value {
		// You could use page here. We use blank identifier for just demo purposes.
		_ = v
	}
	// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// page.ViewListResult = armcostmanagement.ViewListResult{
	// 	Value: []*armcostmanagement.View{
	// 		{
	// 			Name: to.Ptr("swaggerExample"),
	// 			Type: to.Ptr("Microsoft.CostManagement/Views"),
	// 			ETag: to.Ptr("\"1d4ff9fe66f1d10\""),
	// 			ID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample"),
	// 			Properties: &armcostmanagement.ViewProperties{
	// 				Accumulated: to.Ptr(armcostmanagement.AccumulatedTypeTrue),
	// 				Chart: to.Ptr(armcostmanagement.ChartTypeTable),
	// 				DisplayName: to.Ptr("swagger Example"),
	// 				Kpis: []*armcostmanagement.KpiProperties{
	// 					{
	// 						Type: to.Ptr(armcostmanagement.KpiTypeForecast),
	// 						Enabled: to.Ptr(true),
	// 					},
	// 					{
	// 						Type: to.Ptr(armcostmanagement.KpiTypeBudget),
	// 						Enabled: to.Ptr(true),
	// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo"),
	// 				}},
	// 				Metric: to.Ptr(armcostmanagement.MetricTypeActualCost),
	// 				Pivots: []*armcostmanagement.PivotProperties{
	// 					{
	// 						Name: to.Ptr("ServiceName"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeDimension),
	// 					},
	// 					{
	// 						Name: to.Ptr("MeterCategory"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeDimension),
	// 					},
	// 					{
	// 						Name: to.Ptr("swaggerTagKey"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeTagKey),
	// 				}},
	// 				Query: &armcostmanagement.ReportConfigDefinition{
	// 					Type: to.Ptr(armcostmanagement.ReportTypeUsage),
	// 					DataSet: &armcostmanagement.ReportConfigDataset{
	// 						Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{
	// 							"totalCost": &armcostmanagement.ReportConfigAggregation{
	// 								Name: to.Ptr("PreTaxCost"),
	// 								Function: to.Ptr(armcostmanagement.FunctionTypeSum),
	// 							},
	// 						},
	// 						Granularity: to.Ptr(armcostmanagement.ReportGranularityTypeDaily),
	// 						Grouping: []*armcostmanagement.ReportConfigGrouping{
	// 						},
	// 						Sorting: []*armcostmanagement.ReportConfigSorting{
	// 							{
	// 								Name: to.Ptr("UsageDate"),
	// 								Direction: to.Ptr(armcostmanagement.ReportConfigSortingTypeAscending),
	// 						}},
	// 					},
	// 					Timeframe: to.Ptr(armcostmanagement.ReportTimeframeTypeMonthToDate),
	// 				},
	// 				Scope: to.Ptr(""),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("swaggerExample2"),
	// 			Type: to.Ptr("Microsoft.CostManagement/Views"),
	// 			ETag: to.Ptr("\"1d4ffa5a9c2430c\""),
	// 			ID: to.Ptr("/providers/Microsoft.CostManagement/views/swaggerExample2"),
	// 			Properties: &armcostmanagement.ViewProperties{
	// 				Accumulated: to.Ptr(armcostmanagement.AccumulatedTypeTrue),
	// 				Chart: to.Ptr(armcostmanagement.ChartTypeGroupedColumn),
	// 				DisplayName: to.Ptr("swagger Example 2"),
	// 				Kpis: []*armcostmanagement.KpiProperties{
	// 					{
	// 						Type: to.Ptr(armcostmanagement.KpiTypeForecast),
	// 						Enabled: to.Ptr(true),
	// 					},
	// 					{
	// 						Type: to.Ptr(armcostmanagement.KpiTypeBudget),
	// 						Enabled: to.Ptr(true),
	// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo"),
	// 				}},
	// 				Metric: to.Ptr(armcostmanagement.MetricTypeActualCost),
	// 				Pivots: []*armcostmanagement.PivotProperties{
	// 					{
	// 						Name: to.Ptr("ServiceName"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeDimension),
	// 					},
	// 					{
	// 						Name: to.Ptr("MeterCategory"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeDimension),
	// 					},
	// 					{
	// 						Name: to.Ptr("swaggerTagKey"),
	// 						Type: to.Ptr(armcostmanagement.PivotTypeTagKey),
	// 				}},
	// 				Query: &armcostmanagement.ReportConfigDefinition{
	// 					Type: to.Ptr(armcostmanagement.ReportTypeUsage),
	// 					DataSet: &armcostmanagement.ReportConfigDataset{
	// 						Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{
	// 							"totalCost": &armcostmanagement.ReportConfigAggregation{
	// 								Name: to.Ptr("PreTaxCost"),
	// 								Function: to.Ptr(armcostmanagement.FunctionTypeSum),
	// 							},
	// 						},
	// 						Granularity: to.Ptr(armcostmanagement.ReportGranularityTypeDaily),
	// 						Grouping: []*armcostmanagement.ReportConfigGrouping{
	// 						},
	// 						Sorting: []*armcostmanagement.ReportConfigSorting{
	// 							{
	// 								Name: to.Ptr("UsageDate"),
	// 								Direction: to.Ptr(armcostmanagement.ReportConfigSortingTypeAscending),
	// 						}},
	// 					},
	// 					Timeframe: to.Ptr(armcostmanagement.ReportTimeframeType("LastMonthToDate")),
	// 				},
	// 				Scope: to.Ptr(""),
	// 			},
	// 	}},
	// }
}
Output:

type ViewsClientCreateOrUpdateByScopeOptions

type ViewsClientCreateOrUpdateByScopeOptions struct {
}

ViewsClientCreateOrUpdateByScopeOptions contains the optional parameters for the ViewsClient.CreateOrUpdateByScope method.

type ViewsClientCreateOrUpdateByScopeResponse

type ViewsClientCreateOrUpdateByScopeResponse struct {
	// States and configurations of Cost Analysis.
	View
}

ViewsClientCreateOrUpdateByScopeResponse contains the response from method ViewsClient.CreateOrUpdateByScope.

type ViewsClientCreateOrUpdateOptions

type ViewsClientCreateOrUpdateOptions struct {
}

ViewsClientCreateOrUpdateOptions contains the optional parameters for the ViewsClient.CreateOrUpdate method.

type ViewsClientCreateOrUpdateResponse

type ViewsClientCreateOrUpdateResponse struct {
	// States and configurations of Cost Analysis.
	View
}

ViewsClientCreateOrUpdateResponse contains the response from method ViewsClient.CreateOrUpdate.

type ViewsClientDeleteByScopeOptions

type ViewsClientDeleteByScopeOptions struct {
}

ViewsClientDeleteByScopeOptions contains the optional parameters for the ViewsClient.DeleteByScope method.

type ViewsClientDeleteByScopeResponse

type ViewsClientDeleteByScopeResponse struct {
}

ViewsClientDeleteByScopeResponse contains the response from method ViewsClient.DeleteByScope.

type ViewsClientDeleteOptions

type ViewsClientDeleteOptions struct {
}

ViewsClientDeleteOptions contains the optional parameters for the ViewsClient.Delete method.

type ViewsClientDeleteResponse

type ViewsClientDeleteResponse struct {
}

ViewsClientDeleteResponse contains the response from method ViewsClient.Delete.

type ViewsClientGetByScopeOptions

type ViewsClientGetByScopeOptions struct {
}

ViewsClientGetByScopeOptions contains the optional parameters for the ViewsClient.GetByScope method.

type ViewsClientGetByScopeResponse

type ViewsClientGetByScopeResponse struct {
	// States and configurations of Cost Analysis.
	View
}

ViewsClientGetByScopeResponse contains the response from method ViewsClient.GetByScope.

type ViewsClientGetOptions

type ViewsClientGetOptions struct {
}

ViewsClientGetOptions contains the optional parameters for the ViewsClient.Get method.

type ViewsClientGetResponse

type ViewsClientGetResponse struct {
	// States and configurations of Cost Analysis.
	View
}

ViewsClientGetResponse contains the response from method ViewsClient.Get.

type ViewsClientListByScopeOptions

type ViewsClientListByScopeOptions struct {
}

ViewsClientListByScopeOptions contains the optional parameters for the ViewsClient.NewListByScopePager method.

type ViewsClientListByScopeResponse

type ViewsClientListByScopeResponse struct {
	// Result of listing views. It contains a list of available views.
	ViewListResult
}

ViewsClientListByScopeResponse contains the response from method ViewsClient.NewListByScopePager.

type ViewsClientListOptions

type ViewsClientListOptions struct {
}

ViewsClientListOptions contains the optional parameters for the ViewsClient.NewListPager method.

type ViewsClientListResponse

type ViewsClientListResponse struct {
	// Result of listing views. It contains a list of available views.
	ViewListResult
}

ViewsClientListResponse contains the response from method ViewsClient.NewListPager.

type WeeksOfMonth

type WeeksOfMonth string

WeeksOfMonth - Weeks of month.

const (
	WeeksOfMonthFirst  WeeksOfMonth = "First"
	WeeksOfMonthFourth WeeksOfMonth = "Fourth"
	WeeksOfMonthLast   WeeksOfMonth = "Last"
	WeeksOfMonthSecond WeeksOfMonth = "Second"
	WeeksOfMonthThird  WeeksOfMonth = "Third"
)

func PossibleWeeksOfMonthValues

func PossibleWeeksOfMonthValues() []WeeksOfMonth

PossibleWeeksOfMonthValues returns the possible values for the WeeksOfMonth const type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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