twilio-ruby 5.52.0 → 5.67.3

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 (163) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/pr-lint.yml +15 -0
  3. data/.github/workflows/test-and-deploy.yml +129 -0
  4. data/.gitignore +5 -1
  5. data/.rubocop.yml +1 -1
  6. data/.rubocop_todo.yml +91 -28
  7. data/CHANGES.md +563 -0
  8. data/Gemfile +1 -0
  9. data/Makefile +8 -11
  10. data/README.md +13 -6
  11. data/examples/examples.rb +1 -1
  12. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  13. data/lib/twilio-ruby/http/http_client.rb +20 -4
  14. data/lib/twilio-ruby/http.rb +5 -0
  15. data/lib/twilio-ruby/jwt/access_token.rb +13 -0
  16. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +23 -23
  17. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -8
  19. data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +674 -0
  20. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
  21. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +68 -14
  22. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +12 -8
  23. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  24. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -4
  25. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -4
  26. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -4
  27. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +17 -10
  28. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +18 -5
  29. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +34 -7
  30. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
  31. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
  32. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +0 -8
  33. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +0 -6
  34. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +0 -8
  35. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -8
  36. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -8
  37. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +10 -4
  38. data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
  39. data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
  40. data/lib/twilio-ruby/rest/chat.rb +16 -0
  41. data/lib/twilio-ruby/rest/client.rb +21 -12
  42. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +454 -0
  43. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
  44. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +7 -0
  45. data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
  46. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +18 -2
  47. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
  48. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
  49. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
  50. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +7 -0
  51. data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
  52. data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
  53. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
  54. data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
  55. data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
  56. data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
  57. data/lib/twilio-ruby/rest/conversations/v1.rb +24 -0
  58. data/lib/twilio-ruby/rest/conversations.rb +15 -0
  59. data/lib/twilio-ruby/rest/events/v1/event_type.rb +12 -5
  60. data/lib/twilio-ruby/rest/events/v1/sink.rb +41 -5
  61. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +28 -0
  62. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +55 -34
  63. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
  64. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
  65. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +384 -0
  66. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
  67. data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
  68. data/lib/twilio-ruby/rest/flex_api.rb +9 -0
  69. data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +258 -0
  70. data/lib/twilio-ruby/rest/{fax → frontline_api}/v1.rb +11 -11
  71. data/lib/twilio-ruby/rest/{fax.rb → frontline_api.rb} +11 -11
  72. data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
  73. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +434 -0
  74. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
  75. data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
  76. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  77. data/lib/twilio-ruby/rest/insights/v1.rb +46 -0
  78. data/lib/twilio-ruby/rest/insights.rb +28 -0
  79. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +268 -0
  80. data/lib/twilio-ruby/rest/lookups/v2.rb +45 -0
  81. data/lib/twilio-ruby/rest/lookups.rb +7 -0
  82. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +397 -0
  83. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +406 -0
  84. data/lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb +221 -0
  85. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +403 -0
  86. data/lib/twilio-ruby/rest/media/v1.rb +76 -0
  87. data/lib/twilio-ruby/rest/media.rb +65 -0
  88. data/lib/twilio-ruby/rest/{fax/v1/fax/fax_media.rb → messaging/v1/brand_registration/brand_vetting.rb} +134 -95
  89. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +127 -2
  90. data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +7 -0
  91. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +187 -20
  92. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
  93. data/lib/twilio-ruby/rest/messaging/v1/service.rb +37 -5
  94. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +268 -0
  95. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +188 -0
  96. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +128 -26
  97. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
  98. data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
  99. data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
  100. data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
  101. data/lib/twilio-ruby/rest/pricing.rb +19 -0
  102. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +1 -1
  103. data/lib/twilio-ruby/rest/serverless/v1/service.rb +7 -0
  104. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -1
  105. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -1
  106. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  107. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -55
  108. data/lib/twilio-ruby/rest/supersim/v1/{command.rb → ip_command.rb} +132 -84
  109. data/lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb +231 -0
  110. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +30 -1
  111. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
  112. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +23 -9
  113. data/lib/twilio-ruby/rest/supersim/v1.rb +23 -7
  114. data/lib/twilio-ruby/rest/supersim.rb +15 -6
  115. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
  116. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +7 -3
  117. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
  118. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +7 -3
  119. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +23 -11
  120. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
  121. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
  122. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +38 -22
  123. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -3
  124. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +155 -10
  125. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +12 -9
  126. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +74 -22
  127. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +34 -15
  128. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +66 -31
  129. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +7 -3
  130. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +25 -7
  131. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
  132. data/lib/twilio-ruby/rest/verify/v2/service.rb +40 -11
  133. data/lib/twilio-ruby/rest/verify/v2/template.rb +206 -0
  134. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
  135. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +234 -0
  136. data/lib/twilio-ruby/rest/verify/v2.rb +14 -0
  137. data/lib/twilio-ruby/rest/verify.rb +14 -2
  138. data/lib/twilio-ruby/rest/video/v1/composition.rb +21 -8
  139. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +0 -8
  140. data/lib/twilio-ruby/rest/video/v1/recording.rb +21 -0
  141. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
  142. data/lib/twilio-ruby/rest/video/v1/room.rb +62 -5
  143. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  144. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  145. data/lib/twilio-ruby/rest/voice.rb +8 -0
  146. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  147. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +16 -26
  148. data/lib/twilio-ruby/rest.rb +13 -0
  149. data/lib/twilio-ruby/twiml/voice_response.rb +727 -87
  150. data/lib/twilio-ruby/version.rb +1 -1
  151. data/lib/twilio-ruby.rb +6 -16
  152. data/sonar-project.properties +13 -0
  153. data/twilio-ruby.gemspec +1 -2
  154. metadata +59 -32
  155. data/.travis.yml +0 -45
  156. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -536
  157. /data/lib/twilio-ruby/framework/{domain.rb → rest/domain.rb} +0 -0
  158. /data/lib/twilio-ruby/framework/{error.rb → rest/error.rb} +0 -0
  159. /data/lib/twilio-ruby/framework/{helper.rb → rest/helper.rb} +0 -0
  160. /data/lib/twilio-ruby/framework/{obsolete_client.rb → rest/obsolete_client.rb} +0 -0
  161. /data/lib/twilio-ruby/framework/{page.rb → rest/page.rb} +0 -0
  162. /data/lib/twilio-ruby/framework/{resource.rb → rest/resource.rb} +0 -0
  163. /data/lib/twilio-ruby/framework/{version.rb → rest/version.rb} +0 -0
@@ -0,0 +1,268 @@
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
+ # Lists BundleCopyInstance records from the API as a list.
47
+ # Unlike stream(), this operation is eager and will load `limit` records into
48
+ # memory before returning.
49
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
50
+ # guarantees to never return more than limit. Default is no limit
51
+ # @param [Integer] page_size Number of records to fetch per request, when
52
+ # not set will use the default value of 50 records. If no page_size is defined
53
+ # but a limit is defined, stream() will attempt to read the limit with the most
54
+ # efficient page size, i.e. min(limit, 1000)
55
+ # @return [Array] Array of up to limit results
56
+ def list(limit: nil, page_size: nil)
57
+ self.stream(limit: limit, page_size: page_size).entries
58
+ end
59
+
60
+ ##
61
+ # Streams BundleCopyInstance records from the API as an Enumerable.
62
+ # This operation lazily loads records as efficiently as possible until the limit
63
+ # is reached.
64
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
65
+ # guarantees to never return more than limit. Default is no limit.
66
+ # @param [Integer] page_size Number of records to fetch per request, when
67
+ # not set will use the default value of 50 records. If no page_size is defined
68
+ # but a limit is defined, stream() will attempt to read the limit with the most
69
+ # efficient page size, i.e. min(limit, 1000)
70
+ # @return [Enumerable] Enumerable that will yield up to limit results
71
+ def stream(limit: nil, page_size: nil)
72
+ limits = @version.read_limits(limit, page_size)
73
+
74
+ page = self.page(page_size: limits[:page_size], )
75
+
76
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
77
+ end
78
+
79
+ ##
80
+ # When passed a block, yields BundleCopyInstance records from the API.
81
+ # This operation lazily loads records as efficiently as possible until the limit
82
+ # is reached.
83
+ def each
84
+ limits = @version.read_limits
85
+
86
+ page = self.page(page_size: limits[:page_size], )
87
+
88
+ @version.stream(page,
89
+ limit: limits[:limit],
90
+ page_limit: limits[:page_limit]).each {|x| yield x}
91
+ end
92
+
93
+ ##
94
+ # Retrieve a single page of BundleCopyInstance records from the API.
95
+ # Request is executed immediately.
96
+ # @param [String] page_token PageToken provided by the API
97
+ # @param [Integer] page_number Page Number, this value is simply for client state
98
+ # @param [Integer] page_size Number of records to return, defaults to 50
99
+ # @return [Page] Page of BundleCopyInstance
100
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
101
+ params = Twilio::Values.of({
102
+ 'PageToken' => page_token,
103
+ 'Page' => page_number,
104
+ 'PageSize' => page_size,
105
+ })
106
+
107
+ response = @version.page('GET', @uri, params: params)
108
+
109
+ BundleCopyPage.new(@version, response, @solution)
110
+ end
111
+
112
+ ##
113
+ # Retrieve a single page of BundleCopyInstance records from the API.
114
+ # Request is executed immediately.
115
+ # @param [String] target_url API-generated URL for the requested results page
116
+ # @return [Page] Page of BundleCopyInstance
117
+ def get_page(target_url)
118
+ response = @version.domain.request(
119
+ 'GET',
120
+ target_url
121
+ )
122
+ BundleCopyPage.new(@version, response, @solution)
123
+ end
124
+
125
+ ##
126
+ # Provide a user friendly representation
127
+ def to_s
128
+ '#<Twilio.Numbers.V2.BundleCopyList>'
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 BundleCopyPage < Page
135
+ ##
136
+ # Initialize the BundleCopyPage
137
+ # @param [Version] version Version that contains the resource
138
+ # @param [Response] response Response from the API
139
+ # @param [Hash] solution Path solution for the resource
140
+ # @return [BundleCopyPage] BundleCopyPage
141
+ def initialize(version, response, solution)
142
+ super(version, response)
143
+
144
+ # Path Solution
145
+ @solution = solution
146
+ end
147
+
148
+ ##
149
+ # Build an instance of BundleCopyInstance
150
+ # @param [Hash] payload Payload response from the API
151
+ # @return [BundleCopyInstance] BundleCopyInstance
152
+ def get_instance(payload)
153
+ BundleCopyInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], )
154
+ end
155
+
156
+ ##
157
+ # Provide a user friendly representation
158
+ def to_s
159
+ '<Twilio.Numbers.V2.BundleCopyPage>'
160
+ end
161
+ end
162
+
163
+ ##
164
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
165
+ class BundleCopyInstance < InstanceResource
166
+ ##
167
+ # Initialize the BundleCopyInstance
168
+ # @param [Version] version Version that contains the resource
169
+ # @param [Hash] payload payload that contains response from Twilio
170
+ # @param [String] bundle_sid The unique string that we created to identify the
171
+ # Bundle resource.
172
+ # @return [BundleCopyInstance] BundleCopyInstance
173
+ def initialize(version, payload, bundle_sid: nil)
174
+ super(version)
175
+
176
+ # Marshaled Properties
177
+ @properties = {
178
+ 'sid' => payload['sid'],
179
+ 'account_sid' => payload['account_sid'],
180
+ 'regulation_sid' => payload['regulation_sid'],
181
+ 'friendly_name' => payload['friendly_name'],
182
+ 'status' => payload['status'],
183
+ 'valid_until' => Twilio.deserialize_iso8601_datetime(payload['valid_until']),
184
+ 'email' => payload['email'],
185
+ 'status_callback' => payload['status_callback'],
186
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
187
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
188
+ }
189
+ end
190
+
191
+ ##
192
+ # @return [String] The unique string that identifies the resource
193
+ def sid
194
+ @properties['sid']
195
+ end
196
+
197
+ ##
198
+ # @return [String] The SID of the Account that created the resource
199
+ def account_sid
200
+ @properties['account_sid']
201
+ end
202
+
203
+ ##
204
+ # @return [String] The unique string of a regulation
205
+ def regulation_sid
206
+ @properties['regulation_sid']
207
+ end
208
+
209
+ ##
210
+ # @return [String] The string that you assigned to describe the resource
211
+ def friendly_name
212
+ @properties['friendly_name']
213
+ end
214
+
215
+ ##
216
+ # @return [bundle_copy.Status] The verification status of the Bundle resource
217
+ def status
218
+ @properties['status']
219
+ end
220
+
221
+ ##
222
+ # @return [Time] The ISO 8601 date and time in GMT when the resource will be valid until
223
+ def valid_until
224
+ @properties['valid_until']
225
+ end
226
+
227
+ ##
228
+ # @return [String] The email address
229
+ def email
230
+ @properties['email']
231
+ end
232
+
233
+ ##
234
+ # @return [String] The URL we call to inform your application of status changes
235
+ def status_callback
236
+ @properties['status_callback']
237
+ end
238
+
239
+ ##
240
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was created
241
+ def date_created
242
+ @properties['date_created']
243
+ end
244
+
245
+ ##
246
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
247
+ def date_updated
248
+ @properties['date_updated']
249
+ end
250
+
251
+ ##
252
+ # Provide a user friendly representation
253
+ def to_s
254
+ "<Twilio.Numbers.V2.BundleCopyInstance>"
255
+ end
256
+
257
+ ##
258
+ # Provide a detailed, user friendly representation
259
+ def inspect
260
+ "<Twilio.Numbers.V2.BundleCopyInstance>"
261
+ end
262
+ end
263
+ end
264
+ end
265
+ end
266
+ end
267
+ end
268
+ 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