Class: Stigg::Models::V1::Credits::ConsumptionConsumeResponse::Data::Credit

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/stigg/models/v1/credits/consumption_consume_response.rb,
sig/stigg/models/v1/credits/consumption_consume_response.rbs

Overview

See Also:

  • Stigg::Models::V1::Credits::ConsumptionConsumeResponse::Data#credit

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(currency_id:, current_usage:, timestamp:, usage_limit:, usage_period_end: nil) ⇒ Object

Some parameter documentations has been truncated, see Stigg::Models::V1::Credits::ConsumptionConsumeResponse::Data::Credit for more details.

The optimistic credit balance after consumption (when sync credit consumption is enabled)

Parameters:

  • currency_id (String)

    The credit currency identifier

  • current_usage (Float)

    The credits consumed (optimistic — includes not-yet-reconciled usage)

  • timestamp (Time)

    The grant-version timestamp of this balance, used by the SDK for last-write-wins

  • usage_limit (Float)

    The total credits granted

  • usage_period_end (Time, nil) (defaults to: nil)

    End of the current credit grant period (when recurring credits reset), if applic



# File 'lib/stigg/models/v1/credits/consumption_consume_response.rb', line 111

Instance Attribute Details

#currency_idString

The credit currency identifier

Parameters:

  • value (String)

Returns:

  • (String)


83
# File 'lib/stigg/models/v1/credits/consumption_consume_response.rb', line 83

required :currency_id, String, api_name: :currencyId

#current_usageFloat

The credits consumed (optimistic — includes not-yet-reconciled usage)

Parameters:

  • value (Float)

Returns:

  • (Float)


89
# File 'lib/stigg/models/v1/credits/consumption_consume_response.rb', line 89

required :current_usage, Float, api_name: :currentUsage

#timestampTime

The grant-version timestamp of this balance, used by the SDK for last-write-wins reconciliation

Parameters:

  • value (Time)

Returns:

  • (Time)


96
# File 'lib/stigg/models/v1/credits/consumption_consume_response.rb', line 96

required :timestamp, Time

#usage_limitFloat

The total credits granted

Parameters:

  • value (Float)

Returns:

  • (Float)


102
# File 'lib/stigg/models/v1/credits/consumption_consume_response.rb', line 102

required :usage_limit, Float, api_name: :usageLimit

#usage_period_endTime?

End of the current credit grant period (when recurring credits reset), if applicable

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


109
# File 'lib/stigg/models/v1/credits/consumption_consume_response.rb', line 109

optional :usage_period_end, Time, api_name: :usagePeriodEnd, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


88
# File 'sig/stigg/models/v1/credits/consumption_consume_response.rbs', line 88

def to_hash: -> {