Class: Orb::Models::SubscriptionFetchUsageParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/orb/models/subscription_fetch_usage_params.rb,
sig/orb/models/subscription_fetch_usage_params.rbs

Overview

See Also:

  • Orb::Resources::Subscriptions#fetch_usage

Defined Under Namespace

Modules: Granularity, ViewMode

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(subscription_id:, billable_metric_id: nil, first_dimension_key: nil, first_dimension_value: nil, granularity: nil, group_by: nil, second_dimension_key: nil, second_dimension_value: nil, timeframe_end: nil, timeframe_start: nil, view_mode: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see Orb::Models::SubscriptionFetchUsageParams for more details.

Parameters:

  • subscription_id (String)
  • billable_metric_id (String, nil) (defaults to: nil)

    When specified in conjunction with group_by, this parameter filters usage to a

  • first_dimension_key (String, nil) (defaults to: nil)
  • first_dimension_value (String, nil) (defaults to: nil)
  • granularity (Symbol, Orb::Models::SubscriptionFetchUsageParams::Granularity, nil) (defaults to: nil)

    This determines the windowing of usage reporting.

  • group_by (String, nil) (defaults to: nil)

    Groups per-price usage by the key provided.

  • second_dimension_key (String, nil) (defaults to: nil)
  • second_dimension_value (String, nil) (defaults to: nil)
  • timeframe_end (Time, nil) (defaults to: nil)

    Usage returned is exclusive of timeframe_end.

  • timeframe_start (Time, nil) (defaults to: nil)

    Usage returned is inclusive of timeframe_start.

  • view_mode (Symbol, Orb::Models::SubscriptionFetchUsageParams::ViewMode, nil) (defaults to: nil)

    Controls whether Orb returns cumulative usage since the start of the billing per

  • request_options (Orb::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 76

Instance Attribute Details

#billable_metric_idString?

When specified in conjunction with group_by, this parameter filters usage to a single billable metric. Note that both group_by and billable_metric_id must be specified together.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


21
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 21

optional :billable_metric_id, String, nil?: true

#first_dimension_keyString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


26
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 26

optional :first_dimension_key, String, nil?: true

#first_dimension_valueString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


31
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 31

optional :first_dimension_value, String, nil?: true

#granularitySymbol, ...

This determines the windowing of usage reporting.

Parameters:

  • value (Orb::Models::SubscriptionFetchUsageParams::granularity, nil)

Returns:



37
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 37

optional :granularity, enum: -> { Orb::SubscriptionFetchUsageParams::Granularity }, nil?: true

#group_byString?

Groups per-price usage by the key provided.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


43
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 43

optional :group_by, String, nil?: true

#second_dimension_keyString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


48
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 48

optional :second_dimension_key, String, nil?: true

#second_dimension_valueString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


53
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 53

optional :second_dimension_value, String, nil?: true

#subscription_idString

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 13

required :subscription_id, String

#timeframe_endTime?

Usage returned is exclusive of timeframe_end.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


59
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 59

optional :timeframe_end, Time, nil?: true

#timeframe_startTime?

Usage returned is inclusive of timeframe_start.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


65
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 65

optional :timeframe_start, Time, nil?: true

#view_modeSymbol, ...

Controls whether Orb returns cumulative usage since the start of the billing period, or incremental day-by-day usage. If your customer has minimums or discounts, it's strongly recommended that you use the default cumulative behavior.

Parameters:

  • value (Orb::Models::SubscriptionFetchUsageParams::view_mode, nil)

Returns:



74
# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 74

optional :view_mode, enum: -> { Orb::SubscriptionFetchUsageParams::ViewMode }, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/orb/models/subscription_fetch_usage_params.rb', line 110

Instance Method Details

#to_hash{

Returns:

  • ({)


60
# File 'sig/orb/models/subscription_fetch_usage_params.rbs', line 60

def to_hash: -> {