benefitrecommendations

package
v0.20240710.1100952 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2023-07-01-preview/benefitrecommendations Documentation

The benefitrecommendations SDK allows for interaction with the Azure Resource Manager Service costmanagement (API Version 2023-07-01-preview).

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/2023-07-01-preview/benefitrecommendations"

Client Initialization

client := benefitrecommendations.NewBenefitRecommendationsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: BenefitRecommendationsClient.List

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

// alternatively `client.List(ctx, id, benefitrecommendations.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, benefitrecommendations.DefaultListOperationOptions())
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 PossibleValuesForBenefitKind

func PossibleValuesForBenefitKind() []string

func PossibleValuesForGrain

func PossibleValuesForGrain() []string

func PossibleValuesForLookBackPeriod

func PossibleValuesForLookBackPeriod() []string

func PossibleValuesForScope

func PossibleValuesForScope() []string

func PossibleValuesForTerm

func PossibleValuesForTerm() []string

Types

type AllSavingsBenefitDetails

type AllSavingsBenefitDetails struct {
	AverageUtilizationPercentage *float64 `json:"averageUtilizationPercentage,omitempty"`
	BenefitCost                  *float64 `json:"benefitCost,omitempty"`
	CommitmentAmount             *float64 `json:"commitmentAmount,omitempty"`
	CoveragePercentage           *float64 `json:"coveragePercentage,omitempty"`
	OverageCost                  *float64 `json:"overageCost,omitempty"`
	SavingsAmount                *float64 `json:"savingsAmount,omitempty"`
	SavingsPercentage            *float64 `json:"savingsPercentage,omitempty"`
	TotalCost                    *float64 `json:"totalCost,omitempty"`
	WastageCost                  *float64 `json:"wastageCost,omitempty"`
}

type AllSavingsList

type AllSavingsList struct {
	NextLink *string                     `json:"nextLink,omitempty"`
	Value    *[]AllSavingsBenefitDetails `json:"value,omitempty"`
}

type BenefitKind

type BenefitKind string
const (
	BenefitKindIncludedQuantity BenefitKind = "IncludedQuantity"
	BenefitKindReservation      BenefitKind = "Reservation"
	BenefitKindSavingsPlan      BenefitKind = "SavingsPlan"
)

func (*BenefitKind) UnmarshalJSON

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

type BenefitRecommendationModel

type BenefitRecommendationModel struct {
	Id         *string                         `json:"id,omitempty"`
	Kind       *BenefitKind                    `json:"kind,omitempty"`
	Name       *string                         `json:"name,omitempty"`
	Properties BenefitRecommendationProperties `json:"properties"`
	Type       *string                         `json:"type,omitempty"`
}

func (*BenefitRecommendationModel) UnmarshalJSON

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

type BenefitRecommendationModelOperationPredicate

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

func (BenefitRecommendationModelOperationPredicate) Matches

type BenefitRecommendationProperties

type BenefitRecommendationProperties interface {
}

type BenefitRecommendationsClient

type BenefitRecommendationsClient struct {
	Client *resourcemanager.Client
}

func NewBenefitRecommendationsClientWithBaseURI

func NewBenefitRecommendationsClientWithBaseURI(sdkApi sdkEnv.Api) (*BenefitRecommendationsClient, error)

func (BenefitRecommendationsClient) List

List ...

func (BenefitRecommendationsClient) ListComplete

ListComplete retrieves all the results into a single object

func (BenefitRecommendationsClient) ListCompleteMatchingPredicate

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type Grain

type Grain string
const (
	GrainDaily   Grain = "Daily"
	GrainHourly  Grain = "Hourly"
	GrainMonthly Grain = "Monthly"
)

func (*Grain) UnmarshalJSON

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

type ListCompleteResult

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

type ListCustomPager added in v0.20240628.1153531

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationOptions

type ListOperationOptions struct {
	Expand  *string
	Filter  *string
	Orderby *string
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery

type ListOperationResponse

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

type LookBackPeriod

type LookBackPeriod string
const (
	LookBackPeriodLastSevenDays     LookBackPeriod = "Last7Days"
	LookBackPeriodLastSixZeroDays   LookBackPeriod = "Last60Days"
	LookBackPeriodLastThreeZeroDays LookBackPeriod = "Last30Days"
)

func (*LookBackPeriod) UnmarshalJSON

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

type RawBenefitRecommendationPropertiesImpl

type RawBenefitRecommendationPropertiesImpl struct {
	Type   string
	Values map[string]interface{}
}

RawBenefitRecommendationPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RecommendationUsageDetails

type RecommendationUsageDetails struct {
	Charges    *[]float64 `json:"charges,omitempty"`
	UsageGrain *Grain     `json:"usageGrain,omitempty"`
}

type Scope

type Scope string
const (
	ScopeShared Scope = "Shared"
	ScopeSingle Scope = "Single"
)

func (*Scope) UnmarshalJSON

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

type SharedScopeBenefitRecommendationProperties

type SharedScopeBenefitRecommendationProperties struct {

	// Fields inherited from BenefitRecommendationProperties
	AllRecommendationDetails *AllSavingsList             `json:"allRecommendationDetails,omitempty"`
	ArmSkuName               *string                     `json:"armSkuName,omitempty"`
	CommitmentGranularity    *Grain                      `json:"commitmentGranularity,omitempty"`
	CostWithoutBenefit       *float64                    `json:"costWithoutBenefit,omitempty"`
	CurrencyCode             *string                     `json:"currencyCode,omitempty"`
	FirstConsumptionDate     *string                     `json:"firstConsumptionDate,omitempty"`
	LastConsumptionDate      *string                     `json:"lastConsumptionDate,omitempty"`
	LookBackPeriod           *LookBackPeriod             `json:"lookBackPeriod,omitempty"`
	RecommendationDetails    *AllSavingsBenefitDetails   `json:"recommendationDetails,omitempty"`
	Term                     *Term                       `json:"term,omitempty"`
	TotalHours               *int64                      `json:"totalHours,omitempty"`
	Usage                    *RecommendationUsageDetails `json:"usage,omitempty"`
}

func (*SharedScopeBenefitRecommendationProperties) GetFirstConsumptionDateAsTime

func (o *SharedScopeBenefitRecommendationProperties) GetFirstConsumptionDateAsTime() (*time.Time, error)

func (*SharedScopeBenefitRecommendationProperties) GetLastConsumptionDateAsTime

func (o *SharedScopeBenefitRecommendationProperties) GetLastConsumptionDateAsTime() (*time.Time, error)

func (SharedScopeBenefitRecommendationProperties) MarshalJSON

func (*SharedScopeBenefitRecommendationProperties) SetFirstConsumptionDateAsTime

func (o *SharedScopeBenefitRecommendationProperties) SetFirstConsumptionDateAsTime(input time.Time)

func (*SharedScopeBenefitRecommendationProperties) SetLastConsumptionDateAsTime

func (o *SharedScopeBenefitRecommendationProperties) SetLastConsumptionDateAsTime(input time.Time)

type SingleScopeBenefitRecommendationProperties

type SingleScopeBenefitRecommendationProperties struct {
	ResourceGroup  *string `json:"resourceGroup,omitempty"`
	SubscriptionId *string `json:"subscriptionId,omitempty"`

	// Fields inherited from BenefitRecommendationProperties
	AllRecommendationDetails *AllSavingsList             `json:"allRecommendationDetails,omitempty"`
	ArmSkuName               *string                     `json:"armSkuName,omitempty"`
	CommitmentGranularity    *Grain                      `json:"commitmentGranularity,omitempty"`
	CostWithoutBenefit       *float64                    `json:"costWithoutBenefit,omitempty"`
	CurrencyCode             *string                     `json:"currencyCode,omitempty"`
	FirstConsumptionDate     *string                     `json:"firstConsumptionDate,omitempty"`
	LastConsumptionDate      *string                     `json:"lastConsumptionDate,omitempty"`
	LookBackPeriod           *LookBackPeriod             `json:"lookBackPeriod,omitempty"`
	RecommendationDetails    *AllSavingsBenefitDetails   `json:"recommendationDetails,omitempty"`
	Term                     *Term                       `json:"term,omitempty"`
	TotalHours               *int64                      `json:"totalHours,omitempty"`
	Usage                    *RecommendationUsageDetails `json:"usage,omitempty"`
}

func (*SingleScopeBenefitRecommendationProperties) GetFirstConsumptionDateAsTime

func (o *SingleScopeBenefitRecommendationProperties) GetFirstConsumptionDateAsTime() (*time.Time, error)

func (*SingleScopeBenefitRecommendationProperties) GetLastConsumptionDateAsTime

func (o *SingleScopeBenefitRecommendationProperties) GetLastConsumptionDateAsTime() (*time.Time, error)

func (SingleScopeBenefitRecommendationProperties) MarshalJSON

func (*SingleScopeBenefitRecommendationProperties) SetFirstConsumptionDateAsTime

func (o *SingleScopeBenefitRecommendationProperties) SetFirstConsumptionDateAsTime(input time.Time)

func (*SingleScopeBenefitRecommendationProperties) SetLastConsumptionDateAsTime

func (o *SingleScopeBenefitRecommendationProperties) SetLastConsumptionDateAsTime(input time.Time)

type Term

type Term string
const (
	TermPOneY   Term = "P1Y"
	TermPThreeY Term = "P3Y"
)

func (*Term) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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