Class: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/orb/models/subscription_usage.rb

Defined Under Namespace

Modules: ViewMode Classes: BillableMetric, MetricGroup, Usage

Instance Attribute Summary collapse

Instance Method Summary collapse

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(quantity: , timeframe_end: , timeframe_start: ) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/orb/models/subscription_usage.rb', line 113

class Data < Orb::Internal::Type::BaseModel
  # @!attribute billable_metric
  #
  #   @return [Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric]
  required :billable_metric, -> { Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric }

  # @!attribute metric_group
  #
  #   @return [Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup]
  required :metric_group, -> { Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup }

  # @!attribute usage
  #
  #   @return [Array<Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage>]
  required :usage,
           -> { Orb::Internal::Type::ArrayOf[Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage] }

  # @!attribute view_mode
  #
  #   @return [Symbol, Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::ViewMode]
  required :view_mode, enum: -> { Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::ViewMode }

  # @!method initialize(billable_metric:, metric_group:, usage:, view_mode:)
  #   @param billable_metric [Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric]
  #   @param metric_group [Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup]
  #   @param usage [Array<Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage>]
  #   @param view_mode [Symbol, Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::ViewMode]

  # @see Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data#billable_metric
  class BillableMetric < Orb::Internal::Type::BaseModel
    # @!attribute id
    #
    #   @return [String]
    required :id, String

    # @!attribute name
    #
    #   @return [String]
    required :name, String

    # @!method initialize(id:, name:)
    #   @param id [String]
    #   @param name [String]
  end

  # @see Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data#metric_group
  class MetricGroup < Orb::Internal::Type::BaseModel
    # @!attribute property_key
    #
    #   @return [String]
    required :property_key, String

    # @!attribute property_value
    #
    #   @return [String]
    required :property_value, String

    # @!method initialize(property_key:, property_value:)
    #   @param property_key [String]
    #   @param property_value [String]
  end

  class Usage < Orb::Internal::Type::BaseModel
    # @!attribute quantity
    #
    #   @return [Float]
    required :quantity, Float

    # @!attribute timeframe_end
    #
    #   @return [Time]
    required :timeframe_end, Time

    # @!attribute timeframe_start
    #
    #   @return [Time]
    required :timeframe_start, Time

    # @!method initialize(quantity:, timeframe_end:, timeframe_start:)
    #   @param quantity [Float]
    #   @param timeframe_end [Time]
    #   @param timeframe_start [Time]
  end

  # @see Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data#view_mode
  module ViewMode
    extend Orb::Internal::Type::Enum

    PERIODIC = :periodic
    CUMULATIVE = :cumulative

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#billable_metricOrb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric



117
# File 'lib/orb/models/subscription_usage.rb', line 117

required :billable_metric, -> { Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric }

#metric_groupOrb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup



122
# File 'lib/orb/models/subscription_usage.rb', line 122

required :metric_group, -> { Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup }

#usageArray<Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage>



127
128
# File 'lib/orb/models/subscription_usage.rb', line 127

required :usage,
-> { Orb::Internal::Type::ArrayOf[Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage] }

#view_modeSymbol, Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::ViewMode



133
# File 'lib/orb/models/subscription_usage.rb', line 133

required :view_mode, enum: -> { Orb::SubscriptionUsage::GroupedSubscriptionUsage::Data::ViewMode }