views

package
v0.20220901.1111930 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MPL-2.0 Imports: 11 Imported by: 1

README

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

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

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

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-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 := views.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 PossibleValuesForReportConfigColumnType

func PossibleValuesForReportConfigColumnType() []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"
)

type ChartType

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

type CreateOrUpdateByScopeOperationResponse

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

type CreateOrUpdateOperationResponse

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

type DeleteByScopeOperationResponse

type DeleteByScopeOperationResponse struct {
	HttpResponse *http.Response
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
}

type FunctionType

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

type GetByScopeOperationResponse

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

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	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"
)

type ListByScopeCompleteResult

type ListByScopeCompleteResult struct {
	Items []View
}

type ListByScopeOperationResponse

type ListByScopeOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]View
	// contains filtered or unexported fields
}

func (ListByScopeOperationResponse) HasMore

func (r ListByScopeOperationResponse) HasMore() bool

func (ListByScopeOperationResponse) LoadMore

type ListCompleteResult

type ListCompleteResult struct {
	Items []View
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]View
	// contains filtered or unexported fields
}

func (ListOperationResponse) HasMore

func (r ListOperationResponse) HasMore() bool

func (ListOperationResponse) LoadMore

func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error)

type MetricType

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

type OperatorType

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

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"
)

type ReportConfigAggregation

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

type ReportConfigColumnType

type ReportConfigColumnType string
const (
	ReportConfigColumnTypeDimension ReportConfigColumnType = "Dimension"
	ReportConfigColumnTypeTag       ReportConfigColumnType = "Tag"
)

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 ReportConfigColumnType `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"
)

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"
)

type ReportTimeframeType

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

type ReportType

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

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) 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) 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 autorest.Client
	// contains filtered or unexported fields
}

func NewViewsClientWithBaseURI

func NewViewsClientWithBaseURI(endpoint string) ViewsClient

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) (resp ListOperationResponse, err error)

List ...

func (ViewsClient) ListByScope

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

ListByScope ...

func (ViewsClient) ListByScopeComplete

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

ListByScopeComplete retrieves all of the results into a single object

func (ViewsClient) ListByScopeCompleteMatchingPredicate

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

ListByScopeCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (ViewsClient) ListComplete

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

ListComplete retrieves all of the results into a single object

func (ViewsClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

Jump to

Keyboard shortcuts

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