Skip to main content

BillingDateRange

The BillingDateRange represents the range of dates for billing queries. It holds the starting and ending dates of a query range and provides a method to convert this range into a dictionary format.

class BillingDateRange:
start: date = None
end: date = None

query_cloud_usage(
date_range=BillingDateRange(start=date(2024, 1, 8), end=date(2024, 1, 12)),
)

Properties

start

Property (date). Optional; The start date of the billing period. This attribute is optional and defaults to None if not provided. When set, it should be a date object representing the starting point of the date range.

end

Property (date). Optional; The end date of the billing period. This attribute is optional and defaults to None if not provided. When set, it must be a date object indicating the ending point of the date range.

Methods

to_dict

to_dict() -> dict

Converts the BillingDateRange instance into a dictionary. This method formats the start and end dates as strings in the "YYYY-MM-DD" format.

Returns:

dict Returns a dictionary with keys "start" and "end" corresponding to these formatted date strings.