Class: MetronomeSDK::Models::Credit
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- MetronomeSDK::Models::Credit
- Defined in:
- lib/metronome_sdk/models/credit.rb,
sig/metronome_sdk/models/credit.rbs
Defined Under Namespace
Modules: Ledger, RateType, Type Classes: Contract, Product, RolledOverFrom, SubscriptionConfig
Constant Summary collapse
- MetronomeSDK =
Instance Attribute Summary collapse
-
#access_schedule ⇒ MetronomeSDK::Models::ScheduleDuration?
The schedule that the customer will gain access to the credits.
- #applicable_contract_ids ⇒ Array<String>?
- #applicable_product_ids ⇒ Array<String>?
- #applicable_product_tags ⇒ Array<String>?
-
#balance ⇒ Float?
The current balance of the credit or commit.
- #contract ⇒ MetronomeSDK::Models::Credit::Contract?
-
#created_by ⇒ String?
The actor who created this credit.
-
#custom_fields ⇒ Hash{Symbol=>String}?
Custom fields to be added eg.
- #description ⇒ String?
-
#hierarchy_configuration ⇒ MetronomeSDK::Models::CommitHierarchyConfiguration?
Optional configuration for credit hierarchy access control.
- #id ⇒ String
-
#ledger ⇒ Array<MetronomeSDK::Models::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditRolloverLedgerEntry>?
A list of ordered events that impact the balance of a credit.
- #name ⇒ String?
-
#netsuite_sales_order_id ⇒ String?
This field's availability is dependent on your client's configuration.
-
#priority ⇒ Float?
If multiple credits or commits are applicable, the one with the lower priority will apply first.
- #product ⇒ MetronomeSDK::Models::Credit::Product
- #rate_type ⇒ Symbol, ...
-
#recurring_credit_id ⇒ String?
The ID of the recurring credit that this credit was generated from, if applicable.
- #rolled_over_from ⇒ MetronomeSDK::Models::Credit::RolledOverFrom?
-
#salesforce_opportunity_id ⇒ String?
This field's availability is dependent on your client's configuration.
-
#specifiers ⇒ Array<MetronomeSDK::Models::CommitSpecifier>?
List of filters that determine what kind of customer usage draws down a commit or credit.
-
#subscription_config ⇒ MetronomeSDK::Models::Credit::SubscriptionConfig?
The subscription configuration for this credit, if it was generated from a recurring credit with a subscription attached.
- #type ⇒ Symbol, MetronomeSDK::Models::Credit::Type
-
#uniqueness_key ⇒ String?
Prevents the creation of duplicates.
Class Method Summary collapse
- .values ⇒ Array<Symbol>
- .variants ⇒ Array(MetronomeSDK::Models::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditRolloverLedgerEntry)
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(contract_id:, credit_id:) ⇒ Object
|
|
# File 'lib/metronome_sdk/models/credit.rb', line 156
|
Instance Attribute Details
#access_schedule ⇒ MetronomeSDK::Models::ScheduleDuration?
The schedule that the customer will gain access to the credits.
25 |
# File 'lib/metronome_sdk/models/credit.rb', line 25 optional :access_schedule, -> { MetronomeSDK::ScheduleDuration } |
#applicable_contract_ids ⇒ Array<String>?
30 |
# File 'lib/metronome_sdk/models/credit.rb', line 30 optional :applicable_contract_ids, MetronomeSDK::Internal::Type::ArrayOf[String] |
#applicable_product_ids ⇒ Array<String>?
35 |
# File 'lib/metronome_sdk/models/credit.rb', line 35 optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String] |
#applicable_product_tags ⇒ Array<String>?
40 |
# File 'lib/metronome_sdk/models/credit.rb', line 40 optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String] |
#balance ⇒ Float?
The current balance of the credit or commit. This balance reflects the amount of credit or commit that the customer has access to use at this moment - thus, expired and upcoming credit or commit segments contribute 0 to the balance. The balance will match the sum of all ledger entries with the exception of the case where the sum of negative manual ledger entries exceeds the positive amount remaining on the credit or commit - in that case, the balance will be 0. All manual ledger entries associated with active credit or commit segments are included in the balance, including future-dated manual ledger entries.
53 |
# File 'lib/metronome_sdk/models/credit.rb', line 53 optional :balance, Float |
#contract ⇒ MetronomeSDK::Models::Credit::Contract?
58 |
# File 'lib/metronome_sdk/models/credit.rb', line 58 optional :contract, -> { MetronomeSDK::Credit::Contract } |
#created_by ⇒ String?
The actor who created this credit. Omitted for system-generated credits such as recurring credits.
65 |
# File 'lib/metronome_sdk/models/credit.rb', line 65 optional :created_by, String |
#custom_fields ⇒ Hash{Symbol=>String}?
Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
71 |
# File 'lib/metronome_sdk/models/credit.rb', line 71 optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String] |
#description ⇒ String?
76 |
# File 'lib/metronome_sdk/models/credit.rb', line 76 optional :description, String |
#hierarchy_configuration ⇒ MetronomeSDK::Models::CommitHierarchyConfiguration?
Optional configuration for credit hierarchy access control
82 |
# File 'lib/metronome_sdk/models/credit.rb', line 82 optional :hierarchy_configuration, -> { MetronomeSDK::CommitHierarchyConfiguration } |
#id ⇒ String
9 |
# File 'lib/metronome_sdk/models/credit.rb', line 9 required :id, String |
#ledger ⇒ Array<MetronomeSDK::Models::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditRolloverLedgerEntry>?
A list of ordered events that impact the balance of a credit. For example, an invoice deduction or an expiration.
89 |
# File 'lib/metronome_sdk/models/credit.rb', line 89 optional :ledger, -> { MetronomeSDK::Internal::Type::ArrayOf[union: MetronomeSDK::Credit::Ledger] } |
#name ⇒ String?
94 |
# File 'lib/metronome_sdk/models/credit.rb', line 94 optional :name, String |
#netsuite_sales_order_id ⇒ String?
This field's availability is dependent on your client's configuration.
100 |
# File 'lib/metronome_sdk/models/credit.rb', line 100 optional :netsuite_sales_order_id, String |
#priority ⇒ Float?
If multiple credits or commits are applicable, the one with the lower priority will apply first.
107 |
# File 'lib/metronome_sdk/models/credit.rb', line 107 optional :priority, Float |
#product ⇒ MetronomeSDK::Models::Credit::Product
14 |
# File 'lib/metronome_sdk/models/credit.rb', line 14 required :product, -> { MetronomeSDK::Credit::Product } |
#rate_type ⇒ Symbol, ...
112 |
# File 'lib/metronome_sdk/models/credit.rb', line 112 optional :rate_type, enum: -> { MetronomeSDK::Credit::RateType } |
#recurring_credit_id ⇒ String?
The ID of the recurring credit that this credit was generated from, if applicable.
119 |
# File 'lib/metronome_sdk/models/credit.rb', line 119 optional :recurring_credit_id, String |
#rolled_over_from ⇒ MetronomeSDK::Models::Credit::RolledOverFrom?
124 |
# File 'lib/metronome_sdk/models/credit.rb', line 124 optional :rolled_over_from, -> { MetronomeSDK::Credit::RolledOverFrom } |
#salesforce_opportunity_id ⇒ String?
This field's availability is dependent on your client's configuration.
130 |
# File 'lib/metronome_sdk/models/credit.rb', line 130 optional :salesforce_opportunity_id, String |
#specifiers ⇒ Array<MetronomeSDK::Models::CommitSpecifier>?
List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown.
138 |
# File 'lib/metronome_sdk/models/credit.rb', line 138 optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] } |
#subscription_config ⇒ MetronomeSDK::Models::Credit::SubscriptionConfig?
The subscription configuration for this credit, if it was generated from a recurring credit with a subscription attached.
145 |
# File 'lib/metronome_sdk/models/credit.rb', line 145 optional :subscription_config, -> { MetronomeSDK::Credit::SubscriptionConfig } |
#type ⇒ Symbol, MetronomeSDK::Models::Credit::Type
19 |
# File 'lib/metronome_sdk/models/credit.rb', line 19 required :type, enum: -> { MetronomeSDK::Credit::Type } |
#uniqueness_key ⇒ String?
Prevents the creation of duplicates. If a request to create a commit or credit is made with a uniqueness key that was previously used to create a commit or credit, a new record will not be created and the request will fail with a 409 error.
154 |
# File 'lib/metronome_sdk/models/credit.rb', line 154 optional :uniqueness_key, String |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/metronome_sdk/models/credit.rb', line 231
|
.variants ⇒ Array(MetronomeSDK::Models::Credit::Ledger::CreditSegmentStartLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditAutomatedInvoiceDeductionLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditExpirationLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCanceledLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditCreditedLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditManualLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditSeatBasedAdjustmentLedgerEntry, MetronomeSDK::Models::Credit::Ledger::CreditRolloverLedgerEntry)
|
|
# File 'lib/metronome_sdk/models/credit.rb', line 612
|
Instance Method Details
#to_hash ⇒ {
165 |
# File 'sig/metronome_sdk/models/credit.rbs', line 165
def to_hash: -> {
|