telnyx 5.41.0 → 5.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/models/calls/action_answer_params.rb +57 -1
  5. data/lib/telnyx/models/calls/action_bridge_params.rb +10 -1
  6. data/lib/telnyx/models/calls/action_hangup_params.rb +9 -1
  7. data/lib/telnyx/models/payment_create_stored_payment_transaction_params.rb +22 -0
  8. data/lib/telnyx/models/payment_create_stored_payment_transaction_response.rb +91 -0
  9. data/lib/telnyx/models/queue.rb +86 -0
  10. data/lib/telnyx/models/queue_create_params.rb +30 -0
  11. data/lib/telnyx/models/queue_create_response.rb +16 -0
  12. data/lib/telnyx/models/queue_delete_params.rb +14 -0
  13. data/lib/telnyx/models/queue_list_params.rb +30 -0
  14. data/lib/telnyx/models/queue_retrieve_response.rb +3 -84
  15. data/lib/telnyx/models/queue_update_params.rb +22 -0
  16. data/lib/telnyx/models/queue_update_response.rb +16 -0
  17. data/lib/telnyx/models.rb +12 -0
  18. data/lib/telnyx/resources/calls/actions.rb +13 -3
  19. data/lib/telnyx/resources/payment.rb +22 -0
  20. data/lib/telnyx/resources/queues.rb +93 -0
  21. data/lib/telnyx/version.rb +1 -1
  22. data/lib/telnyx.rb +9 -0
  23. data/rbi/telnyx/models/calls/action_answer_params.rbi +146 -0
  24. data/rbi/telnyx/models/calls/action_bridge_params.rbi +13 -0
  25. data/rbi/telnyx/models/calls/action_hangup_params.rbi +13 -0
  26. data/rbi/telnyx/models/payment_create_stored_payment_transaction_params.rbi +43 -0
  27. data/rbi/telnyx/models/payment_create_stored_payment_transaction_response.rbi +235 -0
  28. data/rbi/telnyx/models/queue.rbi +105 -0
  29. data/rbi/telnyx/models/queue_create_params.rbi +54 -0
  30. data/rbi/telnyx/models/queue_create_response.rbi +26 -0
  31. data/rbi/telnyx/models/queue_delete_params.rbi +27 -0
  32. data/rbi/telnyx/models/queue_list_params.rbi +57 -0
  33. data/rbi/telnyx/models/queue_retrieve_response.rbi +4 -138
  34. data/rbi/telnyx/models/queue_update_params.rbi +40 -0
  35. data/rbi/telnyx/models/queue_update_response.rbi +26 -0
  36. data/rbi/telnyx/models.rbi +13 -0
  37. data/rbi/telnyx/resources/calls/actions.rbi +25 -0
  38. data/rbi/telnyx/resources/payment.rbi +14 -0
  39. data/rbi/telnyx/resources/queues.rbi +65 -0
  40. data/sig/telnyx/models/calls/action_answer_params.rbs +49 -1
  41. data/sig/telnyx/models/calls/action_bridge_params.rbs +7 -0
  42. data/sig/telnyx/models/calls/action_hangup_params.rbs +13 -1
  43. data/sig/telnyx/models/payment_create_stored_payment_transaction_params.rbs +23 -0
  44. data/sig/telnyx/models/payment_create_stored_payment_transaction_response.rbs +116 -0
  45. data/sig/telnyx/models/queue.rbs +65 -0
  46. data/sig/telnyx/models/queue_create_params.rbs +30 -0
  47. data/sig/telnyx/models/queue_create_response.rbs +15 -0
  48. data/sig/telnyx/models/queue_delete_params.rbs +14 -0
  49. data/sig/telnyx/models/queue_list_params.rbs +32 -0
  50. data/sig/telnyx/models/queue_retrieve_response.rbs +5 -72
  51. data/sig/telnyx/models/queue_update_params.rbs +23 -0
  52. data/sig/telnyx/models/queue_update_response.rbs +15 -0
  53. data/sig/telnyx/models.rbs +12 -0
  54. data/sig/telnyx/resources/calls/actions.rbs +5 -0
  55. data/sig/telnyx/resources/payment.rbs +5 -0
  56. data/sig/telnyx/resources/queues.rbs +23 -0
  57. metadata +28 -1
@@ -50,7 +50,7 @@ module Telnyx
50
50
  # When the `record` parameter is set to `record-from-answer`, the response will
51
51
  # include a `recording_id` field.
52
52
  #
53
- # @overload answer(call_control_id, billing_group_id: nil, client_state: nil, command_id: nil, custom_headers: nil, preferred_codecs: nil, record: nil, record_channels: nil, record_custom_file_name: nil, record_format: nil, record_max_length: nil, record_timeout_secs: nil, record_track: nil, record_trim: nil, send_silence_when_idle: nil, sip_headers: nil, sound_modifications: nil, stream_bidirectional_codec: nil, stream_bidirectional_mode: nil, stream_bidirectional_target_legs: nil, stream_codec: nil, stream_track: nil, stream_url: nil, transcription: nil, transcription_config: nil, webhook_url: nil, webhook_url_method: nil, request_options: {})
53
+ # @overload answer(call_control_id, billing_group_id: nil, client_state: nil, command_id: nil, custom_headers: nil, preferred_codecs: nil, record: nil, record_channels: nil, record_custom_file_name: nil, record_format: nil, record_max_length: nil, record_timeout_secs: nil, record_track: nil, record_trim: nil, send_silence_when_idle: nil, sip_headers: nil, sound_modifications: nil, stream_bidirectional_codec: nil, stream_bidirectional_mode: nil, stream_bidirectional_target_legs: nil, stream_codec: nil, stream_track: nil, stream_url: nil, transcription: nil, transcription_config: nil, webhook_retries_policies: nil, webhook_url: nil, webhook_url_method: nil, webhook_urls: nil, webhook_urls_method: nil, request_options: {})
54
54
  #
55
55
  # @param call_control_id [String] Unique identifier and token for controlling the call
56
56
  #
@@ -103,10 +103,16 @@ module Telnyx
103
103
  #
104
104
  # @param transcription_config [Telnyx::Models::Calls::TranscriptionStartRequest]
105
105
  #
106
+ # @param webhook_retries_policies [Hash{Symbol=>Telnyx::Models::Calls::ActionAnswerParams::WebhookRetriesPolicy}] A map of event types to retry policies. Each retry policy contains an array of `
107
+ #
106
108
  # @param webhook_url [String] Use this field to override the URL for which Telnyx will send subsequent webhook
107
109
  #
108
110
  # @param webhook_url_method [Symbol, Telnyx::Models::Calls::ActionAnswerParams::WebhookURLMethod] HTTP request type used for `webhook_url`.
109
111
  #
112
+ # @param webhook_urls [Hash{Symbol=>String}] A map of event types to webhook URLs. When an event of the specified type occurs
113
+ #
114
+ # @param webhook_urls_method [Symbol, Telnyx::Models::Calls::ActionAnswerParams::WebhookURLsMethod] HTTP request method to invoke `webhook_urls`.
115
+ #
110
116
  # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
111
117
  #
112
118
  # @return [Telnyx::Models::Calls::ActionAnswerResponse]
@@ -133,7 +139,7 @@ module Telnyx
133
139
  # - `call.bridged` for Leg A
134
140
  # - `call.bridged` for Leg B
135
141
  #
136
- # @overload bridge(call_control_id_to_bridge, call_control_id_to_bridge_with:, client_state: nil, command_id: nil, mute_dtmf: nil, park_after_unbridge: nil, play_ringtone: nil, prevent_double_bridge: nil, queue: nil, record: nil, record_channels: nil, record_custom_file_name: nil, record_format: nil, record_max_length: nil, record_timeout_secs: nil, record_track: nil, record_trim: nil, ringtone: nil, video_room_context: nil, video_room_id: nil, request_options: {})
142
+ # @overload bridge(call_control_id_to_bridge, call_control_id_to_bridge_with:, client_state: nil, command_id: nil, hold_after_unbridge: nil, mute_dtmf: nil, park_after_unbridge: nil, play_ringtone: nil, prevent_double_bridge: nil, queue: nil, record: nil, record_channels: nil, record_custom_file_name: nil, record_format: nil, record_max_length: nil, record_timeout_secs: nil, record_track: nil, record_trim: nil, ringtone: nil, video_room_context: nil, video_room_id: nil, request_options: {})
137
143
  #
138
144
  # @param call_control_id_to_bridge [String] Unique identifier and token for controlling the call
139
145
  #
@@ -143,6 +149,8 @@ module Telnyx
143
149
  #
144
150
  # @param command_id [String] Use this field to avoid duplicate commands. Telnyx will ignore any command with
145
151
  #
152
+ # @param hold_after_unbridge [Boolean] Specifies behavior after the bridge ends. If set to `true`, the current leg will
153
+ #
146
154
  # @param mute_dtmf [Symbol, Telnyx::Models::Calls::ActionBridgeParams::MuteDtmf] When enabled, DTMF tones are not passed to the call participant. The webhooks co
147
155
  #
148
156
  # @param park_after_unbridge [String] Specifies behavior after the bridge ends (i.e. the opposite leg either hangs up
@@ -491,7 +499,7 @@ module Telnyx
491
499
  # - `call.hangup`
492
500
  # - `call.recording.saved`
493
501
  #
494
- # @overload hangup(call_control_id, client_state: nil, command_id: nil, request_options: {})
502
+ # @overload hangup(call_control_id, client_state: nil, command_id: nil, custom_headers: nil, request_options: {})
495
503
  #
496
504
  # @param call_control_id [String] Unique identifier and token for controlling the call
497
505
  #
@@ -499,6 +507,8 @@ module Telnyx
499
507
  #
500
508
  # @param command_id [String] Use this field to avoid duplicate commands. Telnyx will ignore any command with
501
509
  #
510
+ # @param custom_headers [Array<Telnyx::Models::CustomSipHeader>] Custom headers to be added to the SIP BYE message.
511
+ #
502
512
  # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
503
513
  #
504
514
  # @return [Telnyx::Models::Calls::ActionHangupResponse]
@@ -6,6 +6,28 @@ module Telnyx
6
6
  # @return [Telnyx::Resources::Payment::AutoRechargePrefs]
7
7
  attr_reader :auto_recharge_prefs
8
8
 
9
+ # Create a stored payment transaction
10
+ #
11
+ # @overload create_stored_payment_transaction(amount:, request_options: {})
12
+ #
13
+ # @param amount [String] Amount in dollars and cents, e.g. "120.00"
14
+ #
15
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
16
+ #
17
+ # @return [Telnyx::Models::PaymentCreateStoredPaymentTransactionResponse]
18
+ #
19
+ # @see Telnyx::Models::PaymentCreateStoredPaymentTransactionParams
20
+ def create_stored_payment_transaction(params)
21
+ parsed, options = Telnyx::PaymentCreateStoredPaymentTransactionParams.dump_request(params)
22
+ @client.request(
23
+ method: :post,
24
+ path: "v2/payment/stored_payment_transactions",
25
+ body: parsed,
26
+ model: Telnyx::Models::PaymentCreateStoredPaymentTransactionResponse,
27
+ options: options
28
+ )
29
+ end
30
+
9
31
  # @api private
10
32
  #
11
33
  # @param client [Telnyx::Client]
@@ -6,6 +6,30 @@ module Telnyx
6
6
  # @return [Telnyx::Resources::Queues::Calls]
7
7
  attr_reader :calls
8
8
 
9
+ # Create a new call queue.
10
+ #
11
+ # @overload create(queue_name:, max_size: nil, request_options: {})
12
+ #
13
+ # @param queue_name [String] The name of the queue. Must be between 1 and 255 characters.
14
+ #
15
+ # @param max_size [Integer] The maximum number of calls allowed in the queue.
16
+ #
17
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
18
+ #
19
+ # @return [Telnyx::Models::QueueCreateResponse]
20
+ #
21
+ # @see Telnyx::Models::QueueCreateParams
22
+ def create(params)
23
+ parsed, options = Telnyx::QueueCreateParams.dump_request(params)
24
+ @client.request(
25
+ method: :post,
26
+ path: "queues",
27
+ body: parsed,
28
+ model: Telnyx::Models::QueueCreateResponse,
29
+ options: options
30
+ )
31
+ end
32
+
9
33
  # Retrieve an existing call queue
10
34
  #
11
35
  # @overload retrieve(queue_name, request_options: {})
@@ -26,6 +50,75 @@ module Telnyx
26
50
  )
27
51
  end
28
52
 
53
+ # Update properties of an existing call queue.
54
+ #
55
+ # @overload update(queue_name, max_size:, request_options: {})
56
+ #
57
+ # @param queue_name [String] Uniquely identifies the queue by name
58
+ #
59
+ # @param max_size [Integer] The maximum number of calls allowed in the queue.
60
+ #
61
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
62
+ #
63
+ # @return [Telnyx::Models::QueueUpdateResponse]
64
+ #
65
+ # @see Telnyx::Models::QueueUpdateParams
66
+ def update(queue_name, params)
67
+ parsed, options = Telnyx::QueueUpdateParams.dump_request(params)
68
+ @client.request(
69
+ method: :post,
70
+ path: ["queues/%1$s", queue_name],
71
+ body: parsed,
72
+ model: Telnyx::Models::QueueUpdateResponse,
73
+ options: options
74
+ )
75
+ end
76
+
77
+ # List all queues for the authenticated user.
78
+ #
79
+ # @overload list(page_number: nil, page_size: nil, request_options: {})
80
+ #
81
+ # @param page_number [Integer] The page number to load
82
+ #
83
+ # @param page_size [Integer] The size of the page
84
+ #
85
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
86
+ #
87
+ # @return [Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Queue>]
88
+ #
89
+ # @see Telnyx::Models::QueueListParams
90
+ def list(params = {})
91
+ parsed, options = Telnyx::QueueListParams.dump_request(params)
92
+ @client.request(
93
+ method: :get,
94
+ path: "queues",
95
+ query: parsed.transform_keys(page_number: "page[number]", page_size: "page[size]"),
96
+ page: Telnyx::Internal::DefaultFlatPagination,
97
+ model: Telnyx::Queue,
98
+ options: options
99
+ )
100
+ end
101
+
102
+ # Delete an existing call queue.
103
+ #
104
+ # @overload delete(queue_name, request_options: {})
105
+ #
106
+ # @param queue_name [String] Uniquely identifies the queue by name
107
+ #
108
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
109
+ #
110
+ # @return [nil]
111
+ #
112
+ # @see Telnyx::Models::QueueDeleteParams
113
+ def delete(queue_name, params = {})
114
+ @client.request(
115
+ method: :delete,
116
+ path: ["queues/%1$s", queue_name],
117
+ model: NilClass,
118
+ options: params[:request_options]
119
+ )
120
+ end
121
+
29
122
  # @api private
30
123
  #
31
124
  # @param client [Telnyx::Client]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Telnyx
4
- VERSION = "5.41.0"
4
+ VERSION = "5.43.0"
5
5
  end
data/lib/telnyx.rb CHANGED
@@ -1448,6 +1448,8 @@ require_relative "telnyx/models/payment/auto_recharge_pref_list_params"
1448
1448
  require_relative "telnyx/models/payment/auto_recharge_pref_list_response"
1449
1449
  require_relative "telnyx/models/payment/auto_recharge_pref_update_params"
1450
1450
  require_relative "telnyx/models/payment/auto_recharge_pref_update_response"
1451
+ require_relative "telnyx/models/payment_create_stored_payment_transaction_params"
1452
+ require_relative "telnyx/models/payment_create_stored_payment_transaction_response"
1451
1453
  require_relative "telnyx/models/phone_number"
1452
1454
  require_relative "telnyx/models/phone_number_blocks/job"
1453
1455
  require_relative "telnyx/models/phone_number_blocks/job_delete_phone_number_block_params"
@@ -1675,6 +1677,11 @@ require_relative "telnyx/models/public_internet_gateway_retrieve_response"
1675
1677
  require_relative "telnyx/models/push_credential"
1676
1678
  require_relative "telnyx/models/push_credential_response"
1677
1679
  require_relative "telnyx/models/pwg_assigned_resources_summary"
1680
+ require_relative "telnyx/models/queue"
1681
+ require_relative "telnyx/models/queue_create_params"
1682
+ require_relative "telnyx/models/queue_create_response"
1683
+ require_relative "telnyx/models/queue_delete_params"
1684
+ require_relative "telnyx/models/queue_list_params"
1678
1685
  require_relative "telnyx/models/queue_retrieve_params"
1679
1686
  require_relative "telnyx/models/queue_retrieve_response"
1680
1687
  require_relative "telnyx/models/queues/call_list_params"
@@ -1683,6 +1690,8 @@ require_relative "telnyx/models/queues/call_remove_params"
1683
1690
  require_relative "telnyx/models/queues/call_retrieve_params"
1684
1691
  require_relative "telnyx/models/queues/call_retrieve_response"
1685
1692
  require_relative "telnyx/models/queues/call_update_params"
1693
+ require_relative "telnyx/models/queue_update_params"
1694
+ require_relative "telnyx/models/queue_update_response"
1686
1695
  require_relative "telnyx/models/rcs_agent"
1687
1696
  require_relative "telnyx/models/rcs_agent_message"
1688
1697
  require_relative "telnyx/models/rcs_agent_response"
@@ -287,6 +287,32 @@ module Telnyx
287
287
  end
288
288
  attr_writer :transcription_config
289
289
 
290
+ # A map of event types to retry policies. Each retry policy contains an array of
291
+ # `retries_ms` specifying the delays between retry attempts in milliseconds.
292
+ # Maximum 5 retries, total delay cannot exceed 60 seconds.
293
+ sig do
294
+ returns(
295
+ T.nilable(
296
+ T::Hash[
297
+ Symbol,
298
+ Telnyx::Calls::ActionAnswerParams::WebhookRetriesPolicy
299
+ ]
300
+ )
301
+ )
302
+ end
303
+ attr_reader :webhook_retries_policies
304
+
305
+ sig do
306
+ params(
307
+ webhook_retries_policies:
308
+ T::Hash[
309
+ Symbol,
310
+ Telnyx::Calls::ActionAnswerParams::WebhookRetriesPolicy::OrHash
311
+ ]
312
+ ).void
313
+ end
314
+ attr_writer :webhook_retries_policies
315
+
290
316
  # Use this field to override the URL for which Telnyx will send subsequent
291
317
  # webhooks to for this call.
292
318
  sig { returns(T.nilable(String)) }
@@ -313,6 +339,33 @@ module Telnyx
313
339
  end
314
340
  attr_writer :webhook_url_method
315
341
 
342
+ # A map of event types to webhook URLs. When an event of the specified type
343
+ # occurs, the webhook URL associated with that event type will be called instead
344
+ # of `webhook_url`. Events not mapped here will use the default `webhook_url`.
345
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
346
+ attr_reader :webhook_urls
347
+
348
+ sig { params(webhook_urls: T::Hash[Symbol, String]).void }
349
+ attr_writer :webhook_urls
350
+
351
+ # HTTP request method to invoke `webhook_urls`.
352
+ sig do
353
+ returns(
354
+ T.nilable(
355
+ Telnyx::Calls::ActionAnswerParams::WebhookURLsMethod::OrSymbol
356
+ )
357
+ )
358
+ end
359
+ attr_reader :webhook_urls_method
360
+
361
+ sig do
362
+ params(
363
+ webhook_urls_method:
364
+ Telnyx::Calls::ActionAnswerParams::WebhookURLsMethod::OrSymbol
365
+ ).void
366
+ end
367
+ attr_writer :webhook_urls_method
368
+
316
369
  sig do
317
370
  params(
318
371
  billing_group_id: String,
@@ -349,9 +402,17 @@ module Telnyx
349
402
  transcription: T::Boolean,
350
403
  transcription_config:
351
404
  Telnyx::Calls::TranscriptionStartRequest::OrHash,
405
+ webhook_retries_policies:
406
+ T::Hash[
407
+ Symbol,
408
+ Telnyx::Calls::ActionAnswerParams::WebhookRetriesPolicy::OrHash
409
+ ],
352
410
  webhook_url: String,
353
411
  webhook_url_method:
354
412
  Telnyx::Calls::ActionAnswerParams::WebhookURLMethod::OrSymbol,
413
+ webhook_urls: T::Hash[Symbol, String],
414
+ webhook_urls_method:
415
+ Telnyx::Calls::ActionAnswerParams::WebhookURLsMethod::OrSymbol,
355
416
  request_options: Telnyx::RequestOptions::OrHash
356
417
  ).returns(T.attached_class)
357
418
  end
@@ -421,11 +482,21 @@ module Telnyx
421
482
  # Enable transcription upon call answer. The default value is false.
422
483
  transcription: nil,
423
484
  transcription_config: nil,
485
+ # A map of event types to retry policies. Each retry policy contains an array of
486
+ # `retries_ms` specifying the delays between retry attempts in milliseconds.
487
+ # Maximum 5 retries, total delay cannot exceed 60 seconds.
488
+ webhook_retries_policies: nil,
424
489
  # Use this field to override the URL for which Telnyx will send subsequent
425
490
  # webhooks to for this call.
426
491
  webhook_url: nil,
427
492
  # HTTP request type used for `webhook_url`.
428
493
  webhook_url_method: nil,
494
+ # A map of event types to webhook URLs. When an event of the specified type
495
+ # occurs, the webhook URL associated with that event type will be called instead
496
+ # of `webhook_url`. Events not mapped here will use the default `webhook_url`.
497
+ webhook_urls: nil,
498
+ # HTTP request method to invoke `webhook_urls`.
499
+ webhook_urls_method: nil,
429
500
  request_options: {}
430
501
  )
431
502
  end
@@ -466,9 +537,17 @@ module Telnyx
466
537
  stream_url: String,
467
538
  transcription: T::Boolean,
468
539
  transcription_config: Telnyx::Calls::TranscriptionStartRequest,
540
+ webhook_retries_policies:
541
+ T::Hash[
542
+ Symbol,
543
+ Telnyx::Calls::ActionAnswerParams::WebhookRetriesPolicy
544
+ ],
469
545
  webhook_url: String,
470
546
  webhook_url_method:
471
547
  Telnyx::Calls::ActionAnswerParams::WebhookURLMethod::OrSymbol,
548
+ webhook_urls: T::Hash[Symbol, String],
549
+ webhook_urls_method:
550
+ Telnyx::Calls::ActionAnswerParams::WebhookURLsMethod::OrSymbol,
472
551
  request_options: Telnyx::RequestOptions
473
552
  }
474
553
  )
@@ -698,6 +777,38 @@ module Telnyx
698
777
  end
699
778
  end
700
779
 
780
+ class WebhookRetriesPolicy < Telnyx::Internal::Type::BaseModel
781
+ OrHash =
782
+ T.type_alias do
783
+ T.any(
784
+ Telnyx::Calls::ActionAnswerParams::WebhookRetriesPolicy,
785
+ Telnyx::Internal::AnyHash
786
+ )
787
+ end
788
+
789
+ # Array of delays in milliseconds between retry attempts. Total sum cannot exceed
790
+ # 60000ms.
791
+ sig { returns(T.nilable(T::Array[Integer])) }
792
+ attr_reader :retries_ms
793
+
794
+ sig { params(retries_ms: T::Array[Integer]).void }
795
+ attr_writer :retries_ms
796
+
797
+ sig do
798
+ params(retries_ms: T::Array[Integer]).returns(T.attached_class)
799
+ end
800
+ def self.new(
801
+ # Array of delays in milliseconds between retry attempts. Total sum cannot exceed
802
+ # 60000ms.
803
+ retries_ms: nil
804
+ )
805
+ end
806
+
807
+ sig { override.returns({ retries_ms: T::Array[Integer] }) }
808
+ def to_hash
809
+ end
810
+ end
811
+
701
812
  # HTTP request type used for `webhook_url`.
702
813
  module WebhookURLMethod
703
814
  extend Telnyx::Internal::Type::Enum
@@ -729,6 +840,41 @@ module Telnyx
729
840
  def self.values
730
841
  end
731
842
  end
843
+
844
+ # HTTP request method to invoke `webhook_urls`.
845
+ module WebhookURLsMethod
846
+ extend Telnyx::Internal::Type::Enum
847
+
848
+ TaggedSymbol =
849
+ T.type_alias do
850
+ T.all(
851
+ Symbol,
852
+ Telnyx::Calls::ActionAnswerParams::WebhookURLsMethod
853
+ )
854
+ end
855
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
856
+
857
+ POST =
858
+ T.let(
859
+ :POST,
860
+ Telnyx::Calls::ActionAnswerParams::WebhookURLsMethod::TaggedSymbol
861
+ )
862
+ GET =
863
+ T.let(
864
+ :GET,
865
+ Telnyx::Calls::ActionAnswerParams::WebhookURLsMethod::TaggedSymbol
866
+ )
867
+
868
+ sig do
869
+ override.returns(
870
+ T::Array[
871
+ Telnyx::Calls::ActionAnswerParams::WebhookURLsMethod::TaggedSymbol
872
+ ]
873
+ )
874
+ end
875
+ def self.values
876
+ end
877
+ end
732
878
  end
733
879
  end
734
880
  end
@@ -33,6 +33,14 @@ module Telnyx
33
33
  sig { params(command_id: String).void }
34
34
  attr_writer :command_id
35
35
 
36
+ # Specifies behavior after the bridge ends. If set to `true`, the current leg will
37
+ # be put on hold after unbridge instead of being hung up.
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :hold_after_unbridge
40
+
41
+ sig { params(hold_after_unbridge: T::Boolean).void }
42
+ attr_writer :hold_after_unbridge
43
+
36
44
  # When enabled, DTMF tones are not passed to the call participant. The webhooks
37
45
  # containing the DTMF information will be sent.
38
46
  sig do
@@ -236,6 +244,7 @@ module Telnyx
236
244
  call_control_id_to_bridge_with: String,
237
245
  client_state: String,
238
246
  command_id: String,
247
+ hold_after_unbridge: T::Boolean,
239
248
  mute_dtmf: Telnyx::Calls::ActionBridgeParams::MuteDtmf::OrSymbol,
240
249
  park_after_unbridge: String,
241
250
  play_ringtone: T::Boolean,
@@ -269,6 +278,9 @@ module Telnyx
269
278
  # Use this field to avoid duplicate commands. Telnyx will ignore any command with
270
279
  # the same `command_id` for the same `call_control_id`.
271
280
  command_id: nil,
281
+ # Specifies behavior after the bridge ends. If set to `true`, the current leg will
282
+ # be put on hold after unbridge instead of being hung up.
283
+ hold_after_unbridge: nil,
272
284
  # When enabled, DTMF tones are not passed to the call participant. The webhooks
273
285
  # containing the DTMF information will be sent.
274
286
  mute_dtmf: nil,
@@ -336,6 +348,7 @@ module Telnyx
336
348
  call_control_id_to_bridge_with: String,
337
349
  client_state: String,
338
350
  command_id: String,
351
+ hold_after_unbridge: T::Boolean,
339
352
  mute_dtmf: Telnyx::Calls::ActionBridgeParams::MuteDtmf::OrSymbol,
340
353
  park_after_unbridge: String,
341
354
  play_ringtone: T::Boolean,
@@ -28,10 +28,20 @@ module Telnyx
28
28
  sig { params(command_id: String).void }
29
29
  attr_writer :command_id
30
30
 
31
+ # Custom headers to be added to the SIP BYE message.
32
+ sig { returns(T.nilable(T::Array[Telnyx::CustomSipHeader])) }
33
+ attr_reader :custom_headers
34
+
35
+ sig do
36
+ params(custom_headers: T::Array[Telnyx::CustomSipHeader::OrHash]).void
37
+ end
38
+ attr_writer :custom_headers
39
+
31
40
  sig do
32
41
  params(
33
42
  client_state: String,
34
43
  command_id: String,
44
+ custom_headers: T::Array[Telnyx::CustomSipHeader::OrHash],
35
45
  request_options: Telnyx::RequestOptions::OrHash
36
46
  ).returns(T.attached_class)
37
47
  end
@@ -42,6 +52,8 @@ module Telnyx
42
52
  # Use this field to avoid duplicate commands. Telnyx will ignore any command with
43
53
  # the same `command_id` for the same `call_control_id`.
44
54
  command_id: nil,
55
+ # Custom headers to be added to the SIP BYE message.
56
+ custom_headers: nil,
45
57
  request_options: {}
46
58
  )
47
59
  end
@@ -51,6 +63,7 @@ module Telnyx
51
63
  {
52
64
  client_state: String,
53
65
  command_id: String,
66
+ custom_headers: T::Array[Telnyx::CustomSipHeader],
54
67
  request_options: Telnyx::RequestOptions
55
68
  }
56
69
  )
@@ -0,0 +1,43 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Models
5
+ class PaymentCreateStoredPaymentTransactionParams < Telnyx::Internal::Type::BaseModel
6
+ extend Telnyx::Internal::Type::RequestParameters::Converter
7
+ include Telnyx::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Telnyx::PaymentCreateStoredPaymentTransactionParams,
13
+ Telnyx::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Amount in dollars and cents, e.g. "120.00"
18
+ sig { returns(String) }
19
+ attr_accessor :amount
20
+
21
+ sig do
22
+ params(
23
+ amount: String,
24
+ request_options: Telnyx::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(
28
+ # Amount in dollars and cents, e.g. "120.00"
29
+ amount:,
30
+ request_options: {}
31
+ )
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ { amount: String, request_options: Telnyx::RequestOptions }
37
+ )
38
+ end
39
+ def to_hash
40
+ end
41
+ end
42
+ end
43
+ end