Class: Imagekitio::Resources::Accounts::Usage
- Inherits:
-
Object
- Object
- Imagekitio::Resources::Accounts::Usage
- Defined in:
- lib/imagekitio/resources/accounts/usage.rb,
sig/imagekitio/resources/accounts/usage.rbs
Instance Method Summary collapse
-
#get(end_date:, start_date:, request_options: {}) ⇒ Imagekitio::Models::Accounts::UsageGetResponse
Some parameter documentations has been truncated, see Models::Accounts::UsageGetParams for more details.
-
#initialize(client:) ⇒ Usage
constructor
private
A new instance of Usage.
Constructor Details
#initialize(client:) ⇒ Usage
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Usage.
47 48 49 |
# File 'lib/imagekitio/resources/accounts/usage.rb', line 47 def initialize(client:) @client = client end |
Instance Method Details
#get(end_date:, start_date:, request_options: {}) ⇒ Imagekitio::Models::Accounts::UsageGetResponse
Some parameter documentations has been truncated, see Models::Accounts::UsageGetParams for more details.
Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date.
For an agency account, the returned usage is aggregated across the agency and all of its child accounts that are billed to it.
The response is cached for 6 hours per account, date range and requested metrics.
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/imagekitio/resources/accounts/usage.rb', line 32 def get(params) parsed, = Imagekitio::Accounts::UsageGetParams.dump_request(params) query = Imagekitio::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v1/accounts/usage", query: query.transform_keys(end_date: "endDate", start_date: "startDate"), model: Imagekitio::Models::Accounts::UsageGetResponse, options: ) end |