Class: MetronomeSDK::Models::V1::CreditGrantCreateParams::GrantAmount

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/metronome_sdk/models/v1/credit_grant_create_params.rb

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(customer_id: , expires_at: , grant_amount: , name: , paid_amount: , priority: , credit_grant_type: nil, custom_fields: nil, effective_at: nil, invoice_date: nil, product_ids: nil, reason: nil, rollover_settings: nil, uniqueness_key: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see MetronomeSDK::Models::V1::CreditGrantCreateParams for more details.

Parameters:

  • customer_id (String) (defaults to: )

    the Metronome ID of the customer

  • expires_at (Time) (defaults to: )

    The credit grant will only apply to usage or charges dated before this timestamp

  • grant_amount (MetronomeSDK::Models::V1::CreditGrantCreateParams::GrantAmount) (defaults to: )

    the amount of credits granted

  • name (String) (defaults to: )

    the name of the credit grant as it will appear on invoices

  • paid_amount (MetronomeSDK::Models::V1::CreditGrantCreateParams::PaidAmount) (defaults to: )

    the amount paid for this credit grant

  • priority (Float) (defaults to: )
  • credit_grant_type (String) (defaults to: nil)
  • custom_fields (Hash{Symbol=>String}) (defaults to: nil)

    Custom fields to attach to the credit grant.

  • effective_at (Time) (defaults to: nil)

    The credit grant will only apply to usage or charges dated on or after this time

  • invoice_date (Time) (defaults to: nil)

    The date to issue an invoice for the paid_amount.

  • product_ids (Array<String>) (defaults to: nil)

    The product(s) which these credits will be applied to. (If unspecified, the cred

  • reason (String) (defaults to: nil)
  • rollover_settings (MetronomeSDK::Models::V1::CreditGrantCreateParams::RolloverSettings) (defaults to: nil)

    Configure a rollover for this credit grant so if it expires it rolls over a conf

  • uniqueness_key (String) (defaults to: nil)

    Prevents the creation of duplicates. If a request to create a record is made wit

  • request_options (MetronomeSDK::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/metronome_sdk/models/v1/credit_grant_create_params.rb', line 134

class GrantAmount < MetronomeSDK::Internal::Type::BaseModel
  # @!attribute amount
  #
  #   @return [Float]
  required :amount, Float

  # @!attribute credit_type_id
  #   the ID of the pricing unit to be used. Defaults to USD (cents) if not passed.
  #
  #   @return [String]
  required :credit_type_id, String

  # @!method initialize(amount:, credit_type_id:)
  #   the amount of credits granted
  #
  #   @param amount [Float]
  #
  #   @param credit_type_id [String] the ID of the pricing unit to be used. Defaults to USD (cents) if not passed.
end

Instance Attribute Details

#amountFloat

Returns:

  • (Float)


138
# File 'lib/metronome_sdk/models/v1/credit_grant_create_params.rb', line 138

required :amount, Float

#credit_type_idString

the ID of the pricing unit to be used. Defaults to USD (cents) if not passed.

Returns:

  • (String)


144
# File 'lib/metronome_sdk/models/v1/credit_grant_create_params.rb', line 144

required :credit_type_id, String