views

package
v0.20240322.1155759 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MPL-2.0 Imports: 13 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2022-10-01/views Documentation

The views SDK allows for interaction with the Azure Resource Manager Service costmanagement (API Version 2022-10-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2022-10-01/views"

Client Initialization

client := views.NewViewsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ViewsClient.CreateOrUpdate

ctx := context.TODO()
id := views.NewViewID("viewValue")

payload := views.View{
	// ...
}


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

Example Usage: ViewsClient.CreateOrUpdateByScope

ctx := context.TODO()
id := views.NewScopedViewID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "viewValue")

payload := views.View{
	// ...
}


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

Example Usage: ViewsClient.Delete

ctx := context.TODO()
id := views.NewViewID("viewValue")

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

Example Usage: ViewsClient.DeleteByScope

ctx := context.TODO()
id := views.NewScopedViewID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "viewValue")

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

Example Usage: ViewsClient.Get

ctx := context.TODO()
id := views.NewViewID("viewValue")

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

Example Usage: ViewsClient.GetByScope

ctx := context.TODO()
id := views.NewScopedViewID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "viewValue")

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

Example Usage: ViewsClient.List

ctx := context.TODO()


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

Example Usage: ViewsClient.ListByScope

ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForAccumulatedType

func PossibleValuesForAccumulatedType() []string

func PossibleValuesForChartType

func PossibleValuesForChartType() []string

func PossibleValuesForFunctionType

func PossibleValuesForFunctionType() []string

func PossibleValuesForKpiTypeType

func PossibleValuesForKpiTypeType() []string

func PossibleValuesForMetricType

func PossibleValuesForMetricType() []string

func PossibleValuesForOperatorType

func PossibleValuesForOperatorType() []string

func PossibleValuesForPivotTypeType

func PossibleValuesForPivotTypeType() []string

func PossibleValuesForQueryColumnType

func PossibleValuesForQueryColumnType() []string

func PossibleValuesForReportConfigSortingType

func PossibleValuesForReportConfigSortingType() []string

func PossibleValuesForReportGranularityType

func PossibleValuesForReportGranularityType() []string

func PossibleValuesForReportTimeframeType

func PossibleValuesForReportTimeframeType() []string

func PossibleValuesForReportType

func PossibleValuesForReportType() []string

func ValidateScopedViewID

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

ValidateScopedViewID checks that 'input' can be parsed as a Scoped View ID

func ValidateViewID

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

ValidateViewID checks that 'input' can be parsed as a View ID

Types

type AccumulatedType

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

func (*AccumulatedType) UnmarshalJSON

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

type ChartType

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

func (*ChartType) UnmarshalJSON

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

type CreateOrUpdateByScopeOperationResponse

type CreateOrUpdateByScopeOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *View
}

type CreateOrUpdateOperationResponse

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

type DeleteByScopeOperationResponse

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

type DeleteOperationResponse

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

type FunctionType

type FunctionType string
const (
	FunctionTypeSum FunctionType = "Sum"
)

func (*FunctionType) UnmarshalJSON

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

type GetByScopeOperationResponse

type GetByScopeOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *View
}

type GetOperationResponse

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

type KpiProperties

type KpiProperties struct {
	Enabled *bool        `json:"enabled,omitempty"`
	Id      *string      `json:"id,omitempty"`
	Type    *KpiTypeType `json:"type,omitempty"`
}

type KpiTypeType

type KpiTypeType string
const (
	KpiTypeTypeBudget   KpiTypeType = "Budget"
	KpiTypeTypeForecast KpiTypeType = "Forecast"
)

func (*KpiTypeType) UnmarshalJSON

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

type ListByScopeCompleteResult

type ListByScopeCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []View
}

type ListByScopeOperationResponse

type ListByScopeOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]View
}

type ListCompleteResult

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

type ListOperationResponse

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

type MetricType

type MetricType string
const (
	MetricTypeAHUB          MetricType = "AHUB"
	MetricTypeActualCost    MetricType = "ActualCost"
	MetricTypeAmortizedCost MetricType = "AmortizedCost"
)

func (*MetricType) UnmarshalJSON

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

type OperatorType

type OperatorType string
const (
	OperatorTypeContains OperatorType = "Contains"
	OperatorTypeIn       OperatorType = "In"
)

func (*OperatorType) UnmarshalJSON

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

type PivotProperties

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

type PivotTypeType

type PivotTypeType string
const (
	PivotTypeTypeDimension PivotTypeType = "Dimension"
	PivotTypeTypeTagKey    PivotTypeType = "TagKey"
)

func (*PivotTypeType) UnmarshalJSON

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

type QueryColumnType

type QueryColumnType string
const (
	QueryColumnTypeDimension QueryColumnType = "Dimension"
	QueryColumnTypeTagKey    QueryColumnType = "TagKey"
)

func (*QueryColumnType) UnmarshalJSON

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

type ReportConfigAggregation

type ReportConfigAggregation struct {
	Function FunctionType `json:"function"`
	Name     string       `json:"name"`
}

type ReportConfigComparisonExpression

type ReportConfigComparisonExpression struct {
	Name     string       `json:"name"`
	Operator OperatorType `json:"operator"`
	Values   []string     `json:"values"`
}

type ReportConfigDataset

type ReportConfigDataset struct {
	Aggregation   *map[string]ReportConfigAggregation `json:"aggregation,omitempty"`
	Configuration *ReportConfigDatasetConfiguration   `json:"configuration,omitempty"`
	Filter        *ReportConfigFilter                 `json:"filter,omitempty"`
	Granularity   *ReportGranularityType              `json:"granularity,omitempty"`
	Grouping      *[]ReportConfigGrouping             `json:"grouping,omitempty"`
	Sorting       *[]ReportConfigSorting              `json:"sorting,omitempty"`
}

type ReportConfigDatasetConfiguration

type ReportConfigDatasetConfiguration struct {
	Columns *[]string `json:"columns,omitempty"`
}

type ReportConfigDefinition

type ReportConfigDefinition struct {
	DataSet                   *ReportConfigDataset    `json:"dataSet,omitempty"`
	IncludeMonetaryCommitment *bool                   `json:"includeMonetaryCommitment,omitempty"`
	TimePeriod                *ReportConfigTimePeriod `json:"timePeriod,omitempty"`
	Timeframe                 ReportTimeframeType     `json:"timeframe"`
	Type                      ReportType              `json:"type"`
}

type ReportConfigFilter

type ReportConfigFilter struct {
	And        *[]ReportConfigFilter             `json:"and,omitempty"`
	Dimensions *ReportConfigComparisonExpression `json:"dimensions,omitempty"`
	Or         *[]ReportConfigFilter             `json:"or,omitempty"`
	Tags       *ReportConfigComparisonExpression `json:"tags,omitempty"`
}

type ReportConfigGrouping

type ReportConfigGrouping struct {
	Name string          `json:"name"`
	Type QueryColumnType `json:"type"`
}

type ReportConfigSorting

type ReportConfigSorting struct {
	Direction *ReportConfigSortingType `json:"direction,omitempty"`
	Name      string                   `json:"name"`
}

type ReportConfigSortingType

type ReportConfigSortingType string
const (
	ReportConfigSortingTypeAscending  ReportConfigSortingType = "Ascending"
	ReportConfigSortingTypeDescending ReportConfigSortingType = "Descending"
)

func (*ReportConfigSortingType) UnmarshalJSON

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

type ReportConfigTimePeriod

type ReportConfigTimePeriod struct {
	From string `json:"from"`
	To   string `json:"to"`
}

func (*ReportConfigTimePeriod) GetFromAsTime

func (o *ReportConfigTimePeriod) GetFromAsTime() (*time.Time, error)

func (*ReportConfigTimePeriod) GetToAsTime

func (o *ReportConfigTimePeriod) GetToAsTime() (*time.Time, error)

func (*ReportConfigTimePeriod) SetFromAsTime

func (o *ReportConfigTimePeriod) SetFromAsTime(input time.Time)

func (*ReportConfigTimePeriod) SetToAsTime

func (o *ReportConfigTimePeriod) SetToAsTime(input time.Time)

type ReportGranularityType

type ReportGranularityType string
const (
	ReportGranularityTypeDaily   ReportGranularityType = "Daily"
	ReportGranularityTypeMonthly ReportGranularityType = "Monthly"
)

func (*ReportGranularityType) UnmarshalJSON

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

type ReportTimeframeType

type ReportTimeframeType string
const (
	ReportTimeframeTypeCustom      ReportTimeframeType = "Custom"
	ReportTimeframeTypeMonthToDate ReportTimeframeType = "MonthToDate"
	ReportTimeframeTypeWeekToDate  ReportTimeframeType = "WeekToDate"
	ReportTimeframeTypeYearToDate  ReportTimeframeType = "YearToDate"
)

func (*ReportTimeframeType) UnmarshalJSON

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

type ReportType

type ReportType string
const (
	ReportTypeUsage ReportType = "Usage"
)

func (*ReportType) UnmarshalJSON

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

type ScopedViewId

type ScopedViewId struct {
	Scope    string
	ViewName string
}

ScopedViewId is a struct representing the Resource ID for a Scoped View

func NewScopedViewID

func NewScopedViewID(scope string, viewName string) ScopedViewId

NewScopedViewID returns a new ScopedViewId struct

func ParseScopedViewID

func ParseScopedViewID(input string) (*ScopedViewId, error)

ParseScopedViewID parses 'input' into a ScopedViewId

func ParseScopedViewIDInsensitively

func ParseScopedViewIDInsensitively(input string) (*ScopedViewId, error)

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

func (*ScopedViewId) FromParseResult

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

func (ScopedViewId) ID

func (id ScopedViewId) ID() string

ID returns the formatted Scoped View ID

func (ScopedViewId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Scoped View ID

func (ScopedViewId) String

func (id ScopedViewId) String() string

String returns a human-readable description of this Scoped View ID

type View

type View struct {
	ETag       *string         `json:"eTag,omitempty"`
	Id         *string         `json:"id,omitempty"`
	Name       *string         `json:"name,omitempty"`
	Properties *ViewProperties `json:"properties,omitempty"`
	Type       *string         `json:"type,omitempty"`
}

type ViewId

type ViewId struct {
	ViewName string
}

ViewId is a struct representing the Resource ID for a View

func NewViewID

func NewViewID(viewName string) ViewId

NewViewID returns a new ViewId struct

func ParseViewID

func ParseViewID(input string) (*ViewId, error)

ParseViewID parses 'input' into a ViewId

func ParseViewIDInsensitively

func ParseViewIDInsensitively(input string) (*ViewId, error)

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

func (*ViewId) FromParseResult

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

func (ViewId) ID

func (id ViewId) ID() string

ID returns the formatted View ID

func (ViewId) Segments

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

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

func (ViewId) String

func (id ViewId) String() string

String returns a human-readable description of this View ID

type ViewOperationPredicate

type ViewOperationPredicate struct {
	ETag *string
	Id   *string
	Name *string
	Type *string
}

func (ViewOperationPredicate) Matches

func (p ViewOperationPredicate) Matches(input View) bool

type ViewProperties

type ViewProperties struct {
	Accumulated *AccumulatedType        `json:"accumulated,omitempty"`
	Chart       *ChartType              `json:"chart,omitempty"`
	CreatedOn   *string                 `json:"createdOn,omitempty"`
	Currency    *string                 `json:"currency,omitempty"`
	DateRange   *string                 `json:"dateRange,omitempty"`
	DisplayName *string                 `json:"displayName,omitempty"`
	Kpis        *[]KpiProperties        `json:"kpis,omitempty"`
	Metric      *MetricType             `json:"metric,omitempty"`
	ModifiedOn  *string                 `json:"modifiedOn,omitempty"`
	Pivots      *[]PivotProperties      `json:"pivots,omitempty"`
	Query       *ReportConfigDefinition `json:"query,omitempty"`
	Scope       *string                 `json:"scope,omitempty"`
}

func (*ViewProperties) GetCreatedOnAsTime

func (o *ViewProperties) GetCreatedOnAsTime() (*time.Time, error)

func (*ViewProperties) GetModifiedOnAsTime

func (o *ViewProperties) GetModifiedOnAsTime() (*time.Time, error)

func (*ViewProperties) SetCreatedOnAsTime

func (o *ViewProperties) SetCreatedOnAsTime(input time.Time)

func (*ViewProperties) SetModifiedOnAsTime

func (o *ViewProperties) SetModifiedOnAsTime(input time.Time)

type ViewsClient

type ViewsClient struct {
	Client *resourcemanager.Client
}

func NewViewsClientWithBaseURI

func NewViewsClientWithBaseURI(sdkApi sdkEnv.Api) (*ViewsClient, error)

func (ViewsClient) CreateOrUpdate

func (c ViewsClient) CreateOrUpdate(ctx context.Context, id ViewId, input View) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (ViewsClient) CreateOrUpdateByScope

func (c ViewsClient) CreateOrUpdateByScope(ctx context.Context, id ScopedViewId, input View) (result CreateOrUpdateByScopeOperationResponse, err error)

CreateOrUpdateByScope ...

func (ViewsClient) Delete

func (c ViewsClient) Delete(ctx context.Context, id ViewId) (result DeleteOperationResponse, err error)

Delete ...

func (ViewsClient) DeleteByScope

func (c ViewsClient) DeleteByScope(ctx context.Context, id ScopedViewId) (result DeleteByScopeOperationResponse, err error)

DeleteByScope ...

func (ViewsClient) Get

func (c ViewsClient) Get(ctx context.Context, id ViewId) (result GetOperationResponse, err error)

Get ...

func (ViewsClient) GetByScope

func (c ViewsClient) GetByScope(ctx context.Context, id ScopedViewId) (result GetByScopeOperationResponse, err error)

GetByScope ...

func (ViewsClient) List

func (c ViewsClient) List(ctx context.Context) (result ListOperationResponse, err error)

List ...

func (ViewsClient) ListByScope

func (c ViewsClient) ListByScope(ctx context.Context, id commonids.ScopeId) (result ListByScopeOperationResponse, err error)

ListByScope ...

func (ViewsClient) ListByScopeComplete

func (c ViewsClient) ListByScopeComplete(ctx context.Context, id commonids.ScopeId) (ListByScopeCompleteResult, error)

ListByScopeComplete retrieves all the results into a single object

func (ViewsClient) ListByScopeCompleteMatchingPredicate

func (c ViewsClient) ListByScopeCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate ViewOperationPredicate) (result ListByScopeCompleteResult, err error)

ListByScopeCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ViewsClient) ListComplete

func (c ViewsClient) ListComplete(ctx context.Context) (ListCompleteResult, error)

ListComplete retrieves all the results into a single object

func (ViewsClient) ListCompleteMatchingPredicate

func (c ViewsClient) ListCompleteMatchingPredicate(ctx context.Context, predicate ViewOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

Jump to

Keyboard shortcuts

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