Class: Telnyx::Models::PhoneNumberListParams::Filter

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

Defined Under Namespace

Modules: CountryISOAlpha2, Source, Status, VoiceUsagePaymentMethod, WithoutTags Classes: NumberType, VoiceConnectionName

Instance Attribute Summary collapse

Class Method 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(contains: nil, ends_with: nil, eq: nil, starts_with: nil) ⇒ Object

Filter by voice connection name pattern matching.

Parameters:

  • (defaults to: nil)

    Filter contains connection name. Requires at least three characters.

  • (defaults to: nil)

    Filter ends with connection name. Requires at least three characters.

  • (defaults to: nil)

    Filter by connection name.

  • (defaults to: nil)

    Filter starts with connection name. Requires at least three characters.



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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/telnyx/models/phone_number_list_params.rb', line 66

class Filter < Telnyx::Internal::Type::BaseModel
  # @!attribute billing_group_id
  #   Filter by the billing_group_id associated with phone numbers. To filter to only
  #   phone numbers that have no billing group associated them, set the value of this
  #   filter to the string 'null'.
  #
  #   @return [String, nil]
  optional :billing_group_id, String

  # @!attribute connection_id
  #   Filter by connection_id.
  #
  #   @return [String, nil]
  optional :connection_id, String

  # @!attribute country_iso_alpha2
  #   Filter by phone number country ISO alpha-2 code. Can be a single value or an
  #   array of values.
  #
  #   @return [String, Array<String>, nil]
  optional :country_iso_alpha2, union: -> { Telnyx::PhoneNumberListParams::Filter::CountryISOAlpha2 }

  # @!attribute customer_reference
  #   Filter numbers via the customer_reference set.
  #
  #   @return [String, nil]
  optional :customer_reference, String

  # @!attribute emergency_address_id
  #   Filter by the emergency_address_id associated with phone numbers. To filter only
  #   phone numbers that have no emergency address associated with them, set the value
  #   of this filter to the string 'null'.
  #
  #   @return [String, nil]
  optional :emergency_address_id, String

  # @!attribute number_type
  #   Filter phone numbers by phone number type.
  #
  #   @return [Telnyx::Models::PhoneNumberListParams::Filter::NumberType, nil]
  optional :number_type, -> { Telnyx::PhoneNumberListParams::Filter::NumberType }

  # @!attribute phone_number
  #   Filter by phone number. Requires at least three digits. Non-numerical characters
  #   will result in no values being returned.
  #
  #   @return [String, nil]
  optional :phone_number, String

  # @!attribute source
  #   Filter phone numbers by their source. Use 'ported' for numbers ported from other
  #   carriers, or 'purchased' for numbers bought directly from Telnyx.
  #
  #   @return [Symbol, Telnyx::Models::PhoneNumberListParams::Filter::Source, nil]
  optional :source, enum: -> { Telnyx::PhoneNumberListParams::Filter::Source }

  # @!attribute status
  #   Filter by phone number status.
  #
  #   @return [Symbol, Telnyx::Models::PhoneNumberListParams::Filter::Status, nil]
  optional :status, enum: -> { Telnyx::PhoneNumberListParams::Filter::Status }

  # @!attribute tag
  #   Filter by phone number tags.
  #
  #   @return [String, nil]
  optional :tag, String

  # @!attribute voice_connection_name
  #   Filter by voice connection name pattern matching.
  #
  #   @return [Telnyx::Models::PhoneNumberListParams::Filter::VoiceConnectionName, nil]
  optional :voice_connection_name,
           -> { Telnyx::PhoneNumberListParams::Filter::VoiceConnectionName },
           api_name: :"voice.connection_name"

  # @!attribute voice_usage_payment_method
  #   Filter by usage_payment_method.
  #
  #   @return [Symbol, Telnyx::Models::PhoneNumberListParams::Filter::VoiceUsagePaymentMethod, nil]
  optional :voice_usage_payment_method,
           enum: -> { Telnyx::PhoneNumberListParams::Filter::VoiceUsagePaymentMethod },
           api_name: :"voice.usage_payment_method"

  # @!attribute without_tags
  #   When set to 'true', filters for phone numbers that do not have any tags applied.
  #   All other values are ignored.
  #
  #   @return [Symbol, Telnyx::Models::PhoneNumberListParams::Filter::WithoutTags, nil]
  optional :without_tags, enum: -> { Telnyx::PhoneNumberListParams::Filter::WithoutTags }

  # @!method initialize(billing_group_id: nil, connection_id: nil, country_iso_alpha2: nil, customer_reference: nil, emergency_address_id: nil, number_type: nil, phone_number: nil, source: nil, status: nil, tag: nil, voice_connection_name: nil, voice_usage_payment_method: nil, without_tags: nil)
  #   Some parameter documentations has been truncated, see
  #   {Telnyx::Models::PhoneNumberListParams::Filter} for more details.
  #
  #   Consolidated filter parameter (deepObject style). Originally: filter[tag],
  #   filter[phone_number], filter[status], filter[country_iso_alpha2],
  #   filter[connection_id], filter[voice.connection_name],
  #   filter[voice.usage_payment_method], filter[billing_group_id],
  #   filter[emergency_address_id], filter[customer_reference], filter[number_type],
  #   filter[source]
  #
  #   @param billing_group_id [String] Filter by the billing_group_id associated with phone numbers. To filter to only
  #
  #   @param connection_id [String] Filter by connection_id.
  #
  #   @param country_iso_alpha2 [String, Array<String>] Filter by phone number country ISO alpha-2 code. Can be a single value or an arr
  #
  #   @param customer_reference [String] Filter numbers via the customer_reference set.
  #
  #   @param emergency_address_id [String] Filter by the emergency_address_id associated with phone numbers. To filter only
  #
  #   @param number_type [Telnyx::Models::PhoneNumberListParams::Filter::NumberType] Filter phone numbers by phone number type.
  #
  #   @param phone_number [String] Filter by phone number. Requires at least three digits.
  #
  #   @param source [Symbol, Telnyx::Models::PhoneNumberListParams::Filter::Source] Filter phone numbers by their source. Use 'ported' for numbers ported from other
  #
  #   @param status [Symbol, Telnyx::Models::PhoneNumberListParams::Filter::Status] Filter by phone number status.
  #
  #   @param tag [String] Filter by phone number tags.
  #
  #   @param voice_connection_name [Telnyx::Models::PhoneNumberListParams::Filter::VoiceConnectionName] Filter by voice connection name pattern matching.
  #
  #   @param voice_usage_payment_method [Symbol, Telnyx::Models::PhoneNumberListParams::Filter::VoiceUsagePaymentMethod] Filter by usage_payment_method.
  #
  #   @param without_tags [Symbol, Telnyx::Models::PhoneNumberListParams::Filter::WithoutTags] When set to 'true', filters for phone numbers that do not have any tags applied.

  # Filter by phone number country ISO alpha-2 code. Can be a single value or an
  # array of values.
  #
  # @see Telnyx::Models::PhoneNumberListParams::Filter#country_iso_alpha2
  module CountryISOAlpha2
    extend Telnyx::Internal::Type::Union

    variant String

    variant -> { Telnyx::Models::PhoneNumberListParams::Filter::CountryISOAlpha2::StringArray }

    # @!method self.variants
    #   @return [Array(String, Array<String>)]

    # @type [Telnyx::Internal::Type::Converter]
    StringArray = Telnyx::Internal::Type::ArrayOf[String]
  end

  # @see Telnyx::Models::PhoneNumberListParams::Filter#number_type
  class NumberType < Telnyx::Internal::Type::BaseModel
    # @!attribute eq
    #   Filter phone numbers by phone number type.
    #
    #   @return [Symbol, Telnyx::Models::PhoneNumberListParams::Filter::NumberType::Eq, nil]
    optional :eq, enum: -> { Telnyx::PhoneNumberListParams::Filter::NumberType::Eq }

    # @!method initialize(eq: nil)
    #   Filter phone numbers by phone number type.
    #
    #   @param eq [Symbol, Telnyx::Models::PhoneNumberListParams::Filter::NumberType::Eq] Filter phone numbers by phone number type.

    # Filter phone numbers by phone number type.
    #
    # @see Telnyx::Models::PhoneNumberListParams::Filter::NumberType#eq
    module Eq
      extend Telnyx::Internal::Type::Enum

      LOCAL = :local
      NATIONAL = :national
      TOLL_FREE = :toll_free
      MOBILE = :mobile
      SHARED_COST = :shared_cost

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end

  # Filter phone numbers by their source. Use 'ported' for numbers ported from other
  # carriers, or 'purchased' for numbers bought directly from Telnyx.
  #
  # @see Telnyx::Models::PhoneNumberListParams::Filter#source
  module Source
    extend Telnyx::Internal::Type::Enum

    PORTED = :ported
    PURCHASED = :purchased

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # Filter by phone number status.
  #
  # @see Telnyx::Models::PhoneNumberListParams::Filter#status
  module Status
    extend Telnyx::Internal::Type::Enum

    PURCHASE_PENDING = :"purchase-pending"
    PURCHASE_FAILED = :"purchase-failed"
    PORT_PENDING = :"port-pending"
    ACTIVE = :active
    DELETED = :deleted
    PORT_FAILED = :"port-failed"
    EMERGENCY_ONLY = :"emergency-only"
    PORTED_OUT = :"ported-out"
    PORT_OUT_PENDING = :"port-out-pending"

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # @see Telnyx::Models::PhoneNumberListParams::Filter#voice_connection_name
  class VoiceConnectionName < Telnyx::Internal::Type::BaseModel
    # @!attribute contains
    #   Filter contains connection name. Requires at least three characters.
    #
    #   @return [String, nil]
    optional :contains, String

    # @!attribute ends_with
    #   Filter ends with connection name. Requires at least three characters.
    #
    #   @return [String, nil]
    optional :ends_with, String

    # @!attribute eq
    #   Filter by connection name.
    #
    #   @return [String, nil]
    optional :eq, String

    # @!attribute starts_with
    #   Filter starts with connection name. Requires at least three characters.
    #
    #   @return [String, nil]
    optional :starts_with, String

    # @!method initialize(contains: nil, ends_with: nil, eq: nil, starts_with: nil)
    #   Filter by voice connection name pattern matching.
    #
    #   @param contains [String] Filter contains connection name. Requires at least three characters.
    #
    #   @param ends_with [String] Filter ends with connection name. Requires at least three characters.
    #
    #   @param eq [String] Filter by connection name.
    #
    #   @param starts_with [String] Filter starts with connection name. Requires at least three characters.
  end

  # Filter by usage_payment_method.
  #
  # @see Telnyx::Models::PhoneNumberListParams::Filter#voice_usage_payment_method
  module VoiceUsagePaymentMethod
    extend Telnyx::Internal::Type::Enum

    PAY_PER_MINUTE = :"pay-per-minute"
    CHANNEL = :channel

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # When set to 'true', filters for phone numbers that do not have any tags applied.
  # All other values are ignored.
  #
  # @see Telnyx::Models::PhoneNumberListParams::Filter#without_tags
  module WithoutTags
    extend Telnyx::Internal::Type::Enum

    TRUE = :true
    FALSE = :false

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#billing_group_idString?

Filter by the billing_group_id associated with phone numbers. To filter to only phone numbers that have no billing group associated them, set the value of this filter to the string 'null'.

Parameters:

Returns:



73
# File 'lib/telnyx/models/phone_number_list_params.rb', line 73

optional :billing_group_id, String

#connection_idString?

Filter by connection_id.

Parameters:

Returns:



79
# File 'lib/telnyx/models/phone_number_list_params.rb', line 79

optional :connection_id, String

#country_iso_alpha2String, ...

Filter by phone number country ISO alpha-2 code. Can be a single value or an array of values.

Returns:



86
# File 'lib/telnyx/models/phone_number_list_params.rb', line 86

optional :country_iso_alpha2, union: -> { Telnyx::PhoneNumberListParams::Filter::CountryISOAlpha2 }

#customer_referenceString?

Filter numbers via the customer_reference set.

Parameters:

Returns:



92
# File 'lib/telnyx/models/phone_number_list_params.rb', line 92

optional :customer_reference, String

#emergency_address_idString?

Filter by the emergency_address_id associated with phone numbers. To filter only phone numbers that have no emergency address associated with them, set the value of this filter to the string 'null'.

Parameters:

Returns:



100
# File 'lib/telnyx/models/phone_number_list_params.rb', line 100

optional :emergency_address_id, String

#number_typeTelnyx::Models::PhoneNumberListParams::Filter::NumberType?

Filter phone numbers by phone number type.

Returns:



106
# File 'lib/telnyx/models/phone_number_list_params.rb', line 106

optional :number_type, -> { Telnyx::PhoneNumberListParams::Filter::NumberType }

#phone_numberString?

Filter by phone number. Requires at least three digits. Non-numerical characters will result in no values being returned.

Parameters:

Returns:



113
# File 'lib/telnyx/models/phone_number_list_params.rb', line 113

optional :phone_number, String

#sourceSymbol, ...

Filter phone numbers by their source. Use 'ported' for numbers ported from other carriers, or 'purchased' for numbers bought directly from Telnyx.

Returns:



120
# File 'lib/telnyx/models/phone_number_list_params.rb', line 120

optional :source, enum: -> { Telnyx::PhoneNumberListParams::Filter::Source }

#statusSymbol, ...

Filter by phone number status.

Returns:



126
# File 'lib/telnyx/models/phone_number_list_params.rb', line 126

optional :status, enum: -> { Telnyx::PhoneNumberListParams::Filter::Status }

#tagString?

Filter by phone number tags.

Parameters:

Returns:



132
# File 'lib/telnyx/models/phone_number_list_params.rb', line 132

optional :tag, String

#voice_connection_nameTelnyx::Models::PhoneNumberListParams::Filter::VoiceConnectionName?

Filter by voice connection name pattern matching.

Returns:



138
139
140
# File 'lib/telnyx/models/phone_number_list_params.rb', line 138

optional :voice_connection_name,
-> { Telnyx::PhoneNumberListParams::Filter::VoiceConnectionName },
api_name: :"voice.connection_name"

#voice_usage_payment_methodSymbol, ...

Filter by usage_payment_method.

Returns:



146
147
148
# File 'lib/telnyx/models/phone_number_list_params.rb', line 146

optional :voice_usage_payment_method,
enum: -> { Telnyx::PhoneNumberListParams::Filter::VoiceUsagePaymentMethod },
api_name: :"voice.usage_payment_method"

#without_tagsSymbol, ...

When set to 'true', filters for phone numbers that do not have any tags applied. All other values are ignored.

Returns:



155
# File 'lib/telnyx/models/phone_number_list_params.rb', line 155

optional :without_tags, enum: -> { Telnyx::PhoneNumberListParams::Filter::WithoutTags }

Class Method Details

.valuesArray<Symbol>

Returns:



# File 'lib/telnyx/models/phone_number_list_params.rb', line 237

Instance Method Details

#to_hash{

Returns:



161
# File 'sig/telnyx/models/phone_number_list_params.rbs', line 161

def to_hash: -> {