Class: Orb::Resources::Events::Volume
- Inherits:
-
Object
- Object
- Orb::Resources::Events::Volume
- Defined in:
- lib/orb/resources/events/volume.rb,
sig/orb/resources/events/volume.rbs
Overview
The Event resource represents a usage event that has been created for a customer. Events are the core of Orb's usage-based billing model, and are used to calculate the usage charges for a given billing period.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Volume
constructor
private
A new instance of Volume.
-
#list(timeframe_start:, cursor: nil, limit: nil, timeframe_end: nil, request_options: {}) ⇒ Orb::Models::Events::EventVolumes
Some parameter documentations has been truncated, see Models::Events::VolumeListParams for more details.
Constructor Details
#initialize(client:) ⇒ Volume
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 Volume.
57 58 59 |
# File 'lib/orb/resources/events/volume.rb', line 57 def initialize(client:) @client = client end |
Instance Method Details
#list(timeframe_start:, cursor: nil, limit: nil, timeframe_end: nil, request_options: {}) ⇒ Orb::Models::Events::EventVolumes
Some parameter documentations has been truncated, see Models::Events::VolumeListParams for more details.
This endpoint returns the event volume for an account in a paginated list format.
The event volume is aggregated by the hour and the timestamp field is used to determine which hour an event is associated with. Note, this means that late-arriving events increment the volume count for the hour window the timestamp is in, not the latest hour window.
Each item in the response contains the count of events aggregated by the hour where the start and end time are hour-aligned and in UTC. When a specific timestamp is passed in for either start or end time, the response includes the hours the timestamp falls in.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/orb/resources/events/volume.rb', line 42 def list(params) parsed, = Orb::Events::VolumeListParams.dump_request(params) query = Orb::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "events/volume", query: query, model: Orb::Events::EventVolumes, options: ) end |