billing

package
v1.0.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	InvoiceTypeUnknownType = InvoiceType("unknown_type")
	InvoiceTypePeriodic    = InvoiceType("periodic")
	InvoiceTypePurchase    = InvoiceType("purchase")
)
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 (
	DownloadInvoiceRequestFileTypePdf = DownloadInvoiceRequestFileType("pdf")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API: this API allows you to query your consumption. Billing API.

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)

func (*API) GetConsumption

func (s *API) GetConsumption(req *GetConsumptionRequest, opts ...scw.RequestOption) (*GetConsumptionResponse, error)

func (*API) ListInvoices

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

type DownloadInvoiceRequest

type DownloadInvoiceRequest struct {
	// InvoiceID: invoice ID.
	InvoiceID string `json:"-"`
	// FileType: wanted file type.
	// Default value: pdf
	FileType DownloadInvoiceRequestFileType `json:"-"`
}

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 GetConsumptionRequest

type GetConsumptionRequest struct {
	// OrganizationID: filter by organization ID.
	OrganizationID string `json:"-"`
}

type GetConsumptionResponse

type GetConsumptionResponse struct {
	// Consumptions: detailed consumption list.
	Consumptions []*GetConsumptionResponseConsumption `json:"consumptions"`
	// UpdatedAt: last consumption update date.
	UpdatedAt *time.Time `json:"updated_at"`
}

GetConsumptionResponse: get consumption response.

type GetConsumptionResponseConsumption

type GetConsumptionResponseConsumption struct {
	// Value: monetary value of the consumption.
	Value *scw.Money `json:"value"`
	// Description: description of the consumption.
	Description string `json:"description"`
	// ProjectID: project ID of the consumption.
	ProjectID string `json:"project_id"`
	// Category: category of the consumption.
	Category string `json:"category"`
	// OperationPath: unique identifier of the product.
	OperationPath string `json:"operation_path"`
}

GetConsumptionResponseConsumption: get consumption response. consumption.

type Invoice

type Invoice struct {
	// ID: invoice ID.
	ID string `json:"id"`
	// StartDate: start date of the billing period.
	StartDate *time.Time `json:"start_date"`
	// 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"`
	// InvoiceType: type of invoice.
	// Default value: unknown_type
	InvoiceType InvoiceType `json:"invoice_type"`
	// Number: invoice number.
	Number int32 `json:"number"`
}

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 ListInvoicesRequest

type ListInvoicesRequest struct {
	// OrganizationID: organization ID to filter for, only invoices from this Organization will be returned.
	OrganizationID *string `json:"-"`
	// StartedAfter: invoice's `start_date` is greater or equal to `started_after`.
	StartedAfter *time.Time `json:"-"`
	// StartedBefore: invoice's `start_date` precedes `started_before`.
	StartedBefore *time.Time `json:"-"`
	// InvoiceType: invoice type. It can either be `periodic` or `purchase`.
	// Default value: unknown_type
	InvoiceType InvoiceType `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.
	// Default value: 20
	PageSize *uint32 `json:"-"`
	// OrderBy: how invoices are ordered in the response.
	// Default value: invoice_number_desc
	OrderBy ListInvoicesRequestOrderBy `json:"-"`
}

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 uint32 `json:"total_count"`
	// Invoices: paginated returned invoices.
	Invoices []*Invoice `json:"invoices"`
}

ListInvoicesResponse: list invoices response.

func (*ListInvoicesResponse) UnsafeAppend

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

UnsafeAppend should not be used Internal usage only

func (*ListInvoicesResponse) UnsafeGetTotalCount

func (r *ListInvoicesResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

Jump to

Keyboard shortcuts

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