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: Optional[DownloadInvoiceRequestFileType] = 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: Optional[str] = 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: Optional[ListDiscountsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = 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: Optional[ListDiscountsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = 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: Optional[str] = None, started_after: Optional[datetime] = None, started_before: Optional[datetime] = None, invoice_type: Optional[InvoiceType] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListInvoicesRequestOrderBy] = 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: Optional[str] = None, started_after: Optional[datetime] = None, started_before: Optional[datetime] = None, invoice_type: Optional[InvoiceType] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListInvoicesRequestOrderBy] = 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_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_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: Optional[DiscountCoupon]
The description of the coupon.
- creation_date: Optional[datetime]
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: Optional[datetime]
The start date of the discount.
- stop_date: Optional[datetime]
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: Optional[str]
The description of the coupon.
- class scaleway.billing.v2alpha1.types.DiscountDiscountMode(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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: Optional[DownloadInvoiceRequestFileType]
Wanted file type.
- invoice_id: str
Invoice ID.
- class scaleway.billing.v2alpha1.types.DownloadInvoiceRequestFileType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- PDF = 'pdf'
- class scaleway.billing.v2alpha1.types.GetConsumptionRequest(organization_id: 'Optional[str]')
Bases:
object
- organization_id: Optional[str]
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: Optional[datetime]
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.
- 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: Optional[datetime]
Payment time limit, set according to the Organization’s payment conditions.
- id: str
Invoice ID.
- invoice_type: InvoiceType
Type of invoice.
- issued_date: Optional[datetime]
Date when the invoice was sent to the customer.
- number: int
Invoice number.
- start_date: Optional[datetime]
Start date of the billing period.
- class scaleway.billing.v2alpha1.types.InvoiceType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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: Optional[ListDiscountsRequestOrderBy]
Order discounts in the response by their description.
- organization_id: Optional[str]
ID of the organization.
- page: Optional[int]
Positive integer to choose the page to return.
- page_size: Optional[int]
Positive integer lower or equal to 100 to select the number of items to return.
- class scaleway.billing.v2alpha1.types.ListDiscountsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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
- 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: Optional[InvoiceType]
Invoice type. It can either be periodic or purchase.
- order_by: Optional[ListInvoicesRequestOrderBy]
How invoices are ordered in the response.
- organization_id: Optional[str]
Organization ID to filter for, only invoices from this Organization will be returned.
- page: Optional[int]
Positive integer to choose the page to return.
- page_size: Optional[int]
Positive integer lower or equal to 100 to select the number of items to return.
- started_after: Optional[datetime]
Invoice’s start_date is greater or equal to started_after.
- started_before: Optional[datetime]
Invoice’s start_date precedes started_before.
- class scaleway.billing.v2alpha1.types.ListInvoicesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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'
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: Optional[DownloadInvoiceRequestFileType] = 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: Optional[str] = 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: Optional[ListDiscountsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = 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: Optional[ListDiscountsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = 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: Optional[str] = None, started_after: Optional[datetime] = None, started_before: Optional[datetime] = None, invoice_type: Optional[InvoiceType] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListInvoicesRequestOrderBy] = 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: Optional[str] = None, started_after: Optional[datetime] = None, started_before: Optional[datetime] = None, invoice_type: Optional[InvoiceType] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListInvoicesRequestOrderBy] = 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: Optional[DiscountCoupon]
The description of the coupon.
- creation_date: Optional[datetime]
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: Optional[datetime]
The start date of the discount.
- stop_date: Optional[datetime]
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: Optional[str]
The description of the coupon.
- class scaleway.billing.v2alpha1.DiscountDiscountMode(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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: Optional[DownloadInvoiceRequestFileType]
Wanted file type.
- invoice_id: str
Invoice ID.
- class scaleway.billing.v2alpha1.DownloadInvoiceRequestFileType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- PDF = 'pdf'
- class scaleway.billing.v2alpha1.GetConsumptionRequest(organization_id: 'Optional[str]')
Bases:
object
- organization_id: Optional[str]
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: Optional[datetime]
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.
- 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: Optional[datetime]
Payment time limit, set according to the Organization’s payment conditions.
- id: str
Invoice ID.
- invoice_type: InvoiceType
Type of invoice.
- issued_date: Optional[datetime]
Date when the invoice was sent to the customer.
- number: int
Invoice number.
- start_date: Optional[datetime]
Start date of the billing period.
- class scaleway.billing.v2alpha1.InvoiceType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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: Optional[ListDiscountsRequestOrderBy]
Order discounts in the response by their description.
- organization_id: Optional[str]
ID of the organization.
- page: Optional[int]
Positive integer to choose the page to return.
- page_size: Optional[int]
Positive integer lower or equal to 100 to select the number of items to return.
- class scaleway.billing.v2alpha1.ListDiscountsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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
- 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: Optional[InvoiceType]
Invoice type. It can either be periodic or purchase.
- order_by: Optional[ListInvoicesRequestOrderBy]
How invoices are ordered in the response.
- organization_id: Optional[str]
Organization ID to filter for, only invoices from this Organization will be returned.
- page: Optional[int]
Positive integer to choose the page to return.
- page_size: Optional[int]
Positive integer lower or equal to 100 to select the number of items to return.
- started_after: Optional[datetime]
Invoice’s start_date is greater or equal to started_after.
- started_before: Optional[datetime]
Invoice’s start_date precedes started_before.
- class scaleway.billing.v2alpha1.ListInvoicesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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'