telnyx 5.151.0 → 5.152.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -538
- data/README.md +1 -1
- data/lib/telnyx/models/advanced_order_create_params.rb +1 -86
- data/lib/telnyx/models/advanced_order_update_requirement_group_params.rb +1 -88
- data/lib/telnyx/models/dir/email_verification_status_wrapped.rb +82 -0
- data/lib/telnyx/models/dir/reference.rb +125 -0
- data/lib/telnyx/models/dir/reference_create_params.rb +43 -0
- data/lib/telnyx/models/dir/reference_input.rb +74 -0
- data/lib/telnyx/models/dir/reference_list.rb +18 -0
- data/lib/telnyx/models/dir/reference_list_params.rb +22 -0
- data/lib/telnyx/models/dir/reference_update_params.rb +103 -0
- data/lib/telnyx/models/dir/reference_update_response.rb +23 -0
- data/lib/telnyx/models/dir/verify_email_confirm_params.rb +31 -0
- data/lib/telnyx/models/dir/verify_email_create_params.rb +22 -0
- data/lib/telnyx/models/dir/verify_email_list_params.rb +22 -0
- data/lib/telnyx/models/dir_update_infringement_params.rb +6 -2
- data/lib/telnyx/models/enterprises/dir_create_params.rb +10 -10
- data/lib/telnyx/models/storage/kv_create_params.rb +24 -0
- data/lib/telnyx/models/storage/kv_delete_params.rb +22 -0
- data/lib/telnyx/models/storage/kv_list_params.rb +32 -0
- data/lib/telnyx/models/storage/kv_namespace.rb +75 -0
- data/lib/telnyx/models/storage/kv_namespace_response_wrapper.rb +18 -0
- data/lib/telnyx/models/storage/kv_retrieve_params.rb +22 -0
- data/lib/telnyx/models/storage/kvs/key_delete_params.rb +30 -0
- data/lib/telnyx/models/storage/kvs/key_list_params.rb +49 -0
- data/lib/telnyx/models/storage/kvs/key_list_response.rb +82 -0
- data/lib/telnyx/models/storage/kvs/key_retrieve_params.rb +30 -0
- data/lib/telnyx/models/storage/kvs/key_update_params.rb +53 -0
- data/lib/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_params.rb +31 -0
- data/lib/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_response.rb +54 -0
- data/lib/telnyx/resources/dir/references.rb +139 -0
- data/lib/telnyx/resources/dir/verify_email.rb +91 -0
- data/lib/telnyx/resources/dir.rb +17 -1
- data/lib/telnyx/resources/documents.rb +1 -1
- data/lib/telnyx/resources/enterprises/dir.rb +3 -3
- data/lib/telnyx/resources/storage/kvs/keys.rb +154 -0
- data/lib/telnyx/resources/storage/kvs.rb +115 -0
- data/lib/telnyx/resources/storage.rb +5 -0
- data/lib/telnyx/resources/whatsapp/phone_numbers.rb +27 -0
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +28 -2
- data/rbi/telnyx/models/advanced_order_create_params.rbi +4 -198
- data/rbi/telnyx/models/advanced_order_update_requirement_group_params.rbi +2 -219
- data/rbi/telnyx/models/ai/assistant_get_texml_response.rbi +1 -1
- data/rbi/telnyx/models/ai/assistants/instruction_enhance_response.rbi +1 -1
- data/rbi/telnyx/models/dir/email_verification_status_wrapped.rbi +184 -0
- data/rbi/telnyx/models/dir/reference.rbi +162 -0
- data/rbi/telnyx/models/dir/reference_create_params.rbi +66 -0
- data/rbi/telnyx/models/dir/reference_input.rbi +93 -0
- data/rbi/telnyx/models/dir/reference_list.rbi +29 -0
- data/rbi/telnyx/models/dir/reference_list_params.rbi +37 -0
- data/rbi/telnyx/models/dir/reference_update_params.rbi +154 -0
- data/rbi/telnyx/models/dir/reference_update_response.rbi +39 -0
- data/rbi/telnyx/models/dir/verify_email_confirm_params.rbi +54 -0
- data/rbi/telnyx/models/dir/verify_email_create_params.rbi +40 -0
- data/rbi/telnyx/models/dir/verify_email_list_params.rbi +37 -0
- data/rbi/telnyx/models/dir_update_infringement_params.rbi +4 -2
- data/rbi/telnyx/models/enterprises/dir_create_params.rbi +10 -13
- data/rbi/telnyx/models/messaging_profiles/autoresp_config_delete_response.rbi +1 -1
- data/rbi/telnyx/models/storage/kv_create_params.rbi +42 -0
- data/rbi/telnyx/models/storage/kv_delete_params.rbi +37 -0
- data/rbi/telnyx/models/storage/kv_list_params.rbi +59 -0
- data/rbi/telnyx/models/storage/kv_namespace.rbi +131 -0
- data/rbi/telnyx/models/storage/kv_namespace_response_wrapper.rbi +35 -0
- data/rbi/telnyx/models/storage/kv_retrieve_params.rbi +37 -0
- data/rbi/telnyx/models/storage/kvs/key_delete_params.rbi +50 -0
- data/rbi/telnyx/models/storage/kvs/key_list_params.rbi +81 -0
- data/rbi/telnyx/models/storage/kvs/key_list_response.rbi +179 -0
- data/rbi/telnyx/models/storage/kvs/key_retrieve_params.rbi +50 -0
- data/rbi/telnyx/models/storage/kvs/key_update_params.rbi +77 -0
- data/rbi/telnyx/models/sub_number_orders_report_download_response.rbi +1 -1
- data/rbi/telnyx/models/telephony_credential_create_token_response.rbi +1 -1
- data/rbi/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_params.rbi +54 -0
- data/rbi/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_response.rbi +125 -0
- data/rbi/telnyx/models/wireguard_peer_retrieve_config_response.rbi +1 -1
- data/rbi/telnyx/resources/dir/references.rbi +114 -0
- data/rbi/telnyx/resources/dir/verify_email.rbi +70 -0
- data/rbi/telnyx/resources/dir.rbi +13 -1
- data/rbi/telnyx/resources/enterprises/dir.rbi +4 -4
- data/rbi/telnyx/resources/storage/kvs/keys.rbi +115 -0
- data/rbi/telnyx/resources/storage/kvs.rbi +87 -0
- data/rbi/telnyx/resources/storage.rbi +4 -0
- data/rbi/telnyx/resources/whatsapp/phone_numbers.rbi +21 -0
- data/sig/telnyx/models/advanced_order_create_params.rbs +3 -99
- data/sig/telnyx/models/advanced_order_update_requirement_group_params.rbs +3 -94
- data/sig/telnyx/models/dir/email_verification_status_wrapped.rbs +69 -0
- data/sig/telnyx/models/dir/reference.rbs +88 -0
- data/sig/telnyx/models/dir/reference_create_params.rbs +38 -0
- data/sig/telnyx/models/dir/reference_input.rbs +52 -0
- data/sig/telnyx/models/dir/reference_list.rbs +15 -0
- data/sig/telnyx/models/dir/reference_list_params.rbs +25 -0
- data/sig/telnyx/models/dir/reference_update_params.rbs +92 -0
- data/sig/telnyx/models/dir/reference_update_response.rbs +15 -0
- data/sig/telnyx/models/dir/verify_email_confirm_params.rbs +30 -0
- data/sig/telnyx/models/dir/verify_email_create_params.rbs +25 -0
- data/sig/telnyx/models/dir/verify_email_list_params.rbs +25 -0
- data/sig/telnyx/models/enterprises/dir_create_params.rbs +5 -7
- data/sig/telnyx/models/storage/kv_create_params.rbs +25 -0
- data/sig/telnyx/models/storage/kv_delete_params.rbs +22 -0
- data/sig/telnyx/models/storage/kv_list_params.rbs +34 -0
- data/sig/telnyx/models/storage/kv_namespace.rbs +80 -0
- data/sig/telnyx/models/storage/kv_namespace_response_wrapper.rbs +20 -0
- data/sig/telnyx/models/storage/kv_retrieve_params.rbs +22 -0
- data/sig/telnyx/models/storage/kvs/key_delete_params.rbs +32 -0
- data/sig/telnyx/models/storage/kvs/key_list_params.rbs +46 -0
- data/sig/telnyx/models/storage/kvs/key_list_response.rbs +88 -0
- data/sig/telnyx/models/storage/kvs/key_retrieve_params.rbs +32 -0
- data/sig/telnyx/models/storage/kvs/key_update_params.rbs +47 -0
- data/sig/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_params.rbs +30 -0
- data/sig/telnyx/models/whatsapp/phone_number_retrieve_conversation_window_response.rbs +66 -0
- data/sig/telnyx/resources/dir/references.rbs +35 -0
- data/sig/telnyx/resources/dir/verify_email.rbs +25 -0
- data/sig/telnyx/resources/dir.rbs +4 -0
- data/sig/telnyx/resources/enterprises/dir.rbs +1 -1
- data/sig/telnyx/resources/storage/kvs/keys.rbs +39 -0
- data/sig/telnyx/resources/storage/kvs.rbs +32 -0
- data/sig/telnyx/resources/storage.rbs +2 -0
- data/sig/telnyx/resources/whatsapp/phone_numbers.rbs +6 -0
- metadata +85 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
# Some parameter documentations has been truncated, see
|
|
11
|
+
# {Telnyx::Models::Dir::ReferenceCreateParams} for more details.
|
|
12
|
+
#
|
|
13
|
+
# Submit the two business references and one financial reference for a DIR.
|
|
14
|
+
#
|
|
15
|
+
# The DIR's authorizer email must be verified first (see the email-verification
|
|
16
|
+
# endpoint). Until it is, this returns `409` and no references are stored.
|
|
17
|
+
#
|
|
18
|
+
# The request body carries exactly two business references plus one financial
|
|
19
|
+
# reference. On success the references are stored and the response echoes them in
|
|
20
|
+
# the same shape as the GET. Submitting again converges on the already-stored
|
|
21
|
+
# references rather than erroring.
|
|
22
|
+
#
|
|
23
|
+
# @overload create(dir_id, business_references:, financial_reference:, request_options: {})
|
|
24
|
+
#
|
|
25
|
+
# @param dir_id [String] The DIR id. Lowercase UUID.
|
|
26
|
+
#
|
|
27
|
+
# @param business_references [Array<Telnyx::Models::Dir::ReferenceInput>] Exactly two business references.
|
|
28
|
+
#
|
|
29
|
+
# @param financial_reference [Telnyx::Models::Dir::ReferenceInput] One reference supplied at submit. The reference type is implied by the field tha
|
|
30
|
+
#
|
|
31
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
32
|
+
#
|
|
33
|
+
# @return [Telnyx::Models::Dir::ReferenceList]
|
|
34
|
+
#
|
|
35
|
+
# @see Telnyx::Models::Dir::ReferenceCreateParams
|
|
36
|
+
def create(dir_id, params)
|
|
37
|
+
parsed, options = Telnyx::Dir::ReferenceCreateParams.dump_request(params)
|
|
38
|
+
@client.request(
|
|
39
|
+
method: :post,
|
|
40
|
+
path: ["dir/%1$s/references", dir_id],
|
|
41
|
+
body: parsed,
|
|
42
|
+
model: Telnyx::Dir::ReferenceList,
|
|
43
|
+
options: options
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Some parameter documentations has been truncated, see
|
|
48
|
+
# {Telnyx::Models::Dir::ReferenceUpdateParams} for more details.
|
|
49
|
+
#
|
|
50
|
+
# Partially update one reference, addressed by the DIR id plus the reference's
|
|
51
|
+
# type (business or financial) and slot.
|
|
52
|
+
#
|
|
53
|
+
# Cosmetic fields (full name, job title, organization, relationship, email) are
|
|
54
|
+
# always editable. The phone number and timezone may only be changed while a
|
|
55
|
+
# scheduled call has not yet been dialed; if a call is in progress or all attempts
|
|
56
|
+
# are complete, those fields are locked. Changing the timezone reschedules any
|
|
57
|
+
# pending call into the new local calling window.
|
|
58
|
+
#
|
|
59
|
+
# @overload update(slot, dir_id:, ref_type:, email: nil, full_name: nil, job_title: nil, organization: nil, phone_e164: nil, relationship_to_registrant: nil, timezone: nil, request_options: {})
|
|
60
|
+
#
|
|
61
|
+
# @param slot [Integer] Path param: Reference slot. Business references use slots 0 and 1; the financial
|
|
62
|
+
#
|
|
63
|
+
# @param dir_id [String] Path param: The DIR id. Lowercase UUID.
|
|
64
|
+
#
|
|
65
|
+
# @param ref_type [Symbol, Telnyx::Models::Dir::ReferenceUpdateParams::RefType] Path param: Reference type to address.
|
|
66
|
+
#
|
|
67
|
+
# @param email [String] Body param: Reference contact email address.
|
|
68
|
+
#
|
|
69
|
+
# @param full_name [String] Body param: Full name of the reference contact.
|
|
70
|
+
#
|
|
71
|
+
# @param job_title [String, nil] Body param: Job title of the reference contact.
|
|
72
|
+
#
|
|
73
|
+
# @param organization [String, nil] Body param: Organization the reference contact belongs to.
|
|
74
|
+
#
|
|
75
|
+
# @param phone_e164 [String] Body param: Reference phone number in E.164 format.
|
|
76
|
+
#
|
|
77
|
+
# @param relationship_to_registrant [String, nil] Body param: How the reference contact is related to the registering business.
|
|
78
|
+
#
|
|
79
|
+
# @param timezone [String] Body param: IANA timezone id for the reference.
|
|
80
|
+
#
|
|
81
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
82
|
+
#
|
|
83
|
+
# @return [Telnyx::Models::Dir::ReferenceUpdateResponse]
|
|
84
|
+
#
|
|
85
|
+
# @see Telnyx::Models::Dir::ReferenceUpdateParams
|
|
86
|
+
def update(slot, params)
|
|
87
|
+
parsed, options = Telnyx::Dir::ReferenceUpdateParams.dump_request(params)
|
|
88
|
+
dir_id =
|
|
89
|
+
parsed.delete(:dir_id) do
|
|
90
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
91
|
+
end
|
|
92
|
+
ref_type =
|
|
93
|
+
parsed.delete(:ref_type) do
|
|
94
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
95
|
+
end
|
|
96
|
+
@client.request(
|
|
97
|
+
method: :patch,
|
|
98
|
+
path: ["dir/%1$s/references/%2$s/%3$s", dir_id, ref_type, slot],
|
|
99
|
+
body: parsed,
|
|
100
|
+
model: Telnyx::Models::Dir::ReferenceUpdateResponse,
|
|
101
|
+
options: options
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# List the business and financial references submitted for a DIR.
|
|
106
|
+
#
|
|
107
|
+
# Returns the two business references (slots 0 and 1) followed by the single
|
|
108
|
+
# financial reference. Each entry carries only the customer-supplied details
|
|
109
|
+
# (name, title, organization, relationship, phone, email, timezone). Returns an
|
|
110
|
+
# empty list when no references were submitted.
|
|
111
|
+
#
|
|
112
|
+
# @overload list(dir_id, request_options: {})
|
|
113
|
+
#
|
|
114
|
+
# @param dir_id [String] The DIR id. Lowercase UUID.
|
|
115
|
+
#
|
|
116
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
117
|
+
#
|
|
118
|
+
# @return [Telnyx::Models::Dir::ReferenceList]
|
|
119
|
+
#
|
|
120
|
+
# @see Telnyx::Models::Dir::ReferenceListParams
|
|
121
|
+
def list(dir_id, params = {})
|
|
122
|
+
@client.request(
|
|
123
|
+
method: :get,
|
|
124
|
+
path: ["dir/%1$s/references", dir_id],
|
|
125
|
+
model: Telnyx::Dir::ReferenceList,
|
|
126
|
+
options: params[:request_options]
|
|
127
|
+
)
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# @api private
|
|
131
|
+
#
|
|
132
|
+
# @param client [Telnyx::Client]
|
|
133
|
+
def initialize(client:)
|
|
134
|
+
@client = client
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
#
|
|
16
|
+
# @overload create(dir_id, request_options: {})
|
|
17
|
+
#
|
|
18
|
+
# @param dir_id [String] The DIR id. Lowercase UUID.
|
|
19
|
+
#
|
|
20
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
21
|
+
#
|
|
22
|
+
# @return [Telnyx::Models::Dir::EmailVerificationStatusWrapped]
|
|
23
|
+
#
|
|
24
|
+
# @see Telnyx::Models::Dir::VerifyEmailCreateParams
|
|
25
|
+
def create(dir_id, params = {})
|
|
26
|
+
@client.request(
|
|
27
|
+
method: :post,
|
|
28
|
+
path: ["dir/%1$s/verify_email", dir_id],
|
|
29
|
+
model: Telnyx::Dir::EmailVerificationStatusWrapped,
|
|
30
|
+
options: params[:request_options]
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Whether the DIR's current authorizer email has been verified.
|
|
35
|
+
#
|
|
36
|
+
# @overload list(dir_id, request_options: {})
|
|
37
|
+
#
|
|
38
|
+
# @param dir_id [String] The DIR id. Lowercase UUID.
|
|
39
|
+
#
|
|
40
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
41
|
+
#
|
|
42
|
+
# @return [Telnyx::Models::Dir::EmailVerificationStatusWrapped]
|
|
43
|
+
#
|
|
44
|
+
# @see Telnyx::Models::Dir::VerifyEmailListParams
|
|
45
|
+
def list(dir_id, params = {})
|
|
46
|
+
@client.request(
|
|
47
|
+
method: :get,
|
|
48
|
+
path: ["dir/%1$s/verify_email", dir_id],
|
|
49
|
+
model: Telnyx::Dir::EmailVerificationStatusWrapped,
|
|
50
|
+
options: params[:request_options]
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Submit the 6-digit code that was emailed to the DIR's authorizer email. On
|
|
55
|
+
# success the authorizer email is marked verified.
|
|
56
|
+
#
|
|
57
|
+
# For security, any failure (wrong, expired, already-used, or too many attempts)
|
|
58
|
+
# returns the same generic message.
|
|
59
|
+
#
|
|
60
|
+
# @overload confirm(dir_id, code:, request_options: {})
|
|
61
|
+
#
|
|
62
|
+
# @param dir_id [String] The DIR id. Lowercase UUID.
|
|
63
|
+
#
|
|
64
|
+
# @param code [String] The 6-digit code sent to the authorizer email.
|
|
65
|
+
#
|
|
66
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
67
|
+
#
|
|
68
|
+
# @return [Telnyx::Models::Dir::EmailVerificationStatusWrapped]
|
|
69
|
+
#
|
|
70
|
+
# @see Telnyx::Models::Dir::VerifyEmailConfirmParams
|
|
71
|
+
def confirm(dir_id, params)
|
|
72
|
+
parsed, options = Telnyx::Dir::VerifyEmailConfirmParams.dump_request(params)
|
|
73
|
+
@client.request(
|
|
74
|
+
method: :post,
|
|
75
|
+
path: ["dir/%1$s/verify_email/confirm", dir_id],
|
|
76
|
+
body: parsed,
|
|
77
|
+
model: Telnyx::Dir::EmailVerificationStatusWrapped,
|
|
78
|
+
options: options
|
|
79
|
+
)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# @api private
|
|
83
|
+
#
|
|
84
|
+
# @param client [Telnyx::Client]
|
|
85
|
+
def initialize(client:)
|
|
86
|
+
@client = client
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
data/lib/telnyx/resources/dir.rb
CHANGED
|
@@ -18,6 +18,17 @@ module Telnyx
|
|
|
18
18
|
# @return [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
|
+
# @return [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
|
+
# @return [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
|
#
|
|
@@ -298,6 +309,9 @@ module Telnyx
|
|
|
298
309
|
)
|
|
299
310
|
end
|
|
300
311
|
|
|
312
|
+
# Some parameter documentations has been truncated, see
|
|
313
|
+
# {Telnyx::Models::DirUpdateInfringementParams} for more details.
|
|
314
|
+
#
|
|
301
315
|
# Push a fix for a DIR that is `suspended` with an open infringement claim back
|
|
302
316
|
# into vetting. `POST /dir/{dir_id}/submit` is blocked while a claim is open, so
|
|
303
317
|
# this is the customer-callable path to update the DIR's content and re-certify
|
|
@@ -323,7 +337,7 @@ module Telnyx
|
|
|
323
337
|
#
|
|
324
338
|
# @param display_name [String, nil]
|
|
325
339
|
#
|
|
326
|
-
# @param documents [Array<Telnyx::Models::Document>, nil] Append-only supporting documents.
|
|
340
|
+
# @param documents [Array<Telnyx::Models::Document>, nil] Append-only supporting documents to attach while resolving the claim (e.g. autho
|
|
327
341
|
#
|
|
328
342
|
# @param logo_url [String, nil] Publicly accessible HTTPS URL (max 128 chars) to a 256x256 BMP logo (max 1 MB).
|
|
329
343
|
#
|
|
@@ -351,6 +365,8 @@ module Telnyx
|
|
|
351
365
|
@comments = Telnyx::Resources::Dir::Comments.new(client: client)
|
|
352
366
|
@phone_number_batches = Telnyx::Resources::Dir::PhoneNumberBatches.new(client: client)
|
|
353
367
|
@phone_numbers = Telnyx::Resources::Dir::PhoneNumbers.new(client: client)
|
|
368
|
+
@references = Telnyx::Resources::Dir::References.new(client: client)
|
|
369
|
+
@verify_email = Telnyx::Resources::Dir::VerifyEmail.new(client: client)
|
|
354
370
|
end
|
|
355
371
|
end
|
|
356
372
|
end
|
|
@@ -35,7 +35,7 @@ module Telnyx
|
|
|
35
35
|
# `POST /enterprises/{id}/branded_calling`).
|
|
36
36
|
# - `404` - enterprise does not exist or does not belong to your account.
|
|
37
37
|
#
|
|
38
|
-
# @overload create(enterprise_id, authorizer_email:, authorizer_name:, certify_brand_is_accurate:, certify_ip_ownership:, certify_no_shaft_content:, display_name:,
|
|
38
|
+
# @overload create(enterprise_id, authorizer_email:, authorizer_name:, call_reasons:, certify_brand_is_accurate:, certify_ip_ownership:, certify_no_shaft_content:, display_name:, documents: nil, logo_url: nil, reselling: nil, request_options: {})
|
|
39
39
|
#
|
|
40
40
|
# @param enterprise_id [String] The enterprise id. Lowercase UUID.
|
|
41
41
|
#
|
|
@@ -43,6 +43,8 @@ module Telnyx
|
|
|
43
43
|
#
|
|
44
44
|
# @param authorizer_name [String] Name of the person at your enterprise who is authorizing this DIR registration.
|
|
45
45
|
#
|
|
46
|
+
# @param call_reasons [Array<String>] 1–10 reasons your business calls customers. Validate phrasing against `POST /cal
|
|
47
|
+
#
|
|
46
48
|
# @param certify_brand_is_accurate [Boolean, Telnyx::Models::Enterprises::DirCreateParams::CertifyBrandIsAccurate] Must be `true`.
|
|
47
49
|
#
|
|
48
50
|
# @param certify_ip_ownership [Boolean, Telnyx::Models::Enterprises::DirCreateParams::CertifyIPOwnership] Must be `true`. Confirms ownership of any logos/trademarks shown.
|
|
@@ -51,8 +53,6 @@ module Telnyx
|
|
|
51
53
|
#
|
|
52
54
|
# @param display_name [String] Name shown to call recipients. No emoji; not whitespace-only.
|
|
53
55
|
#
|
|
54
|
-
# @param call_reasons [Array<String>] 1–10 reasons your business calls customers. Validate phrasing against `POST /cal
|
|
55
|
-
#
|
|
56
56
|
# @param documents [Array<Telnyx::Models::Document>] Supporting documents. Each `document_id` may appear at most once on a DIR.
|
|
57
57
|
#
|
|
58
58
|
# @param logo_url [String] Publicly accessible HTTPS URL (max 128 chars) to a 256x256 BMP logo (max 1 MB).
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
# Some parameter documentations has been truncated, see
|
|
10
|
+
# {Telnyx::Models::Storage::Kvs::KeyRetrieveParams} for more details.
|
|
11
|
+
#
|
|
12
|
+
# Returns the raw stored value for a key. The response body is the value exactly
|
|
13
|
+
# as it was written; the `Content-Type` header echoes the value's stored content
|
|
14
|
+
# type (defaults to `application/octet-stream`).
|
|
15
|
+
#
|
|
16
|
+
# @overload retrieve(key, id:, request_options: {})
|
|
17
|
+
#
|
|
18
|
+
# @param key [String] Key name. Allowed characters: `a-z A-Z 0-9 - _ / = .`; maximum 256 characters; n
|
|
19
|
+
#
|
|
20
|
+
# @param id [String] KV namespace ID
|
|
21
|
+
#
|
|
22
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
23
|
+
#
|
|
24
|
+
# @return [StringIO]
|
|
25
|
+
#
|
|
26
|
+
# @see Telnyx::Models::Storage::Kvs::KeyRetrieveParams
|
|
27
|
+
def retrieve(key, params)
|
|
28
|
+
parsed, options = Telnyx::Storage::Kvs::KeyRetrieveParams.dump_request(params)
|
|
29
|
+
id =
|
|
30
|
+
parsed.delete(:id) do
|
|
31
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
32
|
+
end
|
|
33
|
+
@client.request(
|
|
34
|
+
method: :get,
|
|
35
|
+
path: ["storage/kvs/%1$s/keys/%2$s", id, key],
|
|
36
|
+
headers: {"accept" => "*/*"},
|
|
37
|
+
model: StringIO,
|
|
38
|
+
options: options
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Some parameter documentations has been truncated, see
|
|
43
|
+
# {Telnyx::Models::Storage::Kvs::KeyUpdateParams} for more details.
|
|
44
|
+
#
|
|
45
|
+
# Creates or replaces the value for a key. The request body is stored verbatim as
|
|
46
|
+
# the value — no base64, no JSON envelope — up to 1 MiB. The request's
|
|
47
|
+
# `Content-Type` header is stored with the value and echoed back on retrieval.
|
|
48
|
+
# Returns `201` when the key is created and `200` when an existing key is updated.
|
|
49
|
+
#
|
|
50
|
+
# @overload update(key, id:, body:, ttl_secs: nil, request_options: {})
|
|
51
|
+
#
|
|
52
|
+
# @param key [String] Path param: Key name. Allowed characters: `a-z A-Z 0-9 - _ / = .`; maximum 256 c
|
|
53
|
+
#
|
|
54
|
+
# @param id [String] Path param: KV namespace ID
|
|
55
|
+
#
|
|
56
|
+
# @param body [Pathname, StringIO, IO, String, Telnyx::FilePart] Body param: Raw value bytes, stored verbatim.
|
|
57
|
+
#
|
|
58
|
+
# @param ttl_secs [Integer] Query param: Time-to-live in seconds. When set, the key expires and is deleted a
|
|
59
|
+
#
|
|
60
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
61
|
+
#
|
|
62
|
+
# @return [nil]
|
|
63
|
+
#
|
|
64
|
+
# @see Telnyx::Models::Storage::Kvs::KeyUpdateParams
|
|
65
|
+
def update(key, params)
|
|
66
|
+
parsed, options = Telnyx::Storage::Kvs::KeyUpdateParams.dump_request(params)
|
|
67
|
+
query = Telnyx::Internal::Util.encode_query_params(parsed.except(:body))
|
|
68
|
+
id =
|
|
69
|
+
parsed.delete(:id) do
|
|
70
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
71
|
+
end
|
|
72
|
+
@client.request(
|
|
73
|
+
method: :put,
|
|
74
|
+
path: ["storage/kvs/%1$s/keys/%2$s", id, key],
|
|
75
|
+
query: query,
|
|
76
|
+
headers: {"content-type" => "*/*"},
|
|
77
|
+
body: parsed[:body],
|
|
78
|
+
model: NilClass,
|
|
79
|
+
options: options
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Lists the keys in a namespace. Returns key names and metadata only, never
|
|
84
|
+
# values. Results are paginated with `limit` and an opaque `cursor`.
|
|
85
|
+
#
|
|
86
|
+
# @overload list(id, cursor: nil, limit: nil, prefix: nil, request_options: {})
|
|
87
|
+
#
|
|
88
|
+
# @param id [String] KV namespace ID
|
|
89
|
+
#
|
|
90
|
+
# @param cursor [String] Opaque pagination cursor from a previous response's `meta.cursor`.
|
|
91
|
+
#
|
|
92
|
+
# @param limit [Integer] Maximum number of keys to return. Values above 1000 are treated as 1000.
|
|
93
|
+
#
|
|
94
|
+
# @param prefix [String] Return only keys that start with this prefix.
|
|
95
|
+
#
|
|
96
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
97
|
+
#
|
|
98
|
+
# @return [Telnyx::Models::Storage::Kvs::KeyListResponse]
|
|
99
|
+
#
|
|
100
|
+
# @see Telnyx::Models::Storage::Kvs::KeyListParams
|
|
101
|
+
def list(id, params = {})
|
|
102
|
+
parsed, options = Telnyx::Storage::Kvs::KeyListParams.dump_request(params)
|
|
103
|
+
query = Telnyx::Internal::Util.encode_query_params(parsed)
|
|
104
|
+
@client.request(
|
|
105
|
+
method: :get,
|
|
106
|
+
path: ["storage/kvs/%1$s/keys", id],
|
|
107
|
+
query: query,
|
|
108
|
+
model: Telnyx::Models::Storage::Kvs::KeyListResponse,
|
|
109
|
+
options: options
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Some parameter documentations has been truncated, see
|
|
114
|
+
# {Telnyx::Models::Storage::Kvs::KeyDeleteParams} for more details.
|
|
115
|
+
#
|
|
116
|
+
# Deletes a key. Idempotent: deleting a key that does not exist still succeeds.
|
|
117
|
+
# The namespace itself must exist and be provisioned.
|
|
118
|
+
#
|
|
119
|
+
# @overload delete(key, id:, request_options: {})
|
|
120
|
+
#
|
|
121
|
+
# @param key [String] Key name. Allowed characters: `a-z A-Z 0-9 - _ / = .`; maximum 256 characters; n
|
|
122
|
+
#
|
|
123
|
+
# @param id [String] KV namespace ID
|
|
124
|
+
#
|
|
125
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
126
|
+
#
|
|
127
|
+
# @return [nil]
|
|
128
|
+
#
|
|
129
|
+
# @see Telnyx::Models::Storage::Kvs::KeyDeleteParams
|
|
130
|
+
def delete(key, params)
|
|
131
|
+
parsed, options = Telnyx::Storage::Kvs::KeyDeleteParams.dump_request(params)
|
|
132
|
+
id =
|
|
133
|
+
parsed.delete(:id) do
|
|
134
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
135
|
+
end
|
|
136
|
+
@client.request(
|
|
137
|
+
method: :delete,
|
|
138
|
+
path: ["storage/kvs/%1$s/keys/%2$s", id, key],
|
|
139
|
+
model: NilClass,
|
|
140
|
+
options: options
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# @api private
|
|
145
|
+
#
|
|
146
|
+
# @param client [Telnyx::Client]
|
|
147
|
+
def initialize(client:)
|
|
148
|
+
@client = client
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Resources
|
|
5
|
+
class Storage
|
|
6
|
+
# Manage KV storage namespaces
|
|
7
|
+
class Kvs
|
|
8
|
+
# Read and write keys within a KV namespace
|
|
9
|
+
# @return [Telnyx::Resources::Storage::Kvs::Keys]
|
|
10
|
+
attr_reader :keys
|
|
11
|
+
|
|
12
|
+
# Creates a new KV namespace. Provisioning is asynchronous: the namespace is
|
|
13
|
+
# returned with status `pending` and becomes usable once it reaches
|
|
14
|
+
# `provision_ok`.
|
|
15
|
+
#
|
|
16
|
+
# @overload create(name:, request_options: {})
|
|
17
|
+
#
|
|
18
|
+
# @param name [String] Namespace name. May contain lowercase letters, numbers, and hyphens only.
|
|
19
|
+
#
|
|
20
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
21
|
+
#
|
|
22
|
+
# @return [Telnyx::Models::Storage::KvNamespaceResponseWrapper]
|
|
23
|
+
#
|
|
24
|
+
# @see Telnyx::Models::Storage::KvCreateParams
|
|
25
|
+
def create(params)
|
|
26
|
+
parsed, options = Telnyx::Storage::KvCreateParams.dump_request(params)
|
|
27
|
+
@client.request(
|
|
28
|
+
method: :post,
|
|
29
|
+
path: "storage/kvs",
|
|
30
|
+
body: parsed,
|
|
31
|
+
model: Telnyx::Storage::KvNamespaceResponseWrapper,
|
|
32
|
+
options: options
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Retrieves a KV namespace by its ID, including its provisioning status.
|
|
37
|
+
#
|
|
38
|
+
# @overload retrieve(id, request_options: {})
|
|
39
|
+
#
|
|
40
|
+
# @param id [String] KV namespace ID
|
|
41
|
+
#
|
|
42
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
43
|
+
#
|
|
44
|
+
# @return [Telnyx::Models::Storage::KvNamespaceResponseWrapper]
|
|
45
|
+
#
|
|
46
|
+
# @see Telnyx::Models::Storage::KvRetrieveParams
|
|
47
|
+
def retrieve(id, params = {})
|
|
48
|
+
@client.request(
|
|
49
|
+
method: :get,
|
|
50
|
+
path: ["storage/kvs/%1$s", id],
|
|
51
|
+
model: Telnyx::Storage::KvNamespaceResponseWrapper,
|
|
52
|
+
options: params[:request_options]
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Lists the KV namespaces for the authenticated user's organization. Results use
|
|
57
|
+
# page-based pagination (`page[number]`/`page[size]`).
|
|
58
|
+
#
|
|
59
|
+
# @overload list(page_number: nil, page_size: nil, request_options: {})
|
|
60
|
+
#
|
|
61
|
+
# @param page_number [Integer] The page number to load.
|
|
62
|
+
#
|
|
63
|
+
# @param page_size [Integer] The size of the page. Values above 250 are treated as 250.
|
|
64
|
+
#
|
|
65
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
66
|
+
#
|
|
67
|
+
# @return [Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Storage::KvNamespace>]
|
|
68
|
+
#
|
|
69
|
+
# @see Telnyx::Models::Storage::KvListParams
|
|
70
|
+
def list(params = {})
|
|
71
|
+
parsed, options = Telnyx::Storage::KvListParams.dump_request(params)
|
|
72
|
+
query = Telnyx::Internal::Util.encode_query_params(parsed)
|
|
73
|
+
@client.request(
|
|
74
|
+
method: :get,
|
|
75
|
+
path: "storage/kvs",
|
|
76
|
+
query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
|
|
77
|
+
page: Telnyx::Internal::DefaultFlatPagination,
|
|
78
|
+
model: Telnyx::Storage::KvNamespace,
|
|
79
|
+
options: options
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Deletes a KV namespace and all of the keys it contains. Deletion is
|
|
84
|
+
# asynchronous: the namespace is returned with status `deleting`. Deleting a
|
|
85
|
+
# namespace whose deletion is already in progress returns a `409`.
|
|
86
|
+
#
|
|
87
|
+
# @overload delete(id, request_options: {})
|
|
88
|
+
#
|
|
89
|
+
# @param id [String] KV namespace ID
|
|
90
|
+
#
|
|
91
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
92
|
+
#
|
|
93
|
+
# @return [Telnyx::Models::Storage::KvNamespaceResponseWrapper]
|
|
94
|
+
#
|
|
95
|
+
# @see Telnyx::Models::Storage::KvDeleteParams
|
|
96
|
+
def delete(id, params = {})
|
|
97
|
+
@client.request(
|
|
98
|
+
method: :delete,
|
|
99
|
+
path: ["storage/kvs/%1$s", id],
|
|
100
|
+
model: Telnyx::Storage::KvNamespaceResponseWrapper,
|
|
101
|
+
options: params[:request_options]
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# @api private
|
|
106
|
+
#
|
|
107
|
+
# @param client [Telnyx::Client]
|
|
108
|
+
def initialize(client:)
|
|
109
|
+
@client = client
|
|
110
|
+
@keys = Telnyx::Resources::Storage::Kvs::Keys.new(client: client)
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
@@ -16,6 +16,10 @@ module Telnyx
|
|
|
16
16
|
# @return [Telnyx::Resources::Storage::Migrations]
|
|
17
17
|
attr_reader :migrations
|
|
18
18
|
|
|
19
|
+
# Manage KV storage namespaces
|
|
20
|
+
# @return [Telnyx::Resources::Storage::Kvs]
|
|
21
|
+
attr_reader :kvs
|
|
22
|
+
|
|
19
23
|
# List Migration Source coverage
|
|
20
24
|
#
|
|
21
25
|
# @overload list_migration_source_coverage(request_options: {})
|
|
@@ -42,6 +46,7 @@ module Telnyx
|
|
|
42
46
|
@buckets = Telnyx::Resources::Storage::Buckets.new(client: client)
|
|
43
47
|
@migration_sources = Telnyx::Resources::Storage::MigrationSources.new(client: client)
|
|
44
48
|
@migrations = Telnyx::Resources::Storage::Migrations.new(client: client)
|
|
49
|
+
@kvs = Telnyx::Resources::Storage::Kvs.new(client: client)
|
|
45
50
|
end
|
|
46
51
|
end
|
|
47
52
|
end
|
|
@@ -81,6 +81,33 @@ module Telnyx
|
|
|
81
81
|
)
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
# Returns whether the 24-hour conversation window is currently open for a given
|
|
85
|
+
# source/destination pair. If window_active is false, only template messages may
|
|
86
|
+
# be sent.
|
|
87
|
+
#
|
|
88
|
+
# @overload retrieve_conversation_window(phone_number, destination_number:, request_options: {})
|
|
89
|
+
#
|
|
90
|
+
# @param phone_number [String] Phone number (E.164 format)
|
|
91
|
+
#
|
|
92
|
+
# @param destination_number [String] Destination phone number in E.164 format
|
|
93
|
+
#
|
|
94
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
95
|
+
#
|
|
96
|
+
# @return [Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse]
|
|
97
|
+
#
|
|
98
|
+
# @see Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowParams
|
|
99
|
+
def retrieve_conversation_window(phone_number, params)
|
|
100
|
+
parsed, options = Telnyx::Whatsapp::PhoneNumberRetrieveConversationWindowParams.dump_request(params)
|
|
101
|
+
query = Telnyx::Internal::Util.encode_query_params(parsed)
|
|
102
|
+
@client.request(
|
|
103
|
+
method: :get,
|
|
104
|
+
path: ["v2/whatsapp/phone_numbers/%1$s/conversation_window", phone_number],
|
|
105
|
+
query: query,
|
|
106
|
+
model: Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse,
|
|
107
|
+
options: options
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
|
|
84
111
|
# Submit verification code for a phone number
|
|
85
112
|
#
|
|
86
113
|
# @overload verify(phone_number, code:, request_options: {})
|
data/lib/telnyx/version.rb
CHANGED