twilio-ruby 7.10.3 → 7.10.4

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.
@@ -0,0 +1,79 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Sample/reference Twilio API.
8
+ # This is the reference API for the rest-proxy server.
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
+ module Twilio
16
+ module REST
17
+ class Insights
18
+ class V2 < Version
19
+ ##
20
+ # Initialize the V2 version of Insights
21
+ def initialize(domain)
22
+ super
23
+ @version = 'v2'
24
+ @inbound = nil
25
+ @outbound = nil
26
+ @reports = nil
27
+ end
28
+
29
+ ##
30
+ # @param [String] report_id A unique Report Id.
31
+ # @return [Twilio::REST::Insights::V2::InboundContext] if reportId was passed.
32
+ # @return [Twilio::REST::Insights::V2::InboundList]
33
+ def inbound(report_id=:unset)
34
+ if report_id.nil?
35
+ raise ArgumentError, 'report_id cannot be nil'
36
+ end
37
+ if report_id == :unset
38
+ @inbound ||= InboundList.new self
39
+ else
40
+ InboundContext.new(self, report_id)
41
+ end
42
+ end
43
+ ##
44
+ # @param [String] report_id A unique Report Id.
45
+ # @return [Twilio::REST::Insights::V2::OutboundContext] if reportId was passed.
46
+ # @return [Twilio::REST::Insights::V2::OutboundList]
47
+ def outbound(report_id=:unset)
48
+ if report_id.nil?
49
+ raise ArgumentError, 'report_id cannot be nil'
50
+ end
51
+ if report_id == :unset
52
+ @outbound ||= OutboundList.new self
53
+ else
54
+ OutboundContext.new(self, report_id)
55
+ end
56
+ end
57
+ ##
58
+ # @param [String] report_id A unique request id.
59
+ # @return [Twilio::REST::Insights::V2::ReportContext] if reportId was passed.
60
+ # @return [Twilio::REST::Insights::V2::ReportList]
61
+ def reports(report_id=:unset)
62
+ if report_id.nil?
63
+ raise ArgumentError, 'report_id cannot be nil'
64
+ end
65
+ if report_id == :unset
66
+ @reports ||= ReportList.new self
67
+ else
68
+ ReportContext.new(self, report_id)
69
+ end
70
+ end
71
+ ##
72
+ # Provide a user friendly representation
73
+ def to_s
74
+ '<Twilio::REST::Insights::V2>';
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -22,16 +22,21 @@ module Twilio
22
22
  @host = "insights.twilio.com"
23
23
  @port = 443
24
24
  @v1 = nil
25
+ @v2 = nil
25
26
  end
26
27
 
27
28
  def v1
28
29
  @v1 ||= Insights::V1.new self
29
30
  end
30
31
 
32
+ def v2
33
+ @v2 ||= Insights::V2.new self
34
+ end
35
+
31
36
  ##
32
37
  # Provide a user friendly representation
33
38
  def to_s
34
- '<Twilio::REST::Insights::V1>';
39
+ '<Twilio::REST::Insights>';
35
40
  end
36
41
  end
37
42
  end
@@ -0,0 +1,251 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Numbers
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 Numbers < NumbersBase
19
+ class V1 < Version
20
+ class EmbeddedSessionList < ListResource
21
+
22
+ class NumbersV1CreateEmbeddedSessionRequest
23
+ # @param [theme_set_id]: [String] Theme ID for the Compliance Embeddable UI. Overrides the theme set during registration creation.
24
+ attr_accessor :theme_set_id
25
+ def initialize(payload)
26
+ @theme_set_id = payload["theme_set_id"]
27
+ end
28
+ def to_json(options = {})
29
+ {
30
+ "themeSetId": @theme_set_id,
31
+ }.to_json(options)
32
+ end
33
+ end
34
+
35
+
36
+ ##
37
+ # Initialize the EmbeddedSessionList
38
+ # @param [Version] version Version that contains the resource
39
+ # @return [EmbeddedSessionList] EmbeddedSessionList
40
+ def initialize(version, bundle_sid: nil)
41
+ super(version)
42
+
43
+ # Path Solution
44
+ @solution = { bundle_sid: bundle_sid }
45
+ @uri = "/SenderIdRegistrations/#{@solution[:bundle_sid]}/EmbeddedSessions"
46
+
47
+ end
48
+ ##
49
+ # Create the EmbeddedSessionInstance
50
+ # @param [NumbersV1CreateEmbeddedSessionRequest] numbers_v1_create_embedded_session_request
51
+ # @return [EmbeddedSessionInstance] Created EmbeddedSessionInstance
52
+ def create(numbers_v1_create_embedded_session_request: nil
53
+ )
54
+
55
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
56
+ headers['Content-Type'] = 'application/json'
57
+
58
+
59
+
60
+
61
+ payload = @version.create('POST', @uri, headers: headers, data: numbers_v1_create_embedded_session_request.to_json)
62
+ EmbeddedSessionInstance.new(
63
+ @version,
64
+ payload,
65
+ bundle_sid: @solution[:bundle_sid],
66
+ )
67
+ end
68
+
69
+ ##
70
+ # Create the EmbeddedSessionInstanceMetadata
71
+ # @param [NumbersV1CreateEmbeddedSessionRequest] numbers_v1_create_embedded_session_request
72
+ # @return [EmbeddedSessionInstance] Created EmbeddedSessionInstance
73
+ def create_with_metadata(numbers_v1_create_embedded_session_request: nil
74
+ )
75
+
76
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
77
+ headers['Content-Type'] = 'application/json'
78
+
79
+
80
+
81
+
82
+ response = @version.create_with_metadata('POST', @uri, headers: headers, data: numbers_v1_create_embedded_session_request.to_json)
83
+ embedded_session_instance = EmbeddedSessionInstance.new(
84
+ @version,
85
+ response.body,
86
+ bundle_sid: @solution[:bundle_sid],
87
+ )
88
+ EmbeddedSessionInstanceMetadata.new(
89
+ @version,
90
+ embedded_session_instance,
91
+ response.headers,
92
+ response.status_code
93
+ )
94
+ end
95
+
96
+
97
+
98
+
99
+ # Provide a user friendly representation
100
+ def to_s
101
+ '#<Twilio.Numbers.V1.EmbeddedSessionList>'
102
+ end
103
+ end
104
+
105
+ class EmbeddedSessionPage < Page
106
+ ##
107
+ # Initialize the EmbeddedSessionPage
108
+ # @param [Version] version Version that contains the resource
109
+ # @param [Response] response Response from the API
110
+ # @param [Hash] solution Path solution for the resource
111
+ # @return [EmbeddedSessionPage] EmbeddedSessionPage
112
+ def initialize(version, response, solution)
113
+ super(version, response)
114
+
115
+
116
+ # Path Solution
117
+ @solution = solution
118
+ end
119
+
120
+ ##
121
+ # Build an instance of EmbeddedSessionInstance
122
+ # @param [Hash] payload Payload response from the API
123
+ # @return [EmbeddedSessionInstance] EmbeddedSessionInstance
124
+ def get_instance(payload)
125
+ EmbeddedSessionInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid])
126
+ end
127
+
128
+ ##
129
+ # Provide a user friendly representation
130
+ def to_s
131
+ '<Twilio.Numbers.V1.EmbeddedSessionPage>'
132
+ end
133
+ end
134
+
135
+ class EmbeddedSessionPageMetadata < PageMetadata
136
+ attr_reader :embedded_session_page
137
+
138
+ def initialize(version, response, solution, limit)
139
+ super(version, response)
140
+ @embedded_session_page = []
141
+ @limit = limit
142
+ key = get_key(response.body)
143
+ records = 0
144
+ while( limit != :unset && records < limit )
145
+ @embedded_session_page << EmbeddedSessionListResponse.new(version, @payload, key, limit - records)
146
+ @payload = self.next_page
147
+ break unless @payload
148
+ records += @payload.body[key].size
149
+ end
150
+ # Path Solution
151
+ @solution = solution
152
+ end
153
+
154
+ def each
155
+ @embedded_session_page.each do |record|
156
+ yield record
157
+ end
158
+ end
159
+
160
+ def to_s
161
+ '<Twilio::REST::Numbers::V1PageMetadata>';
162
+ end
163
+ end
164
+ class EmbeddedSessionListResponse < InstanceListResource
165
+
166
+ # @param [Array<EmbeddedSessionInstance>] instance
167
+ # @param [Hash{String => Object}] headers
168
+ # @param [Integer] status_code
169
+ def initialize(version, payload, key, limit = :unset)
170
+ data_list = payload.body[key]
171
+ if limit != :unset
172
+ data_list = data_list[0, limit]
173
+ end
174
+ @embedded_session = data_list.map do |data|
175
+ EmbeddedSessionInstance.new(version, data)
176
+ end
177
+ @headers = payload.headers
178
+ @status_code = payload.status_code
179
+ end
180
+
181
+ def embedded_session
182
+ @embedded_session
183
+ end
184
+
185
+ def headers
186
+ @headers
187
+ end
188
+
189
+ def status_code
190
+ @status_code
191
+ end
192
+ end
193
+
194
+ class EmbeddedSessionInstance < InstanceResource
195
+ ##
196
+ # Initialize the EmbeddedSessionInstance
197
+ # @param [Version] version Version that contains the resource
198
+ # @param [Hash] payload payload that contains response from Twilio
199
+ # @param [String] account_sid The SID of the
200
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this EmbeddedSession
201
+ # resource.
202
+ # @param [String] sid The SID of the Call resource to fetch.
203
+ # @return [EmbeddedSessionInstance] EmbeddedSessionInstance
204
+ def initialize(version, payload , bundle_sid: nil)
205
+ super(version)
206
+
207
+
208
+ # Marshaled Properties
209
+ @properties = {
210
+ 'id' => payload['id'],
211
+ 'session_id' => payload['session_id'],
212
+ 'session_token' => payload['session_token'],
213
+ }
214
+ end
215
+
216
+
217
+ ##
218
+ # @return [String] Registration identifier (BU-prefixed).
219
+ def id
220
+ @properties['id']
221
+ end
222
+
223
+ ##
224
+ # @return [String] Session ID for the compliance embeddable.
225
+ def session_id
226
+ @properties['session_id']
227
+ end
228
+
229
+ ##
230
+ # @return [String] Ephemeral session token for the compliance embeddable.
231
+ def session_token
232
+ @properties['session_token']
233
+ end
234
+
235
+ ##
236
+ # Provide a user friendly representation
237
+ def to_s
238
+ "<Twilio.Numbers.V1.EmbeddedSessionInstance>"
239
+ end
240
+
241
+ ##
242
+ # Provide a detailed, user friendly representation
243
+ def inspect
244
+ "<Twilio.Numbers.V1.EmbeddedSessionInstance>"
245
+ end
246
+ end
247
+
248
+ end
249
+ end
250
+ end
251
+ end
@@ -0,0 +1,333 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Numbers
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 Numbers < NumbersBase
19
+ class V1 < Version
20
+ class SenderIdRegistrationList < ListResource
21
+
22
+ class NumbersV1CreateEmbeddedRegistrationRequest
23
+ # @param [regulation_id]: [String] The regulation for this registration.
24
+ # @param [regulation_version]: [String] The regulation version.
25
+ # @param [friendly_name]: [String] Human-readable name for the registration.
26
+ # @param [status_notification_email]: [String] Email address for registration status notifications.
27
+ # @param [status_callback_url]: [String] The URL of this resource.
28
+ # @param [comments]: [String] Additional comments about the registration.
29
+ # @param [theme_set_id]: [String] Theme ID for the Compliance Embeddable UI.
30
+ # @param [data]: [Hash<String, Object>] Registration data organized by section (alphanumericSender, business, useCase, authorizedRepresentative, officer, businessAddress).
31
+ attr_accessor :regulation_id, :regulation_version, :friendly_name, :status_notification_email, :status_callback_url, :comments, :theme_set_id, :data
32
+ def initialize(payload)
33
+ @regulation_id = payload["regulation_id"]
34
+ @regulation_version = payload["regulation_version"]
35
+ @friendly_name = payload["friendly_name"]
36
+ @status_notification_email = payload["status_notification_email"]
37
+ @status_callback_url = payload["status_callback_url"]
38
+ @comments = payload["comments"]
39
+ @theme_set_id = payload["theme_set_id"]
40
+ @data = payload["data"]
41
+ end
42
+ def to_json(options = {})
43
+ {
44
+ "regulationId": @regulation_id,
45
+ "regulationVersion": @regulation_version,
46
+ "friendlyName": @friendly_name,
47
+ "statusNotificationEmail": @status_notification_email,
48
+ "statusCallbackUrl": @status_callback_url,
49
+ "comments": @comments,
50
+ "themeSetId": @theme_set_id,
51
+ "data": @data,
52
+ }.to_json(options)
53
+ end
54
+ end
55
+
56
+
57
+ ##
58
+ # Initialize the SenderIdRegistrationList
59
+ # @param [Version] version Version that contains the resource
60
+ # @return [SenderIdRegistrationList] SenderIdRegistrationList
61
+ def initialize(version)
62
+ super(version)
63
+
64
+ # Path Solution
65
+ @solution = { }
66
+ @uri = "/SenderIdRegistrations"
67
+
68
+ end
69
+ ##
70
+ # Create the SenderIdRegistrationInstance
71
+ # @param [NumbersV1CreateEmbeddedRegistrationRequest] numbers_v1_create_embedded_registration_request
72
+ # @return [SenderIdRegistrationInstance] Created SenderIdRegistrationInstance
73
+ def create(numbers_v1_create_embedded_registration_request: nil
74
+ )
75
+
76
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
77
+ headers['Content-Type'] = 'application/json'
78
+
79
+
80
+
81
+
82
+ payload = @version.create('POST', @uri, headers: headers, data: numbers_v1_create_embedded_registration_request.to_json)
83
+ SenderIdRegistrationInstance.new(
84
+ @version,
85
+ payload,
86
+ )
87
+ end
88
+
89
+ ##
90
+ # Create the SenderIdRegistrationInstanceMetadata
91
+ # @param [NumbersV1CreateEmbeddedRegistrationRequest] numbers_v1_create_embedded_registration_request
92
+ # @return [SenderIdRegistrationInstance] Created SenderIdRegistrationInstance
93
+ def create_with_metadata(numbers_v1_create_embedded_registration_request: nil
94
+ )
95
+
96
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
97
+ headers['Content-Type'] = 'application/json'
98
+
99
+
100
+
101
+
102
+ response = @version.create_with_metadata('POST', @uri, headers: headers, data: numbers_v1_create_embedded_registration_request.to_json)
103
+ sender_id_registration_instance = SenderIdRegistrationInstance.new(
104
+ @version,
105
+ response.body,
106
+ )
107
+ SenderIdRegistrationInstanceMetadata.new(
108
+ @version,
109
+ sender_id_registration_instance,
110
+ response.headers,
111
+ response.status_code
112
+ )
113
+ end
114
+
115
+
116
+
117
+
118
+ # Provide a user friendly representation
119
+ def to_s
120
+ '#<Twilio.Numbers.V1.SenderIdRegistrationList>'
121
+ end
122
+ end
123
+
124
+ class SenderIdRegistrationPage < Page
125
+ ##
126
+ # Initialize the SenderIdRegistrationPage
127
+ # @param [Version] version Version that contains the resource
128
+ # @param [Response] response Response from the API
129
+ # @param [Hash] solution Path solution for the resource
130
+ # @return [SenderIdRegistrationPage] SenderIdRegistrationPage
131
+ def initialize(version, response, solution)
132
+ super(version, response)
133
+
134
+
135
+ # Path Solution
136
+ @solution = solution
137
+ end
138
+
139
+ ##
140
+ # Build an instance of SenderIdRegistrationInstance
141
+ # @param [Hash] payload Payload response from the API
142
+ # @return [SenderIdRegistrationInstance] SenderIdRegistrationInstance
143
+ def get_instance(payload)
144
+ SenderIdRegistrationInstance.new(@version, payload)
145
+ end
146
+
147
+ ##
148
+ # Provide a user friendly representation
149
+ def to_s
150
+ '<Twilio.Numbers.V1.SenderIdRegistrationPage>'
151
+ end
152
+ end
153
+
154
+ class SenderIdRegistrationPageMetadata < PageMetadata
155
+ attr_reader :sender_id_registration_page
156
+
157
+ def initialize(version, response, solution, limit)
158
+ super(version, response)
159
+ @sender_id_registration_page = []
160
+ @limit = limit
161
+ key = get_key(response.body)
162
+ records = 0
163
+ while( limit != :unset && records < limit )
164
+ @sender_id_registration_page << SenderIdRegistrationListResponse.new(version, @payload, key, limit - records)
165
+ @payload = self.next_page
166
+ break unless @payload
167
+ records += @payload.body[key].size
168
+ end
169
+ # Path Solution
170
+ @solution = solution
171
+ end
172
+
173
+ def each
174
+ @sender_id_registration_page.each do |record|
175
+ yield record
176
+ end
177
+ end
178
+
179
+ def to_s
180
+ '<Twilio::REST::Numbers::V1PageMetadata>';
181
+ end
182
+ end
183
+ class SenderIdRegistrationListResponse < InstanceListResource
184
+
185
+ # @param [Array<SenderIdRegistrationInstance>] instance
186
+ # @param [Hash{String => Object}] headers
187
+ # @param [Integer] status_code
188
+ def initialize(version, payload, key, limit = :unset)
189
+ data_list = payload.body[key]
190
+ if limit != :unset
191
+ data_list = data_list[0, limit]
192
+ end
193
+ @sender_id_registration = data_list.map do |data|
194
+ SenderIdRegistrationInstance.new(version, data)
195
+ end
196
+ @headers = payload.headers
197
+ @status_code = payload.status_code
198
+ end
199
+
200
+ def sender_id_registration
201
+ @sender_id_registration
202
+ end
203
+
204
+ def headers
205
+ @headers
206
+ end
207
+
208
+ def status_code
209
+ @status_code
210
+ end
211
+ end
212
+
213
+ class SenderIdRegistrationInstance < InstanceResource
214
+ ##
215
+ # Initialize the SenderIdRegistrationInstance
216
+ # @param [Version] version Version that contains the resource
217
+ # @param [Hash] payload payload that contains response from Twilio
218
+ # @param [String] account_sid The SID of the
219
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this SenderIdRegistration
220
+ # resource.
221
+ # @param [String] sid The SID of the Call resource to fetch.
222
+ # @return [SenderIdRegistrationInstance] SenderIdRegistrationInstance
223
+ def initialize(version, payload )
224
+ super(version)
225
+
226
+
227
+ # Marshaled Properties
228
+ @properties = {
229
+ 'id' => payload['id'],
230
+ 'regulation_id' => payload['regulation_id'],
231
+ 'regulation_version' => payload['regulation_version'] == nil ? payload['regulation_version'] : payload['regulation_version'].to_i,
232
+ 'friendly_name' => payload['friendly_name'],
233
+ 'status' => payload['status'],
234
+ 'status_notification_email' => payload['status_notification_email'],
235
+ 'status_callback_url' => payload['status_callback_url'],
236
+ 'comments' => payload['comments'],
237
+ 'embedded_session' => payload['embedded_session'],
238
+ 'data' => payload['data'],
239
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
240
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
241
+ }
242
+ end
243
+
244
+
245
+ ##
246
+ # @return [String] Registration identifier (BU-prefixed).
247
+ def id
248
+ @properties['id']
249
+ end
250
+
251
+ ##
252
+ # @return [String] The regulation ID for this registration.
253
+ def regulation_id
254
+ @properties['regulation_id']
255
+ end
256
+
257
+ ##
258
+ # @return [String] The regulation version.
259
+ def regulation_version
260
+ @properties['regulation_version']
261
+ end
262
+
263
+ ##
264
+ # @return [String] The friendly name provided in the request.
265
+ def friendly_name
266
+ @properties['friendly_name']
267
+ end
268
+
269
+ ##
270
+ # @return [String] Registration status. Always DRAFT on creation.
271
+ def status
272
+ @properties['status']
273
+ end
274
+
275
+ ##
276
+ # @return [String] Email address for status notifications.
277
+ def status_notification_email
278
+ @properties['status_notification_email']
279
+ end
280
+
281
+ ##
282
+ # @return [String] Callback URL for status webhooks.
283
+ def status_callback_url
284
+ @properties['status_callback_url']
285
+ end
286
+
287
+ ##
288
+ # @return [String] Additional comments.
289
+ def comments
290
+ @properties['comments']
291
+ end
292
+
293
+ ##
294
+ # @return [NumbersV1EmbeddedSession]
295
+ def embedded_session
296
+ @properties['embedded_session']
297
+ end
298
+
299
+ ##
300
+ # @return [Hash<String, Object>] Registration data echoed from the request.
301
+ def data
302
+ @properties['data']
303
+ end
304
+
305
+ ##
306
+ # @return [Time] Timestamp of creation.
307
+ def date_created
308
+ @properties['date_created']
309
+ end
310
+
311
+ ##
312
+ # @return [Time] Timestamp of last update.
313
+ def date_updated
314
+ @properties['date_updated']
315
+ end
316
+
317
+ ##
318
+ # Provide a user friendly representation
319
+ def to_s
320
+ "<Twilio.Numbers.V1.SenderIdRegistrationInstance>"
321
+ end
322
+
323
+ ##
324
+ # Provide a detailed, user friendly representation
325
+ def inspect
326
+ "<Twilio.Numbers.V1.SenderIdRegistrationInstance>"
327
+ end
328
+ end
329
+
330
+ end
331
+ end
332
+ end
333
+ end