Class: Stripe::Billing::AlertCreateParams::SpendThreshold

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/billing/alert_create_params.rb

Defined Under Namespace

Classes: Filters, Gte

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(aggregation_period: nil, filters: nil, group_by: nil, gte: nil) ⇒ SpendThreshold

Returns a new instance of SpendThreshold.



217
218
219
220
221
222
# File 'lib/stripe/params/billing/alert_create_params.rb', line 217

def initialize(aggregation_period: nil, filters: nil, group_by: nil, gte: nil)
  @aggregation_period = aggregation_period
  @filters = filters
  @group_by = group_by
  @gte = gte
end

Instance Attribute Details

#aggregation_periodObject

Defines the period over which spend is aggregated.



209
210
211
# File 'lib/stripe/params/billing/alert_create_params.rb', line 209

def aggregation_period
  @aggregation_period
end

#filtersObject

Filters to scope the spend calculation.



211
212
213
# File 'lib/stripe/params/billing/alert_create_params.rb', line 211

def filters
  @filters
end

#group_byObject

Defines the granularity of spend aggregation. Defaults to ‘pricing_plan_subscription`.



213
214
215
# File 'lib/stripe/params/billing/alert_create_params.rb', line 213

def group_by
  @group_by
end

#gteObject

Defines at which value the alert will fire.



215
216
217
# File 'lib/stripe/params/billing/alert_create_params.rb', line 215

def gte
  @gte
end

Class Method Details

.field_encodingsObject



224
225
226
227
228
229
230
231
# File 'lib/stripe/params/billing/alert_create_params.rb', line 224

def self.field_encodings
  @field_encodings = {
    gte: {
      kind: :object,
      fields: { custom_pricing_unit: { kind: :object, fields: { value: :decimal_string } } },
    },
  }
end