billing

package
v0.0.0-...-d74374d Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBillingsInto

func ExtractBillingsInto(r pagination.Page, v interface{}) error

func List

List returns a Pager which allows you to iterate over a collection of billing.

Types

type Billing

type Billing struct {
	Region         string  `json:"REGION"`
	ProjectID      string  `json:"PROJECT_ID"`
	ProjectName    string  `json:"PROJECT_NAME"`
	ObjectID       string  `json:"OBJECT_ID"`
	MetricType     string  `json:"METRIC_TYPE"`
	Amount         float64 `json:"AMOUNT,string"`
	Duration       float64 `json:"DURATION,string"`
	PriceLoc       float64 `json:"PRICE_LOC,string"`
	PriceSec       float64 `json:"PRICE_SEC,string"`
	CostObject     string  `json:"COST_OBJECT"`
	CostObjectType string  `json:"COST_OBJECT_TYPE"`
	COInherited    Bool    `json:"CO_INHERITED"`
	SendCC         int     `json:"SEND_CC"`
}

Billing represents a Billing Billing.

func ExtractBillings

func ExtractBillings(r pagination.Page) ([]Billing, error)

ExtractBillings accepts a Page struct, specifically a BillingPage struct, and extracts the elements into a slice of Billing structs. In other words, a generic collection is mapped into a relevant slice.

type BillingPage

type BillingPage struct {
	pagination.SinglePageBase
}

BillingPage is the page returned by a pager when traversing over a collection of billing.

type Bool

type Bool bool

Bool allows 0/1 to also become boolean.

func (*Bool) UnmarshalJSON

func (v *Bool) UnmarshalJSON(b []byte) error

type ListOpts

type ListOpts struct {
	CostObject       string    `q:"cost_object"`
	ProjectID        string    `q:"project_id"`
	ExcludeMissingCO bool      `q:"exclude_missing_co"`
	Format           string    `q:"format"`
	Language         string    `q:"language"`
	Year             int       `q:"year"`
	Month            int       `q:"month"`
	From             time.Time `q:"-"`
	To               time.Time `q:"-"`
}

ListOpts is a structure that holds options for listing billings.

func (ListOpts) ToBillingListQuery

func (opts ListOpts) ToBillingListQuery() (string, error)

ToBillingListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToBillingListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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