Class: Stripe::Billing::AlertCreateParams

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

Defined Under Namespace

Classes: CreditBalanceThreshold, SpendThreshold, UsageThreshold

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(alert_type: nil, credit_balance_threshold: nil, expand: nil, spend_threshold: nil, title: nil, usage_threshold: nil) ⇒ AlertCreateParams

Returns a new instance of AlertCreateParams.



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/stripe/params/billing/alert_create_params.rb', line 275

def initialize(
  alert_type: nil,
  credit_balance_threshold: nil,
  expand: nil,
  spend_threshold: nil,
  title: nil,
  usage_threshold: nil
)
  @alert_type = alert_type
  @credit_balance_threshold = credit_balance_threshold
  @expand = expand
  @spend_threshold = spend_threshold
  @title = title
  @usage_threshold = usage_threshold
end

Instance Attribute Details

#alert_typeObject

The type of alert to create.



263
264
265
# File 'lib/stripe/params/billing/alert_create_params.rb', line 263

def alert_type
  @alert_type
end

#credit_balance_thresholdObject

The configuration of the credit balance threshold.



265
266
267
# File 'lib/stripe/params/billing/alert_create_params.rb', line 265

def credit_balance_threshold
  @credit_balance_threshold
end

#expandObject

Specifies which fields in the response should be expanded.



267
268
269
# File 'lib/stripe/params/billing/alert_create_params.rb', line 267

def expand
  @expand
end

#spend_thresholdObject

The configuration of the spend threshold. An event fires when the amount consumed exceeds the threshold, after all credits and discounts are applied but before tax is applied.



269
270
271
# File 'lib/stripe/params/billing/alert_create_params.rb', line 269

def spend_threshold
  @spend_threshold
end

#titleObject

The title of the alert.



271
272
273
# File 'lib/stripe/params/billing/alert_create_params.rb', line 271

def title
  @title
end

#usage_thresholdObject

The configuration of the usage threshold.



273
274
275
# File 'lib/stripe/params/billing/alert_create_params.rb', line 273

def usage_threshold
  @usage_threshold
end

Class Method Details

.field_encodingsObject



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/stripe/params/billing/alert_create_params.rb', line 291

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