twilio-ruby 5.58.0 → 5.59.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGES.md +90 -0
  4. data/README.md +3 -3
  5. data/lib/twilio-ruby/http/http_client.rb +1 -1
  6. data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +667 -0
  7. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +27 -1
  8. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +4 -4
  9. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +4 -4
  10. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +4 -4
  11. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +10 -10
  12. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
  13. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +18 -2
  14. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
  15. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  16. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +44 -38
  17. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +43 -1
  18. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +9 -2
  19. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
  20. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +188 -0
  21. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +188 -0
  22. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +59 -14
  23. data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
  24. data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
  25. data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
  26. data/lib/twilio-ruby/rest/pricing.rb +19 -0
  27. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +1 -1
  28. data/lib/twilio-ruby/rest/serverless/v1/service.rb +7 -0
  29. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +7 -3
  30. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +7 -3
  31. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +23 -11
  32. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +30 -20
  33. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -3
  34. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +6 -2
  35. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +36 -11
  36. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +11 -9
  37. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +8 -8
  38. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +7 -3
  39. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +8 -8
  40. data/lib/twilio-ruby/rest/verify/v2/template.rb +206 -0
  41. data/lib/twilio-ruby/rest/verify/v2.rb +7 -0
  42. data/lib/twilio-ruby/rest/verify.rb +6 -0
  43. data/lib/twilio-ruby/version.rb +1 -1
  44. metadata +9 -3
@@ -30,9 +30,13 @@ module Twilio
30
30
 
31
31
  ##
32
32
  # Fetch the UsAppToPersonUsecaseInstance
33
+ # @param [String] brand_registration_sid The unique string to identify the A2P
34
+ # brand.
33
35
  # @return [UsAppToPersonUsecaseInstance] Fetched UsAppToPersonUsecaseInstance
34
- def fetch
35
- payload = @version.fetch('GET', @uri)
36
+ def fetch(brand_registration_sid: :unset)
37
+ params = Twilio::Values.of({'BrandRegistrationSid' => brand_registration_sid, })
38
+
39
+ payload = @version.fetch('GET', @uri, params: params)
36
40
 
37
41
  UsAppToPersonUsecaseInstance.new(
38
42
  @version,
@@ -0,0 +1,188 @@
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 Numbers < Domain
12
+ class V2 < Version
13
+ class RegulatoryComplianceList < ListResource
14
+ class BundleContext < InstanceContext
15
+ ##
16
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
17
+ class BundleCopyList < ListResource
18
+ ##
19
+ # Initialize the BundleCopyList
20
+ # @param [Version] version Version that contains the resource
21
+ # @param [String] bundle_sid The unique string that we created to identify the
22
+ # Bundle resource.
23
+ # @return [BundleCopyList] BundleCopyList
24
+ def initialize(version, bundle_sid: nil)
25
+ super(version)
26
+
27
+ # Path Solution
28
+ @solution = {bundle_sid: bundle_sid}
29
+ @uri = "/RegulatoryCompliance/Bundles/#{@solution[:bundle_sid]}/Copies"
30
+ end
31
+
32
+ ##
33
+ # Create the BundleCopyInstance
34
+ # @param [String] friendly_name The string that you assigned to describe the
35
+ # copied bundle.
36
+ # @return [BundleCopyInstance] Created BundleCopyInstance
37
+ def create(friendly_name: :unset)
38
+ data = Twilio::Values.of({'FriendlyName' => friendly_name, })
39
+
40
+ payload = @version.create('POST', @uri, data: data)
41
+
42
+ BundleCopyInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], )
43
+ end
44
+
45
+ ##
46
+ # Provide a user friendly representation
47
+ def to_s
48
+ '#<Twilio.Numbers.V2.BundleCopyList>'
49
+ end
50
+ end
51
+
52
+ ##
53
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
54
+ class BundleCopyPage < Page
55
+ ##
56
+ # Initialize the BundleCopyPage
57
+ # @param [Version] version Version that contains the resource
58
+ # @param [Response] response Response from the API
59
+ # @param [Hash] solution Path solution for the resource
60
+ # @return [BundleCopyPage] BundleCopyPage
61
+ def initialize(version, response, solution)
62
+ super(version, response)
63
+
64
+ # Path Solution
65
+ @solution = solution
66
+ end
67
+
68
+ ##
69
+ # Build an instance of BundleCopyInstance
70
+ # @param [Hash] payload Payload response from the API
71
+ # @return [BundleCopyInstance] BundleCopyInstance
72
+ def get_instance(payload)
73
+ BundleCopyInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], )
74
+ end
75
+
76
+ ##
77
+ # Provide a user friendly representation
78
+ def to_s
79
+ '<Twilio.Numbers.V2.BundleCopyPage>'
80
+ end
81
+ end
82
+
83
+ ##
84
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
85
+ class BundleCopyInstance < InstanceResource
86
+ ##
87
+ # Initialize the BundleCopyInstance
88
+ # @param [Version] version Version that contains the resource
89
+ # @param [Hash] payload payload that contains response from Twilio
90
+ # @param [String] bundle_sid The unique string that we created to identify the
91
+ # Bundle resource.
92
+ # @return [BundleCopyInstance] BundleCopyInstance
93
+ def initialize(version, payload, bundle_sid: nil)
94
+ super(version)
95
+
96
+ # Marshaled Properties
97
+ @properties = {
98
+ 'sid' => payload['sid'],
99
+ 'account_sid' => payload['account_sid'],
100
+ 'regulation_sid' => payload['regulation_sid'],
101
+ 'friendly_name' => payload['friendly_name'],
102
+ 'status' => payload['status'],
103
+ 'valid_until' => Twilio.deserialize_iso8601_datetime(payload['valid_until']),
104
+ 'email' => payload['email'],
105
+ 'status_callback' => payload['status_callback'],
106
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
107
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
108
+ }
109
+ end
110
+
111
+ ##
112
+ # @return [String] The unique string that identifies the resource
113
+ def sid
114
+ @properties['sid']
115
+ end
116
+
117
+ ##
118
+ # @return [String] The SID of the Account that created the resource
119
+ def account_sid
120
+ @properties['account_sid']
121
+ end
122
+
123
+ ##
124
+ # @return [String] The unique string of a regulation
125
+ def regulation_sid
126
+ @properties['regulation_sid']
127
+ end
128
+
129
+ ##
130
+ # @return [String] The string that you assigned to describe the resource
131
+ def friendly_name
132
+ @properties['friendly_name']
133
+ end
134
+
135
+ ##
136
+ # @return [bundle_copy.Status] The verification status of the Bundle resource
137
+ def status
138
+ @properties['status']
139
+ end
140
+
141
+ ##
142
+ # @return [Time] The ISO 8601 date and time in GMT when the resource will be valid until
143
+ def valid_until
144
+ @properties['valid_until']
145
+ end
146
+
147
+ ##
148
+ # @return [String] The email address
149
+ def email
150
+ @properties['email']
151
+ end
152
+
153
+ ##
154
+ # @return [String] The URL we call to inform your application of status changes
155
+ def status_callback
156
+ @properties['status_callback']
157
+ end
158
+
159
+ ##
160
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was created
161
+ def date_created
162
+ @properties['date_created']
163
+ end
164
+
165
+ ##
166
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
167
+ def date_updated
168
+ @properties['date_updated']
169
+ end
170
+
171
+ ##
172
+ # Provide a user friendly representation
173
+ def to_s
174
+ "<Twilio.Numbers.V2.BundleCopyInstance>"
175
+ end
176
+
177
+ ##
178
+ # Provide a detailed, user friendly representation
179
+ def inspect
180
+ "<Twilio.Numbers.V2.BundleCopyInstance>"
181
+ end
182
+ end
183
+ end
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end
@@ -0,0 +1,188 @@
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 Numbers < Domain
12
+ class V2 < Version
13
+ class RegulatoryComplianceList < ListResource
14
+ class BundleContext < InstanceContext
15
+ ##
16
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
17
+ class ReplaceItemsList < ListResource
18
+ ##
19
+ # Initialize the ReplaceItemsList
20
+ # @param [Version] version Version that contains the resource
21
+ # @param [String] bundle_sid The unique string that we created to identify the
22
+ # Bundle resource.
23
+ # @return [ReplaceItemsList] ReplaceItemsList
24
+ def initialize(version, bundle_sid: nil)
25
+ super(version)
26
+
27
+ # Path Solution
28
+ @solution = {bundle_sid: bundle_sid}
29
+ @uri = "/RegulatoryCompliance/Bundles/#{@solution[:bundle_sid]}/ReplaceItems"
30
+ end
31
+
32
+ ##
33
+ # Create the ReplaceItemsInstance
34
+ # @param [String] from_bundle_sid The source bundle sid to copy the item
35
+ # assignments from.
36
+ # @return [ReplaceItemsInstance] Created ReplaceItemsInstance
37
+ def create(from_bundle_sid: nil)
38
+ data = Twilio::Values.of({'FromBundleSid' => from_bundle_sid, })
39
+
40
+ payload = @version.create('POST', @uri, data: data)
41
+
42
+ ReplaceItemsInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], )
43
+ end
44
+
45
+ ##
46
+ # Provide a user friendly representation
47
+ def to_s
48
+ '#<Twilio.Numbers.V2.ReplaceItemsList>'
49
+ end
50
+ end
51
+
52
+ ##
53
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
54
+ class ReplaceItemsPage < Page
55
+ ##
56
+ # Initialize the ReplaceItemsPage
57
+ # @param [Version] version Version that contains the resource
58
+ # @param [Response] response Response from the API
59
+ # @param [Hash] solution Path solution for the resource
60
+ # @return [ReplaceItemsPage] ReplaceItemsPage
61
+ def initialize(version, response, solution)
62
+ super(version, response)
63
+
64
+ # Path Solution
65
+ @solution = solution
66
+ end
67
+
68
+ ##
69
+ # Build an instance of ReplaceItemsInstance
70
+ # @param [Hash] payload Payload response from the API
71
+ # @return [ReplaceItemsInstance] ReplaceItemsInstance
72
+ def get_instance(payload)
73
+ ReplaceItemsInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], )
74
+ end
75
+
76
+ ##
77
+ # Provide a user friendly representation
78
+ def to_s
79
+ '<Twilio.Numbers.V2.ReplaceItemsPage>'
80
+ end
81
+ end
82
+
83
+ ##
84
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
85
+ class ReplaceItemsInstance < InstanceResource
86
+ ##
87
+ # Initialize the ReplaceItemsInstance
88
+ # @param [Version] version Version that contains the resource
89
+ # @param [Hash] payload payload that contains response from Twilio
90
+ # @param [String] bundle_sid The unique string that we created to identify the
91
+ # Bundle resource.
92
+ # @return [ReplaceItemsInstance] ReplaceItemsInstance
93
+ def initialize(version, payload, bundle_sid: nil)
94
+ super(version)
95
+
96
+ # Marshaled Properties
97
+ @properties = {
98
+ 'sid' => payload['sid'],
99
+ 'account_sid' => payload['account_sid'],
100
+ 'regulation_sid' => payload['regulation_sid'],
101
+ 'friendly_name' => payload['friendly_name'],
102
+ 'status' => payload['status'],
103
+ 'valid_until' => Twilio.deserialize_iso8601_datetime(payload['valid_until']),
104
+ 'email' => payload['email'],
105
+ 'status_callback' => payload['status_callback'],
106
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
107
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
108
+ }
109
+ end
110
+
111
+ ##
112
+ # @return [String] The unique string that identifies the resource
113
+ def sid
114
+ @properties['sid']
115
+ end
116
+
117
+ ##
118
+ # @return [String] The SID of the Account that created the resource
119
+ def account_sid
120
+ @properties['account_sid']
121
+ end
122
+
123
+ ##
124
+ # @return [String] The unique string of a regulation
125
+ def regulation_sid
126
+ @properties['regulation_sid']
127
+ end
128
+
129
+ ##
130
+ # @return [String] The string that you assigned to describe the resource
131
+ def friendly_name
132
+ @properties['friendly_name']
133
+ end
134
+
135
+ ##
136
+ # @return [replace_items.Status] The verification status of the Bundle resource
137
+ def status
138
+ @properties['status']
139
+ end
140
+
141
+ ##
142
+ # @return [Time] The ISO 8601 date and time in GMT when the resource will be valid until
143
+ def valid_until
144
+ @properties['valid_until']
145
+ end
146
+
147
+ ##
148
+ # @return [String] The email address
149
+ def email
150
+ @properties['email']
151
+ end
152
+
153
+ ##
154
+ # @return [String] The URL we call to inform your application of status changes
155
+ def status_callback
156
+ @properties['status_callback']
157
+ end
158
+
159
+ ##
160
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was created
161
+ def date_created
162
+ @properties['date_created']
163
+ end
164
+
165
+ ##
166
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
167
+ def date_updated
168
+ @properties['date_updated']
169
+ end
170
+
171
+ ##
172
+ # Provide a user friendly representation
173
+ def to_s
174
+ "<Twilio.Numbers.V2.ReplaceItemsInstance>"
175
+ end
176
+
177
+ ##
178
+ # Provide a detailed, user friendly representation
179
+ def inspect
180
+ "<Twilio.Numbers.V2.ReplaceItemsInstance>"
181
+ end
182
+ end
183
+ end
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end
@@ -34,12 +34,14 @@ module Twilio
34
34
  # status changes.
35
35
  # @param [String] regulation_sid The unique string of a regulation that is
36
36
  # associated to the Bundle resource.
37
- # @param [String] iso_country The ISO country code of the Bundle's phone number
38
- # country ownership request.
39
- # @param [bundle.EndUserType] end_user_type The type of End User of the Bundle
40
- # resource.
37
+ # @param [String] iso_country The {ISO country
38
+ # code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the Bundle's phone
39
+ # number country ownership request.
40
+ # @param [bundle.EndUserType] end_user_type The {type of End
41
+ # User}[https://www.twilio.com/docs/phone-numbers/regulatory/api/end-user-types]
42
+ # of the Bundle resource.
41
43
  # @param [String] number_type The type of phone number of the Bundle's ownership
42
- # request.
44
+ # request. Can be `local`, `mobile`, `national`, or `toll free`.
43
45
  # @return [BundleInstance] Created BundleInstance
44
46
  def create(friendly_name: nil, email: nil, status_callback: :unset, regulation_sid: :unset, iso_country: :unset, end_user_type: :unset, number_type: :unset)
45
47
  data = Twilio::Values.of({
@@ -66,10 +68,11 @@ module Twilio
66
68
  # resource.
67
69
  # @param [String] regulation_sid The unique string of a regulation that is
68
70
  # associated to the Bundle resource.
69
- # @param [String] iso_country The ISO country code of the Bundle's phone number
70
- # country ownership request.
71
+ # @param [String] iso_country The {ISO country
72
+ # code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the Bundle's phone
73
+ # number country ownership request.
71
74
  # @param [String] number_type The type of phone number of the Bundle's ownership
72
- # request.
75
+ # request. Can be `local`, `mobile`, `national`, or `toll free`.
73
76
  # @param [Integer] limit Upper limit for the number of records to return. stream()
74
77
  # guarantees to never return more than limit. Default is no limit
75
78
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -98,10 +101,11 @@ module Twilio
98
101
  # resource.
99
102
  # @param [String] regulation_sid The unique string of a regulation that is
100
103
  # associated to the Bundle resource.
101
- # @param [String] iso_country The ISO country code of the Bundle's phone number
102
- # country ownership request.
104
+ # @param [String] iso_country The {ISO country
105
+ # code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the Bundle's phone
106
+ # number country ownership request.
103
107
  # @param [String] number_type The type of phone number of the Bundle's ownership
104
- # request.
108
+ # request. Can be `local`, `mobile`, `national`, or `toll free`.
105
109
  # @param [Integer] limit Upper limit for the number of records to return. stream()
106
110
  # guarantees to never return more than limit. Default is no limit.
107
111
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -146,10 +150,11 @@ module Twilio
146
150
  # resource.
147
151
  # @param [String] regulation_sid The unique string of a regulation that is
148
152
  # associated to the Bundle resource.
149
- # @param [String] iso_country The ISO country code of the Bundle's phone number
150
- # country ownership request.
153
+ # @param [String] iso_country The {ISO country
154
+ # code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the Bundle's phone
155
+ # number country ownership request.
151
156
  # @param [String] number_type The type of phone number of the Bundle's ownership
152
- # request.
157
+ # request. Can be `local`, `mobile`, `national`, or `toll free`.
153
158
  # @param [String] page_token PageToken provided by the API
154
159
  # @param [Integer] page_number Page Number, this value is simply for client state
155
160
  # @param [Integer] page_size Number of records to return, defaults to 50
@@ -237,6 +242,8 @@ module Twilio
237
242
  # Dependents
238
243
  @evaluations = nil
239
244
  @item_assignments = nil
245
+ @bundle_copies = nil
246
+ @replace_items = nil
240
247
  end
241
248
 
242
249
  ##
@@ -314,6 +321,30 @@ module Twilio
314
321
  @item_assignments
315
322
  end
316
323
 
324
+ ##
325
+ # Access the bundle_copies
326
+ # @return [BundleCopyList]
327
+ # @return [BundleCopyContext]
328
+ def bundle_copies
329
+ unless @bundle_copies
330
+ @bundle_copies = BundleCopyList.new(@version, bundle_sid: @solution[:sid], )
331
+ end
332
+
333
+ @bundle_copies
334
+ end
335
+
336
+ ##
337
+ # Access the replace_items
338
+ # @return [ReplaceItemsList]
339
+ # @return [ReplaceItemsContext]
340
+ def replace_items
341
+ unless @replace_items
342
+ @replace_items = ReplaceItemsList.new(@version, bundle_sid: @solution[:sid], )
343
+ end
344
+
345
+ @replace_items
346
+ end
347
+
317
348
  ##
318
349
  # Provide a user friendly representation
319
350
  def to_s
@@ -491,6 +522,20 @@ module Twilio
491
522
  context.item_assignments
492
523
  end
493
524
 
525
+ ##
526
+ # Access the bundle_copies
527
+ # @return [bundle_copies] bundle_copies
528
+ def bundle_copies
529
+ context.bundle_copies
530
+ end
531
+
532
+ ##
533
+ # Access the replace_items
534
+ # @return [replace_items] replace_items
535
+ def replace_items
536
+ context.replace_items
537
+ end
538
+
494
539
  ##
495
540
  # Provide a user friendly representation
496
541
  def to_s