twilio-ruby 7.10.6 → 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 +57 -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 +507 -0
- 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 +61 -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 +87 -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 +46 -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 +34 -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,321 @@
|
|
|
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 A2PCampaignRegistrationList < ListResource
|
|
21
|
+
|
|
22
|
+
class TrusthubV1A2pCampaignRegistrationRequest
|
|
23
|
+
# @param [a2p_brand_registration_sid]: [String] The legacy Twilio A2P Brand SID (BN-prefixed) for the brand this campaign is registered under. This is a different identifier from the `id` returned by the Initialize Brand endpoint (which is formatted as `tri1.us1.account.AC.../registration.BU...`). Retrieve the BN brand SID via [GET /v1/a2p/BrandRegistrations/{Sid}](https://www.twilio.com/docs/messaging/api/brand-registration-resource) on `messaging.twilio.com`.
|
|
24
|
+
# @param [messaging_service_sid]: [String] The SID of the Messaging Service.
|
|
25
|
+
# @param [theme_set_id]: [String] Theme ID for styling the inquiry form.
|
|
26
|
+
# @param [use_case_categories]: [Array<String>] The categories of the messaging use case.
|
|
27
|
+
# @param [use_case_description]: [String] A description of the messaging use case.
|
|
28
|
+
# @param [use_case_sample_message1]: [String] A sample message for the use case.
|
|
29
|
+
# @param [use_case_sample_message2]: [String] A second sample message for the use case.
|
|
30
|
+
# @param [use_case_sample_message3]: [String] A third sample message for the use case.
|
|
31
|
+
# @param [use_case_sample_message4]: [String] A fourth sample message for the use case.
|
|
32
|
+
# @param [use_case_sample_message5]: [String] A fifth sample message for the use case.
|
|
33
|
+
# @param [use_case_opt_in_types]: [Array<String>] The opt-in methods for the use case.
|
|
34
|
+
# @param [use_case_opt_in_description]: [String] A description of the opt-in process.
|
|
35
|
+
# @param [has_embedded_links]: [Boolean] Whether messages will contain embedded links.
|
|
36
|
+
# @param [has_embedded_phone]: [Boolean] Whether messages will contain embedded phone numbers.
|
|
37
|
+
# @param [embedded_url_sample]: [String] A sample URL that will be embedded in messages (must use https://).
|
|
38
|
+
# @param [direct_lending]: [Boolean] Whether the campaign involves direct lending.
|
|
39
|
+
# @param [age_gated]: [Boolean] Whether the content is age-gated.
|
|
40
|
+
# @param [privacy_policy_url]: [String] The URL to the privacy policy.
|
|
41
|
+
# @param [terms_and_conditions_url]: [String] The URL to the terms and conditions.
|
|
42
|
+
# @param [opt_in_keywords]: [Array<String>] Keywords users can text to opt in.
|
|
43
|
+
# @param [opt_in_message_sample]: [String] A sample opt-in confirmation message.
|
|
44
|
+
# @param [opt_out_keywords]: [Array<String>] Keywords users can text to opt out.
|
|
45
|
+
# @param [opt_out_message_sample]: [String] A sample opt-out confirmation message.
|
|
46
|
+
# @param [help_keywords]: [Array<String>] Keywords users can text for help.
|
|
47
|
+
# @param [help_message_sample]: [String] A sample help message.
|
|
48
|
+
attr_accessor :a2p_brand_registration_sid, :messaging_service_sid, :theme_set_id, :use_case_categories, :use_case_description, :use_case_sample_message1, :use_case_sample_message2, :use_case_sample_message3, :use_case_sample_message4, :use_case_sample_message5, :use_case_opt_in_types, :use_case_opt_in_description, :has_embedded_links, :has_embedded_phone, :embedded_url_sample, :direct_lending, :age_gated, :privacy_policy_url, :terms_and_conditions_url, :opt_in_keywords, :opt_in_message_sample, :opt_out_keywords, :opt_out_message_sample, :help_keywords, :help_message_sample
|
|
49
|
+
def initialize(payload)
|
|
50
|
+
@a2p_brand_registration_sid = payload["a2p_brand_registration_sid"]
|
|
51
|
+
@messaging_service_sid = payload["messaging_service_sid"]
|
|
52
|
+
@theme_set_id = payload["theme_set_id"]
|
|
53
|
+
@use_case_categories = payload["use_case_categories"]
|
|
54
|
+
@use_case_description = payload["use_case_description"]
|
|
55
|
+
@use_case_sample_message1 = payload["use_case_sample_message1"]
|
|
56
|
+
@use_case_sample_message2 = payload["use_case_sample_message2"]
|
|
57
|
+
@use_case_sample_message3 = payload["use_case_sample_message3"]
|
|
58
|
+
@use_case_sample_message4 = payload["use_case_sample_message4"]
|
|
59
|
+
@use_case_sample_message5 = payload["use_case_sample_message5"]
|
|
60
|
+
@use_case_opt_in_types = payload["use_case_opt_in_types"]
|
|
61
|
+
@use_case_opt_in_description = payload["use_case_opt_in_description"]
|
|
62
|
+
@has_embedded_links = payload["has_embedded_links"]
|
|
63
|
+
@has_embedded_phone = payload["has_embedded_phone"]
|
|
64
|
+
@embedded_url_sample = payload["embedded_url_sample"]
|
|
65
|
+
@direct_lending = payload["direct_lending"]
|
|
66
|
+
@age_gated = payload["age_gated"]
|
|
67
|
+
@privacy_policy_url = payload["privacy_policy_url"]
|
|
68
|
+
@terms_and_conditions_url = payload["terms_and_conditions_url"]
|
|
69
|
+
@opt_in_keywords = payload["opt_in_keywords"]
|
|
70
|
+
@opt_in_message_sample = payload["opt_in_message_sample"]
|
|
71
|
+
@opt_out_keywords = payload["opt_out_keywords"]
|
|
72
|
+
@opt_out_message_sample = payload["opt_out_message_sample"]
|
|
73
|
+
@help_keywords = payload["help_keywords"]
|
|
74
|
+
@help_message_sample = payload["help_message_sample"]
|
|
75
|
+
end
|
|
76
|
+
def to_json(options = {})
|
|
77
|
+
{
|
|
78
|
+
"a2pBrandRegistrationSid": @a2p_brand_registration_sid,
|
|
79
|
+
"messagingServiceSid": @messaging_service_sid,
|
|
80
|
+
"themeSetId": @theme_set_id,
|
|
81
|
+
"useCaseCategories": @use_case_categories,
|
|
82
|
+
"useCaseDescription": @use_case_description,
|
|
83
|
+
"useCaseSampleMessage1": @use_case_sample_message1,
|
|
84
|
+
"useCaseSampleMessage2": @use_case_sample_message2,
|
|
85
|
+
"useCaseSampleMessage3": @use_case_sample_message3,
|
|
86
|
+
"useCaseSampleMessage4": @use_case_sample_message4,
|
|
87
|
+
"useCaseSampleMessage5": @use_case_sample_message5,
|
|
88
|
+
"useCaseOptInTypes": @use_case_opt_in_types,
|
|
89
|
+
"useCaseOptInDescription": @use_case_opt_in_description,
|
|
90
|
+
"hasEmbeddedLinks": @has_embedded_links,
|
|
91
|
+
"hasEmbeddedPhone": @has_embedded_phone,
|
|
92
|
+
"embeddedUrlSample": @embedded_url_sample,
|
|
93
|
+
"directLending": @direct_lending,
|
|
94
|
+
"ageGated": @age_gated,
|
|
95
|
+
"privacyPolicyUrl": @privacy_policy_url,
|
|
96
|
+
"termsAndConditionsUrl": @terms_and_conditions_url,
|
|
97
|
+
"optInKeywords": @opt_in_keywords,
|
|
98
|
+
"optInMessageSample": @opt_in_message_sample,
|
|
99
|
+
"optOutKeywords": @opt_out_keywords,
|
|
100
|
+
"optOutMessageSample": @opt_out_message_sample,
|
|
101
|
+
"helpKeywords": @help_keywords,
|
|
102
|
+
"helpMessageSample": @help_message_sample,
|
|
103
|
+
}.to_json(options)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
##
|
|
109
|
+
# Initialize the A2PCampaignRegistrationList
|
|
110
|
+
# @param [Version] version Version that contains the resource
|
|
111
|
+
# @return [A2PCampaignRegistrationList] A2PCampaignRegistrationList
|
|
112
|
+
def initialize(version)
|
|
113
|
+
super(version)
|
|
114
|
+
|
|
115
|
+
# Path Solution
|
|
116
|
+
@solution = { }
|
|
117
|
+
@uri = "/A2PCampaignRegistrations"
|
|
118
|
+
|
|
119
|
+
end
|
|
120
|
+
##
|
|
121
|
+
# Create the A2PCampaignRegistrationInstance
|
|
122
|
+
# @param [TrusthubV1A2pCampaignRegistrationRequest] trusthub_v1_a2p_campaign_registration_request
|
|
123
|
+
# @return [A2PCampaignRegistrationInstance] Created A2PCampaignRegistrationInstance
|
|
124
|
+
def create(trusthub_v1_a2p_campaign_registration_request: nil
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
128
|
+
headers['Content-Type'] = 'application/json'
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
payload = @version.create('POST', @uri, headers: headers, data: trusthub_v1_a2p_campaign_registration_request.to_json)
|
|
134
|
+
A2PCampaignRegistrationInstance.new(
|
|
135
|
+
@version,
|
|
136
|
+
payload,
|
|
137
|
+
)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
##
|
|
141
|
+
# Create the A2PCampaignRegistrationInstanceMetadata
|
|
142
|
+
# @param [TrusthubV1A2pCampaignRegistrationRequest] trusthub_v1_a2p_campaign_registration_request
|
|
143
|
+
# @return [A2PCampaignRegistrationInstance] Created A2PCampaignRegistrationInstance
|
|
144
|
+
def create_with_metadata(trusthub_v1_a2p_campaign_registration_request: nil
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
148
|
+
headers['Content-Type'] = 'application/json'
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
response = @version.create_with_metadata('POST', @uri, headers: headers, data: trusthub_v1_a2p_campaign_registration_request.to_json)
|
|
154
|
+
a2_p_campaign_registration_instance = A2PCampaignRegistrationInstance.new(
|
|
155
|
+
@version,
|
|
156
|
+
response.body,
|
|
157
|
+
)
|
|
158
|
+
A2PCampaignRegistrationInstanceMetadata.new(
|
|
159
|
+
@version,
|
|
160
|
+
a2_p_campaign_registration_instance,
|
|
161
|
+
response.headers,
|
|
162
|
+
response.status_code
|
|
163
|
+
)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
# Provide a user friendly representation
|
|
170
|
+
def to_s
|
|
171
|
+
'#<Twilio.Trusthub.V1.A2PCampaignRegistrationList>'
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
class A2PCampaignRegistrationPage < Page
|
|
176
|
+
##
|
|
177
|
+
# Initialize the A2PCampaignRegistrationPage
|
|
178
|
+
# @param [Version] version Version that contains the resource
|
|
179
|
+
# @param [Response] response Response from the API
|
|
180
|
+
# @param [Hash] solution Path solution for the resource
|
|
181
|
+
# @return [A2PCampaignRegistrationPage] A2PCampaignRegistrationPage
|
|
182
|
+
def initialize(version, response, solution)
|
|
183
|
+
super(version, response)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
# Path Solution
|
|
187
|
+
@solution = solution
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
##
|
|
191
|
+
# Build an instance of A2PCampaignRegistrationInstance
|
|
192
|
+
# @param [Hash] payload Payload response from the API
|
|
193
|
+
# @return [A2PCampaignRegistrationInstance] A2PCampaignRegistrationInstance
|
|
194
|
+
def get_instance(payload)
|
|
195
|
+
A2PCampaignRegistrationInstance.new(@version, payload)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
##
|
|
199
|
+
# Provide a user friendly representation
|
|
200
|
+
def to_s
|
|
201
|
+
'<Twilio.Trusthub.V1.A2PCampaignRegistrationPage>'
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
class A2PCampaignRegistrationPageMetadata < PageMetadata
|
|
206
|
+
attr_reader :a2_p_campaign_registration_page
|
|
207
|
+
|
|
208
|
+
def initialize(version, response, solution, limit)
|
|
209
|
+
super(version, response)
|
|
210
|
+
@a2_p_campaign_registration_page = []
|
|
211
|
+
@limit = limit
|
|
212
|
+
key = get_key(response.body)
|
|
213
|
+
records = 0
|
|
214
|
+
while( limit != :unset && records < limit )
|
|
215
|
+
@a2_p_campaign_registration_page << A2PCampaignRegistrationListResponse.new(version, @payload, key, limit - records)
|
|
216
|
+
@payload = self.next_page
|
|
217
|
+
break unless @payload
|
|
218
|
+
records += (@payload.body[key] || []).size
|
|
219
|
+
end
|
|
220
|
+
# Path Solution
|
|
221
|
+
@solution = solution
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
def each
|
|
225
|
+
@a2_p_campaign_registration_page.each do |record|
|
|
226
|
+
yield record
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
def to_s
|
|
231
|
+
'<Twilio::REST::Trusthub::V1PageMetadata>';
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
class A2PCampaignRegistrationListResponse < InstanceListResource
|
|
235
|
+
|
|
236
|
+
# @param [Array<A2PCampaignRegistrationInstance>] instance
|
|
237
|
+
# @param [Hash{String => Object}] headers
|
|
238
|
+
# @param [Integer] status_code
|
|
239
|
+
def initialize(version, payload, key, limit = :unset)
|
|
240
|
+
data_list = payload.body[key] || []
|
|
241
|
+
if limit != :unset
|
|
242
|
+
data_list = data_list[0, limit]
|
|
243
|
+
end
|
|
244
|
+
@a2_p_campaign_registration = data_list.map do |data|
|
|
245
|
+
A2PCampaignRegistrationInstance.new(version, data)
|
|
246
|
+
end
|
|
247
|
+
@headers = payload.headers
|
|
248
|
+
@status_code = payload.status_code
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
def a2_p_campaign_registration
|
|
252
|
+
@a2_p_campaign_registration
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
def headers
|
|
256
|
+
@headers
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
def status_code
|
|
260
|
+
@status_code
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
class A2PCampaignRegistrationInstance < InstanceResource
|
|
265
|
+
##
|
|
266
|
+
# Initialize the A2PCampaignRegistrationInstance
|
|
267
|
+
# @param [Version] version Version that contains the resource
|
|
268
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
269
|
+
# @param [String] account_sid The SID of the
|
|
270
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this A2PCampaignRegistration
|
|
271
|
+
# resource.
|
|
272
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
273
|
+
# @return [A2PCampaignRegistrationInstance] A2PCampaignRegistrationInstance
|
|
274
|
+
def initialize(version, payload )
|
|
275
|
+
super(version)
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
# Marshaled Properties
|
|
279
|
+
@properties = {
|
|
280
|
+
'id' => payload['id'],
|
|
281
|
+
'session_id' => payload['session_id'],
|
|
282
|
+
'session_token' => payload['session_token'],
|
|
283
|
+
}
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
##
|
|
288
|
+
# @return [String] The unique A2P Brand or Campaign Registration identifier, formatted as `tri1.us1.account.AC.../registration.BU...`.
|
|
289
|
+
def id
|
|
290
|
+
@properties['id']
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
##
|
|
294
|
+
# @return [String] The Persona inquiry ID used to start the embedded compliance session.
|
|
295
|
+
def session_id
|
|
296
|
+
@properties['session_id']
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
##
|
|
300
|
+
# @return [String] The Persona session token for embedding the compliance UI. Expires in 24 hours.
|
|
301
|
+
def session_token
|
|
302
|
+
@properties['session_token']
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
##
|
|
306
|
+
# Provide a user friendly representation
|
|
307
|
+
def to_s
|
|
308
|
+
"<Twilio.Trusthub.V1.A2PCampaignRegistrationInstance>"
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
##
|
|
312
|
+
# Provide a detailed, user friendly representation
|
|
313
|
+
def inspect
|
|
314
|
+
"<Twilio.Trusthub.V1.A2PCampaignRegistrationInstance>"
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
end
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
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 A2PCampaignRegistrationEmbeddedSessionList < ListResource
|
|
21
|
+
|
|
22
|
+
##
|
|
23
|
+
# Initialize the A2PCampaignRegistrationEmbeddedSessionList
|
|
24
|
+
# @param [Version] version Version that contains the resource
|
|
25
|
+
# @return [A2PCampaignRegistrationEmbeddedSessionList] A2PCampaignRegistrationEmbeddedSessionList
|
|
26
|
+
def initialize(version, id: nil)
|
|
27
|
+
super(version)
|
|
28
|
+
|
|
29
|
+
# Path Solution
|
|
30
|
+
@solution = { id: id }
|
|
31
|
+
@uri = "/A2PCampaignRegistrations/#{@solution[:id]}/EmbeddedSessions"
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
##
|
|
35
|
+
# Create the A2PCampaignRegistrationEmbeddedSessionInstance
|
|
36
|
+
# @return [A2PCampaignRegistrationEmbeddedSessionInstance] Created A2PCampaignRegistrationEmbeddedSessionInstance
|
|
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
|
+
A2PCampaignRegistrationEmbeddedSessionInstance.new(
|
|
47
|
+
@version,
|
|
48
|
+
payload,
|
|
49
|
+
id: @solution[:id],
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
##
|
|
54
|
+
# Create the A2PCampaignRegistrationEmbeddedSessionInstanceMetadata
|
|
55
|
+
# @return [A2PCampaignRegistrationEmbeddedSessionInstance] Created A2PCampaignRegistrationEmbeddedSessionInstance
|
|
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_campaign_registration_embedded_session_instance = A2PCampaignRegistrationEmbeddedSessionInstance.new(
|
|
66
|
+
@version,
|
|
67
|
+
response.body,
|
|
68
|
+
id: @solution[:id],
|
|
69
|
+
)
|
|
70
|
+
A2PCampaignRegistrationEmbeddedSessionInstanceMetadata.new(
|
|
71
|
+
@version,
|
|
72
|
+
a2_p_campaign_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.A2PCampaignRegistrationEmbeddedSessionList>'
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
class A2PCampaignRegistrationEmbeddedSessionPage < Page
|
|
88
|
+
##
|
|
89
|
+
# Initialize the A2PCampaignRegistrationEmbeddedSessionPage
|
|
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 [A2PCampaignRegistrationEmbeddedSessionPage] A2PCampaignRegistrationEmbeddedSessionPage
|
|
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 A2PCampaignRegistrationEmbeddedSessionInstance
|
|
104
|
+
# @param [Hash] payload Payload response from the API
|
|
105
|
+
# @return [A2PCampaignRegistrationEmbeddedSessionInstance] A2PCampaignRegistrationEmbeddedSessionInstance
|
|
106
|
+
def get_instance(payload)
|
|
107
|
+
A2PCampaignRegistrationEmbeddedSessionInstance.new(@version, payload, id: @solution[:id])
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
##
|
|
111
|
+
# Provide a user friendly representation
|
|
112
|
+
def to_s
|
|
113
|
+
'<Twilio.Trusthub.V1.A2PCampaignRegistrationEmbeddedSessionPage>'
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
class A2PCampaignRegistrationEmbeddedSessionPageMetadata < PageMetadata
|
|
118
|
+
attr_reader :a2_p_campaign_registration_embedded_session_page
|
|
119
|
+
|
|
120
|
+
def initialize(version, response, solution, limit)
|
|
121
|
+
super(version, response)
|
|
122
|
+
@a2_p_campaign_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_campaign_registration_embedded_session_page << A2PCampaignRegistrationEmbeddedSessionListResponse.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_campaign_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 A2PCampaignRegistrationEmbeddedSessionListResponse < InstanceListResource
|
|
147
|
+
|
|
148
|
+
# @param [Array<A2PCampaignRegistrationEmbeddedSessionInstance>] 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_campaign_registration_embedded_session = data_list.map do |data|
|
|
157
|
+
A2PCampaignRegistrationEmbeddedSessionInstance.new(version, data)
|
|
158
|
+
end
|
|
159
|
+
@headers = payload.headers
|
|
160
|
+
@status_code = payload.status_code
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def a2_p_campaign_registration_embedded_session
|
|
164
|
+
@a2_p_campaign_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 A2PCampaignRegistrationEmbeddedSessionInstance < InstanceResource
|
|
177
|
+
##
|
|
178
|
+
# Initialize the A2PCampaignRegistrationEmbeddedSessionInstance
|
|
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 A2PCampaignRegistrationEmbeddedSession
|
|
183
|
+
# resource.
|
|
184
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
185
|
+
# @return [A2PCampaignRegistrationEmbeddedSessionInstance] A2PCampaignRegistrationEmbeddedSessionInstance
|
|
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.A2PCampaignRegistrationEmbeddedSessionInstance>"
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
##
|
|
224
|
+
# Provide a detailed, user friendly representation
|
|
225
|
+
def inspect
|
|
226
|
+
"<Twilio.Trusthub.V1.A2PCampaignRegistrationEmbeddedSessionInstance>"
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
end
|