Class: Telnyx::Models::Pricing::ProductRetrieveResponse::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/pricing/product_retrieve_response.rb,
sig/telnyx/models/pricing/product_retrieve_response.rbs

Defined Under Namespace

Modules: Rate

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(cached_input_rate: nil, cached_input_tiers: nil, country_iso: nil, currency: nil, direction: nil, input_rate: nil, input_tiers: nil, model: nil, name: nil, note: nil, output_rate: nil, output_tiers: nil, pricing_type: nil, rate: nil, tiers: nil, type: nil, unit: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::Pricing::ProductRetrieveResponse::Data for more details.

A single pricing entry. Standard products include rate, unit, currency, type, country_iso, direction, and tiers. Inference products include model, input_rate, output_rate, cached_input_rate, and their respective tier arrays. Rate-deck products include pricing_type and note fields with null rate and empty tiers.

Parameters:

  • cached_input_rate (String) (defaults to: nil)

    Cached input token rate. Present only on inference product entries.

  • cached_input_tiers (Array<Telnyx::Models::Pricing::PricingTier>) (defaults to: nil)

    Cached input token tiered pricing. Present only on inference product entries.

  • country_iso (String, nil) (defaults to: nil)

    ISO country code. Null for non-geographic products.

  • currency (String) (defaults to: nil)

    ISO currency code (e.g., USD).

  • direction (String, nil) (defaults to: nil)

    Direction (e.g., termination). Null for non-directional products.

  • input_rate (String) (defaults to: nil)

    Input token rate. Present only on inference product entries.

  • input_tiers (Array<Telnyx::Models::Pricing::PricingTier>) (defaults to: nil)

    Input token tiered pricing. Present only on inference product entries.

  • model (String) (defaults to: nil)

    Model identifier. Present only on inference product entries.

  • name (String) (defaults to: nil)

    Human-readable name describing the pricing entry.

  • note (String, nil) (defaults to: nil)

    Additional note for rate-deck products (e.g., "Pricing is determined by the What

  • output_rate (String) (defaults to: nil)

    Output token rate. Present only on inference product entries.

  • output_tiers (Array<Telnyx::Models::Pricing::PricingTier>) (defaults to: nil)

    Output token tiered pricing. Present only on inference product entries.

  • pricing_type (String, nil) (defaults to: nil)

    Pricing type for non-standard products (e.g., rate_deck). Absent on standard pro

  • rate (Float, String, nil) (defaults to: nil)

    Per-unit rate. Numeric for standard products, string for inference products. Nul

  • tiers (Array<Telnyx::Models::Pricing::PricingTier>) (defaults to: nil)

    Volume-based tiered pricing. Empty for rate-deck products.

  • type (String) (defaults to: nil)

    Pricing type (e.g., usage).

  • unit (String) (defaults to: nil)

    Unit of measurement (e.g., part, message, GB, per_1k_tokens).



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 23

class Data < Telnyx::Internal::Type::BaseModel
  # @!attribute cached_input_rate
  #   Cached input token rate. Present only on inference product entries.
  #
  #   @return [String, nil]
  optional :cached_input_rate, String

  # @!attribute cached_input_tiers
  #   Cached input token tiered pricing. Present only on inference product entries.
  #
  #   @return [Array<Telnyx::Models::Pricing::PricingTier>, nil]
  optional :cached_input_tiers, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Pricing::PricingTier] }

  # @!attribute country_iso
  #   ISO country code. Null for non-geographic products.
  #
  #   @return [String, nil]
  optional :country_iso, String, nil?: true

  # @!attribute currency
  #   ISO currency code (e.g., USD).
  #
  #   @return [String, nil]
  optional :currency, String

  # @!attribute direction
  #   Direction (e.g., termination). Null for non-directional products.
  #
  #   @return [String, nil]
  optional :direction, String, nil?: true

  # @!attribute input_rate
  #   Input token rate. Present only on inference product entries.
  #
  #   @return [String, nil]
  optional :input_rate, String

  # @!attribute input_tiers
  #   Input token tiered pricing. Present only on inference product entries.
  #
  #   @return [Array<Telnyx::Models::Pricing::PricingTier>, nil]
  optional :input_tiers, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Pricing::PricingTier] }

  # @!attribute model
  #   Model identifier. Present only on inference product entries.
  #
  #   @return [String, nil]
  optional :model, String

  # @!attribute name
  #   Human-readable name describing the pricing entry.
  #
  #   @return [String, nil]
  optional :name, String

  # @!attribute note
  #   Additional note for rate-deck products (e.g., "Pricing is determined by the
  #   WhatsApp rate deck.").
  #
  #   @return [String, nil]
  optional :note, String, nil?: true

  # @!attribute output_rate
  #   Output token rate. Present only on inference product entries.
  #
  #   @return [String, nil]
  optional :output_rate, String

  # @!attribute output_tiers
  #   Output token tiered pricing. Present only on inference product entries.
  #
  #   @return [Array<Telnyx::Models::Pricing::PricingTier>, nil]
  optional :output_tiers, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Pricing::PricingTier] }

  # @!attribute pricing_type
  #   Pricing type for non-standard products (e.g., rate_deck). Absent on standard
  #   products.
  #
  #   @return [String, nil]
  optional :pricing_type, String, nil?: true

  # @!attribute rate
  #   Per-unit rate. Numeric for standard products, string for inference products.
  #   Null for rate-deck products.
  #
  #   @return [Float, String, nil]
  optional :rate, union: -> { Telnyx::Models::Pricing::ProductRetrieveResponse::Data::Rate }, nil?: true

  # @!attribute tiers
  #   Volume-based tiered pricing. Empty for rate-deck products.
  #
  #   @return [Array<Telnyx::Models::Pricing::PricingTier>, nil]
  optional :tiers, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Pricing::PricingTier] }

  # @!attribute type
  #   Pricing type (e.g., usage).
  #
  #   @return [String, nil]
  optional :type, String

  # @!attribute unit
  #   Unit of measurement (e.g., part, message, GB, per_1k_tokens).
  #
  #   @return [String, nil]
  optional :unit, String

  # @!method initialize(cached_input_rate: nil, cached_input_tiers: nil, country_iso: nil, currency: nil, direction: nil, input_rate: nil, input_tiers: nil, model: nil, name: nil, note: nil, output_rate: nil, output_tiers: nil, pricing_type: nil, rate: nil, tiers: nil, type: nil, unit: nil)
  #   Some parameter documentations has been truncated, see
  #   {Telnyx::Models::Pricing::ProductRetrieveResponse::Data} for more details.
  #
  #   A single pricing entry. Standard products include rate, unit, currency, type,
  #   country_iso, direction, and tiers. Inference products include model, input_rate,
  #   output_rate, cached_input_rate, and their respective tier arrays. Rate-deck
  #   products include pricing_type and note fields with null rate and empty tiers.
  #
  #   @param cached_input_rate [String] Cached input token rate. Present only on inference product entries.
  #
  #   @param cached_input_tiers [Array<Telnyx::Models::Pricing::PricingTier>] Cached input token tiered pricing. Present only on inference product entries.
  #
  #   @param country_iso [String, nil] ISO country code. Null for non-geographic products.
  #
  #   @param currency [String] ISO currency code (e.g., USD).
  #
  #   @param direction [String, nil] Direction (e.g., termination). Null for non-directional products.
  #
  #   @param input_rate [String] Input token rate. Present only on inference product entries.
  #
  #   @param input_tiers [Array<Telnyx::Models::Pricing::PricingTier>] Input token tiered pricing. Present only on inference product entries.
  #
  #   @param model [String] Model identifier. Present only on inference product entries.
  #
  #   @param name [String] Human-readable name describing the pricing entry.
  #
  #   @param note [String, nil] Additional note for rate-deck products (e.g., "Pricing is determined by the What
  #
  #   @param output_rate [String] Output token rate. Present only on inference product entries.
  #
  #   @param output_tiers [Array<Telnyx::Models::Pricing::PricingTier>] Output token tiered pricing. Present only on inference product entries.
  #
  #   @param pricing_type [String, nil] Pricing type for non-standard products (e.g., rate_deck). Absent on standard pro
  #
  #   @param rate [Float, String, nil] Per-unit rate. Numeric for standard products, string for inference products. Nul
  #
  #   @param tiers [Array<Telnyx::Models::Pricing::PricingTier>] Volume-based tiered pricing. Empty for rate-deck products.
  #
  #   @param type [String] Pricing type (e.g., usage).
  #
  #   @param unit [String] Unit of measurement (e.g., part, message, GB, per_1k_tokens).

  # Per-unit rate. Numeric for standard products, string for inference products.
  # Null for rate-deck products.
  #
  # @see Telnyx::Models::Pricing::ProductRetrieveResponse::Data#rate
  module Rate
    extend Telnyx::Internal::Type::Union

    # Rate for standard products (e.g., 0.004).
    variant Float

    # Rate for inference products (e.g., "0.001").
    variant String

    # @!method self.variants
    #   @return [Array(Float, String)]
  end
end

Instance Attribute Details

#cached_input_rateString?

Cached input token rate. Present only on inference product entries.

Parameters:

  • (String)

Returns:

  • (String, nil)


28
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 28

optional :cached_input_rate, String

#cached_input_tiersArray<Telnyx::Models::Pricing::PricingTier>?

Cached input token tiered pricing. Present only on inference product entries.

Returns:



34
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 34

optional :cached_input_tiers, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Pricing::PricingTier] }

#country_isoString?

ISO country code. Null for non-geographic products.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


40
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 40

optional :country_iso, String, nil?: true

#currencyString?

ISO currency code (e.g., USD).

Parameters:

  • (String)

Returns:

  • (String, nil)


46
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 46

optional :currency, String

#directionString?

Direction (e.g., termination). Null for non-directional products.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


52
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 52

optional :direction, String, nil?: true

#input_rateString?

Input token rate. Present only on inference product entries.

Parameters:

  • (String)

Returns:

  • (String, nil)


58
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 58

optional :input_rate, String

#input_tiersArray<Telnyx::Models::Pricing::PricingTier>?

Input token tiered pricing. Present only on inference product entries.

Returns:



64
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 64

optional :input_tiers, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Pricing::PricingTier] }

#modelString?

Model identifier. Present only on inference product entries.

Parameters:

  • (String)

Returns:

  • (String, nil)


70
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 70

optional :model, String

#nameString?

Human-readable name describing the pricing entry.

Parameters:

  • (String)

Returns:

  • (String, nil)


76
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 76

optional :name, String

#noteString?

Additional note for rate-deck products (e.g., "Pricing is determined by the WhatsApp rate deck.").

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


83
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 83

optional :note, String, nil?: true

#output_rateString?

Output token rate. Present only on inference product entries.

Parameters:

  • (String)

Returns:

  • (String, nil)


89
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 89

optional :output_rate, String

#output_tiersArray<Telnyx::Models::Pricing::PricingTier>?

Output token tiered pricing. Present only on inference product entries.

Returns:



95
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 95

optional :output_tiers, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Pricing::PricingTier] }

#pricing_typeString?

Pricing type for non-standard products (e.g., rate_deck). Absent on standard products.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


102
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 102

optional :pricing_type, String, nil?: true

#rateFloat, ...

Per-unit rate. Numeric for standard products, string for inference products. Null for rate-deck products.

Parameters:

  • value (Telnyx::Models::Pricing::ProductRetrieveResponse::Data::rate, nil)

Returns:

  • (Float, String, nil)


109
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 109

optional :rate, union: -> { Telnyx::Models::Pricing::ProductRetrieveResponse::Data::Rate }, nil?: true

#tiersArray<Telnyx::Models::Pricing::PricingTier>?

Volume-based tiered pricing. Empty for rate-deck products.

Returns:



115
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 115

optional :tiers, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::Pricing::PricingTier] }

#typeString?

Pricing type (e.g., usage).

Parameters:

  • (String)

Returns:

  • (String, nil)


121
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 121

optional :type, String

#unitString?

Unit of measurement (e.g., part, message, GB, per_1k_tokens).

Parameters:

  • (String)

Returns:

  • (String, nil)


127
# File 'lib/telnyx/models/pricing/product_retrieve_response.rb', line 127

optional :unit, String

Instance Method Details

#to_hash{

Returns:

  • ({)


133
# File 'sig/telnyx/models/pricing/product_retrieve_response.rbs', line 133

def to_hash: -> {