Class: Stripe::SubscriptionItemUsageRecordService::CreateParams

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/subscription_item_usage_record_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(action: nil, expand: nil, quantity: nil, timestamp: nil) ⇒ CreateParams

Returns a new instance of CreateParams.



16
17
18
19
20
21
# File 'lib/stripe/services/subscription_item_usage_record_service.rb', line 16

def initialize(action: nil, expand: nil, quantity: nil, timestamp: nil)
  @action = action
  @expand = expand
  @quantity = quantity
  @timestamp = timestamp
end

Instance Attribute Details

#actionObject

Valid values are ‘increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value.



8
9
10
# File 'lib/stripe/services/subscription_item_usage_record_service.rb', line 8

def action
  @action
end

#expandObject

Specifies which fields in the response should be expanded.



10
11
12
# File 'lib/stripe/services/subscription_item_usage_record_service.rb', line 10

def expand
  @expand
end

#quantityObject

The usage quantity for the specified timestamp.



12
13
14
# File 'lib/stripe/services/subscription_item_usage_record_service.rb', line 12

def quantity
  @quantity
end

#timestampObject

The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided ‘subscription_item`, and must not be in the future. When passing `“now”`, Stripe records usage for the current time. Default is `“now”` if a value is not provided.



14
15
16
# File 'lib/stripe/services/subscription_item_usage_record_service.rb', line 14

def timestamp
  @timestamp
end