twilio-ruby 5.73.3 → 5.74.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/CHANGES.md +49 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +19 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb +4 -4
- data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +195 -0
- data/lib/twilio-ruby/rest/content/v1/content.rb +18 -9
- data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +156 -0
- data/lib/twilio-ruby/rest/flex_api/v1/good_data.rb +6 -6
- data/lib/twilio-ruby/rest/flex_api/v1/user_roles.rb +1 -1
- data/lib/twilio-ruby/rest/flex_api/v1.rb +7 -0
- data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +133 -0
- data/lib/twilio-ruby/rest/flex_api/v2.rb +35 -0
- data/lib/twilio-ruby/rest/flex_api.rb +19 -0
- data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +81 -6
- data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +257 -0
- data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +267 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +43 -18
- data/lib/twilio-ruby/rest/messaging/v1.rb +34 -0
- data/lib/twilio-ruby/rest/messaging.rb +18 -0
- data/lib/twilio-ruby/rest/microvisor/v1/device.rb +7 -0
- data/lib/twilio-ruby/rest/oauth/v1/device_code.rb +153 -0
- data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +1 -1
- data/lib/twilio-ruby/rest/oauth/v1.rb +7 -0
- data/lib/twilio-ruby/rest/oauth.rb +6 -0
- data/lib/twilio-ruby/rest/preview.rb +0 -33
- data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +12 -5
- data/lib/twilio-ruby/twiml/voice_response.rb +21 -21
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +9 -8
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +0 -165
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +0 -225
- data/lib/twilio-ruby/rest/preview/trusted_comms/brands_information.rb +0 -195
- data/lib/twilio-ruby/rest/preview/trusted_comms/cps.rb +0 -186
- data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +0 -277
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -65
@@ -0,0 +1,267 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Messaging < Domain
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
15
|
+
class DomainConfigList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the DomainConfigList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [DomainConfigList] DomainConfigList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Provide a user friendly representation
|
29
|
+
def to_s
|
30
|
+
'#<Twilio.Messaging.V1.DomainConfigList>'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
36
|
+
class DomainConfigPage < Page
|
37
|
+
##
|
38
|
+
# Initialize the DomainConfigPage
|
39
|
+
# @param [Version] version Version that contains the resource
|
40
|
+
# @param [Response] response Response from the API
|
41
|
+
# @param [Hash] solution Path solution for the resource
|
42
|
+
# @return [DomainConfigPage] DomainConfigPage
|
43
|
+
def initialize(version, response, solution)
|
44
|
+
super(version, response)
|
45
|
+
|
46
|
+
# Path Solution
|
47
|
+
@solution = solution
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Build an instance of DomainConfigInstance
|
52
|
+
# @param [Hash] payload Payload response from the API
|
53
|
+
# @return [DomainConfigInstance] DomainConfigInstance
|
54
|
+
def get_instance(payload)
|
55
|
+
DomainConfigInstance.new(@version, payload, )
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Provide a user friendly representation
|
60
|
+
def to_s
|
61
|
+
'<Twilio.Messaging.V1.DomainConfigPage>'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
67
|
+
class DomainConfigContext < InstanceContext
|
68
|
+
##
|
69
|
+
# Initialize the DomainConfigContext
|
70
|
+
# @param [Version] version Version that contains the resource
|
71
|
+
# @param [String] domain_sid Unique string used to identify the domain that this
|
72
|
+
# config should be associated with.
|
73
|
+
# @return [DomainConfigContext] DomainConfigContext
|
74
|
+
def initialize(version, domain_sid)
|
75
|
+
super(version)
|
76
|
+
|
77
|
+
# Path Solution
|
78
|
+
@solution = {domain_sid: domain_sid, }
|
79
|
+
@uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/Config"
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Update the DomainConfigInstance
|
84
|
+
# @param [Array[String]] messaging_service_sids A list of messagingServiceSids
|
85
|
+
# (with prefix MG)
|
86
|
+
# @param [String] fallback_url Any requests we receive to this domain that do not
|
87
|
+
# match an existing shortened message will be redirected to the fallback url.
|
88
|
+
# These will likely be either expired messages, random misdirected traffic, or
|
89
|
+
# intentional scraping.
|
90
|
+
# @param [String] callback_url URL to receive click events to your webhook
|
91
|
+
# whenever the recipients click on the shortened links
|
92
|
+
# @param [String] messaging_service_sids_action An action type for
|
93
|
+
# messaging_service_sids operation (ADD, DELETE, REPLACE)
|
94
|
+
# @return [DomainConfigInstance] Updated DomainConfigInstance
|
95
|
+
def update(messaging_service_sids: nil, fallback_url: :unset, callback_url: :unset, messaging_service_sids_action: :unset)
|
96
|
+
data = Twilio::Values.of({
|
97
|
+
'MessagingServiceSids' => Twilio.serialize_list(messaging_service_sids) { |e| e },
|
98
|
+
'FallbackUrl' => fallback_url,
|
99
|
+
'CallbackUrl' => callback_url,
|
100
|
+
'MessagingServiceSidsAction' => messaging_service_sids_action,
|
101
|
+
})
|
102
|
+
|
103
|
+
payload = @version.update('POST', @uri, data: data)
|
104
|
+
|
105
|
+
DomainConfigInstance.new(@version, payload, domain_sid: @solution[:domain_sid], )
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# Fetch the DomainConfigInstance
|
110
|
+
# @return [DomainConfigInstance] Fetched DomainConfigInstance
|
111
|
+
def fetch
|
112
|
+
payload = @version.fetch('GET', @uri)
|
113
|
+
|
114
|
+
DomainConfigInstance.new(@version, payload, domain_sid: @solution[:domain_sid], )
|
115
|
+
end
|
116
|
+
|
117
|
+
##
|
118
|
+
# Provide a user friendly representation
|
119
|
+
def to_s
|
120
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
121
|
+
"#<Twilio.Messaging.V1.DomainConfigContext #{context}>"
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# Provide a detailed, user friendly representation
|
126
|
+
def inspect
|
127
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
128
|
+
"#<Twilio.Messaging.V1.DomainConfigContext #{context}>"
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
##
|
133
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
134
|
+
class DomainConfigInstance < InstanceResource
|
135
|
+
##
|
136
|
+
# Initialize the DomainConfigInstance
|
137
|
+
# @param [Version] version Version that contains the resource
|
138
|
+
# @param [Hash] payload payload that contains response from Twilio
|
139
|
+
# @param [String] domain_sid Unique string used to identify the domain that this
|
140
|
+
# config should be associated with.
|
141
|
+
# @return [DomainConfigInstance] DomainConfigInstance
|
142
|
+
def initialize(version, payload, domain_sid: nil)
|
143
|
+
super(version)
|
144
|
+
|
145
|
+
# Marshaled Properties
|
146
|
+
@properties = {
|
147
|
+
'domain_sid' => payload['domain_sid'],
|
148
|
+
'config_sid' => payload['config_sid'],
|
149
|
+
'messaging_service_sids' => payload['messaging_service_sids'],
|
150
|
+
'fallback_url' => payload['fallback_url'],
|
151
|
+
'callback_url' => payload['callback_url'],
|
152
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
153
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
154
|
+
'url' => payload['url'],
|
155
|
+
}
|
156
|
+
|
157
|
+
# Context
|
158
|
+
@instance_context = nil
|
159
|
+
@params = {'domain_sid' => domain_sid || @properties['domain_sid'], }
|
160
|
+
end
|
161
|
+
|
162
|
+
##
|
163
|
+
# Generate an instance context for the instance, the context is capable of
|
164
|
+
# performing various actions. All instance actions are proxied to the context
|
165
|
+
# @return [DomainConfigContext] DomainConfigContext for this DomainConfigInstance
|
166
|
+
def context
|
167
|
+
unless @instance_context
|
168
|
+
@instance_context = DomainConfigContext.new(@version, @params['domain_sid'], )
|
169
|
+
end
|
170
|
+
@instance_context
|
171
|
+
end
|
172
|
+
|
173
|
+
##
|
174
|
+
# @return [String] The unique string that we created to identify the Domain resource.
|
175
|
+
def domain_sid
|
176
|
+
@properties['domain_sid']
|
177
|
+
end
|
178
|
+
|
179
|
+
##
|
180
|
+
# @return [String] The unique string that we created to identify the Domain config (prefix ZK).
|
181
|
+
def config_sid
|
182
|
+
@properties['config_sid']
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# @return [Array[String]] A list of messagingServiceSids (with prefix MG).
|
187
|
+
def messaging_service_sids
|
188
|
+
@properties['messaging_service_sids']
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# @return [String] We will redirect requests to urls we are unable to identify to this url.
|
193
|
+
def fallback_url
|
194
|
+
@properties['fallback_url']
|
195
|
+
end
|
196
|
+
|
197
|
+
##
|
198
|
+
# @return [String] URL to receive click events to your webhook whenever the recipients click on the shortened links.
|
199
|
+
def callback_url
|
200
|
+
@properties['callback_url']
|
201
|
+
end
|
202
|
+
|
203
|
+
##
|
204
|
+
# @return [Time] Date this Domain Config was created.
|
205
|
+
def date_created
|
206
|
+
@properties['date_created']
|
207
|
+
end
|
208
|
+
|
209
|
+
##
|
210
|
+
# @return [Time] Date that this Domain Config was last updated.
|
211
|
+
def date_updated
|
212
|
+
@properties['date_updated']
|
213
|
+
end
|
214
|
+
|
215
|
+
##
|
216
|
+
# @return [String] The url
|
217
|
+
def url
|
218
|
+
@properties['url']
|
219
|
+
end
|
220
|
+
|
221
|
+
##
|
222
|
+
# Update the DomainConfigInstance
|
223
|
+
# @param [Array[String]] messaging_service_sids A list of messagingServiceSids
|
224
|
+
# (with prefix MG)
|
225
|
+
# @param [String] fallback_url Any requests we receive to this domain that do not
|
226
|
+
# match an existing shortened message will be redirected to the fallback url.
|
227
|
+
# These will likely be either expired messages, random misdirected traffic, or
|
228
|
+
# intentional scraping.
|
229
|
+
# @param [String] callback_url URL to receive click events to your webhook
|
230
|
+
# whenever the recipients click on the shortened links
|
231
|
+
# @param [String] messaging_service_sids_action An action type for
|
232
|
+
# messaging_service_sids operation (ADD, DELETE, REPLACE)
|
233
|
+
# @return [DomainConfigInstance] Updated DomainConfigInstance
|
234
|
+
def update(messaging_service_sids: nil, fallback_url: :unset, callback_url: :unset, messaging_service_sids_action: :unset)
|
235
|
+
context.update(
|
236
|
+
messaging_service_sids: messaging_service_sids,
|
237
|
+
fallback_url: fallback_url,
|
238
|
+
callback_url: callback_url,
|
239
|
+
messaging_service_sids_action: messaging_service_sids_action,
|
240
|
+
)
|
241
|
+
end
|
242
|
+
|
243
|
+
##
|
244
|
+
# Fetch the DomainConfigInstance
|
245
|
+
# @return [DomainConfigInstance] Fetched DomainConfigInstance
|
246
|
+
def fetch
|
247
|
+
context.fetch
|
248
|
+
end
|
249
|
+
|
250
|
+
##
|
251
|
+
# Provide a user friendly representation
|
252
|
+
def to_s
|
253
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
254
|
+
"<Twilio.Messaging.V1.DomainConfigInstance #{values}>"
|
255
|
+
end
|
256
|
+
|
257
|
+
##
|
258
|
+
# Provide a detailed, user friendly representation
|
259
|
+
def inspect
|
260
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
261
|
+
"<Twilio.Messaging.V1.DomainConfigInstance #{values}>"
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
@@ -33,38 +33,63 @@ module Twilio
|
|
33
33
|
# Create the UsAppToPersonInstance
|
34
34
|
# @param [String] brand_registration_sid A2P Brand Registration SID
|
35
35
|
# @param [String] description A short description of what this SMS campaign does.
|
36
|
-
#
|
37
|
-
#
|
36
|
+
# Min length: 40 characters. Max length: 4096 characters.
|
37
|
+
# @param [String] message_flow Required for all Campaigns. Details around how a
|
38
|
+
# consumer opts-in to their campaign, therefore giving consent to receive their
|
39
|
+
# messages. If multiple opt-in methods can be used for the same campaign, they
|
40
|
+
# must all be listed. 40 character minimum. 2048 character maximum.
|
41
|
+
# @param [Array[String]] message_samples Message samples, at least 1 and up to 5
|
42
|
+
# sample messages (at least 2 for sole proprietor), >=20 chars, <=1024 chars each.
|
38
43
|
# @param [String] us_app_to_person_usecase A2P Campaign Use Case. Examples: [ 2FA,
|
39
44
|
# EMERGENCY, MARKETING..]
|
40
45
|
# @param [Boolean] has_embedded_links Indicates that this SMS campaign will send
|
41
46
|
# messages that contain links.
|
42
47
|
# @param [Boolean] has_embedded_phone Indicates that this SMS campaign will send
|
43
48
|
# messages that contain phone numbers.
|
44
|
-
# @param [String]
|
45
|
-
# campaign,
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
49
|
+
# @param [String] opt_in_message If end users can text in a keyword to start
|
50
|
+
# receiving messages from this campaign, the auto-reply messages sent to the end
|
51
|
+
# users must be provided. The opt-in response should include the Brand name,
|
52
|
+
# confirmation of opt-in enrollment to a recurring message campaign, how to get
|
53
|
+
# help, and clear description of how to opt-out. This field is required if end
|
54
|
+
# users can text in a keyword to start receiving messages from this campaign. 20
|
55
|
+
# character minimum. 320 character maximum.
|
56
|
+
# @param [String] opt_out_message Upon receiving the opt-out keywords from the end
|
57
|
+
# users, Twilio customers are expected to send back an auto-generated response,
|
58
|
+
# which must provide acknowledgment of the opt-out request and confirmation that
|
59
|
+
# no further messages will be sent. It is also recommended that these opt-out
|
60
|
+
# messages include the brand name. This field is required if managing opt out
|
61
|
+
# keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out
|
62
|
+
# features). 20 character minimum. 320 character maximum.
|
63
|
+
# @param [String] help_message When customers receive the help keywords from their
|
64
|
+
# end users, Twilio customers are expected to send back an auto-generated
|
65
|
+
# response; this may include the brand name and additional support contact
|
66
|
+
# information. This field is required if managing help keywords yourself (i.e. not
|
67
|
+
# using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320
|
68
|
+
# character maximum.
|
69
|
+
# @param [Array[String]] opt_in_keywords If end users can text in a keyword to
|
70
|
+
# start receiving messages from this campaign, those keywords must be provided.
|
71
|
+
# This field is required if end users can text in a keyword to start receiving
|
72
|
+
# messages from this campaign. Values must be alphanumeric. 255 character maximum.
|
73
|
+
# @param [Array[String]] opt_out_keywords End users should be able to text in a
|
74
|
+
# keyword to stop receiving messages from this campaign. Those keywords must be
|
75
|
+
# provided. This field is required if managing opt out keywords yourself (i.e. not
|
76
|
+
# using Twilio's Default or Advanced Opt Out features). Values must be
|
77
|
+
# alphanumeric. 255 character maximum.
|
78
|
+
# @param [Array[String]] help_keywords End users should be able to text in a
|
79
|
+
# keyword to receive help. Those keywords must be provided as part of the campaign
|
80
|
+
# registration request. This field is required if managing help keywords yourself
|
81
|
+
# (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be
|
82
|
+
# alphanumeric. 255 character maximum.
|
58
83
|
# @return [UsAppToPersonInstance] Created UsAppToPersonInstance
|
59
|
-
def create(brand_registration_sid: nil, description: nil, message_samples: nil, us_app_to_person_usecase: nil, has_embedded_links: nil, has_embedded_phone: nil,
|
84
|
+
def create(brand_registration_sid: nil, description: nil, message_flow: nil, message_samples: nil, us_app_to_person_usecase: nil, has_embedded_links: nil, has_embedded_phone: nil, opt_in_message: :unset, opt_out_message: :unset, help_message: :unset, opt_in_keywords: :unset, opt_out_keywords: :unset, help_keywords: :unset)
|
60
85
|
data = Twilio::Values.of({
|
61
86
|
'BrandRegistrationSid' => brand_registration_sid,
|
62
87
|
'Description' => description,
|
88
|
+
'MessageFlow' => message_flow,
|
63
89
|
'MessageSamples' => Twilio.serialize_list(message_samples) { |e| e },
|
64
90
|
'UsAppToPersonUsecase' => us_app_to_person_usecase,
|
65
91
|
'HasEmbeddedLinks' => has_embedded_links,
|
66
92
|
'HasEmbeddedPhone' => has_embedded_phone,
|
67
|
-
'MessageFlow' => message_flow,
|
68
93
|
'OptInMessage' => opt_in_message,
|
69
94
|
'OptOutMessage' => opt_out_message,
|
70
95
|
'HelpMessage' => help_message,
|
@@ -17,6 +17,8 @@ module Twilio
|
|
17
17
|
@version = 'v1'
|
18
18
|
@brand_registrations = nil
|
19
19
|
@deactivations = nil
|
20
|
+
@domain_certs = nil
|
21
|
+
@domain_config = nil
|
20
22
|
@external_campaign = nil
|
21
23
|
@services = nil
|
22
24
|
@tollfree_verifications = nil
|
@@ -44,6 +46,38 @@ module Twilio
|
|
44
46
|
@deactivations ||= DeactivationsContext.new self
|
45
47
|
end
|
46
48
|
|
49
|
+
##
|
50
|
+
# @param [String] domain_sid Unique string used to identify the domain that this
|
51
|
+
# certificate should be associated with.
|
52
|
+
# @return [Twilio::REST::Messaging::V1::DomainCertsContext] if domain_sid was passed.
|
53
|
+
# @return [Twilio::REST::Messaging::V1::DomainCertsList]
|
54
|
+
def domain_certs(domain_sid=:unset)
|
55
|
+
if domain_sid.nil?
|
56
|
+
raise ArgumentError, 'domain_sid cannot be nil'
|
57
|
+
end
|
58
|
+
if domain_sid == :unset
|
59
|
+
@domain_certs ||= DomainCertsList.new self
|
60
|
+
else
|
61
|
+
DomainCertsContext.new(self, domain_sid)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# @param [String] domain_sid Unique string used to identify the domain that this
|
67
|
+
# config should be associated with.
|
68
|
+
# @return [Twilio::REST::Messaging::V1::DomainConfigContext] if domain_sid was passed.
|
69
|
+
# @return [Twilio::REST::Messaging::V1::DomainConfigList]
|
70
|
+
def domain_config(domain_sid=:unset)
|
71
|
+
if domain_sid.nil?
|
72
|
+
raise ArgumentError, 'domain_sid cannot be nil'
|
73
|
+
end
|
74
|
+
if domain_sid == :unset
|
75
|
+
@domain_config ||= DomainConfigList.new self
|
76
|
+
else
|
77
|
+
DomainConfigContext.new(self, domain_sid)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
47
81
|
##
|
48
82
|
# @return [Twilio::REST::Messaging::V1::ExternalCampaignContext]
|
49
83
|
def external_campaign
|
@@ -42,6 +42,24 @@ module Twilio
|
|
42
42
|
self.v1.deactivations()
|
43
43
|
end
|
44
44
|
|
45
|
+
##
|
46
|
+
# @param [String] domain_sid The unique string that we created to identify the
|
47
|
+
# Domain resource.
|
48
|
+
# @return [Twilio::REST::Messaging::V1::DomainCertsInstance] if domain_sid was passed.
|
49
|
+
# @return [Twilio::REST::Messaging::V1::DomainCertsList]
|
50
|
+
def domain_certs(domain_sid=:unset)
|
51
|
+
self.v1.domain_certs(domain_sid)
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# @param [String] domain_sid The unique string that we created to identify the
|
56
|
+
# Domain resource.
|
57
|
+
# @return [Twilio::REST::Messaging::V1::DomainConfigInstance] if domain_sid was passed.
|
58
|
+
# @return [Twilio::REST::Messaging::V1::DomainConfigList]
|
59
|
+
def domain_config(domain_sid=:unset)
|
60
|
+
self.v1.domain_config(domain_sid)
|
61
|
+
end
|
62
|
+
|
45
63
|
##
|
46
64
|
# @return [Twilio::REST::Messaging::V1::ExternalCampaignInstance]
|
47
65
|
def external_campaign
|
@@ -226,6 +226,7 @@ module Twilio
|
|
226
226
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
227
227
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
228
228
|
'url' => payload['url'],
|
229
|
+
'links' => payload['links'],
|
229
230
|
}
|
230
231
|
|
231
232
|
# Context
|
@@ -292,6 +293,12 @@ module Twilio
|
|
292
293
|
@properties['url']
|
293
294
|
end
|
294
295
|
|
296
|
+
##
|
297
|
+
# @return [String] The absolute URLs of related resources
|
298
|
+
def links
|
299
|
+
@properties['links']
|
300
|
+
end
|
301
|
+
|
295
302
|
##
|
296
303
|
# Fetch the DeviceInstance
|
297
304
|
# @return [DeviceInstance] Fetched DeviceInstance
|
@@ -0,0 +1,153 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Oauth < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class DeviceCodeList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the DeviceCodeList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @return [DeviceCodeList] DeviceCodeList
|
18
|
+
def initialize(version)
|
19
|
+
super(version)
|
20
|
+
|
21
|
+
# Path Solution
|
22
|
+
@solution = {}
|
23
|
+
@uri = "/device/code"
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# Create the DeviceCodeInstance
|
28
|
+
# @param [String] client_sid A 34 character string that uniquely identifies this
|
29
|
+
# OAuth App.
|
30
|
+
# @param [Array[String]] scopes An Array of scopes for authorization request
|
31
|
+
# @param [Array[String]] audiences An array of intended audiences for token
|
32
|
+
# requests
|
33
|
+
# @return [DeviceCodeInstance] Created DeviceCodeInstance
|
34
|
+
def create(client_sid: nil, scopes: nil, audiences: :unset)
|
35
|
+
data = Twilio::Values.of({
|
36
|
+
'ClientSid' => client_sid,
|
37
|
+
'Scopes' => Twilio.serialize_list(scopes) { |e| e },
|
38
|
+
'Audiences' => Twilio.serialize_list(audiences) { |e| e },
|
39
|
+
})
|
40
|
+
|
41
|
+
payload = @version.create('POST', @uri, data: data)
|
42
|
+
|
43
|
+
DeviceCodeInstance.new(@version, payload, )
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Provide a user friendly representation
|
48
|
+
def to_s
|
49
|
+
'#<Twilio.Oauth.V1.DeviceCodeList>'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class DeviceCodePage < Page
|
54
|
+
##
|
55
|
+
# Initialize the DeviceCodePage
|
56
|
+
# @param [Version] version Version that contains the resource
|
57
|
+
# @param [Response] response Response from the API
|
58
|
+
# @param [Hash] solution Path solution for the resource
|
59
|
+
# @return [DeviceCodePage] DeviceCodePage
|
60
|
+
def initialize(version, response, solution)
|
61
|
+
super(version, response)
|
62
|
+
|
63
|
+
# Path Solution
|
64
|
+
@solution = solution
|
65
|
+
end
|
66
|
+
|
67
|
+
##
|
68
|
+
# Build an instance of DeviceCodeInstance
|
69
|
+
# @param [Hash] payload Payload response from the API
|
70
|
+
# @return [DeviceCodeInstance] DeviceCodeInstance
|
71
|
+
def get_instance(payload)
|
72
|
+
DeviceCodeInstance.new(@version, payload, )
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Provide a user friendly representation
|
77
|
+
def to_s
|
78
|
+
'<Twilio.Oauth.V1.DeviceCodePage>'
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
class DeviceCodeInstance < InstanceResource
|
83
|
+
##
|
84
|
+
# Initialize the DeviceCodeInstance
|
85
|
+
# @param [Version] version Version that contains the resource
|
86
|
+
# @param [Hash] payload payload that contains response from Twilio
|
87
|
+
# @return [DeviceCodeInstance] DeviceCodeInstance
|
88
|
+
def initialize(version, payload)
|
89
|
+
super(version)
|
90
|
+
|
91
|
+
# Marshaled Properties
|
92
|
+
@properties = {
|
93
|
+
'device_code' => payload['device_code'],
|
94
|
+
'user_code' => payload['user_code'],
|
95
|
+
'verification_uri' => payload['verification_uri'],
|
96
|
+
'verification_uri_complete' => payload['verification_uri_complete'],
|
97
|
+
'expires_in' => payload['expires_in'] == nil ? payload['expires_in'] : payload['expires_in'].to_i,
|
98
|
+
'interval' => payload['interval'] == nil ? payload['interval'] : payload['interval'].to_i,
|
99
|
+
}
|
100
|
+
end
|
101
|
+
|
102
|
+
##
|
103
|
+
# @return [String] The device verification code
|
104
|
+
def device_code
|
105
|
+
@properties['device_code']
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# @return [String] The verification code for the end user
|
110
|
+
def user_code
|
111
|
+
@properties['user_code']
|
112
|
+
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# @return [String] The URI that the end user visits to verify request
|
116
|
+
def verification_uri
|
117
|
+
@properties['verification_uri']
|
118
|
+
end
|
119
|
+
|
120
|
+
##
|
121
|
+
# @return [String] he URI with user_code that the end-user alternatively visits to verify request
|
122
|
+
def verification_uri_complete
|
123
|
+
@properties['verification_uri_complete']
|
124
|
+
end
|
125
|
+
|
126
|
+
##
|
127
|
+
# @return [String] The expiration time of the device_code and user_code in seconds
|
128
|
+
def expires_in
|
129
|
+
@properties['expires_in']
|
130
|
+
end
|
131
|
+
|
132
|
+
##
|
133
|
+
# @return [String] The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint
|
134
|
+
def interval
|
135
|
+
@properties['interval']
|
136
|
+
end
|
137
|
+
|
138
|
+
##
|
139
|
+
# Provide a user friendly representation
|
140
|
+
def to_s
|
141
|
+
"<Twilio.Oauth.V1.DeviceCodeInstance>"
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# Provide a detailed, user friendly representation
|
146
|
+
def inspect
|
147
|
+
"<Twilio.Oauth.V1.DeviceCodeInstance>"
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
@@ -16,6 +16,7 @@ module Twilio
|
|
16
16
|
super
|
17
17
|
@version = 'v1'
|
18
18
|
@oauth = nil
|
19
|
+
@device_code = nil
|
19
20
|
@openid_discovery = nil
|
20
21
|
@token = nil
|
21
22
|
@user_info = nil
|
@@ -27,6 +28,12 @@ module Twilio
|
|
27
28
|
@oauth ||= OauthContext.new self
|
28
29
|
end
|
29
30
|
|
31
|
+
##
|
32
|
+
# @return [Twilio::REST::Oauth::V1::DeviceCodeContext]
|
33
|
+
def device_code
|
34
|
+
@device_code ||= DeviceCodeList.new self
|
35
|
+
end
|
36
|
+
|
30
37
|
##
|
31
38
|
# @return [Twilio::REST::Oauth::V1::OpenidDiscoveryContext]
|
32
39
|
def openid_discovery
|
@@ -34,6 +34,12 @@ module Twilio
|
|
34
34
|
self.v1.oauth()
|
35
35
|
end
|
36
36
|
|
37
|
+
##
|
38
|
+
# @return [Twilio::REST::Oauth::V1::DeviceCodeInstance]
|
39
|
+
def device_code
|
40
|
+
self.v1.device_code()
|
41
|
+
end
|
42
|
+
|
37
43
|
##
|
38
44
|
# @return [Twilio::REST::Oauth::V1::OpenidDiscoveryInstance]
|
39
45
|
def openid_discovery
|