telnyx 5.151.0 → 5.153.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 (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -533
  3. data/README.md +1 -1
  4. data/lib/telnyx/internal/cursor_flat_pagination.rb +106 -0
  5. data/lib/telnyx/models/advanced_order_create_params.rb +1 -86
  6. data/lib/telnyx/models/advanced_order_update_requirement_group_params.rb +1 -88
  7. data/lib/telnyx/models/dir/email_verification_status_wrapped.rb +82 -0
  8. data/lib/telnyx/models/dir/reference.rb +125 -0
  9. data/lib/telnyx/models/dir/reference_create_params.rb +43 -0
  10. data/lib/telnyx/models/dir/reference_input.rb +74 -0
  11. data/lib/telnyx/models/dir/reference_list.rb +18 -0
  12. data/lib/telnyx/models/dir/reference_list_params.rb +22 -0
  13. data/lib/telnyx/models/dir/reference_update_params.rb +103 -0
  14. data/lib/telnyx/models/dir/reference_update_response.rb +23 -0
  15. data/lib/telnyx/models/dir/verify_email_confirm_params.rb +31 -0
  16. data/lib/telnyx/models/dir/verify_email_create_params.rb +22 -0
  17. data/lib/telnyx/models/dir/verify_email_list_params.rb +22 -0
  18. data/lib/telnyx/models/dir_update_infringement_params.rb +6 -2
  19. data/lib/telnyx/models/enterprises/dir_create_params.rb +10 -10
  20. data/lib/telnyx/models/storage/kv_create_params.rb +24 -0
  21. data/lib/telnyx/models/storage/kv_delete_params.rb +22 -0
  22. data/lib/telnyx/models/storage/kv_list_params.rb +32 -0
  23. data/lib/telnyx/models/storage/kv_namespace.rb +75 -0
  24. data/lib/telnyx/models/storage/kv_namespace_response_wrapper.rb +18 -0
  25. data/lib/telnyx/models/storage/kv_retrieve_params.rb +22 -0
  26. data/lib/telnyx/models/storage/kvs/key_delete_params.rb +30 -0
  27. data/lib/telnyx/models/storage/kvs/key_list_params.rb +49 -0
  28. data/lib/telnyx/models/storage/kvs/key_list_response.rb +35 -0
  29. data/lib/telnyx/models/storage/kvs/key_retrieve_params.rb +30 -0
  30. data/lib/telnyx/models/storage/kvs/key_update_params.rb +53 -0
  31. data/lib/telnyx/models/uac_inbound.rb +25 -1
  32. data/lib/telnyx/models/uac_inbound_request.rb +25 -1
  33. data/lib/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_params.rb +31 -0
  34. data/lib/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_response.rb +54 -0
  35. data/lib/telnyx/resources/dir/references.rb +139 -0
  36. data/lib/telnyx/resources/dir/verify_email.rb +91 -0
  37. data/lib/telnyx/resources/dir.rb +17 -1
  38. data/lib/telnyx/resources/documents.rb +1 -1
  39. data/lib/telnyx/resources/enterprises/dir.rb +3 -3
  40. data/lib/telnyx/resources/storage/kvs/keys.rb +155 -0
  41. data/lib/telnyx/resources/storage/kvs.rb +115 -0
  42. data/lib/telnyx/resources/storage.rb +5 -0
  43. data/lib/telnyx/resources/whatsapp/phone_numbers.rb +27 -0
  44. data/lib/telnyx/version.rb +1 -1
  45. data/lib/telnyx.rb +29 -2
  46. data/rbi/telnyx/internal/cursor_flat_pagination.rbi +48 -0
  47. data/rbi/telnyx/models/advanced_order_create_params.rbi +4 -198
  48. data/rbi/telnyx/models/advanced_order_update_requirement_group_params.rbi +2 -219
  49. data/rbi/telnyx/models/ai/assistant_get_texml_response.rbi +1 -1
  50. data/rbi/telnyx/models/ai/assistants/instruction_enhance_response.rbi +1 -1
  51. data/rbi/telnyx/models/dir/email_verification_status_wrapped.rbi +184 -0
  52. data/rbi/telnyx/models/dir/reference.rbi +162 -0
  53. data/rbi/telnyx/models/dir/reference_create_params.rbi +66 -0
  54. data/rbi/telnyx/models/dir/reference_input.rbi +93 -0
  55. data/rbi/telnyx/models/dir/reference_list.rbi +29 -0
  56. data/rbi/telnyx/models/dir/reference_list_params.rbi +37 -0
  57. data/rbi/telnyx/models/dir/reference_update_params.rbi +154 -0
  58. data/rbi/telnyx/models/dir/reference_update_response.rbi +39 -0
  59. data/rbi/telnyx/models/dir/verify_email_confirm_params.rbi +54 -0
  60. data/rbi/telnyx/models/dir/verify_email_create_params.rbi +40 -0
  61. data/rbi/telnyx/models/dir/verify_email_list_params.rbi +37 -0
  62. data/rbi/telnyx/models/dir_update_infringement_params.rbi +4 -2
  63. data/rbi/telnyx/models/enterprises/dir_create_params.rbi +10 -13
  64. data/rbi/telnyx/models/messaging_profiles/autoresp_config_delete_response.rbi +1 -1
  65. data/rbi/telnyx/models/storage/kv_create_params.rbi +42 -0
  66. data/rbi/telnyx/models/storage/kv_delete_params.rbi +37 -0
  67. data/rbi/telnyx/models/storage/kv_list_params.rbi +59 -0
  68. data/rbi/telnyx/models/storage/kv_namespace.rbi +131 -0
  69. data/rbi/telnyx/models/storage/kv_namespace_response_wrapper.rbi +35 -0
  70. data/rbi/telnyx/models/storage/kv_retrieve_params.rbi +37 -0
  71. data/rbi/telnyx/models/storage/kvs/key_delete_params.rbi +50 -0
  72. data/rbi/telnyx/models/storage/kvs/key_list_params.rbi +81 -0
  73. data/rbi/telnyx/models/storage/kvs/key_list_response.rbi +59 -0
  74. data/rbi/telnyx/models/storage/kvs/key_retrieve_params.rbi +50 -0
  75. data/rbi/telnyx/models/storage/kvs/key_update_params.rbi +77 -0
  76. data/rbi/telnyx/models/sub_number_orders_report_download_response.rbi +1 -1
  77. data/rbi/telnyx/models/telephony_credential_create_token_response.rbi +1 -1
  78. data/rbi/telnyx/models/uac_inbound.rbi +36 -0
  79. data/rbi/telnyx/models/uac_inbound_request.rbi +39 -0
  80. data/rbi/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_params.rbi +54 -0
  81. data/rbi/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_response.rbi +125 -0
  82. data/rbi/telnyx/models/wireguard_peer_retrieve_config_response.rbi +1 -1
  83. data/rbi/telnyx/resources/dir/references.rbi +114 -0
  84. data/rbi/telnyx/resources/dir/verify_email.rbi +70 -0
  85. data/rbi/telnyx/resources/dir.rbi +13 -1
  86. data/rbi/telnyx/resources/enterprises/dir.rbi +4 -4
  87. data/rbi/telnyx/resources/storage/kvs/keys.rbi +122 -0
  88. data/rbi/telnyx/resources/storage/kvs.rbi +87 -0
  89. data/rbi/telnyx/resources/storage.rbi +4 -0
  90. data/rbi/telnyx/resources/whatsapp/phone_numbers.rbi +21 -0
  91. data/sig/telnyx/internal/cursor_flat_pagination.rbs +28 -0
  92. data/sig/telnyx/models/advanced_order_create_params.rbs +3 -99
  93. data/sig/telnyx/models/advanced_order_update_requirement_group_params.rbs +3 -94
  94. data/sig/telnyx/models/dir/email_verification_status_wrapped.rbs +69 -0
  95. data/sig/telnyx/models/dir/reference.rbs +88 -0
  96. data/sig/telnyx/models/dir/reference_create_params.rbs +38 -0
  97. data/sig/telnyx/models/dir/reference_input.rbs +52 -0
  98. data/sig/telnyx/models/dir/reference_list.rbs +15 -0
  99. data/sig/telnyx/models/dir/reference_list_params.rbs +25 -0
  100. data/sig/telnyx/models/dir/reference_update_params.rbs +92 -0
  101. data/sig/telnyx/models/dir/reference_update_response.rbs +15 -0
  102. data/sig/telnyx/models/dir/verify_email_confirm_params.rbs +30 -0
  103. data/sig/telnyx/models/dir/verify_email_create_params.rbs +25 -0
  104. data/sig/telnyx/models/dir/verify_email_list_params.rbs +25 -0
  105. data/sig/telnyx/models/enterprises/dir_create_params.rbs +5 -7
  106. data/sig/telnyx/models/storage/kv_create_params.rbs +25 -0
  107. data/sig/telnyx/models/storage/kv_delete_params.rbs +22 -0
  108. data/sig/telnyx/models/storage/kv_list_params.rbs +34 -0
  109. data/sig/telnyx/models/storage/kv_namespace.rbs +80 -0
  110. data/sig/telnyx/models/storage/kv_namespace_response_wrapper.rbs +20 -0
  111. data/sig/telnyx/models/storage/kv_retrieve_params.rbs +22 -0
  112. data/sig/telnyx/models/storage/kvs/key_delete_params.rbs +32 -0
  113. data/sig/telnyx/models/storage/kvs/key_list_params.rbs +46 -0
  114. data/sig/telnyx/models/storage/kvs/key_list_response.rbs +32 -0
  115. data/sig/telnyx/models/storage/kvs/key_retrieve_params.rbs +32 -0
  116. data/sig/telnyx/models/storage/kvs/key_update_params.rbs +47 -0
  117. data/sig/telnyx/models/uac_inbound.rbs +21 -0
  118. data/sig/telnyx/models/uac_inbound_request.rbs +21 -0
  119. data/sig/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_params.rbs +30 -0
  120. data/sig/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_response.rbs +66 -0
  121. data/sig/telnyx/resources/dir/references.rbs +35 -0
  122. data/sig/telnyx/resources/dir/verify_email.rbs +25 -0
  123. data/sig/telnyx/resources/dir.rbs +4 -0
  124. data/sig/telnyx/resources/enterprises/dir.rbs +1 -1
  125. data/sig/telnyx/resources/storage/kvs/keys.rbs +39 -0
  126. data/sig/telnyx/resources/storage/kvs.rbs +32 -0
  127. data/sig/telnyx/resources/storage.rbs +2 -0
  128. data/sig/telnyx/resources/whatsapp/phone_numbers.rbs +6 -0
  129. metadata +89 -2
@@ -128,6 +128,16 @@ module Telnyx
128
128
  sig { params(sip_compact_headers_enabled: T::Boolean).void }
129
129
  attr_writer :sip_compact_headers_enabled
130
130
 
131
+ # Selects which `sip_region` to receive inbound calls from. If null, the default
132
+ # region (US) will be used.
133
+ sig { returns(T.nilable(Telnyx::UacInboundRequest::SipRegion::OrSymbol)) }
134
+ attr_reader :sip_region
135
+
136
+ sig do
137
+ params(sip_region: Telnyx::UacInboundRequest::SipRegion::OrSymbol).void
138
+ end
139
+ attr_writer :sip_region
140
+
131
141
  # Time(sec) before aborting if connection is not made.
132
142
  sig { returns(T.nilable(Integer)) }
133
143
  attr_reader :timeout_1xx_secs
@@ -162,6 +172,7 @@ module Telnyx
162
172
  simultaneous_ringing:
163
173
  Telnyx::UacInboundRequest::SimultaneousRinging::OrSymbol,
164
174
  sip_compact_headers_enabled: T::Boolean,
175
+ sip_region: Telnyx::UacInboundRequest::SipRegion::OrSymbol,
165
176
  timeout_1xx_secs: Integer,
166
177
  timeout_2xx_secs: Integer
167
178
  ).returns(T.attached_class)
@@ -198,6 +209,9 @@ module Telnyx
198
209
  simultaneous_ringing: nil,
199
210
  # Defaults to true.
200
211
  sip_compact_headers_enabled: nil,
212
+ # Selects which `sip_region` to receive inbound calls from. If null, the default
213
+ # region (US) will be used.
214
+ sip_region: nil,
201
215
  # Time(sec) before aborting if connection is not made.
202
216
  timeout_1xx_secs: nil,
203
217
  # Time(sec) before aborting if call is unanswered (min: 1, max: 600).
@@ -223,6 +237,7 @@ module Telnyx
223
237
  simultaneous_ringing:
224
238
  Telnyx::UacInboundRequest::SimultaneousRinging::OrSymbol,
225
239
  sip_compact_headers_enabled: T::Boolean,
240
+ sip_region: Telnyx::UacInboundRequest::SipRegion::OrSymbol,
226
241
  timeout_1xx_secs: Integer,
227
242
  timeout_2xx_secs: Integer
228
243
  }
@@ -376,6 +391,30 @@ module Telnyx
376
391
  def self.values
377
392
  end
378
393
  end
394
+
395
+ # Selects which `sip_region` to receive inbound calls from. If null, the default
396
+ # region (US) will be used.
397
+ module SipRegion
398
+ extend Telnyx::Internal::Type::Enum
399
+
400
+ TaggedSymbol =
401
+ T.type_alias { T.all(Symbol, Telnyx::UacInboundRequest::SipRegion) }
402
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
403
+
404
+ US = T.let(:US, Telnyx::UacInboundRequest::SipRegion::TaggedSymbol)
405
+ EUROPE =
406
+ T.let(:Europe, Telnyx::UacInboundRequest::SipRegion::TaggedSymbol)
407
+ AUSTRALIA =
408
+ T.let(:Australia, Telnyx::UacInboundRequest::SipRegion::TaggedSymbol)
409
+
410
+ sig do
411
+ override.returns(
412
+ T::Array[Telnyx::UacInboundRequest::SipRegion::TaggedSymbol]
413
+ )
414
+ end
415
+ def self.values
416
+ end
417
+ end
379
418
  end
380
419
  end
381
420
  end
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Whatsapp
6
+ class PhoneNumberRetrieveConversationWindowParams < Telnyx::Internal::Type::BaseModel
7
+ extend Telnyx::Internal::Type::RequestParameters::Converter
8
+ include Telnyx::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Telnyx::Whatsapp::PhoneNumberRetrieveConversationWindowParams,
14
+ Telnyx::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :phone_number
20
+
21
+ # Destination phone number in E.164 format
22
+ sig { returns(String) }
23
+ attr_accessor :destination_number
24
+
25
+ sig do
26
+ params(
27
+ phone_number: String,
28
+ destination_number: String,
29
+ request_options: Telnyx::RequestOptions::OrHash
30
+ ).returns(T.attached_class)
31
+ end
32
+ def self.new(
33
+ phone_number:,
34
+ # Destination phone number in E.164 format
35
+ destination_number:,
36
+ request_options: {}
37
+ )
38
+ end
39
+
40
+ sig do
41
+ override.returns(
42
+ {
43
+ phone_number: String,
44
+ destination_number: String,
45
+ request_options: Telnyx::RequestOptions
46
+ }
47
+ )
48
+ end
49
+ def to_hash
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,125 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Whatsapp
6
+ class PhoneNumberRetrieveConversationWindowResponse < Telnyx::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse,
11
+ Telnyx::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig do
16
+ returns(
17
+ T.nilable(
18
+ Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse::Data
19
+ )
20
+ )
21
+ end
22
+ attr_reader :data
23
+
24
+ sig do
25
+ params(
26
+ data:
27
+ Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse::Data::OrHash
28
+ ).void
29
+ end
30
+ attr_writer :data
31
+
32
+ sig do
33
+ params(
34
+ data:
35
+ Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse::Data::OrHash
36
+ ).returns(T.attached_class)
37
+ end
38
+ def self.new(data: nil)
39
+ end
40
+
41
+ sig do
42
+ override.returns(
43
+ {
44
+ data:
45
+ Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse::Data
46
+ }
47
+ )
48
+ end
49
+ def to_hash
50
+ end
51
+
52
+ class Data < Telnyx::Internal::Type::BaseModel
53
+ OrHash =
54
+ T.type_alias do
55
+ T.any(
56
+ Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse::Data,
57
+ Telnyx::Internal::AnyHash
58
+ )
59
+ end
60
+
61
+ # Timestamp of the last inbound message that opened the window
62
+ sig { returns(T.nilable(Time)) }
63
+ attr_reader :last_user_message_at
64
+
65
+ sig { params(last_user_message_at: Time).void }
66
+ attr_writer :last_user_message_at
67
+
68
+ # Whether the 24-hour conversation window is currently open
69
+ sig { returns(T.nilable(T::Boolean)) }
70
+ attr_reader :window_active
71
+
72
+ sig { params(window_active: T::Boolean).void }
73
+ attr_writer :window_active
74
+
75
+ # When the window closes. Null if no active window.
76
+ sig { returns(T.nilable(Time)) }
77
+ attr_reader :window_expires_at
78
+
79
+ sig { params(window_expires_at: Time).void }
80
+ attr_writer :window_expires_at
81
+
82
+ # Window type. Currently always 24h when present.
83
+ sig { returns(T.nilable(String)) }
84
+ attr_reader :window_type
85
+
86
+ sig { params(window_type: String).void }
87
+ attr_writer :window_type
88
+
89
+ sig do
90
+ params(
91
+ last_user_message_at: Time,
92
+ window_active: T::Boolean,
93
+ window_expires_at: Time,
94
+ window_type: String
95
+ ).returns(T.attached_class)
96
+ end
97
+ def self.new(
98
+ # Timestamp of the last inbound message that opened the window
99
+ last_user_message_at: nil,
100
+ # Whether the 24-hour conversation window is currently open
101
+ window_active: nil,
102
+ # When the window closes. Null if no active window.
103
+ window_expires_at: nil,
104
+ # Window type. Currently always 24h when present.
105
+ window_type: nil
106
+ )
107
+ end
108
+
109
+ sig do
110
+ override.returns(
111
+ {
112
+ last_user_message_at: Time,
113
+ window_active: T::Boolean,
114
+ window_expires_at: Time,
115
+ window_type: String
116
+ }
117
+ )
118
+ end
119
+ def to_hash
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Telnyx
4
4
  module Models
5
- WireguardPeerRetrieveConfigResponse = String
5
+ WireguardPeerRetrieveConfigResponse = T.type_alias { String }
6
6
  end
7
7
  end
@@ -0,0 +1,114 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Resources
5
+ class Dir
6
+ # Submit and manage the two business references and one financial reference that
7
+ # vouch for a DIR. References are contacted to confirm the business identity
8
+ # during vetting.
9
+ class References
10
+ # Submit the two business references and one financial reference for a DIR.
11
+ #
12
+ # The DIR's authorizer email must be verified first (see the email-verification
13
+ # endpoint). Until it is, this returns `409` and no references are stored.
14
+ #
15
+ # The request body carries exactly two business references plus one financial
16
+ # reference. On success the references are stored and the response echoes them in
17
+ # the same shape as the GET. Submitting again converges on the already-stored
18
+ # references rather than erroring.
19
+ sig do
20
+ params(
21
+ dir_id: String,
22
+ business_references: T::Array[Telnyx::Dir::ReferenceInput::OrHash],
23
+ financial_reference: Telnyx::Dir::ReferenceInput::OrHash,
24
+ request_options: Telnyx::RequestOptions::OrHash
25
+ ).returns(Telnyx::Dir::ReferenceList)
26
+ end
27
+ def create(
28
+ # The DIR id. Lowercase UUID.
29
+ dir_id,
30
+ # Exactly two business references.
31
+ business_references:,
32
+ # One reference supplied at submit. The reference type is implied by the field
33
+ # that carries it (business_references vs financial_reference).
34
+ financial_reference:,
35
+ request_options: {}
36
+ )
37
+ end
38
+
39
+ # Partially update one reference, addressed by the DIR id plus the reference's
40
+ # type (business or financial) and slot.
41
+ #
42
+ # Cosmetic fields (full name, job title, organization, relationship, email) are
43
+ # always editable. The phone number and timezone may only be changed while a
44
+ # scheduled call has not yet been dialed; if a call is in progress or all attempts
45
+ # are complete, those fields are locked. Changing the timezone reschedules any
46
+ # pending call into the new local calling window.
47
+ sig do
48
+ params(
49
+ slot: Integer,
50
+ dir_id: String,
51
+ ref_type: Telnyx::Dir::ReferenceUpdateParams::RefType::OrSymbol,
52
+ email: String,
53
+ full_name: String,
54
+ job_title: T.nilable(String),
55
+ organization: T.nilable(String),
56
+ phone_e164: String,
57
+ relationship_to_registrant: T.nilable(String),
58
+ timezone: String,
59
+ request_options: Telnyx::RequestOptions::OrHash
60
+ ).returns(Telnyx::Models::Dir::ReferenceUpdateResponse)
61
+ end
62
+ def update(
63
+ # Path param: Reference slot. Business references use slots 0 and 1; the financial
64
+ # reference uses slot 0.
65
+ slot,
66
+ # Path param: The DIR id. Lowercase UUID.
67
+ dir_id:,
68
+ # Path param: Reference type to address.
69
+ ref_type:,
70
+ # Body param: Reference contact email address.
71
+ email: nil,
72
+ # Body param: Full name of the reference contact.
73
+ full_name: nil,
74
+ # Body param: Job title of the reference contact.
75
+ job_title: nil,
76
+ # Body param: Organization the reference contact belongs to.
77
+ organization: nil,
78
+ # Body param: Reference phone number in E.164 format.
79
+ phone_e164: nil,
80
+ # Body param: How the reference contact is related to the registering business.
81
+ relationship_to_registrant: nil,
82
+ # Body param: IANA timezone id for the reference.
83
+ timezone: nil,
84
+ request_options: {}
85
+ )
86
+ end
87
+
88
+ # List the business and financial references submitted for a DIR.
89
+ #
90
+ # Returns the two business references (slots 0 and 1) followed by the single
91
+ # financial reference. Each entry carries only the customer-supplied details
92
+ # (name, title, organization, relationship, phone, email, timezone). Returns an
93
+ # empty list when no references were submitted.
94
+ sig do
95
+ params(
96
+ dir_id: String,
97
+ request_options: Telnyx::RequestOptions::OrHash
98
+ ).returns(Telnyx::Dir::ReferenceList)
99
+ end
100
+ def list(
101
+ # The DIR id. Lowercase UUID.
102
+ dir_id,
103
+ request_options: {}
104
+ )
105
+ end
106
+
107
+ # @api private
108
+ sig { params(client: Telnyx::Client).returns(T.attached_class) }
109
+ def self.new(client:)
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,70 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Resources
5
+ class Dir
6
+ # Verify ownership of a DIR's authorizer email. A short code is emailed and
7
+ # confirmed; the email must be verified before references can be submitted.
8
+ class VerifyEmail
9
+ # Email a 6-digit code to the DIR's authorizer email to confirm ownership of that
10
+ # address.
11
+ #
12
+ # The code expires in 15 minutes. Requesting a new code invalidates any previous
13
+ # one. Resends are rate limited (a short cooldown plus a daily cap). Submit the
14
+ # code to `POST /dir/{dir_id}/verify_email/confirm`.
15
+ sig do
16
+ params(
17
+ dir_id: String,
18
+ request_options: Telnyx::RequestOptions::OrHash
19
+ ).returns(Telnyx::Dir::EmailVerificationStatusWrapped)
20
+ end
21
+ def create(
22
+ # The DIR id. Lowercase UUID.
23
+ dir_id,
24
+ request_options: {}
25
+ )
26
+ end
27
+
28
+ # Whether the DIR's current authorizer email has been verified.
29
+ sig do
30
+ params(
31
+ dir_id: String,
32
+ request_options: Telnyx::RequestOptions::OrHash
33
+ ).returns(Telnyx::Dir::EmailVerificationStatusWrapped)
34
+ end
35
+ def list(
36
+ # The DIR id. Lowercase UUID.
37
+ dir_id,
38
+ request_options: {}
39
+ )
40
+ end
41
+
42
+ # Submit the 6-digit code that was emailed to the DIR's authorizer email. On
43
+ # success the authorizer email is marked verified.
44
+ #
45
+ # For security, any failure (wrong, expired, already-used, or too many attempts)
46
+ # returns the same generic message.
47
+ sig do
48
+ params(
49
+ dir_id: String,
50
+ code: String,
51
+ request_options: Telnyx::RequestOptions::OrHash
52
+ ).returns(Telnyx::Dir::EmailVerificationStatusWrapped)
53
+ end
54
+ def confirm(
55
+ # The DIR id. Lowercase UUID.
56
+ dir_id,
57
+ # The 6-digit code sent to the authorizer email.
58
+ code:,
59
+ request_options: {}
60
+ )
61
+ end
62
+
63
+ # @api private
64
+ sig { params(client: Telnyx::Client).returns(T.attached_class) }
65
+ def self.new(client:)
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -18,6 +18,17 @@ module Telnyx
18
18
  sig { returns(Telnyx::Resources::Dir::PhoneNumbers) }
19
19
  attr_reader :phone_numbers
20
20
 
21
+ # Submit and manage the two business references and one financial reference that
22
+ # vouch for a DIR. References are contacted to confirm the business identity
23
+ # during vetting.
24
+ sig { returns(Telnyx::Resources::Dir::References) }
25
+ attr_reader :references
26
+
27
+ # Verify ownership of a DIR's authorizer email. A short code is emailed and
28
+ # confirmed; the email must be verified before references can be submitted.
29
+ sig { returns(Telnyx::Resources::Dir::VerifyEmail) }
30
+ attr_reader :verify_email
31
+
21
32
  # Returns a single DIR by id. The enterprise is resolved server-side from the DIR
22
33
  # id. Returns `404` if the DIR does not exist or is not yours.
23
34
  sig do
@@ -294,7 +305,8 @@ module Telnyx
294
305
  infringement_resolution_notes:,
295
306
  call_reasons: nil,
296
307
  display_name: nil,
297
- # Append-only supporting documents.
308
+ # Append-only supporting documents to attach while resolving the claim (e.g.
309
+ # authorization or licensing proof).
298
310
  documents: nil,
299
311
  # Publicly accessible HTTPS URL (max 128 chars) to a 256x256 BMP logo (max 1 MB).
300
312
  logo_url: nil,
@@ -36,6 +36,7 @@ module Telnyx
36
36
  enterprise_id: String,
37
37
  authorizer_email: String,
38
38
  authorizer_name: String,
39
+ call_reasons: T::Array[String],
39
40
  certify_brand_is_accurate:
40
41
  Telnyx::Enterprises::DirCreateParams::CertifyBrandIsAccurate::OrBoolean,
41
42
  certify_ip_ownership:
@@ -43,7 +44,6 @@ module Telnyx
43
44
  certify_no_shaft_content:
44
45
  Telnyx::Enterprises::DirCreateParams::CertifyNoShaftContent::OrBoolean,
45
46
  display_name: String,
46
- call_reasons: T::Array[String],
47
47
  documents: T::Array[Telnyx::Document::OrHash],
48
48
  logo_url: String,
49
49
  reselling: T::Boolean,
@@ -59,6 +59,9 @@ module Telnyx
59
59
  # Name of the person at your enterprise who is authorizing this DIR registration.
60
60
  # Must be a real individual (used for audit and trademark-claim contests).
61
61
  authorizer_name:,
62
+ # 1–10 reasons your business calls customers. Validate phrasing against
63
+ # `POST /call_reasons/validate`.
64
+ call_reasons:,
62
65
  # Must be `true`.
63
66
  certify_brand_is_accurate:,
64
67
  # Must be `true`. Confirms ownership of any logos/trademarks shown.
@@ -68,9 +71,6 @@ module Telnyx
68
71
  certify_no_shaft_content:,
69
72
  # Name shown to call recipients. No emoji; not whitespace-only.
70
73
  display_name:,
71
- # 1–10 reasons your business calls customers. Validate phrasing against
72
- # `POST /call_reasons/validate`.
73
- call_reasons: nil,
74
74
  # Supporting documents. Each `document_id` may appear at most once on a DIR.
75
75
  documents: nil,
76
76
  # Publicly accessible HTTPS URL (max 128 chars) to a 256x256 BMP logo (max 1 MB).
@@ -0,0 +1,122 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Resources
5
+ class Storage
6
+ class Kvs
7
+ # Read and write keys within a KV namespace
8
+ class Keys
9
+ # Returns the raw stored value for a key. The response body is the value exactly
10
+ # as it was written; the `Content-Type` header echoes the value's stored content
11
+ # type (defaults to `application/octet-stream`).
12
+ sig do
13
+ params(
14
+ key: String,
15
+ id: String,
16
+ request_options: Telnyx::RequestOptions::OrHash
17
+ ).returns(StringIO)
18
+ end
19
+ def retrieve(
20
+ # Key name. Allowed characters: `a-z A-Z 0-9 - _ / = .`; maximum 256 characters;
21
+ # names starting with `_` are reserved for system use. May contain `/`. When
22
+ # calling the HTTP API directly, URL-encode the key so the whole string is treated
23
+ # as one key (for example `user/1` -> `user%2F1`). SDK users should pass the key
24
+ # raw - SDKs URL-encode path parameters automatically.
25
+ key,
26
+ # KV namespace ID
27
+ id:,
28
+ request_options: {}
29
+ )
30
+ end
31
+
32
+ # Creates or replaces the value for a key. The request body is stored verbatim as
33
+ # the value — no base64, no JSON envelope — up to 1 MiB. The request's
34
+ # `Content-Type` header is stored with the value and echoed back on retrieval.
35
+ # Returns `201` when the key is created and `200` when an existing key is updated.
36
+ sig do
37
+ params(
38
+ key: String,
39
+ id: String,
40
+ body: Telnyx::Internal::FileInput,
41
+ ttl_secs: Integer,
42
+ request_options: Telnyx::RequestOptions::OrHash
43
+ ).void
44
+ end
45
+ def update(
46
+ # Path param: Key name. Allowed characters: `a-z A-Z 0-9 - _ / = .`; maximum 256
47
+ # characters; names starting with `_` are reserved for system use. May contain
48
+ # `/`. When calling the HTTP API directly, URL-encode the key so the whole string
49
+ # is treated as one key (for example `user/1` -> `user%2F1`). SDK users should
50
+ # pass the key raw - SDKs URL-encode path parameters automatically.
51
+ key,
52
+ # Path param: KV namespace ID
53
+ id:,
54
+ # Body param: Raw value bytes, stored verbatim.
55
+ body:,
56
+ # Query param: Time-to-live in seconds. When set, the key expires and is deleted
57
+ # after this duration. Requires a namespace provisioned with TTL support;
58
+ # namespaces without it return a `409`.
59
+ ttl_secs: nil,
60
+ request_options: {}
61
+ )
62
+ end
63
+
64
+ # Lists the keys in a namespace. Returns key names and metadata only, never
65
+ # values. Results are paginated with `limit` and an opaque `cursor`.
66
+ sig do
67
+ params(
68
+ id: String,
69
+ cursor: String,
70
+ limit: Integer,
71
+ prefix: String,
72
+ request_options: Telnyx::RequestOptions::OrHash
73
+ ).returns(
74
+ Telnyx::Internal::CursorFlatPagination[
75
+ Telnyx::Models::Storage::Kvs::KeyListResponse
76
+ ]
77
+ )
78
+ end
79
+ def list(
80
+ # KV namespace ID
81
+ id,
82
+ # Opaque pagination cursor from a previous response's `meta.cursor`.
83
+ cursor: nil,
84
+ # Maximum number of keys to return. Values above 1000 are treated as 1000.
85
+ limit: nil,
86
+ # Return only keys that start with this prefix.
87
+ prefix: nil,
88
+ request_options: {}
89
+ )
90
+ end
91
+
92
+ # Deletes a key. Idempotent: deleting a key that does not exist still succeeds.
93
+ # The namespace itself must exist and be provisioned.
94
+ sig do
95
+ params(
96
+ key: String,
97
+ id: String,
98
+ request_options: Telnyx::RequestOptions::OrHash
99
+ ).void
100
+ end
101
+ def delete(
102
+ # Key name. Allowed characters: `a-z A-Z 0-9 - _ / = .`; maximum 256 characters;
103
+ # names starting with `_` are reserved for system use. May contain `/`. When
104
+ # calling the HTTP API directly, URL-encode the key so the whole string is treated
105
+ # as one key (for example `user/1` -> `user%2F1`). SDK users should pass the key
106
+ # raw - SDKs URL-encode path parameters automatically.
107
+ key,
108
+ # KV namespace ID
109
+ id:,
110
+ request_options: {}
111
+ )
112
+ end
113
+
114
+ # @api private
115
+ sig { params(client: Telnyx::Client).returns(T.attached_class) }
116
+ def self.new(client:)
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
122
+ end