Class: ApiReference::SubscriptionUsageRequestParams
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::SubscriptionUsageRequestParams
- Defined in:
- lib/api_reference/models/subscription_usage_request_params.rb
Overview
SubscriptionUsageRequestParams Model.
Instance Attribute Summary collapse
-
#billable_metric_id ⇒ String
When specified in conjunction with
group_by, this parameter filters usage to a single billable metric. -
#first_dimension_key ⇒ String
Controls whether Orb returns cumulative usage since the start of the billing period, or incremental day-by-day usage.
-
#first_dimension_value ⇒ String
Controls whether Orb returns cumulative usage since the start of the billing period, or incremental day-by-day usage.
-
#granularity ⇒ Granularity
This determines the windowing of usage reporting.
-
#group_by ⇒ String
Groups per-price usage by the key provided.
-
#second_dimension_key ⇒ String
Controls whether Orb returns cumulative usage since the start of the billing period, or incremental day-by-day usage.
-
#second_dimension_value ⇒ String
Controls whether Orb returns cumulative usage since the start of the billing period, or incremental day-by-day usage.
-
#timeframe_end ⇒ DateTime
Usage returned is exclusive of
timeframe_end. -
#timeframe_start ⇒ DateTime
Usage returned is inclusive of
timeframe_start. -
#view_mode ⇒ ViewMode
Controls whether Orb returns cumulative usage since the start of the billing period, or incremental day-by-day usage.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(granularity: Granularity::DAY, timeframe_start: SKIP, timeframe_end: SKIP, billable_metric_id: SKIP, group_by: SKIP, view_mode: SKIP, first_dimension_key: SKIP, first_dimension_value: SKIP, second_dimension_key: SKIP, second_dimension_value: SKIP) ⇒ SubscriptionUsageRequestParams
constructor
A new instance of SubscriptionUsageRequestParams.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_timeframe_end ⇒ Object
- #to_custom_timeframe_start ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(granularity: Granularity::DAY, timeframe_start: SKIP, timeframe_end: SKIP, billable_metric_id: SKIP, group_by: SKIP, view_mode: SKIP, first_dimension_key: SKIP, first_dimension_value: SKIP, second_dimension_key: SKIP, second_dimension_value: SKIP) ⇒ SubscriptionUsageRequestParams
Returns a new instance of SubscriptionUsageRequestParams.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 118 def initialize(granularity: Granularity::DAY, timeframe_start: SKIP, timeframe_end: SKIP, billable_metric_id: SKIP, group_by: SKIP, view_mode: SKIP, first_dimension_key: SKIP, first_dimension_value: SKIP, second_dimension_key: SKIP, second_dimension_value: SKIP) @granularity = granularity unless granularity == SKIP @timeframe_start = timeframe_start unless timeframe_start == SKIP @timeframe_end = timeframe_end unless timeframe_end == SKIP @billable_metric_id = billable_metric_id unless billable_metric_id == SKIP @group_by = group_by unless group_by == SKIP @view_mode = view_mode unless view_mode == SKIP @first_dimension_key = first_dimension_key unless first_dimension_key == SKIP @first_dimension_value = first_dimension_value unless first_dimension_value == SKIP @second_dimension_key = second_dimension_key unless second_dimension_key == SKIP @second_dimension_value = second_dimension_value unless second_dimension_value == SKIP end |
Instance Attribute Details
#billable_metric_id ⇒ String
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.
29 30 31 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 29 def billable_metric_id @billable_metric_id end |
#first_dimension_key ⇒ String
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.
47 48 49 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 47 def first_dimension_key @first_dimension_key end |
#first_dimension_value ⇒ String
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.
54 55 56 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 54 def first_dimension_value @first_dimension_value end |
#granularity ⇒ Granularity
This determines the windowing of usage reporting.
15 16 17 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 15 def granularity @granularity end |
#group_by ⇒ String
Groups per-price usage by the key provided.
33 34 35 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 33 def group_by @group_by end |
#second_dimension_key ⇒ String
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.
61 62 63 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 61 def second_dimension_key @second_dimension_key end |
#second_dimension_value ⇒ String
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.
68 69 70 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 68 def second_dimension_value @second_dimension_value end |
#timeframe_end ⇒ DateTime
Usage returned is exclusive of timeframe_end.
23 24 25 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 23 def timeframe_end @timeframe_end end |
#timeframe_start ⇒ DateTime
Usage returned is inclusive of timeframe_start.
19 20 21 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 19 def timeframe_start @timeframe_start end |
#view_mode ⇒ ViewMode
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.
40 41 42 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 40 def view_mode @view_mode end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 136 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. granularity = hash['granularity'] ||= Granularity::DAY timeframe_start = if hash.key?('timeframe_start') (DateTimeHelper.from_rfc3339(hash['timeframe_start']) if hash['timeframe_start']) else SKIP end timeframe_end = if hash.key?('timeframe_end') (DateTimeHelper.from_rfc3339(hash['timeframe_end']) if hash['timeframe_end']) else SKIP end billable_metric_id = hash.key?('billable_metric_id') ? hash['billable_metric_id'] : SKIP group_by = hash.key?('group_by') ? hash['group_by'] : SKIP view_mode = hash.key?('view_mode') ? hash['view_mode'] : SKIP first_dimension_key = hash.key?('first_dimension_key') ? hash['first_dimension_key'] : SKIP first_dimension_value = hash.key?('first_dimension_value') ? hash['first_dimension_value'] : SKIP second_dimension_key = hash.key?('second_dimension_key') ? hash['second_dimension_key'] : SKIP second_dimension_value = hash.key?('second_dimension_value') ? hash['second_dimension_value'] : SKIP # Create object from extracted values. SubscriptionUsageRequestParams.new(granularity: granularity, timeframe_start: timeframe_start, timeframe_end: timeframe_end, billable_metric_id: billable_metric_id, group_by: group_by, view_mode: view_mode, first_dimension_key: first_dimension_key, first_dimension_value: first_dimension_value, second_dimension_key: second_dimension_key, second_dimension_value: second_dimension_value) end |
.names ⇒ Object
A mapping from model property names to API property names.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 71 def self.names @_hash = {} if @_hash.nil? @_hash['granularity'] = 'granularity' @_hash['timeframe_start'] = 'timeframe_start' @_hash['timeframe_end'] = 'timeframe_end' @_hash['billable_metric_id'] = 'billable_metric_id' @_hash['group_by'] = 'group_by' @_hash['view_mode'] = 'view_mode' @_hash['first_dimension_key'] = 'first_dimension_key' @_hash['first_dimension_value'] = 'first_dimension_value' @_hash['second_dimension_key'] = 'second_dimension_key' @_hash['second_dimension_value'] = 'second_dimension_value' @_hash end |
.nullables ⇒ Object
An array for nullable fields
103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 103 def self.nullables %w[ granularity timeframe_start timeframe_end billable_metric_id group_by view_mode first_dimension_key first_dimension_value second_dimension_key second_dimension_value ] end |
.optionals ⇒ Object
An array for optional fields
87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 87 def self.optionals %w[ granularity timeframe_start timeframe_end billable_metric_id group_by view_mode first_dimension_key first_dimension_value second_dimension_key second_dimension_value ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
196 197 198 199 200 201 202 203 204 205 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 196 def inspect class_name = self.class.name.split('::').last "<#{class_name} granularity: #{@granularity.inspect}, timeframe_start:"\ " #{@timeframe_start.inspect}, timeframe_end: #{@timeframe_end.inspect}, billable_metric_id:"\ " #{@billable_metric_id.inspect}, group_by: #{@group_by.inspect}, view_mode:"\ " #{@view_mode.inspect}, first_dimension_key: #{@first_dimension_key.inspect},"\ " first_dimension_value: #{@first_dimension_value.inspect}, second_dimension_key:"\ " #{@second_dimension_key.inspect}, second_dimension_value:"\ " #{@second_dimension_value.inspect}>" end |
#to_custom_timeframe_end ⇒ Object
181 182 183 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 181 def to_custom_timeframe_end DateTimeHelper.to_rfc3339(timeframe_end) end |
#to_custom_timeframe_start ⇒ Object
177 178 179 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 177 def to_custom_timeframe_start DateTimeHelper.to_rfc3339(timeframe_start) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
186 187 188 189 190 191 192 193 |
# File 'lib/api_reference/models/subscription_usage_request_params.rb', line 186 def to_s class_name = self.class.name.split('::').last "<#{class_name} granularity: #{@granularity}, timeframe_start: #{@timeframe_start},"\ " timeframe_end: #{@timeframe_end}, billable_metric_id: #{@billable_metric_id}, group_by:"\ " #{@group_by}, view_mode: #{@view_mode}, first_dimension_key: #{@first_dimension_key},"\ " first_dimension_value: #{@first_dimension_value}, second_dimension_key:"\ " #{@second_dimension_key}, second_dimension_value: #{@second_dimension_value}>" end |