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

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/metronome_sdk/models/v1/credit_grant_create_params.rb

Overview

Defined Under Namespace

Classes: GrantAmount, PaidAmount, RolloverSettings

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(amount: , credit_type_id: ) ⇒ Object

the amount paid for this credit grant

Parameters:

  • amount (Float) (defaults to: )
  • credit_type_id (String) (defaults to: )

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



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


Instance Attribute Details

#credit_grant_typeString?

Returns:

  • (String, nil)


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

optional :credit_grant_type, String

#custom_fieldsHash{Symbol=>String}?

Custom fields to attach to the credit grant.

Returns:

  • (Hash{Symbol=>String}, nil)


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

optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String]

#customer_idString

the Metronome ID of the customer

Returns:

  • (String)


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

required :customer_id, String

#effective_atTime?

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

Returns:

  • (Time, nil)


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

optional :effective_at, Time

#expires_atTime

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

Returns:

  • (Time)


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

required :expires_at, Time

#grant_amountMetronomeSDK::Models::V1::CreditGrantCreateParams::GrantAmount

the amount of credits granted



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

required :grant_amount, -> { MetronomeSDK::V1::CreditGrantCreateParams::GrantAmount }

#invoice_dateTime?

The date to issue an invoice for the paid_amount.

Returns:

  • (Time, nil)


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

optional :invoice_date, Time

#nameString

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

Returns:

  • (String)


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

required :name, String

the amount paid for this credit grant



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

required :paid_amount, -> { MetronomeSDK::V1::CreditGrantCreateParams::PaidAmount }

#priorityFloat

Returns:

  • (Float)


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

required :priority, Float

#product_idsArray<String>?

The product(s) which these credits will be applied to. (If unspecified, the credits will be applied to charges for all products.). The array ordering specified here will be used to determine the order in which credits will be applied to invoice line items

Returns:

  • (Array<String>, nil)


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

optional :product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]

#reasonString?

Returns:

  • (String, nil)


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

optional :reason, String

#rollover_settingsMetronomeSDK::Models::V1::CreditGrantCreateParams::RolloverSettings?

Configure a rollover for this credit grant so if it expires it rolls over a configured amount to a new credit grant. This feature is currently opt-in only. Contact Metronome to be added to the beta.



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

optional :rollover_settings, -> { MetronomeSDK::V1::CreditGrantCreateParams::RolloverSettings }

#uniqueness_keyString?

Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.

Returns:

  • (String, nil)


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

optional :uniqueness_key, String