twilio-ruby 7.10.7 → 7.11.1
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/.github/workflows/test-and-deploy.yml +43 -67
- data/.gitignore +0 -1
- data/CHANGES.md +46 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +154 -0
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +25 -6
- data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +48 -12
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +6 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +56 -2
- data/lib/twilio-ruby/rest/client.rb +0 -5
- data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +11 -1
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v2/action.rb +2 -2
- data/lib/twilio-ruby/rest/conversations/v2/communication.rb +43 -21
- data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +59 -21
- data/lib/twilio-ruby/rest/conversations/v2/conversation.rb +28 -28
- data/lib/twilio-ruby/rest/conversations/v2/operation.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v2/participant.rb +58 -58
- data/lib/twilio-ruby/rest/conversations/v2.rb +45 -45
- data/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +2 -2
- data/lib/twilio-ruby/rest/iam/v1/o_auth_app.rb +15 -2
- data/lib/twilio-ruby/rest/iam_base.rb +6 -1
- data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/call/event.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v3/metadata.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v3/query.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v3.rb +1 -1
- data/lib/twilio-ruby/rest/intelligence/v3/conversation.rb +8 -8
- data/lib/twilio-ruby/rest/intelligence/v3/rule_execution.rb +502 -0
- data/lib/twilio-ruby/rest/intelligence/v3.rb +6 -0
- data/lib/twilio-ruby/rest/knowledge/v2/chunk.rb +28 -0
- data/lib/twilio-ruby/rest/knowledge/v2/knowledge.rb +38 -0
- data/lib/twilio-ruby/rest/knowledge/v2/search.rb +8 -117
- data/lib/twilio-ruby/rest/knowledge/v2.rb +1 -2
- data/lib/twilio-ruby/rest/memory/v1/bulk.rb +9 -118
- data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +13 -5
- data/lib/twilio-ruby/rest/memory/v1/data_mapping.rb +6 -12
- data/lib/twilio-ruby/rest/memory/v1/identifier.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb +11 -132
- data/lib/twilio-ruby/rest/memory/v1/import.rb +28 -5
- data/lib/twilio-ruby/rest/memory/v1/lookup.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/observation.rb +70 -18
- data/lib/twilio-ruby/rest/memory/v1/operation.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/profile.rb +2 -2
- data/lib/twilio-ruby/rest/memory/v1/recall.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/revision.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/store.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/trait.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/trait_group.rb +56 -6
- data/lib/twilio-ruby/rest/memory/v1.rb +3 -46
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +0 -18
- data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +23 -4
- data/lib/twilio-ruby/rest/messaging/v3/typing_indicator.rb +4 -4
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +231 -0
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +238 -0
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +245 -0
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification_check.rb +224 -0
- data/lib/twilio-ruby/rest/numbers/v1.rb +24 -0
- data/lib/twilio-ruby/rest/{assistants/v1/session.rb → numbers/v2/caller_id.rb} +141 -127
- data/lib/twilio-ruby/rest/numbers/v2.rb +16 -0
- data/lib/twilio-ruby/rest/oauth/v2/authorize.rb +14 -2
- data/lib/twilio-ruby/rest/oauth/v2/oauth_authorization_server.rb +259 -0
- data/lib/twilio-ruby/rest/oauth/v2/token.rb +8 -2
- data/lib/twilio-ruby/rest/preview_iam/versionless/organization.rb +0 -19
- data/lib/twilio-ruby/rest/routes/v3/phone_number.rb +465 -0
- data/lib/twilio-ruby/rest/routes/v3.rb +50 -0
- data/lib/twilio-ruby/rest/routes_base.rb +6 -1
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration.rb +330 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration_embedded_session.rb +233 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration.rb +321 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration_embedded_session.rb +233 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb +445 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products_provisional_copy.rb +445 -0
- data/lib/twilio-ruby/rest/trusthub/v1.rb +74 -0
- data/lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb +556 -0
- data/lib/twilio-ruby/rest/voice/v2/configuration/default.rb +356 -0
- data/lib/twilio-ruby/rest/voice/v2/configuration.rb +412 -0
- data/lib/twilio-ruby/rest/voice/v2/recording.rb +616 -0
- data/lib/twilio-ruby/rest/voice/v2/transcription.rb +591 -0
- data/lib/twilio-ruby/rest/voice/v2/type.rb +518 -0
- data/lib/twilio-ruby/rest/voice/v2.rb +141 -0
- data/lib/twilio-ruby/rest/voice_base.rb +5 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +6 -68
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +33 -21
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb +0 -558
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +0 -558
- data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +0 -431
- data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +0 -296
- data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +0 -927
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +0 -325
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +0 -349
- data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +0 -871
- data/lib/twilio-ruby/rest/assistants/v1/policy.rb +0 -364
- data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +0 -360
- data/lib/twilio-ruby/rest/assistants/v1/tool.rb +0 -847
- data/lib/twilio-ruby/rest/assistants/v1.rb +0 -104
- data/lib/twilio-ruby/rest/assistants.rb +0 -6
- data/lib/twilio-ruby/rest/assistants_base.rb +0 -38
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
|
+
#
|
|
7
|
+
# Twilio - Trusthub
|
|
8
|
+
# This is the public Twilio REST API.
|
|
9
|
+
#
|
|
10
|
+
# NOTE: This class is auto generated by OpenAPI Generator.
|
|
11
|
+
# https://openapi-generator.tech
|
|
12
|
+
# Do not edit the class manually.
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
module Twilio
|
|
17
|
+
module REST
|
|
18
|
+
class Trusthub < TrusthubBase
|
|
19
|
+
class V1 < Version
|
|
20
|
+
class A2PBrandRegistrationList < ListResource
|
|
21
|
+
|
|
22
|
+
class TrusthubV1A2pBrandRegistrationRequest
|
|
23
|
+
# @param [brand_type]: [String] The type of brand being registered.
|
|
24
|
+
# @param [theme_set_id]: [String] Theme ID for styling the inquiry form.
|
|
25
|
+
# @param [friendly_name]: [String] A human-readable name for the brand registration.
|
|
26
|
+
# @param [notification_email]: [String] The email address to receive notifications about the registration.
|
|
27
|
+
# @param [business_name]: [String] The legal name of the business.
|
|
28
|
+
# @param [business_registration_authority]: [String] The authority with which the business is registered.
|
|
29
|
+
# @param [business_registration_number]: [String] The business registration number (e.g., EIN, CBN, ACN). Maximum 21 characters.
|
|
30
|
+
# @param [business_industry]: [String] The industry of the business.
|
|
31
|
+
# @param [business_website]: [String] The business website URL (must use https://).
|
|
32
|
+
# @param [business_type]: [String] The type of business entity.
|
|
33
|
+
# @param [business_stock_symbol]: [String] The stock symbol for publicly traded companies.
|
|
34
|
+
# @param [business_stock_exchange]: [String] The stock exchange where the business is listed.
|
|
35
|
+
# @param [business_tax_exempt_status]: [String] Nonprofit/political organization tax-exempt status per the U.S. tax code (e.g. 501c3, 501c1, 527). A value of 527 (political organization) requires a Campaign Verify token in brandExternalVettingToken.
|
|
36
|
+
# @param [brand_external_vetting_token]: [String] Campaign Verify token for externally vetted brands.
|
|
37
|
+
# @param [business_street_address]: [String] The street address of the business.
|
|
38
|
+
# @param [business_street_address2]: [String] Additional street address information.
|
|
39
|
+
# @param [business_city]: [String] The city of the business.
|
|
40
|
+
# @param [business_state_province_region]: [String] The state, province, or region of the business.
|
|
41
|
+
# @param [business_postal_code]: [String] The postal code of the business.
|
|
42
|
+
# @param [business_country]: [String] The two-letter ISO country code of the business.
|
|
43
|
+
# @param [business_contact_first_name]: [String] The first name of the business contact.
|
|
44
|
+
# @param [business_contact_last_name]: [String] The last name of the business contact.
|
|
45
|
+
# @param [business_contact_email]: [String] The email address of the business contact.
|
|
46
|
+
# @param [business_contact_phone]: [String] The phone number of the business contact in E.164 format.
|
|
47
|
+
# @param [authorized_contact_verification_email]: [String] The email address for authorized contact verification.
|
|
48
|
+
# @param [authorized_contact_mobile_phone_number_e164]: [String] The mobile phone number for authorized contact in E.164 format.
|
|
49
|
+
# @param [is_test]: [Boolean] Whether this is a test brand registration.
|
|
50
|
+
# @param [skip_automatic_sec_vet]: [Boolean] Whether to skip automatic secondary vetting.
|
|
51
|
+
attr_accessor :brand_type, :theme_set_id, :friendly_name, :notification_email, :business_name, :business_registration_authority, :business_registration_number, :business_industry, :business_website, :business_type, :business_stock_symbol, :business_stock_exchange, :business_tax_exempt_status, :brand_external_vetting_token, :business_street_address, :business_street_address2, :business_city, :business_state_province_region, :business_postal_code, :business_country, :business_contact_first_name, :business_contact_last_name, :business_contact_email, :business_contact_phone, :authorized_contact_verification_email, :authorized_contact_mobile_phone_number_e164, :is_test, :skip_automatic_sec_vet
|
|
52
|
+
def initialize(payload)
|
|
53
|
+
@brand_type = payload["brand_type"]
|
|
54
|
+
@theme_set_id = payload["theme_set_id"]
|
|
55
|
+
@friendly_name = payload["friendly_name"]
|
|
56
|
+
@notification_email = payload["notification_email"]
|
|
57
|
+
@business_name = payload["business_name"]
|
|
58
|
+
@business_registration_authority = payload["business_registration_authority"]
|
|
59
|
+
@business_registration_number = payload["business_registration_number"]
|
|
60
|
+
@business_industry = payload["business_industry"]
|
|
61
|
+
@business_website = payload["business_website"]
|
|
62
|
+
@business_type = payload["business_type"]
|
|
63
|
+
@business_stock_symbol = payload["business_stock_symbol"]
|
|
64
|
+
@business_stock_exchange = payload["business_stock_exchange"]
|
|
65
|
+
@business_tax_exempt_status = payload["business_tax_exempt_status"]
|
|
66
|
+
@brand_external_vetting_token = payload["brand_external_vetting_token"]
|
|
67
|
+
@business_street_address = payload["business_street_address"]
|
|
68
|
+
@business_street_address2 = payload["business_street_address2"]
|
|
69
|
+
@business_city = payload["business_city"]
|
|
70
|
+
@business_state_province_region = payload["business_state_province_region"]
|
|
71
|
+
@business_postal_code = payload["business_postal_code"]
|
|
72
|
+
@business_country = payload["business_country"]
|
|
73
|
+
@business_contact_first_name = payload["business_contact_first_name"]
|
|
74
|
+
@business_contact_last_name = payload["business_contact_last_name"]
|
|
75
|
+
@business_contact_email = payload["business_contact_email"]
|
|
76
|
+
@business_contact_phone = payload["business_contact_phone"]
|
|
77
|
+
@authorized_contact_verification_email = payload["authorized_contact_verification_email"]
|
|
78
|
+
@authorized_contact_mobile_phone_number_e164 = payload["authorized_contact_mobile_phone_number_e164"]
|
|
79
|
+
@is_test = payload["is_test"]
|
|
80
|
+
@skip_automatic_sec_vet = payload["skip_automatic_sec_vet"]
|
|
81
|
+
end
|
|
82
|
+
def to_json(options = {})
|
|
83
|
+
{
|
|
84
|
+
"brandType": @brand_type,
|
|
85
|
+
"themeSetId": @theme_set_id,
|
|
86
|
+
"friendlyName": @friendly_name,
|
|
87
|
+
"notificationEmail": @notification_email,
|
|
88
|
+
"businessName": @business_name,
|
|
89
|
+
"businessRegistrationAuthority": @business_registration_authority,
|
|
90
|
+
"businessRegistrationNumber": @business_registration_number,
|
|
91
|
+
"businessIndustry": @business_industry,
|
|
92
|
+
"businessWebsite": @business_website,
|
|
93
|
+
"businessType": @business_type,
|
|
94
|
+
"businessStockSymbol": @business_stock_symbol,
|
|
95
|
+
"businessStockExchange": @business_stock_exchange,
|
|
96
|
+
"businessTaxExemptStatus": @business_tax_exempt_status,
|
|
97
|
+
"brandExternalVettingToken": @brand_external_vetting_token,
|
|
98
|
+
"businessStreetAddress": @business_street_address,
|
|
99
|
+
"businessStreetAddress2": @business_street_address2,
|
|
100
|
+
"businessCity": @business_city,
|
|
101
|
+
"businessStateProvinceRegion": @business_state_province_region,
|
|
102
|
+
"businessPostalCode": @business_postal_code,
|
|
103
|
+
"businessCountry": @business_country,
|
|
104
|
+
"businessContactFirstName": @business_contact_first_name,
|
|
105
|
+
"businessContactLastName": @business_contact_last_name,
|
|
106
|
+
"businessContactEmail": @business_contact_email,
|
|
107
|
+
"businessContactPhone": @business_contact_phone,
|
|
108
|
+
"authorizedContactVerificationEmail": @authorized_contact_verification_email,
|
|
109
|
+
"authorizedContactMobilePhoneNumberE164": @authorized_contact_mobile_phone_number_e164,
|
|
110
|
+
"isTest": @is_test,
|
|
111
|
+
"skipAutomaticSecVet": @skip_automatic_sec_vet,
|
|
112
|
+
}.to_json(options)
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
##
|
|
118
|
+
# Initialize the A2PBrandRegistrationList
|
|
119
|
+
# @param [Version] version Version that contains the resource
|
|
120
|
+
# @return [A2PBrandRegistrationList] A2PBrandRegistrationList
|
|
121
|
+
def initialize(version)
|
|
122
|
+
super(version)
|
|
123
|
+
|
|
124
|
+
# Path Solution
|
|
125
|
+
@solution = { }
|
|
126
|
+
@uri = "/A2PBrandRegistrations"
|
|
127
|
+
|
|
128
|
+
end
|
|
129
|
+
##
|
|
130
|
+
# Create the A2PBrandRegistrationInstance
|
|
131
|
+
# @param [TrusthubV1A2pBrandRegistrationRequest] trusthub_v1_a2p_brand_registration_request
|
|
132
|
+
# @return [A2PBrandRegistrationInstance] Created A2PBrandRegistrationInstance
|
|
133
|
+
def create(trusthub_v1_a2p_brand_registration_request: nil
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
137
|
+
headers['Content-Type'] = 'application/json'
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
payload = @version.create('POST', @uri, headers: headers, data: trusthub_v1_a2p_brand_registration_request.to_json)
|
|
143
|
+
A2PBrandRegistrationInstance.new(
|
|
144
|
+
@version,
|
|
145
|
+
payload,
|
|
146
|
+
)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
##
|
|
150
|
+
# Create the A2PBrandRegistrationInstanceMetadata
|
|
151
|
+
# @param [TrusthubV1A2pBrandRegistrationRequest] trusthub_v1_a2p_brand_registration_request
|
|
152
|
+
# @return [A2PBrandRegistrationInstance] Created A2PBrandRegistrationInstance
|
|
153
|
+
def create_with_metadata(trusthub_v1_a2p_brand_registration_request: nil
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
157
|
+
headers['Content-Type'] = 'application/json'
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
response = @version.create_with_metadata('POST', @uri, headers: headers, data: trusthub_v1_a2p_brand_registration_request.to_json)
|
|
163
|
+
a2_p_brand_registration_instance = A2PBrandRegistrationInstance.new(
|
|
164
|
+
@version,
|
|
165
|
+
response.body,
|
|
166
|
+
)
|
|
167
|
+
A2PBrandRegistrationInstanceMetadata.new(
|
|
168
|
+
@version,
|
|
169
|
+
a2_p_brand_registration_instance,
|
|
170
|
+
response.headers,
|
|
171
|
+
response.status_code
|
|
172
|
+
)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
# Provide a user friendly representation
|
|
179
|
+
def to_s
|
|
180
|
+
'#<Twilio.Trusthub.V1.A2PBrandRegistrationList>'
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
class A2PBrandRegistrationPage < Page
|
|
185
|
+
##
|
|
186
|
+
# Initialize the A2PBrandRegistrationPage
|
|
187
|
+
# @param [Version] version Version that contains the resource
|
|
188
|
+
# @param [Response] response Response from the API
|
|
189
|
+
# @param [Hash] solution Path solution for the resource
|
|
190
|
+
# @return [A2PBrandRegistrationPage] A2PBrandRegistrationPage
|
|
191
|
+
def initialize(version, response, solution)
|
|
192
|
+
super(version, response)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
# Path Solution
|
|
196
|
+
@solution = solution
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
##
|
|
200
|
+
# Build an instance of A2PBrandRegistrationInstance
|
|
201
|
+
# @param [Hash] payload Payload response from the API
|
|
202
|
+
# @return [A2PBrandRegistrationInstance] A2PBrandRegistrationInstance
|
|
203
|
+
def get_instance(payload)
|
|
204
|
+
A2PBrandRegistrationInstance.new(@version, payload)
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
##
|
|
208
|
+
# Provide a user friendly representation
|
|
209
|
+
def to_s
|
|
210
|
+
'<Twilio.Trusthub.V1.A2PBrandRegistrationPage>'
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
class A2PBrandRegistrationPageMetadata < PageMetadata
|
|
215
|
+
attr_reader :a2_p_brand_registration_page
|
|
216
|
+
|
|
217
|
+
def initialize(version, response, solution, limit)
|
|
218
|
+
super(version, response)
|
|
219
|
+
@a2_p_brand_registration_page = []
|
|
220
|
+
@limit = limit
|
|
221
|
+
key = get_key(response.body)
|
|
222
|
+
records = 0
|
|
223
|
+
while( limit != :unset && records < limit )
|
|
224
|
+
@a2_p_brand_registration_page << A2PBrandRegistrationListResponse.new(version, @payload, key, limit - records)
|
|
225
|
+
@payload = self.next_page
|
|
226
|
+
break unless @payload
|
|
227
|
+
records += (@payload.body[key] || []).size
|
|
228
|
+
end
|
|
229
|
+
# Path Solution
|
|
230
|
+
@solution = solution
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
def each
|
|
234
|
+
@a2_p_brand_registration_page.each do |record|
|
|
235
|
+
yield record
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
def to_s
|
|
240
|
+
'<Twilio::REST::Trusthub::V1PageMetadata>';
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
class A2PBrandRegistrationListResponse < InstanceListResource
|
|
244
|
+
|
|
245
|
+
# @param [Array<A2PBrandRegistrationInstance>] instance
|
|
246
|
+
# @param [Hash{String => Object}] headers
|
|
247
|
+
# @param [Integer] status_code
|
|
248
|
+
def initialize(version, payload, key, limit = :unset)
|
|
249
|
+
data_list = payload.body[key] || []
|
|
250
|
+
if limit != :unset
|
|
251
|
+
data_list = data_list[0, limit]
|
|
252
|
+
end
|
|
253
|
+
@a2_p_brand_registration = data_list.map do |data|
|
|
254
|
+
A2PBrandRegistrationInstance.new(version, data)
|
|
255
|
+
end
|
|
256
|
+
@headers = payload.headers
|
|
257
|
+
@status_code = payload.status_code
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def a2_p_brand_registration
|
|
261
|
+
@a2_p_brand_registration
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
def headers
|
|
265
|
+
@headers
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
def status_code
|
|
269
|
+
@status_code
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
class A2PBrandRegistrationInstance < InstanceResource
|
|
274
|
+
##
|
|
275
|
+
# Initialize the A2PBrandRegistrationInstance
|
|
276
|
+
# @param [Version] version Version that contains the resource
|
|
277
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
278
|
+
# @param [String] account_sid The SID of the
|
|
279
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this A2PBrandRegistration
|
|
280
|
+
# resource.
|
|
281
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
282
|
+
# @return [A2PBrandRegistrationInstance] A2PBrandRegistrationInstance
|
|
283
|
+
def initialize(version, payload )
|
|
284
|
+
super(version)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
# Marshaled Properties
|
|
288
|
+
@properties = {
|
|
289
|
+
'id' => payload['id'],
|
|
290
|
+
'session_id' => payload['session_id'],
|
|
291
|
+
'session_token' => payload['session_token'],
|
|
292
|
+
}
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
##
|
|
297
|
+
# @return [String] The unique A2P Brand or Campaign Registration identifier, formatted as `tri1.us1.account.AC.../registration.BU...`.
|
|
298
|
+
def id
|
|
299
|
+
@properties['id']
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
##
|
|
303
|
+
# @return [String] The Persona inquiry ID used to start the embedded compliance session.
|
|
304
|
+
def session_id
|
|
305
|
+
@properties['session_id']
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
##
|
|
309
|
+
# @return [String] The Persona session token for embedding the compliance UI. Expires in 24 hours.
|
|
310
|
+
def session_token
|
|
311
|
+
@properties['session_token']
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
##
|
|
315
|
+
# Provide a user friendly representation
|
|
316
|
+
def to_s
|
|
317
|
+
"<Twilio.Trusthub.V1.A2PBrandRegistrationInstance>"
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
##
|
|
321
|
+
# Provide a detailed, user friendly representation
|
|
322
|
+
def inspect
|
|
323
|
+
"<Twilio.Trusthub.V1.A2PBrandRegistrationInstance>"
|
|
324
|
+
end
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
end
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
end
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
|
+
#
|
|
7
|
+
# Twilio - Trusthub
|
|
8
|
+
# This is the public Twilio REST API.
|
|
9
|
+
#
|
|
10
|
+
# NOTE: This class is auto generated by OpenAPI Generator.
|
|
11
|
+
# https://openapi-generator.tech
|
|
12
|
+
# Do not edit the class manually.
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
module Twilio
|
|
17
|
+
module REST
|
|
18
|
+
class Trusthub < TrusthubBase
|
|
19
|
+
class V1 < Version
|
|
20
|
+
class A2PBrandRegistrationEmbeddedSessionList < ListResource
|
|
21
|
+
|
|
22
|
+
##
|
|
23
|
+
# Initialize the A2PBrandRegistrationEmbeddedSessionList
|
|
24
|
+
# @param [Version] version Version that contains the resource
|
|
25
|
+
# @return [A2PBrandRegistrationEmbeddedSessionList] A2PBrandRegistrationEmbeddedSessionList
|
|
26
|
+
def initialize(version, id: nil)
|
|
27
|
+
super(version)
|
|
28
|
+
|
|
29
|
+
# Path Solution
|
|
30
|
+
@solution = { id: id }
|
|
31
|
+
@uri = "/A2PBrandRegistrations/#{@solution[:id]}/EmbeddedSessions"
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
##
|
|
35
|
+
# Create the A2PBrandRegistrationEmbeddedSessionInstance
|
|
36
|
+
# @return [A2PBrandRegistrationEmbeddedSessionInstance] Created A2PBrandRegistrationEmbeddedSessionInstance
|
|
37
|
+
def create
|
|
38
|
+
|
|
39
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
payload = @version.create('POST', @uri, headers: headers)
|
|
46
|
+
A2PBrandRegistrationEmbeddedSessionInstance.new(
|
|
47
|
+
@version,
|
|
48
|
+
payload,
|
|
49
|
+
id: @solution[:id],
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
##
|
|
54
|
+
# Create the A2PBrandRegistrationEmbeddedSessionInstanceMetadata
|
|
55
|
+
# @return [A2PBrandRegistrationEmbeddedSessionInstance] Created A2PBrandRegistrationEmbeddedSessionInstance
|
|
56
|
+
def create_with_metadata
|
|
57
|
+
|
|
58
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
response = @version.create_with_metadata('POST', @uri, headers: headers)
|
|
65
|
+
a2_p_brand_registration_embedded_session_instance = A2PBrandRegistrationEmbeddedSessionInstance.new(
|
|
66
|
+
@version,
|
|
67
|
+
response.body,
|
|
68
|
+
id: @solution[:id],
|
|
69
|
+
)
|
|
70
|
+
A2PBrandRegistrationEmbeddedSessionInstanceMetadata.new(
|
|
71
|
+
@version,
|
|
72
|
+
a2_p_brand_registration_embedded_session_instance,
|
|
73
|
+
response.headers,
|
|
74
|
+
response.status_code
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# Provide a user friendly representation
|
|
82
|
+
def to_s
|
|
83
|
+
'#<Twilio.Trusthub.V1.A2PBrandRegistrationEmbeddedSessionList>'
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
class A2PBrandRegistrationEmbeddedSessionPage < Page
|
|
88
|
+
##
|
|
89
|
+
# Initialize the A2PBrandRegistrationEmbeddedSessionPage
|
|
90
|
+
# @param [Version] version Version that contains the resource
|
|
91
|
+
# @param [Response] response Response from the API
|
|
92
|
+
# @param [Hash] solution Path solution for the resource
|
|
93
|
+
# @return [A2PBrandRegistrationEmbeddedSessionPage] A2PBrandRegistrationEmbeddedSessionPage
|
|
94
|
+
def initialize(version, response, solution)
|
|
95
|
+
super(version, response)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
# Path Solution
|
|
99
|
+
@solution = solution
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
##
|
|
103
|
+
# Build an instance of A2PBrandRegistrationEmbeddedSessionInstance
|
|
104
|
+
# @param [Hash] payload Payload response from the API
|
|
105
|
+
# @return [A2PBrandRegistrationEmbeddedSessionInstance] A2PBrandRegistrationEmbeddedSessionInstance
|
|
106
|
+
def get_instance(payload)
|
|
107
|
+
A2PBrandRegistrationEmbeddedSessionInstance.new(@version, payload, id: @solution[:id])
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
##
|
|
111
|
+
# Provide a user friendly representation
|
|
112
|
+
def to_s
|
|
113
|
+
'<Twilio.Trusthub.V1.A2PBrandRegistrationEmbeddedSessionPage>'
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
class A2PBrandRegistrationEmbeddedSessionPageMetadata < PageMetadata
|
|
118
|
+
attr_reader :a2_p_brand_registration_embedded_session_page
|
|
119
|
+
|
|
120
|
+
def initialize(version, response, solution, limit)
|
|
121
|
+
super(version, response)
|
|
122
|
+
@a2_p_brand_registration_embedded_session_page = []
|
|
123
|
+
@limit = limit
|
|
124
|
+
key = get_key(response.body)
|
|
125
|
+
records = 0
|
|
126
|
+
while( limit != :unset && records < limit )
|
|
127
|
+
@a2_p_brand_registration_embedded_session_page << A2PBrandRegistrationEmbeddedSessionListResponse.new(version, @payload, key, limit - records)
|
|
128
|
+
@payload = self.next_page
|
|
129
|
+
break unless @payload
|
|
130
|
+
records += (@payload.body[key] || []).size
|
|
131
|
+
end
|
|
132
|
+
# Path Solution
|
|
133
|
+
@solution = solution
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def each
|
|
137
|
+
@a2_p_brand_registration_embedded_session_page.each do |record|
|
|
138
|
+
yield record
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def to_s
|
|
143
|
+
'<Twilio::REST::Trusthub::V1PageMetadata>';
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
class A2PBrandRegistrationEmbeddedSessionListResponse < InstanceListResource
|
|
147
|
+
|
|
148
|
+
# @param [Array<A2PBrandRegistrationEmbeddedSessionInstance>] instance
|
|
149
|
+
# @param [Hash{String => Object}] headers
|
|
150
|
+
# @param [Integer] status_code
|
|
151
|
+
def initialize(version, payload, key, limit = :unset)
|
|
152
|
+
data_list = payload.body[key] || []
|
|
153
|
+
if limit != :unset
|
|
154
|
+
data_list = data_list[0, limit]
|
|
155
|
+
end
|
|
156
|
+
@a2_p_brand_registration_embedded_session = data_list.map do |data|
|
|
157
|
+
A2PBrandRegistrationEmbeddedSessionInstance.new(version, data)
|
|
158
|
+
end
|
|
159
|
+
@headers = payload.headers
|
|
160
|
+
@status_code = payload.status_code
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def a2_p_brand_registration_embedded_session
|
|
164
|
+
@a2_p_brand_registration_embedded_session
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def headers
|
|
168
|
+
@headers
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def status_code
|
|
172
|
+
@status_code
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
class A2PBrandRegistrationEmbeddedSessionInstance < InstanceResource
|
|
177
|
+
##
|
|
178
|
+
# Initialize the A2PBrandRegistrationEmbeddedSessionInstance
|
|
179
|
+
# @param [Version] version Version that contains the resource
|
|
180
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
181
|
+
# @param [String] account_sid The SID of the
|
|
182
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this A2PBrandRegistrationEmbeddedSession
|
|
183
|
+
# resource.
|
|
184
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
185
|
+
# @return [A2PBrandRegistrationEmbeddedSessionInstance] A2PBrandRegistrationEmbeddedSessionInstance
|
|
186
|
+
def initialize(version, payload , id: nil)
|
|
187
|
+
super(version)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
# Marshaled Properties
|
|
191
|
+
@properties = {
|
|
192
|
+
'id' => payload['id'],
|
|
193
|
+
'session_id' => payload['session_id'],
|
|
194
|
+
'session_token' => payload['session_token'],
|
|
195
|
+
}
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
##
|
|
200
|
+
# @return [String] The unique A2P Brand or Campaign Registration identifier, formatted as `tri1.us1.account.AC.../registration.BU...`.
|
|
201
|
+
def id
|
|
202
|
+
@properties['id']
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
##
|
|
206
|
+
# @return [String] The Persona inquiry ID used to start the embedded compliance session.
|
|
207
|
+
def session_id
|
|
208
|
+
@properties['session_id']
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
##
|
|
212
|
+
# @return [String] The Persona session token for embedding the compliance UI. Expires in 24 hours.
|
|
213
|
+
def session_token
|
|
214
|
+
@properties['session_token']
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
##
|
|
218
|
+
# Provide a user friendly representation
|
|
219
|
+
def to_s
|
|
220
|
+
"<Twilio.Trusthub.V1.A2PBrandRegistrationEmbeddedSessionInstance>"
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
##
|
|
224
|
+
# Provide a detailed, user friendly representation
|
|
225
|
+
def inspect
|
|
226
|
+
"<Twilio.Trusthub.V1.A2PBrandRegistrationEmbeddedSessionInstance>"
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
end
|