twilio-ruby 7.10.1 → 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.
Files changed (33) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test-and-deploy.yml +2 -1
  3. data/CHANGES.md +89 -0
  4. data/Dockerfile +1 -1
  5. data/README.md +2 -2
  6. data/cluster/cluster_oauth_spec.rb +4 -4
  7. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +14 -2
  8. data/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb +12 -0
  9. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +8 -8
  10. data/lib/twilio-ruby/rest/flex_api/v1/create_flex_instance.rb +1 -1
  11. data/lib/twilio-ruby/rest/flex_api_base.rb +1 -6
  12. data/lib/twilio-ruby/rest/insights/v2/inbound.rb +570 -0
  13. data/lib/twilio-ruby/rest/insights/v2/outbound.rb +641 -0
  14. data/lib/twilio-ruby/rest/insights/v2/report.rb +940 -0
  15. data/lib/twilio-ruby/rest/insights/v2.rb +79 -0
  16. data/lib/twilio-ruby/rest/insights_base.rb +6 -1
  17. data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +12 -4
  18. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +93 -19
  19. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +21 -21
  20. data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +2 -2
  21. data/lib/twilio-ruby/rest/numbers/v1/embedded_session.rb +251 -0
  22. data/lib/twilio-ruby/rest/numbers/v1/sender_id_registration.rb +333 -0
  23. data/lib/twilio-ruby/rest/numbers/v1.rb +12 -0
  24. data/lib/twilio-ruby/rest/numbers/v2/application.rb +153 -8
  25. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +20 -4
  26. data/lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb +197 -0
  27. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +14 -0
  28. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +7 -0
  29. data/lib/twilio-ruby/rest/studio/v2/flow.rb +7 -0
  30. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +2 -2
  31. data/lib/twilio-ruby/rest/video/v1/room/transcriptions.rb +12 -3
  32. data/lib/twilio-ruby/version.rb +1 -1
  33. metadata +10 -9
@@ -131,6 +131,11 @@ module Twilio
131
131
  # Lists ApplicationInstance records from the API as a list.
132
132
  # Unlike stream(), this operation is eager and will load `limit` records into
133
133
  # memory before returning.
134
+ # @param [String] account_sid The Account SID to filter by.
135
+ # @param [String] iso_country The ISO country to filter by.
136
+ # @param [String] status The application status to filter by.
137
+ # @param [String] friendly_name The friendly name to filter by.
138
+ # @param [String] sid The application SID to filter by.
134
139
  # @param [Integer] limit Upper limit for the number of records to return. stream()
135
140
  # guarantees to never return more than limit. Default is no limit
136
141
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -138,8 +143,13 @@ module Twilio
138
143
  # but a limit is defined, stream() will attempt to read the limit with the most
139
144
  # efficient page size, i.e. min(limit, 1000)
140
145
  # @return [Array] Array of up to limit results
141
- def list(limit: nil, page_size: nil)
146
+ def list(account_sid: :unset, iso_country: :unset, status: :unset, friendly_name: :unset, sid: :unset, limit: nil, page_size: nil)
142
147
  self.stream(
148
+ account_sid: account_sid,
149
+ iso_country: iso_country,
150
+ status: status,
151
+ friendly_name: friendly_name,
152
+ sid: sid,
143
153
  limit: limit,
144
154
  page_size: page_size
145
155
  ).entries
@@ -149,6 +159,11 @@ module Twilio
149
159
  # Streams Instance records from the API as an Enumerable.
150
160
  # This operation lazily loads records as efficiently as possible until the limit
151
161
  # is reached.
162
+ # @param [String] account_sid The Account SID to filter by.
163
+ # @param [String] iso_country The ISO country to filter by.
164
+ # @param [String] status The application status to filter by.
165
+ # @param [String] friendly_name The friendly name to filter by.
166
+ # @param [String] sid The application SID to filter by.
152
167
  # @param [Integer] limit Upper limit for the number of records to return. stream()
153
168
  # guarantees to never return more than limit. Default is no limit
154
169
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -156,10 +171,15 @@ module Twilio
156
171
  # but a limit is defined, stream() will attempt to read the limit with the most
157
172
  # efficient page size, i.e. min(limit, 1000)
158
173
  # @return [Enumerable] Enumerable that will yield up to limit results
159
- def stream(limit: nil, page_size: nil)
174
+ def stream(account_sid: :unset, iso_country: :unset, status: :unset, friendly_name: :unset, sid: :unset, limit: nil, page_size: nil)
160
175
  limits = @version.read_limits(limit, page_size)
161
176
 
162
177
  page = self.page(
178
+ account_sid: account_sid,
179
+ iso_country: iso_country,
180
+ status: status,
181
+ friendly_name: friendly_name,
182
+ sid: sid,
163
183
  page_size: limits[:page_size], )
164
184
 
165
185
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
@@ -167,6 +187,11 @@ module Twilio
167
187
 
168
188
  ##
169
189
  # Lists ApplicationPageMetadata records from the API as a list.
190
+ # @param [String] account_sid The Account SID to filter by.
191
+ # @param [String] iso_country The ISO country to filter by.
192
+ # @param [String] status The application status to filter by.
193
+ # @param [String] friendly_name The friendly name to filter by.
194
+ # @param [String] sid The application SID to filter by.
170
195
  # @param [Integer] limit Upper limit for the number of records to return. stream()
171
196
  # guarantees to never return more than limit. Default is no limit
172
197
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -174,9 +199,14 @@ module Twilio
174
199
  # but a limit is defined, stream() will attempt to read the limit with the most
175
200
  # efficient page size, i.e. min(limit, 1000)
176
201
  # @return [Array] Array of up to limit results
177
- def list_with_metadata(limit: nil, page_size: nil)
202
+ def list_with_metadata(account_sid: :unset, iso_country: :unset, status: :unset, friendly_name: :unset, sid: :unset, limit: nil, page_size: nil)
178
203
  limits = @version.read_limits(limit, page_size)
179
204
  params = Twilio::Values.of({
205
+ 'AccountSid' => account_sid,
206
+ 'IsoCountry' => iso_country,
207
+ 'Status' => status,
208
+ 'FriendlyName' => friendly_name,
209
+ 'Sid' => sid,
180
210
 
181
211
  'PageSize' => limits[:page_size],
182
212
  });
@@ -204,12 +234,22 @@ module Twilio
204
234
  ##
205
235
  # Retrieve a single page of ApplicationInstance records from the API.
206
236
  # Request is executed immediately.
237
+ # @param [String] account_sid The Account SID to filter by.
238
+ # @param [String] iso_country The ISO country to filter by.
239
+ # @param [String] status The application status to filter by.
240
+ # @param [String] friendly_name The friendly name to filter by.
241
+ # @param [String] sid The application SID to filter by.
207
242
  # @param [String] page_token PageToken provided by the API
208
243
  # @param [Integer] page_number Page Number, this value is simply for client state
209
244
  # @param [Integer] page_size Number of records to return, defaults to 50
210
245
  # @return [Page] Page of ApplicationInstance
211
- def page(page_token: :unset, page_number: :unset,page_size: :unset)
246
+ def page(account_sid: :unset, iso_country: :unset, status: :unset, friendly_name: :unset, sid: :unset, page_token: :unset, page_number: :unset,page_size: :unset)
212
247
  params = Twilio::Values.of({
248
+ 'AccountSid' => account_sid,
249
+ 'IsoCountry' => iso_country,
250
+ 'Status' => status,
251
+ 'FriendlyName' => friendly_name,
252
+ 'Sid' => sid,
213
253
  'PageToken' => page_token,
214
254
  'Page' => page_number,
215
255
  'PageSize' => page_size,
@@ -474,11 +514,26 @@ module Twilio
474
514
  # Marshaled Properties
475
515
  @properties = {
476
516
  'sid' => payload['sid'],
477
- 'bundle_sid' => payload['bundle_sid'],
478
517
  'application_requirements_sid' => payload['application_requirements_sid'],
518
+ 'application_requirements_version' => payload['application_requirements_version'] == nil ? payload['application_requirements_version'] : payload['application_requirements_version'].to_i,
519
+ 'account_sid' => payload['account_sid'],
520
+ 'bundle_sid' => payload['bundle_sid'],
521
+ 'reviewer' => payload['reviewer'],
522
+ 'zendesk_ticket_id' => payload['zendesk_ticket_id'],
479
523
  'friendly_name' => payload['friendly_name'],
524
+ 'notification_emails' => payload['notification_emails'],
480
525
  'iso_country' => payload['iso_country'],
481
526
  'state' => payload['state'],
527
+ 'setup' => payload['setup'],
528
+ 'business_information' => payload['business_information'],
529
+ 'user_sign_up' => payload['user_sign_up'],
530
+ 'compliance_keywords' => payload['compliance_keywords'],
531
+ 'content_examples' => payload['content_examples'],
532
+ 'sms_campaign_details' => payload['sms_campaign_details'],
533
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
534
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
535
+ 'created_by' => payload['created_by'],
536
+ 'updated_by' => payload['updated_by'],
482
537
  }
483
538
 
484
539
  # Context
@@ -503,6 +558,24 @@ module Twilio
503
558
  @properties['sid']
504
559
  end
505
560
 
561
+ ##
562
+ # @return [String] The Application Requirements SID.
563
+ def application_requirements_sid
564
+ @properties['application_requirements_sid']
565
+ end
566
+
567
+ ##
568
+ # @return [String] The version of the application requirements.
569
+ def application_requirements_version
570
+ @properties['application_requirements_version']
571
+ end
572
+
573
+ ##
574
+ # @return [String] The Account SID associated with the application.
575
+ def account_sid
576
+ @properties['account_sid']
577
+ end
578
+
506
579
  ##
507
580
  # @return [String] The Bundle SID for regulatory compliance.
508
581
  def bundle_sid
@@ -510,9 +583,15 @@ module Twilio
510
583
  end
511
584
 
512
585
  ##
513
- # @return [String] The Application Requirements SID.
514
- def application_requirements_sid
515
- @properties['application_requirements_sid']
586
+ # @return [String] The reviewer of the application.
587
+ def reviewer
588
+ @properties['reviewer']
589
+ end
590
+
591
+ ##
592
+ # @return [String] The Zendesk ticket ID associated with the application.
593
+ def zendesk_ticket_id
594
+ @properties['zendesk_ticket_id']
516
595
  end
517
596
 
518
597
  ##
@@ -521,6 +600,12 @@ module Twilio
521
600
  @properties['friendly_name']
522
601
  end
523
602
 
603
+ ##
604
+ # @return [Array<String>] The notification emails for the application.
605
+ def notification_emails
606
+ @properties['notification_emails']
607
+ end
608
+
524
609
  ##
525
610
  # @return [String] The ISO country code.
526
611
  def iso_country
@@ -533,6 +618,66 @@ module Twilio
533
618
  @properties['state']
534
619
  end
535
620
 
621
+ ##
622
+ # @return [CreateShortCodeApplicationResponseSetup]
623
+ def setup
624
+ @properties['setup']
625
+ end
626
+
627
+ ##
628
+ # @return [CreateShortCodeApplicationResponseBusinessInformation]
629
+ def business_information
630
+ @properties['business_information']
631
+ end
632
+
633
+ ##
634
+ # @return [CreateShortCodeApplicationResponseUserSignUp]
635
+ def user_sign_up
636
+ @properties['user_sign_up']
637
+ end
638
+
639
+ ##
640
+ # @return [CreateShortCodeApplicationResponseComplianceKeywords]
641
+ def compliance_keywords
642
+ @properties['compliance_keywords']
643
+ end
644
+
645
+ ##
646
+ # @return [CreateShortCodeApplicationResponseContentExamples]
647
+ def content_examples
648
+ @properties['content_examples']
649
+ end
650
+
651
+ ##
652
+ # @return [CreateShortCodeApplicationResponseSmsCampaignDetails]
653
+ def sms_campaign_details
654
+ @properties['sms_campaign_details']
655
+ end
656
+
657
+ ##
658
+ # @return [Time] The date and time the application was created.
659
+ def date_created
660
+ @properties['date_created']
661
+ end
662
+
663
+ ##
664
+ # @return [Time] The date and time the application was last updated.
665
+ def date_updated
666
+ @properties['date_updated']
667
+ end
668
+
669
+ ##
670
+ # @return [String] The identity of the user who created the application.
671
+ def created_by
672
+ @properties['created_by']
673
+ end
674
+
675
+ ##
676
+ # @return [String] The identity of the user who last updated the application.
677
+ def updated_by
678
+ @properties['updated_by']
679
+ end
680
+
536
681
  ##
537
682
  # Fetch the ApplicationInstance
538
683
  # @return [ApplicationInstance] Fetched ApplicationInstance
@@ -137,10 +137,12 @@ module Twilio
137
137
  # Unlike stream(), this operation is eager and will load `limit` records into
138
138
  # memory before returning.
139
139
  # @param [Status] status The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details.
140
+ # @param [String] bundle_sids A comma-separated list of Bundle SIDs to filter the results (maximum 20). Each Bundle SID must match `^BU[0-9a-fA-F]{32}$`.
140
141
  # @param [String] friendly_name The string that you assigned to describe the resource. The column can contain 255 variable characters.
141
142
  # @param [String] regulation_sid The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource.
142
143
  # @param [String] iso_country The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request.
143
144
  # @param [String] number_type The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`.
145
+ # @param [String] end_user_type The end user type of the regulation of the Bundle. Can be `business` or `individual`.
144
146
  # @param [Boolean] has_valid_until_date Indicates that the Bundle is a valid Bundle until a specified expiration date.
145
147
  # @param [SortBy] sort_by Can be `valid-until` or `date-updated`. Defaults to `date-created`.
146
148
  # @param [SortDirection] sort_direction Default is `DESC`. Can be `ASC` or `DESC`.
@@ -154,13 +156,15 @@ module Twilio
154
156
  # but a limit is defined, stream() will attempt to read the limit with the most
155
157
  # efficient page size, i.e. min(limit, 1000)
156
158
  # @return [Array] Array of up to limit results
157
- def list(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
159
+ def list(status: :unset, bundle_sids: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, end_user_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
158
160
  self.stream(
159
161
  status: status,
162
+ bundle_sids: bundle_sids,
160
163
  friendly_name: friendly_name,
161
164
  regulation_sid: regulation_sid,
162
165
  iso_country: iso_country,
163
166
  number_type: number_type,
167
+ end_user_type: end_user_type,
164
168
  has_valid_until_date: has_valid_until_date,
165
169
  sort_by: sort_by,
166
170
  sort_direction: sort_direction,
@@ -177,10 +181,12 @@ module Twilio
177
181
  # This operation lazily loads records as efficiently as possible until the limit
178
182
  # is reached.
179
183
  # @param [Status] status The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details.
184
+ # @param [String] bundle_sids A comma-separated list of Bundle SIDs to filter the results (maximum 20). Each Bundle SID must match `^BU[0-9a-fA-F]{32}$`.
180
185
  # @param [String] friendly_name The string that you assigned to describe the resource. The column can contain 255 variable characters.
181
186
  # @param [String] regulation_sid The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource.
182
187
  # @param [String] iso_country The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request.
183
188
  # @param [String] number_type The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`.
189
+ # @param [String] end_user_type The end user type of the regulation of the Bundle. Can be `business` or `individual`.
184
190
  # @param [Boolean] has_valid_until_date Indicates that the Bundle is a valid Bundle until a specified expiration date.
185
191
  # @param [SortBy] sort_by Can be `valid-until` or `date-updated`. Defaults to `date-created`.
186
192
  # @param [SortDirection] sort_direction Default is `DESC`. Can be `ASC` or `DESC`.
@@ -194,15 +200,17 @@ module Twilio
194
200
  # but a limit is defined, stream() will attempt to read the limit with the most
195
201
  # efficient page size, i.e. min(limit, 1000)
196
202
  # @return [Enumerable] Enumerable that will yield up to limit results
197
- def stream(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
203
+ def stream(status: :unset, bundle_sids: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, end_user_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
198
204
  limits = @version.read_limits(limit, page_size)
199
205
 
200
206
  page = self.page(
201
207
  status: status,
208
+ bundle_sids: bundle_sids,
202
209
  friendly_name: friendly_name,
203
210
  regulation_sid: regulation_sid,
204
211
  iso_country: iso_country,
205
212
  number_type: number_type,
213
+ end_user_type: end_user_type,
206
214
  has_valid_until_date: has_valid_until_date,
207
215
  sort_by: sort_by,
208
216
  sort_direction: sort_direction,
@@ -217,10 +225,12 @@ module Twilio
217
225
  ##
218
226
  # Lists BundlePageMetadata records from the API as a list.
219
227
  # @param [Status] status The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details.
228
+ # @param [String] bundle_sids A comma-separated list of Bundle SIDs to filter the results (maximum 20). Each Bundle SID must match `^BU[0-9a-fA-F]{32}$`.
220
229
  # @param [String] friendly_name The string that you assigned to describe the resource. The column can contain 255 variable characters.
221
230
  # @param [String] regulation_sid The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource.
222
231
  # @param [String] iso_country The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request.
223
232
  # @param [String] number_type The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`.
233
+ # @param [String] end_user_type The end user type of the regulation of the Bundle. Can be `business` or `individual`.
224
234
  # @param [Boolean] has_valid_until_date Indicates that the Bundle is a valid Bundle until a specified expiration date.
225
235
  # @param [SortBy] sort_by Can be `valid-until` or `date-updated`. Defaults to `date-created`.
226
236
  # @param [SortDirection] sort_direction Default is `DESC`. Can be `ASC` or `DESC`.
@@ -234,14 +244,16 @@ module Twilio
234
244
  # but a limit is defined, stream() will attempt to read the limit with the most
235
245
  # efficient page size, i.e. min(limit, 1000)
236
246
  # @return [Array] Array of up to limit results
237
- def list_with_metadata(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
247
+ def list_with_metadata(status: :unset, bundle_sids: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, end_user_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
238
248
  limits = @version.read_limits(limit, page_size)
239
249
  params = Twilio::Values.of({
240
250
  'Status' => status,
251
+ 'BundleSids' => bundle_sids,
241
252
  'FriendlyName' => friendly_name,
242
253
  'RegulationSid' => regulation_sid,
243
254
  'IsoCountry' => iso_country,
244
255
  'NumberType' => number_type,
256
+ 'EndUserType' => end_user_type,
245
257
  'HasValidUntilDate' => has_valid_until_date,
246
258
  'SortBy' => sort_by,
247
259
  'SortDirection' => sort_direction,
@@ -276,10 +288,12 @@ module Twilio
276
288
  # Retrieve a single page of BundleInstance records from the API.
277
289
  # Request is executed immediately.
278
290
  # @param [Status] status The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details.
291
+ # @param [String] bundle_sids A comma-separated list of Bundle SIDs to filter the results (maximum 20). Each Bundle SID must match `^BU[0-9a-fA-F]{32}$`.
279
292
  # @param [String] friendly_name The string that you assigned to describe the resource. The column can contain 255 variable characters.
280
293
  # @param [String] regulation_sid The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource.
281
294
  # @param [String] iso_country The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request.
282
295
  # @param [String] number_type The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`.
296
+ # @param [String] end_user_type The end user type of the regulation of the Bundle. Can be `business` or `individual`.
283
297
  # @param [Boolean] has_valid_until_date Indicates that the Bundle is a valid Bundle until a specified expiration date.
284
298
  # @param [SortBy] sort_by Can be `valid-until` or `date-updated`. Defaults to `date-created`.
285
299
  # @param [SortDirection] sort_direction Default is `DESC`. Can be `ASC` or `DESC`.
@@ -290,13 +304,15 @@ module Twilio
290
304
  # @param [Integer] page_number Page Number, this value is simply for client state
291
305
  # @param [Integer] page_size Number of records to return, defaults to 50
292
306
  # @return [Page] Page of BundleInstance
293
- def page(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, page_token: :unset, page_number: :unset,page_size: :unset)
307
+ def page(status: :unset, bundle_sids: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, end_user_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, page_token: :unset, page_number: :unset,page_size: :unset)
294
308
  params = Twilio::Values.of({
295
309
  'Status' => status,
310
+ 'BundleSids' => bundle_sids,
296
311
  'FriendlyName' => friendly_name,
297
312
  'RegulationSid' => regulation_sid,
298
313
  'IsoCountry' => iso_country,
299
314
  'NumberType' => number_type,
315
+ 'EndUserType' => end_user_type,
300
316
  'HasValidUntilDate' => has_valid_until_date,
301
317
  'SortBy' => sort_by,
302
318
  'SortDirection' => sort_direction,
@@ -21,6 +21,135 @@ module Twilio
21
21
 
22
22
  class UserList < ListResource
23
23
 
24
+ class ScimPatchOperation
25
+ # @param [op]: [String] The operation to perform
26
+ # @param [path]: [String]
27
+ # @param [value]: [Hash]
28
+ attr_accessor :op, :path, :value
29
+ def initialize(payload)
30
+ @op = payload["op"]
31
+ @path = payload["path"]
32
+ @value = payload["value"]
33
+ end
34
+ def to_json(options = {})
35
+ {
36
+ "op": @op,
37
+ "path": @path,
38
+ "value": @value,
39
+ }.to_json(options)
40
+ end
41
+ end
42
+
43
+ class ScimPatchRequest
44
+ # @param [schemas]: [Array<String>]
45
+ # @param [operations]: [Array<UserList.ScimPatchOperation>]
46
+ attr_accessor :schemas, :operations
47
+ def initialize(payload)
48
+ @schemas = payload["schemas"]
49
+ @operations = payload["operations"]
50
+ end
51
+ def to_json(options = {})
52
+ {
53
+ "schemas": @schemas,
54
+ "Operations": @operations,
55
+ }.to_json(options)
56
+ end
57
+ end
58
+
59
+ class ScimUser
60
+ # @param [id]: [String] Unique Twilio user sid
61
+ # @param [external_id]: [String] External unique resource id defined by provisioning client
62
+ # @param [user_name]: [String] Unique username, MUST be same as primary email address
63
+ # @param [display_name]: [String] User friendly display name
64
+ # @param [name]: [UserList.ScimName]
65
+ # @param [emails]: [Array<UserList.ScimEmailAddress>] Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username.
66
+ # @param [active]: [Boolean] Indicates whether the user is active
67
+ # @param [locale]: [String] User's locale
68
+ # @param [timezone]: [String] User's time zone
69
+ # @param [schemas]: [Array<String>] An array of URIs that indicate the schemas supported for this user resource
70
+ # @param [meta]: [UserList.ScimMeta]
71
+ # @param [detail]: [String] A human-readable description of the error
72
+ # @param [scim_type]: [String] A scimType error code as defined in RFC7644
73
+ # @param [status]: [String] Http status code
74
+ # @param [code]: [String] Twilio-specific error code
75
+ # @param [more_info]: [String] Link to Error Code References
76
+ attr_accessor :id, :external_id, :user_name, :display_name, :name, :emails, :active, :locale, :timezone, :schemas, :meta, :detail, :scim_type, :status, :code, :more_info
77
+ def initialize(payload)
78
+ @id = payload["id"]
79
+ @external_id = payload["external_id"]
80
+ @user_name = payload["user_name"]
81
+ @display_name = payload["display_name"]
82
+ @name = payload["name"]
83
+ @emails = payload["emails"]
84
+ @active = payload["active"]
85
+ @locale = payload["locale"]
86
+ @timezone = payload["timezone"]
87
+ @schemas = payload["schemas"]
88
+ @meta = payload["meta"]
89
+ @detail = payload["detail"]
90
+ @scim_type = payload["scim_type"]
91
+ @status = payload["status"]
92
+ @code = payload["code"]
93
+ @more_info = payload["more_info"]
94
+ end
95
+ def to_json(options = {})
96
+ {
97
+ "id": @id,
98
+ "externalId": @external_id,
99
+ "userName": @user_name,
100
+ "displayName": @display_name,
101
+ "name": @name,
102
+ "emails": @emails,
103
+ "active": @active,
104
+ "locale": @locale,
105
+ "timezone": @timezone,
106
+ "schemas": @schemas,
107
+ "meta": @meta,
108
+ "detail": @detail,
109
+ "scimType": @scim_type,
110
+ "status": @status,
111
+ "code": @code,
112
+ "moreInfo": @more_info,
113
+ }.to_json(options)
114
+ end
115
+ end
116
+
117
+
118
+ class ScimPatchOperation
119
+ # @param [op]: [String] The operation to perform
120
+ # @param [path]: [String]
121
+ # @param [value]: [Hash]
122
+ attr_accessor :op, :path, :value
123
+ def initialize(payload)
124
+ @op = payload["op"]
125
+ @path = payload["path"]
126
+ @value = payload["value"]
127
+ end
128
+ def to_json(options = {})
129
+ {
130
+ "op": @op,
131
+ "path": @path,
132
+ "value": @value,
133
+ }.to_json(options)
134
+ end
135
+ end
136
+
137
+ class ScimPatchRequest
138
+ # @param [schemas]: [Array<String>]
139
+ # @param [operations]: [Array<UserList.ScimPatchOperation>]
140
+ attr_accessor :schemas, :operations
141
+ def initialize(payload)
142
+ @schemas = payload["schemas"]
143
+ @operations = payload["operations"]
144
+ end
145
+ def to_json(options = {})
146
+ {
147
+ "schemas": @schemas,
148
+ "Operations": @operations,
149
+ }.to_json(options)
150
+ end
151
+ end
152
+
24
153
  class ScimUser
25
154
  # @param [id]: [String] Unique Twilio user sid
26
155
  # @param [external_id]: [String] External unique resource id defined by provisioning client
@@ -362,6 +491,60 @@ module Twilio
362
491
  )
363
492
  end
364
493
 
494
+ ##
495
+ # Patch the UserInstance
496
+ # @param [String] if_match
497
+ # @param [ScimPatchRequest] scim_patch_request
498
+ # @return [UserInstance] Patched UserInstance
499
+ def patch(
500
+ if_match: :unset,scim_patch_request: nil
501
+ )
502
+
503
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, })
504
+
505
+ headers['Content-Type'] = 'application/scim+json'
506
+
507
+ headers['Accept'] = 'application/scim+json'
508
+
509
+ payload = @version.patch('PATCH', @uri, headers: headers, data: scim_patch_request.to_json)
510
+ UserInstance.new(
511
+ @version,
512
+ payload,
513
+ organization_sid: @solution[:organization_sid],
514
+ id: @solution[:id],
515
+ )
516
+ end
517
+
518
+ ##
519
+ # Patch the UserInstanceMetadata
520
+ # @param [String] if_match
521
+ # @param [ScimPatchRequest] scim_patch_request
522
+ # @return [UserInstance] Patchd UserInstance
523
+ def patch_with_metadata(
524
+ if_match: :unset,scim_patch_request: nil
525
+ )
526
+
527
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, })
528
+
529
+ headers['Content-Type'] = 'application/scim+json'
530
+
531
+ headers['Accept'] = 'application/scim+json'
532
+
533
+ response = @version.patch_with_metadata('PATCH', @uri, headers: headers, data: scim_patch_request.to_json)
534
+ user_instance = UserInstance.new(
535
+ @version,
536
+ response.body,
537
+ organization_sid: @solution[:organization_sid],
538
+ id: @solution[:id],
539
+ )
540
+ UserInstanceMetadata.new(
541
+ @version,
542
+ user_instance,
543
+ response.headers,
544
+ response.status_code
545
+ )
546
+ end
547
+
365
548
  ##
366
549
  # Update the UserInstance
367
550
  # @param [String] if_match
@@ -730,6 +913,20 @@ module Twilio
730
913
  context.fetch
731
914
  end
732
915
 
916
+ ##
917
+ # Patch the UserInstance
918
+ # @param [String] if_match
919
+ # @param [ScimPatchRequest] scim_patch_request
920
+ # @return [UserInstance] Patched UserInstance
921
+ def patch(
922
+ if_match: :unset,scim_patch_request: nil
923
+ )
924
+
925
+ context.patch(
926
+ if_match: if_match,
927
+ )
928
+ end
929
+
733
930
  ##
734
931
  # Update the UserInstance
735
932
  # @param [String] if_match
@@ -597,6 +597,8 @@ module Twilio
597
597
  'account_sid' => payload['account_sid'],
598
598
  'flow_sid' => payload['flow_sid'],
599
599
  'contact_channel_address' => payload['contact_channel_address'],
600
+ 'contact_sid' => payload['contact_sid'],
601
+ 'flow_version' => payload['flow_version'] == nil ? payload['flow_version'] : payload['flow_version'].to_i,
600
602
  'context' => payload['context'],
601
603
  'status' => payload['status'],
602
604
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
@@ -645,6 +647,18 @@ module Twilio
645
647
  @properties['contact_channel_address']
646
648
  end
647
649
 
650
+ ##
651
+ # @return [String] The SID of the Contact.
652
+ def contact_sid
653
+ @properties['contact_sid']
654
+ end
655
+
656
+ ##
657
+ # @return [String] The Flow version number at the time of Execution creation.
658
+ def flow_version
659
+ @properties['flow_version']
660
+ end
661
+
648
662
  ##
649
663
  # @return [Hash] The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution.
650
664
  def context
@@ -385,6 +385,7 @@ module Twilio
385
385
  @properties = {
386
386
  'sid' => payload['sid'],
387
387
  'account_sid' => payload['account_sid'],
388
+ 'author_sid' => payload['author_sid'],
388
389
  'friendly_name' => payload['friendly_name'],
389
390
  'definition' => payload['definition'],
390
391
  'status' => payload['status'],
@@ -425,6 +426,12 @@ module Twilio
425
426
  @properties['account_sid']
426
427
  end
427
428
 
429
+ ##
430
+ # @return [String] The SID of the User that created or last updated the Flow.
431
+ def author_sid
432
+ @properties['author_sid']
433
+ end
434
+
428
435
  ##
429
436
  # @return [String] The string that you assigned to describe the Flow.
430
437
  def friendly_name