scaleway.billing.v2alpha1 package

Submodules

scaleway.billing.v2alpha1.api module

class scaleway.billing.v2alpha1.api.BillingV2Alpha1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage and query your Scaleway billing and consumption.

download_invoice(*, invoice_id: str, file_type: DownloadInvoiceRequestFileType | None = None) ScwFile

Download an invoice. Download a specific invoice, specified by its ID. :param invoice_id: Invoice ID. :param file_type: Wanted file type. :return: ScwFile

Usage:

result = api.download_invoice(
    invoice_id="example",
)
get_consumption(*, organization_id: str | None = None) GetConsumptionResponse

Get current month’s consumption. The consumption reflects the amount of money you have spent for the products you have used. The consumption value is monetary and is not computed in real time. :param organization_id: Filter by organization ID. :return: GetConsumptionResponse

Usage:

result = api.get_consumption()
list_discounts(*, order_by: ListDiscountsRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None, organization_id: str | None = None) ListDiscountsResponse

List all user’s discounts. List all discounts for an organization and usable categories/products/offers/references/regions/zones where the discount can be applied. :param order_by: Order discounts in the response by their description. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: ID of the organization. :return: ListDiscountsResponse

Usage:

result = api.list_discounts()
list_discounts_all(*, order_by: ListDiscountsRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None, organization_id: str | None = None) List[Discount]

List all user’s discounts. List all discounts for an organization and usable categories/products/offers/references/regions/zones where the discount can be applied. :param order_by: Order discounts in the response by their description. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: ID of the organization. :return: List[Discount]

Usage:

result = api.list_discounts_all()
list_invoices(*, organization_id: str | None = None, started_after: datetime | None = None, started_before: datetime | None = None, invoice_type: InvoiceType | None = None, page: int | None = None, page_size: int | None = None, order_by: ListInvoicesRequestOrderBy | None = None) ListInvoicesResponse

List invoices. List all your invoices, filtering by start_date and invoice_type. Each invoice has its own ID. :param organization_id: Organization ID to filter for, only invoices from this Organization will be returned. :param started_after: Invoice’s start_date is greater or equal to started_after. :param started_before: Invoice’s start_date precedes started_before. :param invoice_type: Invoice type. It can either be periodic or purchase. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param order_by: How invoices are ordered in the response. :return: ListInvoicesResponse

Usage:

result = api.list_invoices()
list_invoices_all(*, organization_id: str | None = None, started_after: datetime | None = None, started_before: datetime | None = None, invoice_type: InvoiceType | None = None, page: int | None = None, page_size: int | None = None, order_by: ListInvoicesRequestOrderBy | None = None) List[Invoice]

List invoices. List all your invoices, filtering by start_date and invoice_type. Each invoice has its own ID. :param organization_id: Organization ID to filter for, only invoices from this Organization will be returned. :param started_after: Invoice’s start_date is greater or equal to started_after. :param started_before: Invoice’s start_date precedes started_before. :param invoice_type: Invoice type. It can either be periodic or purchase. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param order_by: How invoices are ordered in the response. :return: List[Invoice]

Usage:

result = api.list_invoices_all()

scaleway.billing.v2alpha1.marshalling module

scaleway.billing.v2alpha1.marshalling.unmarshal_Discount(data: Any) Discount
scaleway.billing.v2alpha1.marshalling.unmarshal_DiscountCoupon(data: Any) DiscountCoupon
scaleway.billing.v2alpha1.marshalling.unmarshal_DiscountFilter(data: Any) DiscountFilter
scaleway.billing.v2alpha1.marshalling.unmarshal_GetConsumptionResponse(data: Any) GetConsumptionResponse
scaleway.billing.v2alpha1.marshalling.unmarshal_GetConsumptionResponseConsumption(data: Any) GetConsumptionResponseConsumption
scaleway.billing.v2alpha1.marshalling.unmarshal_Invoice(data: Any) Invoice
scaleway.billing.v2alpha1.marshalling.unmarshal_ListDiscountsResponse(data: Any) ListDiscountsResponse
scaleway.billing.v2alpha1.marshalling.unmarshal_ListInvoicesResponse(data: Any) ListInvoicesResponse

scaleway.billing.v2alpha1.types module

class scaleway.billing.v2alpha1.types.Discount(id: 'str', organization_id: 'str', description: 'str', value: 'float', value_used: 'float', value_remaining: 'float', mode: 'DiscountDiscountMode', filters: 'List[DiscountFilter]', creation_date: 'Optional[datetime]', start_date: 'Optional[datetime]', stop_date: 'Optional[datetime]', coupon: 'Optional[DiscountCoupon]')

Bases: object

coupon: DiscountCoupon | None

The description of the coupon.

creation_date: datetime | None

The creation date of the discount.

description: str

The description of the discount.

filters: List[DiscountFilter]

List of products/ranges/regions/zones to limit the usability of discounts.

id: str

The ID of the discount.

mode: DiscountDiscountMode

The mode of the discount.

organization_id: str

The organization ID of the discount.

start_date: datetime | None

The start date of the discount.

stop_date: datetime | None

The stop date of the discount.

value: float

The initial value of the discount.

value_remaining: float

The remaining value of the discount.

value_used: float

The value indicating how much of the discount has been used.

class scaleway.billing.v2alpha1.types.DiscountCoupon(description: 'Optional[str]')

Bases: object

description: str | None

The description of the coupon.

class scaleway.billing.v2alpha1.types.DiscountDiscountMode(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

DISCOUNT_MODE_RATE = 'discount_mode_rate'
DISCOUNT_MODE_SPLITTABLE = 'discount_mode_splittable'
DISCOUNT_MODE_VALUE = 'discount_mode_value'
UNKNOWN_DISCOUNT_MODE = 'unknown_discount_mode'
class scaleway.billing.v2alpha1.types.DiscountFilter(type_: 'DiscountFilterType', value: 'str', exclude: 'bool')

Bases: object

exclude: bool

Boolean to describe if filter is an excluding filter.

type_: DiscountFilterType

Type of the filter.

value: str

Value of filter, it can be a product/range/region/zone value.

class scaleway.billing.v2alpha1.types.DiscountFilterType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

PRODUCT = 'product'
PRODUCT_CATEGORY = 'product_category'
PRODUCT_OFFER = 'product_offer'
PRODUCT_REFERENCE = 'product_reference'
REGION = 'region'
UNKNOWN_TYPE = 'unknown_type'
ZONE = 'zone'
class scaleway.billing.v2alpha1.types.DownloadInvoiceRequest(invoice_id: 'str', file_type: 'Optional[DownloadInvoiceRequestFileType]')

Bases: object

file_type: DownloadInvoiceRequestFileType | None

Wanted file type.

invoice_id: str

Invoice ID.

class scaleway.billing.v2alpha1.types.DownloadInvoiceRequestFileType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

PDF = 'pdf'
class scaleway.billing.v2alpha1.types.GetConsumptionRequest(organization_id: 'Optional[str]')

Bases: object

organization_id: str | None

Filter by organization ID.

class scaleway.billing.v2alpha1.types.GetConsumptionResponse(consumptions: 'List[GetConsumptionResponseConsumption]', updated_at: 'Optional[datetime]')

Bases: object

consumptions: List[GetConsumptionResponseConsumption]

Detailed consumption list.

updated_at: datetime | None

Last consumption update date.

class scaleway.billing.v2alpha1.types.GetConsumptionResponseConsumption(description: 'str', project_id: 'str', category: 'str', operation_path: 'str', value: 'Optional[Money]')

Bases: object

category: str

Category of the consumption.

description: str

Description of the consumption.

operation_path: str

Unique identifier of the product.

project_id: str

Project ID of the consumption.

value: Money | None

Monetary value of the consumption.

class scaleway.billing.v2alpha1.types.Invoice(id: 'str', invoice_type: 'InvoiceType', number: 'int', start_date: 'Optional[datetime]', issued_date: 'Optional[datetime]', due_date: 'Optional[datetime]', total_untaxed: 'Optional[Money]', total_taxed: 'Optional[Money]')

Bases: object

due_date: datetime | None

Payment time limit, set according to the Organization’s payment conditions.

id: str

Invoice ID.

invoice_type: InvoiceType

Type of invoice.

issued_date: datetime | None

Date when the invoice was sent to the customer.

number: int

Invoice number.

start_date: datetime | None

Start date of the billing period.

total_taxed: Money | None

Total amount, taxed.

total_untaxed: Money | None

Total amount, untaxed.

class scaleway.billing.v2alpha1.types.InvoiceType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

PERIODIC = 'periodic'
PURCHASE = 'purchase'
UNKNOWN_TYPE = 'unknown_type'
class scaleway.billing.v2alpha1.types.ListDiscountsRequest(order_by: 'Optional[ListDiscountsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', organization_id: 'Optional[str]')

Bases: object

order_by: ListDiscountsRequestOrderBy | None

Order discounts in the response by their description.

organization_id: str | None

ID of the organization.

page: int | None

Positive integer to choose the page to return.

page_size: int | None

Positive integer lower or equal to 100 to select the number of items to return.

class scaleway.billing.v2alpha1.types.ListDiscountsRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

CREATION_DATE_ASC = 'creation_date_asc'
CREATION_DATE_DESC = 'creation_date_desc'
class scaleway.billing.v2alpha1.types.ListDiscountsResponse(total_count: 'int', discounts: 'List[Discount]')

Bases: object

discounts: List[Discount]

Paginated returned discounts.

total_count: int

Total number of discounts.

class scaleway.billing.v2alpha1.types.ListInvoicesRequest(organization_id: 'Optional[str]', started_after: 'Optional[datetime]', started_before: 'Optional[datetime]', invoice_type: 'Optional[InvoiceType]', page: 'Optional[int]', page_size: 'Optional[int]', order_by: 'Optional[ListInvoicesRequestOrderBy]')

Bases: object

invoice_type: InvoiceType | None

Invoice type. It can either be periodic or purchase.

order_by: ListInvoicesRequestOrderBy | None

How invoices are ordered in the response.

organization_id: str | None

Organization ID to filter for, only invoices from this Organization will be returned.

page: int | None

Positive integer to choose the page to return.

page_size: int | None

Positive integer lower or equal to 100 to select the number of items to return.

started_after: datetime | None

Invoice’s start_date is greater or equal to started_after.

started_before: datetime | None

Invoice’s start_date precedes started_before.

class scaleway.billing.v2alpha1.types.ListInvoicesRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

DUE_DATE_ASC = 'due_date_asc'
DUE_DATE_DESC = 'due_date_desc'
INVOICE_NUMBER_ASC = 'invoice_number_asc'
INVOICE_NUMBER_DESC = 'invoice_number_desc'
INVOICE_TYPE_ASC = 'invoice_type_asc'
INVOICE_TYPE_DESC = 'invoice_type_desc'
ISSUED_DATE_ASC = 'issued_date_asc'
ISSUED_DATE_DESC = 'issued_date_desc'
START_DATE_ASC = 'start_date_asc'
START_DATE_DESC = 'start_date_desc'
TOTAL_TAXED_ASC = 'total_taxed_asc'
TOTAL_TAXED_DESC = 'total_taxed_desc'
TOTAL_UNTAXED_ASC = 'total_untaxed_asc'
TOTAL_UNTAXED_DESC = 'total_untaxed_desc'
class scaleway.billing.v2alpha1.types.ListInvoicesResponse(total_count: 'int', invoices: 'List[Invoice]')

Bases: object

invoices: List[Invoice]

Paginated returned invoices.

total_count: int

Total number of invoices.

Module contents

class scaleway.billing.v2alpha1.BillingV2Alpha1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage and query your Scaleway billing and consumption.

download_invoice(*, invoice_id: str, file_type: DownloadInvoiceRequestFileType | None = None) ScwFile

Download an invoice. Download a specific invoice, specified by its ID. :param invoice_id: Invoice ID. :param file_type: Wanted file type. :return: ScwFile

Usage:

result = api.download_invoice(
    invoice_id="example",
)
get_consumption(*, organization_id: str | None = None) GetConsumptionResponse

Get current month’s consumption. The consumption reflects the amount of money you have spent for the products you have used. The consumption value is monetary and is not computed in real time. :param organization_id: Filter by organization ID. :return: GetConsumptionResponse

Usage:

result = api.get_consumption()
list_discounts(*, order_by: ListDiscountsRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None, organization_id: str | None = None) ListDiscountsResponse

List all user’s discounts. List all discounts for an organization and usable categories/products/offers/references/regions/zones where the discount can be applied. :param order_by: Order discounts in the response by their description. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: ID of the organization. :return: ListDiscountsResponse

Usage:

result = api.list_discounts()
list_discounts_all(*, order_by: ListDiscountsRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None, organization_id: str | None = None) List[Discount]

List all user’s discounts. List all discounts for an organization and usable categories/products/offers/references/regions/zones where the discount can be applied. :param order_by: Order discounts in the response by their description. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: ID of the organization. :return: List[Discount]

Usage:

result = api.list_discounts_all()
list_invoices(*, organization_id: str | None = None, started_after: datetime | None = None, started_before: datetime | None = None, invoice_type: InvoiceType | None = None, page: int | None = None, page_size: int | None = None, order_by: ListInvoicesRequestOrderBy | None = None) ListInvoicesResponse

List invoices. List all your invoices, filtering by start_date and invoice_type. Each invoice has its own ID. :param organization_id: Organization ID to filter for, only invoices from this Organization will be returned. :param started_after: Invoice’s start_date is greater or equal to started_after. :param started_before: Invoice’s start_date precedes started_before. :param invoice_type: Invoice type. It can either be periodic or purchase. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param order_by: How invoices are ordered in the response. :return: ListInvoicesResponse

Usage:

result = api.list_invoices()
list_invoices_all(*, organization_id: str | None = None, started_after: datetime | None = None, started_before: datetime | None = None, invoice_type: InvoiceType | None = None, page: int | None = None, page_size: int | None = None, order_by: ListInvoicesRequestOrderBy | None = None) List[Invoice]

List invoices. List all your invoices, filtering by start_date and invoice_type. Each invoice has its own ID. :param organization_id: Organization ID to filter for, only invoices from this Organization will be returned. :param started_after: Invoice’s start_date is greater or equal to started_after. :param started_before: Invoice’s start_date precedes started_before. :param invoice_type: Invoice type. It can either be periodic or purchase. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param order_by: How invoices are ordered in the response. :return: List[Invoice]

Usage:

result = api.list_invoices_all()
class scaleway.billing.v2alpha1.Discount(id: 'str', organization_id: 'str', description: 'str', value: 'float', value_used: 'float', value_remaining: 'float', mode: 'DiscountDiscountMode', filters: 'List[DiscountFilter]', creation_date: 'Optional[datetime]', start_date: 'Optional[datetime]', stop_date: 'Optional[datetime]', coupon: 'Optional[DiscountCoupon]')

Bases: object

coupon: DiscountCoupon | None

The description of the coupon.

creation_date: datetime | None

The creation date of the discount.

description: str

The description of the discount.

filters: List[DiscountFilter]

List of products/ranges/regions/zones to limit the usability of discounts.

id: str

The ID of the discount.

mode: DiscountDiscountMode

The mode of the discount.

organization_id: str

The organization ID of the discount.

start_date: datetime | None

The start date of the discount.

stop_date: datetime | None

The stop date of the discount.

value: float

The initial value of the discount.

value_remaining: float

The remaining value of the discount.

value_used: float

The value indicating how much of the discount has been used.

class scaleway.billing.v2alpha1.DiscountCoupon(description: 'Optional[str]')

Bases: object

description: str | None

The description of the coupon.

class scaleway.billing.v2alpha1.DiscountDiscountMode(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

DISCOUNT_MODE_RATE = 'discount_mode_rate'
DISCOUNT_MODE_SPLITTABLE = 'discount_mode_splittable'
DISCOUNT_MODE_VALUE = 'discount_mode_value'
UNKNOWN_DISCOUNT_MODE = 'unknown_discount_mode'
class scaleway.billing.v2alpha1.DiscountFilter(type_: 'DiscountFilterType', value: 'str', exclude: 'bool')

Bases: object

exclude: bool

Boolean to describe if filter is an excluding filter.

type_: DiscountFilterType

Type of the filter.

value: str

Value of filter, it can be a product/range/region/zone value.

class scaleway.billing.v2alpha1.DiscountFilterType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

PRODUCT = 'product'
PRODUCT_CATEGORY = 'product_category'
PRODUCT_OFFER = 'product_offer'
PRODUCT_REFERENCE = 'product_reference'
REGION = 'region'
UNKNOWN_TYPE = 'unknown_type'
ZONE = 'zone'
class scaleway.billing.v2alpha1.DownloadInvoiceRequest(invoice_id: 'str', file_type: 'Optional[DownloadInvoiceRequestFileType]')

Bases: object

file_type: DownloadInvoiceRequestFileType | None

Wanted file type.

invoice_id: str

Invoice ID.

class scaleway.billing.v2alpha1.DownloadInvoiceRequestFileType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

PDF = 'pdf'
class scaleway.billing.v2alpha1.GetConsumptionRequest(organization_id: 'Optional[str]')

Bases: object

organization_id: str | None

Filter by organization ID.

class scaleway.billing.v2alpha1.GetConsumptionResponse(consumptions: 'List[GetConsumptionResponseConsumption]', updated_at: 'Optional[datetime]')

Bases: object

consumptions: List[GetConsumptionResponseConsumption]

Detailed consumption list.

updated_at: datetime | None

Last consumption update date.

class scaleway.billing.v2alpha1.GetConsumptionResponseConsumption(description: 'str', project_id: 'str', category: 'str', operation_path: 'str', value: 'Optional[Money]')

Bases: object

category: str

Category of the consumption.

description: str

Description of the consumption.

operation_path: str

Unique identifier of the product.

project_id: str

Project ID of the consumption.

value: Money | None

Monetary value of the consumption.

class scaleway.billing.v2alpha1.Invoice(id: 'str', invoice_type: 'InvoiceType', number: 'int', start_date: 'Optional[datetime]', issued_date: 'Optional[datetime]', due_date: 'Optional[datetime]', total_untaxed: 'Optional[Money]', total_taxed: 'Optional[Money]')

Bases: object

due_date: datetime | None

Payment time limit, set according to the Organization’s payment conditions.

id: str

Invoice ID.

invoice_type: InvoiceType

Type of invoice.

issued_date: datetime | None

Date when the invoice was sent to the customer.

number: int

Invoice number.

start_date: datetime | None

Start date of the billing period.

total_taxed: Money | None

Total amount, taxed.

total_untaxed: Money | None

Total amount, untaxed.

class scaleway.billing.v2alpha1.InvoiceType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

PERIODIC = 'periodic'
PURCHASE = 'purchase'
UNKNOWN_TYPE = 'unknown_type'
class scaleway.billing.v2alpha1.ListDiscountsRequest(order_by: 'Optional[ListDiscountsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', organization_id: 'Optional[str]')

Bases: object

order_by: ListDiscountsRequestOrderBy | None

Order discounts in the response by their description.

organization_id: str | None

ID of the organization.

page: int | None

Positive integer to choose the page to return.

page_size: int | None

Positive integer lower or equal to 100 to select the number of items to return.

class scaleway.billing.v2alpha1.ListDiscountsRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

CREATION_DATE_ASC = 'creation_date_asc'
CREATION_DATE_DESC = 'creation_date_desc'
class scaleway.billing.v2alpha1.ListDiscountsResponse(total_count: 'int', discounts: 'List[Discount]')

Bases: object

discounts: List[Discount]

Paginated returned discounts.

total_count: int

Total number of discounts.

class scaleway.billing.v2alpha1.ListInvoicesRequest(organization_id: 'Optional[str]', started_after: 'Optional[datetime]', started_before: 'Optional[datetime]', invoice_type: 'Optional[InvoiceType]', page: 'Optional[int]', page_size: 'Optional[int]', order_by: 'Optional[ListInvoicesRequestOrderBy]')

Bases: object

invoice_type: InvoiceType | None

Invoice type. It can either be periodic or purchase.

order_by: ListInvoicesRequestOrderBy | None

How invoices are ordered in the response.

organization_id: str | None

Organization ID to filter for, only invoices from this Organization will be returned.

page: int | None

Positive integer to choose the page to return.

page_size: int | None

Positive integer lower or equal to 100 to select the number of items to return.

started_after: datetime | None

Invoice’s start_date is greater or equal to started_after.

started_before: datetime | None

Invoice’s start_date precedes started_before.

class scaleway.billing.v2alpha1.ListInvoicesRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

DUE_DATE_ASC = 'due_date_asc'
DUE_DATE_DESC = 'due_date_desc'
INVOICE_NUMBER_ASC = 'invoice_number_asc'
INVOICE_NUMBER_DESC = 'invoice_number_desc'
INVOICE_TYPE_ASC = 'invoice_type_asc'
INVOICE_TYPE_DESC = 'invoice_type_desc'
ISSUED_DATE_ASC = 'issued_date_asc'
ISSUED_DATE_DESC = 'issued_date_desc'
START_DATE_ASC = 'start_date_asc'
START_DATE_DESC = 'start_date_desc'
TOTAL_TAXED_ASC = 'total_taxed_asc'
TOTAL_TAXED_DESC = 'total_taxed_desc'
TOTAL_UNTAXED_ASC = 'total_untaxed_asc'
TOTAL_UNTAXED_DESC = 'total_untaxed_desc'
class scaleway.billing.v2alpha1.ListInvoicesResponse(total_count: 'int', invoices: 'List[Invoice]')

Bases: object

invoices: List[Invoice]

Paginated returned invoices.

total_count: int

Total number of invoices.