billing

package
v1.0.0-beta.26 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package billing provides methods and message types of the billing v2beta1 API.

Index

Constants

View Source
const (
	// Unknown discount mode.
	DiscountDiscountModeUnknownDiscountMode = DiscountDiscountMode("unknown_discount_mode")
	// A rate discount that reduces each customer bill by the discount value percentage.
	DiscountDiscountModeDiscountModeRate = DiscountDiscountMode("discount_mode_rate")
	// A value discount that reduces the amount of the customer bill by the discount value.
	DiscountDiscountModeDiscountModeValue = DiscountDiscountMode("discount_mode_value")
	// A fixed sum to be deducted from the user's bills.
	DiscountDiscountModeDiscountModeSplittable = DiscountDiscountMode("discount_mode_splittable")
)
View Source
const (
	// Unknown filter type.
	DiscountFilterTypeUnknownType = DiscountFilterType("unknown_type")
	// Product category, such as Compute, Network, Observability.
	DiscountFilterTypeCategoryName = DiscountFilterType("category_name")
	// Products within the Product category. For example, VPC, Private Networks, and Public Gateways are products in the Network category.
	DiscountFilterTypeProductName = DiscountFilterType("product_name")
	// The range of a product. For example, `Production Optimized` or `Cost Optimized` for an `instance` product of the `compute` category.
	DiscountFilterTypeProductRange = DiscountFilterType("product_range")
	// Identifies the reference based on category, product, range, size, region, and zone. It can sometimes include different product options, such as licenses and monthly payments.
	DiscountFilterTypeResourceName = DiscountFilterType("resource_name")
	// Region name like "FR-PAR", "NL-AMS", "PL-WAW".
	DiscountFilterTypeRegion = DiscountFilterType("region")
	// Zone name like "FR-PAR-1", "FR-PAR-2", "FR-PAR-3".
	DiscountFilterTypeZone = DiscountFilterType("zone")
)
View Source
const (
	ExportInvoicesRequestOrderByInvoiceNumberDesc = ExportInvoicesRequestOrderBy("invoice_number_desc")
	ExportInvoicesRequestOrderByInvoiceNumberAsc  = ExportInvoicesRequestOrderBy("invoice_number_asc")
	ExportInvoicesRequestOrderByStartDateDesc     = ExportInvoicesRequestOrderBy("start_date_desc")
	ExportInvoicesRequestOrderByStartDateAsc      = ExportInvoicesRequestOrderBy("start_date_asc")
	ExportInvoicesRequestOrderByIssuedDateDesc    = ExportInvoicesRequestOrderBy("issued_date_desc")
	ExportInvoicesRequestOrderByIssuedDateAsc     = ExportInvoicesRequestOrderBy("issued_date_asc")
	ExportInvoicesRequestOrderByDueDateDesc       = ExportInvoicesRequestOrderBy("due_date_desc")
	ExportInvoicesRequestOrderByDueDateAsc        = ExportInvoicesRequestOrderBy("due_date_asc")
	ExportInvoicesRequestOrderByTotalUntaxedDesc  = ExportInvoicesRequestOrderBy("total_untaxed_desc")
	ExportInvoicesRequestOrderByTotalUntaxedAsc   = ExportInvoicesRequestOrderBy("total_untaxed_asc")
	ExportInvoicesRequestOrderByTotalTaxedDesc    = ExportInvoicesRequestOrderBy("total_taxed_desc")
	ExportInvoicesRequestOrderByTotalTaxedAsc     = ExportInvoicesRequestOrderBy("total_taxed_asc")
	ExportInvoicesRequestOrderByInvoiceTypeDesc   = ExportInvoicesRequestOrderBy("invoice_type_desc")
	ExportInvoicesRequestOrderByInvoiceTypeAsc    = ExportInvoicesRequestOrderBy("invoice_type_asc")
)
View Source
const (
	InvoiceTypeUnknownType = InvoiceType("unknown_type")
	InvoiceTypePeriodic    = InvoiceType("periodic")
	InvoiceTypePurchase    = InvoiceType("purchase")
)
View Source
const (
	// Order consumptions by update date (descending chronological order).
	ListConsumptionsRequestOrderByUpdatedAtDesc = ListConsumptionsRequestOrderBy("updated_at_desc")
	// Order consumptions by update date (ascending chronological order).
	ListConsumptionsRequestOrderByUpdatedAtAsc = ListConsumptionsRequestOrderBy("updated_at_asc")
	// Order consumptions by category name (descending alphabetical order).
	ListConsumptionsRequestOrderByCategoryNameDesc = ListConsumptionsRequestOrderBy("category_name_desc")
	// Order consumptions by category name (ascending alphabetical order).
	ListConsumptionsRequestOrderByCategoryNameAsc = ListConsumptionsRequestOrderBy("category_name_asc")
)
View Source
const (
	// Order discounts by creation date (descending chronological order).
	ListDiscountsRequestOrderByCreationDateDesc = ListDiscountsRequestOrderBy("creation_date_desc")
	// Order discounts by creation date (ascending chronological order).
	ListDiscountsRequestOrderByCreationDateAsc = ListDiscountsRequestOrderBy("creation_date_asc")
)
View Source
const (
	ListInvoicesRequestOrderByInvoiceNumberDesc = ListInvoicesRequestOrderBy("invoice_number_desc")
	ListInvoicesRequestOrderByInvoiceNumberAsc  = ListInvoicesRequestOrderBy("invoice_number_asc")
	ListInvoicesRequestOrderByStartDateDesc     = ListInvoicesRequestOrderBy("start_date_desc")
	ListInvoicesRequestOrderByStartDateAsc      = ListInvoicesRequestOrderBy("start_date_asc")
	ListInvoicesRequestOrderByIssuedDateDesc    = ListInvoicesRequestOrderBy("issued_date_desc")
	ListInvoicesRequestOrderByIssuedDateAsc     = ListInvoicesRequestOrderBy("issued_date_asc")
	ListInvoicesRequestOrderByDueDateDesc       = ListInvoicesRequestOrderBy("due_date_desc")
	ListInvoicesRequestOrderByDueDateAsc        = ListInvoicesRequestOrderBy("due_date_asc")
	ListInvoicesRequestOrderByTotalUntaxedDesc  = ListInvoicesRequestOrderBy("total_untaxed_desc")
	ListInvoicesRequestOrderByTotalUntaxedAsc   = ListInvoicesRequestOrderBy("total_untaxed_asc")
	ListInvoicesRequestOrderByTotalTaxedDesc    = ListInvoicesRequestOrderBy("total_taxed_desc")
	ListInvoicesRequestOrderByTotalTaxedAsc     = ListInvoicesRequestOrderBy("total_taxed_asc")
	ListInvoicesRequestOrderByInvoiceTypeDesc   = ListInvoicesRequestOrderBy("invoice_type_desc")
	ListInvoicesRequestOrderByInvoiceTypeAsc    = ListInvoicesRequestOrderBy("invoice_type_asc")
)
View Source
const (
	// Order consumptions by update date (descending chronological order).
	ListTaxesRequestOrderByUpdatedAtDesc = ListTaxesRequestOrderBy("updated_at_desc")
	// Order consumptions by update date (ascending chronological order).
	ListTaxesRequestOrderByUpdatedAtAsc = ListTaxesRequestOrderBy("updated_at_asc")
	// Order consumptions by category name (descending alphabetical order).
	ListTaxesRequestOrderByCategoryNameDesc = ListTaxesRequestOrderBy("category_name_desc")
	// Order consumptions by category name (ascending alphabetical order).
	ListTaxesRequestOrderByCategoryNameAsc = ListTaxesRequestOrderBy("category_name_asc")
)
View Source
const (
	DownloadInvoiceRequestFileTypePdf = DownloadInvoiceRequestFileType("pdf")
)
View Source
const (
	ExportInvoicesRequestFileTypeCsv = ExportInvoicesRequestFileType("csv")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

This API allows you to query your consumption.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) DownloadInvoice

func (s *API) DownloadInvoice(req *DownloadInvoiceRequest, opts ...scw.RequestOption) (*scw.File, error)

DownloadInvoice: Download a specific invoice, specified by its ID.

func (*API) ExportInvoices

func (s *API) ExportInvoices(req *ExportInvoicesRequest, opts ...scw.RequestOption) (*scw.File, error)

ExportInvoices: Export invoices in a CSV file.

func (*API) GetInvoice

func (s *API) GetInvoice(req *GetInvoiceRequest, opts ...scw.RequestOption) (*Invoice, error)

GetInvoice: Get a specific invoice, specified by its ID.

func (*API) ListConsumptions

func (s *API) ListConsumptions(req *ListConsumptionsRequest, opts ...scw.RequestOption) (*ListConsumptionsResponse, error)

ListConsumptions: Consumption allows you to retrieve your past or current consumption cost, by project or category.

func (*API) ListDiscounts

func (s *API) ListDiscounts(req *ListDiscountsRequest, opts ...scw.RequestOption) (*ListDiscountsResponse, error)

ListDiscounts: List all discounts for your organization and usable categories, products, offers, references, regions and zones where the discount can be applied.

func (*API) ListInvoices

func (s *API) ListInvoices(req *ListInvoicesRequest, opts ...scw.RequestOption) (*ListInvoicesResponse, error)

ListInvoices: List all your invoices, filtering by `start_date` and `invoice_type`. Each invoice has its own ID.

func (*API) ListTaxes

func (s *API) ListTaxes(req *ListTaxesRequest, opts ...scw.RequestOption) (*ListTaxesResponse, error)

ListTaxes: Consumption Tax allows you to retrieve your past or current tax charges, by project or category.

type Discount

type Discount struct {
	// ID: the ID of the discount.
	ID string `json:"id"`

	// CreationDate: the creation date of the discount.
	CreationDate *time.Time `json:"creation_date"`

	// OrganizationID: the organization ID of the discount.
	OrganizationID string `json:"organization_id"`

	// Description: the description of the discount.
	Description string `json:"description"`

	// Value: the initial value of the discount.
	Value float64 `json:"value"`

	// ValueUsed: the value indicating how much of the discount has been used.
	ValueUsed float64 `json:"value_used"`

	// ValueRemaining: the remaining value of the discount.
	ValueRemaining float64 `json:"value_remaining"`

	// Mode: the mode of the discount.
	// Default value: unknown_discount_mode
	Mode DiscountDiscountMode `json:"mode"`

	// StartDate: the start date of the discount.
	StartDate *time.Time `json:"start_date"`

	// StopDate: the stop date of the discount.
	StopDate *time.Time `json:"stop_date"`

	// Coupon: the description of the coupon.
	Coupon *DiscountCoupon `json:"coupon"`

	// Filters: list of the discount scopes.
	Filters []*DiscountFilter `json:"filters"`
}

Discount: discount.

type DiscountCoupon

type DiscountCoupon struct {
	// Description: the description of the coupon.
	Description *string `json:"description"`
}

DiscountCoupon: discount coupon.

type DiscountDiscountMode

type DiscountDiscountMode string

func (DiscountDiscountMode) MarshalJSON

func (enum DiscountDiscountMode) MarshalJSON() ([]byte, error)

func (DiscountDiscountMode) String

func (enum DiscountDiscountMode) String() string

func (*DiscountDiscountMode) UnmarshalJSON

func (enum *DiscountDiscountMode) UnmarshalJSON(data []byte) error

type DiscountFilter

type DiscountFilter struct {
	// Type: type of the filter (category name, product name, product range, resource name, region or zone).
	// Default value: unknown_type
	Type DiscountFilterType `json:"type"`

	// Value: value of filter.
	Value string `json:"value"`
}

DiscountFilter: discount filter.

type DiscountFilterType

type DiscountFilterType string

func (DiscountFilterType) MarshalJSON

func (enum DiscountFilterType) MarshalJSON() ([]byte, error)

func (DiscountFilterType) String

func (enum DiscountFilterType) String() string

func (*DiscountFilterType) UnmarshalJSON

func (enum *DiscountFilterType) UnmarshalJSON(data []byte) error

type DownloadInvoiceRequest

type DownloadInvoiceRequest struct {
	// InvoiceID: invoice ID.
	InvoiceID string `json:"-"`

	// FileType: file type. PDF by default.
	// Default value: pdf
	FileType DownloadInvoiceRequestFileType `json:"-"`
}

DownloadInvoiceRequest: download invoice request.

type DownloadInvoiceRequestFileType

type DownloadInvoiceRequestFileType string

func (DownloadInvoiceRequestFileType) MarshalJSON

func (enum DownloadInvoiceRequestFileType) MarshalJSON() ([]byte, error)

func (DownloadInvoiceRequestFileType) String

func (enum DownloadInvoiceRequestFileType) String() string

func (*DownloadInvoiceRequestFileType) UnmarshalJSON

func (enum *DownloadInvoiceRequestFileType) UnmarshalJSON(data []byte) error

type ExportInvoicesRequest

type ExportInvoicesRequest struct {
	// OrganizationID: organization ID. If specified, only invoices from this Organization will be returned.
	OrganizationID *string `json:"-"`

	// BillingPeriodStartAfter: return only invoice with start date greater than billing_period_start.
	BillingPeriodStartAfter *time.Time `json:"-"`

	// BillingPeriodStartBefore: return only invoice with start date less than billing_period_start.
	BillingPeriodStartBefore *time.Time `json:"-"`

	// InvoiceType: invoice type. It can either be `periodic` or `purchase`.
	// Default value: unknown_type
	InvoiceType InvoiceType `json:"-"`

	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: positive integer lower or equal to 100 to select the number of items to return.
	PageSize *uint32 `json:"-"`

	// OrderBy: how invoices are ordered in the response.
	// Default value: invoice_number_desc
	OrderBy ExportInvoicesRequestOrderBy `json:"-"`

	// FileType: file format for exporting the invoice list.
	// Default value: csv
	FileType ExportInvoicesRequestFileType `json:"-"`
}

ExportInvoicesRequest: export invoices request.

type ExportInvoicesRequestFileType

type ExportInvoicesRequestFileType string

func (ExportInvoicesRequestFileType) MarshalJSON

func (enum ExportInvoicesRequestFileType) MarshalJSON() ([]byte, error)

func (ExportInvoicesRequestFileType) String

func (enum ExportInvoicesRequestFileType) String() string

func (*ExportInvoicesRequestFileType) UnmarshalJSON

func (enum *ExportInvoicesRequestFileType) UnmarshalJSON(data []byte) error

type ExportInvoicesRequestOrderBy

type ExportInvoicesRequestOrderBy string

func (ExportInvoicesRequestOrderBy) MarshalJSON

func (enum ExportInvoicesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ExportInvoicesRequestOrderBy) String

func (enum ExportInvoicesRequestOrderBy) String() string

func (*ExportInvoicesRequestOrderBy) UnmarshalJSON

func (enum *ExportInvoicesRequestOrderBy) UnmarshalJSON(data []byte) error

type GetInvoiceRequest

type GetInvoiceRequest struct {
	// InvoiceID: invoice ID.
	InvoiceID string `json:"-"`
}

GetInvoiceRequest: get invoice request.

type Invoice

type Invoice struct {
	// ID: invoice ID.
	ID string `json:"id"`

	OrganizationID string `json:"organization_id"`

	OrganizationName string `json:"organization_name"`

	// StartDate: start date of the billing period.
	StartDate *time.Time `json:"start_date"`

	StopDate *time.Time `json:"stop_date"`

	// BillingPeriod: the billing period of the invoice in the YYYY-MM format.
	BillingPeriod *time.Time `json:"billing_period"`

	// IssuedDate: date when the invoice was sent to the customer.
	IssuedDate *time.Time `json:"issued_date"`

	// DueDate: payment time limit, set according to the Organization's payment conditions.
	DueDate *time.Time `json:"due_date"`

	// TotalUntaxed: total amount, untaxed.
	TotalUntaxed *scw.Money `json:"total_untaxed"`

	// TotalTaxed: total amount, taxed.
	TotalTaxed *scw.Money `json:"total_taxed"`

	// TotalTax: the total tax amount of the invoice.
	TotalTax *scw.Money `json:"total_tax"`

	// TotalDiscount: the total discount amount of the invoice.
	TotalDiscount *scw.Money `json:"total_discount"`

	// TotalUndiscount: the total amount of the invoice before applying the discount.
	TotalUndiscount *scw.Money `json:"total_undiscount"`

	// Type: type of invoice, either periodic or purchase.
	// Default value: unknown_type
	Type InvoiceType `json:"type"`

	// State: the state of the Invoice.
	State string `json:"state"`

	// Number: invoice number.
	Number int32 `json:"number"`

	// SellerName: the name of the seller (Scaleway).
	SellerName string `json:"seller_name"`
}

Invoice: invoice.

type InvoiceType

type InvoiceType string

func (InvoiceType) MarshalJSON

func (enum InvoiceType) MarshalJSON() ([]byte, error)

func (InvoiceType) String

func (enum InvoiceType) String() string

func (*InvoiceType) UnmarshalJSON

func (enum *InvoiceType) UnmarshalJSON(data []byte) error

type ListConsumptionsRequest

type ListConsumptionsRequest struct {
	// OrderBy: order consumptions list in the response by their update date.
	// Default value: updated_at_desc
	OrderBy ListConsumptionsRequestOrderBy `json:"-"`

	// Page: positive integer to choose the page to return.
	Page *int32 `json:"-"`

	// PageSize: positive integer lower or equal to 100 to select the number of items to return.
	PageSize *uint32 `json:"-"`

	// OrganizationID: filter by Organization ID.
	// Precisely one of OrganizationID, ProjectID must be set.
	OrganizationID *string `json:"organization_id,omitempty"`

	// ProjectID: filter by Project ID.
	// Precisely one of OrganizationID, ProjectID must be set.
	ProjectID *string `json:"project_id,omitempty"`

	// CategoryName: filter by name of a Category as they are shown in the invoice (Compute, Network, Observability).
	CategoryName *string `json:"-"`

	// BillingPeriod: filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default.
	BillingPeriod *string `json:"-"`
}

ListConsumptionsRequest: list consumptions request.

type ListConsumptionsRequestOrderBy

type ListConsumptionsRequestOrderBy string

func (ListConsumptionsRequestOrderBy) MarshalJSON

func (enum ListConsumptionsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListConsumptionsRequestOrderBy) String

func (enum ListConsumptionsRequestOrderBy) String() string

func (*ListConsumptionsRequestOrderBy) UnmarshalJSON

func (enum *ListConsumptionsRequestOrderBy) UnmarshalJSON(data []byte) error

type ListConsumptionsResponse

type ListConsumptionsResponse struct {
	// Consumptions: detailed consumption list.
	Consumptions []*ListConsumptionsResponseConsumption `json:"consumptions"`

	// TotalCount: total number of returned items.
	TotalCount uint64 `json:"total_count"`

	// TotalDiscountUntaxedValue: sum of all discounts, displayed only when no category or project ID filter is applied.
	TotalDiscountUntaxedValue float64 `json:"total_discount_untaxed_value"`

	// UpdatedAt: last consumption update date.
	UpdatedAt *time.Time `json:"updated_at"`
}

ListConsumptionsResponse: list consumptions response.

func (*ListConsumptionsResponse) UnsafeAppend

func (r *ListConsumptionsResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListConsumptionsResponse) UnsafeGetTotalCount

func (r *ListConsumptionsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListConsumptionsResponseConsumption

type ListConsumptionsResponseConsumption struct {
	// Value: monetary value of the consumption.
	Value *scw.Money `json:"value"`

	// ProductName: the product name. For example, "VPC Public Gateway S", "VPC Public Gateway M" for the VPC product.
	ProductName string `json:"product_name"`

	// ResourceName: identifies the reference based on the category.
	ResourceName string `json:"resource_name"`

	// Sku: unique identifier of the product.
	Sku string `json:"sku"`

	// ProjectID: project ID of the consumption.
	ProjectID string `json:"project_id"`

	// CategoryName: name of consumption category.
	CategoryName string `json:"category_name"`

	// Unit: unit of consumed quantity.
	Unit string `json:"unit"`

	// BilledQuantity: consumed quantity.
	BilledQuantity string `json:"billed_quantity"`
}

ListConsumptionsResponseConsumption: list consumptions response consumption.

type ListDiscountsRequest

type ListDiscountsRequest struct {
	// OrderBy: order discounts in the response by their description.
	// Default value: creation_date_desc
	OrderBy ListDiscountsRequestOrderBy `json:"-"`

	// Page: positive integer to choose the page to return.
	Page *int32 `json:"-"`

	// PageSize: positive integer lower or equal to 100 to select the number of items to return.
	PageSize *uint32 `json:"-"`

	// OrganizationID: ID of the organization.
	OrganizationID *string `json:"-"`
}

ListDiscountsRequest: list discounts request.

type ListDiscountsRequestOrderBy

type ListDiscountsRequestOrderBy string

func (ListDiscountsRequestOrderBy) MarshalJSON

func (enum ListDiscountsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListDiscountsRequestOrderBy) String

func (enum ListDiscountsRequestOrderBy) String() string

func (*ListDiscountsRequestOrderBy) UnmarshalJSON

func (enum *ListDiscountsRequestOrderBy) UnmarshalJSON(data []byte) error

type ListDiscountsResponse

type ListDiscountsResponse struct {
	// TotalCount: total number of discounts.
	TotalCount uint64 `json:"total_count"`

	// Discounts: paginated returned discounts.
	Discounts []*Discount `json:"discounts"`
}

ListDiscountsResponse: list discounts response.

func (*ListDiscountsResponse) UnsafeAppend

func (r *ListDiscountsResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListDiscountsResponse) UnsafeGetTotalCount

func (r *ListDiscountsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListInvoicesRequest

type ListInvoicesRequest struct {
	// OrganizationID: organization ID. If specified, only invoices from this Organization will be returned.
	OrganizationID *string `json:"-"`

	// BillingPeriodStartAfter: return only invoice with start date greater than billing_period_start.
	BillingPeriodStartAfter *time.Time `json:"-"`

	// BillingPeriodStartBefore: return only invoice with start date less than billing_period_start.
	BillingPeriodStartBefore *time.Time `json:"-"`

	// InvoiceType: invoice type. It can either be `periodic` or `purchase`.
	// Default value: unknown_type
	InvoiceType InvoiceType `json:"-"`

	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: positive integer lower or equal to 100 to select the number of items to return.
	PageSize *uint32 `json:"-"`

	// OrderBy: how invoices are ordered in the response.
	// Default value: invoice_number_desc
	OrderBy ListInvoicesRequestOrderBy `json:"-"`
}

ListInvoicesRequest: list invoices request.

type ListInvoicesRequestOrderBy

type ListInvoicesRequestOrderBy string

func (ListInvoicesRequestOrderBy) MarshalJSON

func (enum ListInvoicesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListInvoicesRequestOrderBy) String

func (enum ListInvoicesRequestOrderBy) String() string

func (*ListInvoicesRequestOrderBy) UnmarshalJSON

func (enum *ListInvoicesRequestOrderBy) UnmarshalJSON(data []byte) error

type ListInvoicesResponse

type ListInvoicesResponse struct {
	// TotalCount: total number of invoices.
	TotalCount uint64 `json:"total_count"`

	// Invoices: paginated returned invoices.
	Invoices []*Invoice `json:"invoices"`
}

ListInvoicesResponse: list invoices response.

func (*ListInvoicesResponse) UnsafeAppend

func (r *ListInvoicesResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListInvoicesResponse) UnsafeGetTotalCount

func (r *ListInvoicesResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListTaxesRequest

type ListTaxesRequest struct {
	// OrderBy: order consumed taxes list in the response by their update date.
	// Default value: updated_at_desc
	OrderBy ListTaxesRequestOrderBy `json:"-"`

	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: positive integer lower or equal to 100 to select the number of items to return.
	PageSize *uint32 `json:"-"`

	// OrganizationID: filter by Organization ID.
	OrganizationID string `json:"-"`

	// BillingPeriod: filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default.
	BillingPeriod *string `json:"-"`
}

ListTaxesRequest: list taxes request.

type ListTaxesRequestOrderBy

type ListTaxesRequestOrderBy string

func (ListTaxesRequestOrderBy) MarshalJSON

func (enum ListTaxesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListTaxesRequestOrderBy) String

func (enum ListTaxesRequestOrderBy) String() string

func (*ListTaxesRequestOrderBy) UnmarshalJSON

func (enum *ListTaxesRequestOrderBy) UnmarshalJSON(data []byte) error

type ListTaxesResponse

type ListTaxesResponse struct {
	// Taxes: detailed consumption tax.
	Taxes []*ListTaxesResponseTax `json:"taxes"`

	// TotalCount: total number of returned items.
	TotalCount uint64 `json:"total_count"`

	// UpdatedAt: last consumption update date.
	UpdatedAt *time.Time `json:"updated_at"`
}

ListTaxesResponse: list taxes response.

func (*ListTaxesResponse) UnsafeAppend

func (r *ListTaxesResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListTaxesResponse) UnsafeGetTotalCount

func (r *ListTaxesResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListTaxesResponseTax

type ListTaxesResponseTax struct {
	// Description: description of the tax applied.
	Description string `json:"description"`

	// Currency: the three-letter currency code.
	Currency string `json:"currency"`

	// Rate: applied tax rate (0.2 means a VAT of 20%).
	Rate *float64 `json:"rate"`

	// TotalTaxValue: the total tax value of the consumption.
	TotalTaxValue *float64 `json:"total_tax_value"`
}

ListTaxesResponseTax: list taxes response tax.

Jump to

Keyboard shortcuts

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