twilio-ruby 6.12.1 → 7.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +5 -5
  3. data/CHANGES.md +72 -1
  4. data/README.md +2 -2
  5. data/UPGRADE.md +11 -0
  6. data/lib/twilio-ruby/framework/request.rb +8 -1
  7. data/lib/twilio-ruby/http/http_client.rb +10 -3
  8. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +0 -2
  9. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +22 -22
  10. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +7 -0
  11. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +22 -22
  12. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +0 -2
  13. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +0 -2
  14. data/lib/twilio-ruby/rest/client.rb +8 -3
  15. data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +184 -0
  16. data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +11 -13
  17. data/lib/twilio-ruby/rest/content/v1/content.rb +422 -3
  18. data/lib/twilio-ruby/rest/content/v1/content_and_approvals.rb +1 -1
  19. data/lib/twilio-ruby/rest/content/v1/legacy_content.rb +1 -1
  20. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +6 -6
  21. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +6 -6
  22. data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +0 -2
  23. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +26 -0
  24. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +0 -2
  25. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +0 -2
  26. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +0 -2
  27. data/lib/twilio-ruby/rest/flex_api/v1/insights_session.rb +0 -2
  28. data/lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb +0 -2
  29. data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +6 -0
  30. data/lib/twilio-ruby/rest/flex_api/v1/provisioning_status.rb +0 -2
  31. data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +0 -2
  32. data/lib/twilio-ruby/rest/insights/v1/call/annotation.rb +0 -2
  33. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +0 -2
  34. data/lib/twilio-ruby/rest/insights/v1/room.rb +0 -2
  35. data/lib/twilio-ruby/rest/intelligence/v2/service.rb +0 -2
  36. data/lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb +0 -2
  37. data/lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb +0 -2
  38. data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +0 -2
  39. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +17 -6
  40. data/lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_vetting.rb +0 -2
  41. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +0 -2
  42. data/lib/twilio-ruby/rest/messaging/v1/domain_certs.rb +0 -2
  43. data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +0 -2
  44. data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +0 -2
  45. data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb +0 -2
  46. data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb +0 -2
  47. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +0 -2
  48. data/lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb +0 -2
  49. data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +0 -2
  50. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +0 -2
  51. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +0 -2
  52. data/lib/twilio-ruby/rest/messaging/v1/service.rb +7 -2
  53. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +0 -2
  54. data/lib/twilio-ruby/rest/microvisor/v1/account_config.rb +0 -2
  55. data/lib/twilio-ruby/rest/microvisor/v1/account_secret.rb +0 -2
  56. data/lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb +0 -2
  57. data/lib/twilio-ruby/rest/microvisor/v1/app.rb +0 -2
  58. data/lib/twilio-ruby/rest/microvisor/v1/device/device_config.rb +0 -2
  59. data/lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb +0 -2
  60. data/lib/twilio-ruby/rest/microvisor/v1/device.rb +0 -2
  61. data/lib/twilio-ruby/rest/notify/v1/credential.rb +0 -2
  62. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +0 -2
  63. data/lib/twilio-ruby/rest/notify/v1/service.rb +0 -2
  64. data/lib/twilio-ruby/rest/numbers/v1/bulk_eligibility.rb +16 -3
  65. data/lib/twilio-ruby/rest/numbers/v1/eligibility.rb +127 -0
  66. data/lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb +0 -2
  67. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +134 -0
  68. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +7 -2
  69. data/lib/twilio-ruby/rest/numbers/v1/porting_portability.rb +0 -2
  70. data/lib/twilio-ruby/rest/numbers/v1.rb +12 -0
  71. data/lib/twilio-ruby/rest/numbers/v2/authorization_document.rb +0 -2
  72. data/lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb +16 -3
  73. data/lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb +0 -2
  74. data/lib/twilio-ruby/rest/oauth/v1/authorize.rb +143 -0
  75. data/lib/twilio-ruby/rest/oauth/v1/token.rb +181 -0
  76. data/lib/twilio-ruby/rest/oauth/v1.rb +46 -0
  77. data/lib/twilio-ruby/rest/{media.rb → oauth.rb} +1 -1
  78. data/lib/twilio-ruby/rest/{media_base.rb → oauth_base.rb} +6 -6
  79. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb +0 -2
  80. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb +0 -2
  81. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb +0 -2
  82. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb +0 -2
  83. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +0 -2
  84. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +0 -2
  85. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +0 -2
  86. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +0 -2
  87. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +0 -2
  88. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +0 -2
  89. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +0 -2
  90. data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -2
  91. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -2
  92. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -2
  93. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -2
  94. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -2
  95. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -2
  96. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -2
  97. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -2
  98. data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -2
  99. data/lib/twilio-ruby/rest/preview/wireless/command.rb +0 -2
  100. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +0 -2
  101. data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +0 -2
  102. data/lib/twilio-ruby/rest/preview/wireless/sim.rb +0 -2
  103. data/lib/twilio-ruby/rest/preview_messaging/v1/broadcast.rb +164 -0
  104. data/lib/twilio-ruby/rest/preview_messaging/v1/message.rb +235 -0
  105. data/lib/twilio-ruby/rest/preview_messaging/v1.rb +46 -0
  106. data/lib/twilio-ruby/rest/preview_messaging.rb +12 -0
  107. data/lib/twilio-ruby/rest/preview_messaging_base.rb +38 -0
  108. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +0 -2
  109. data/lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb +0 -2
  110. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +0 -2
  111. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +0 -2
  112. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +0 -2
  113. data/lib/twilio-ruby/rest/proxy/v1/service/short_code.rb +0 -2
  114. data/lib/twilio-ruby/rest/proxy/v1/service.rb +0 -2
  115. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +0 -2
  116. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +0 -2
  117. data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +0 -2
  118. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +0 -2
  119. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +0 -2
  120. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +0 -2
  121. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +0 -2
  122. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +0 -2
  123. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +0 -2
  124. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +0 -2
  125. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +0 -2
  126. data/lib/twilio-ruby/rest/serverless/v1/service.rb +0 -2
  127. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +0 -2
  128. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +0 -2
  129. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +0 -2
  130. data/lib/twilio-ruby/rest/supersim/v1/network.rb +0 -2
  131. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +0 -2
  132. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +0 -2
  133. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +0 -2
  134. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +0 -2
  135. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.rb +163 -0
  136. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +8 -8
  137. data/lib/twilio-ruby/rest/trusthub/v1/compliance_registration_inquiries.rb +95 -4
  138. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +9 -3
  139. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +9 -3
  140. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +18 -18
  141. data/lib/twilio-ruby/rest/trusthub/v1.rb +12 -3
  142. data/lib/twilio-ruby/rest/verify/v2/form.rb +0 -2
  143. data/lib/twilio-ruby/rest/verify/v2/safelist.rb +0 -2
  144. data/lib/twilio-ruby/rest/verify/v2/service.rb +25 -0
  145. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +0 -2
  146. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +0 -2
  147. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb +0 -2
  148. data/lib/twilio-ruby/version.rb +1 -1
  149. metadata +16 -9
  150. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +0 -424
  151. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +0 -407
  152. data/lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb +0 -255
  153. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +0 -436
  154. data/lib/twilio-ruby/rest/media/v1.rb +0 -79
@@ -1,424 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
- # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
- # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
- #
7
- # Twilio - Media
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 Media < MediaBase
19
- class V1 < Version
20
- class MediaProcessorList < ListResource
21
-
22
- ##
23
- # Initialize the MediaProcessorList
24
- # @param [Version] version Version that contains the resource
25
- # @return [MediaProcessorList] MediaProcessorList
26
- def initialize(version)
27
- super(version)
28
- # Path Solution
29
- @solution = { }
30
- @uri = "/MediaProcessors"
31
-
32
- end
33
- ##
34
- # Create the MediaProcessorInstance
35
- # @param [String] extension The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2`
36
- # @param [String] extension_context The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send.
37
- # @param [Object] extension_environment User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about whether you need to provide this.
38
- # @param [String] status_callback The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details.
39
- # @param [String] status_callback_method The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
40
- # @param [String] max_duration The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming.
41
- # @return [MediaProcessorInstance] Created MediaProcessorInstance
42
- def create(
43
- extension: nil,
44
- extension_context: nil,
45
- extension_environment: :unset,
46
- status_callback: :unset,
47
- status_callback_method: :unset,
48
- max_duration: :unset
49
- )
50
-
51
- data = Twilio::Values.of({
52
- 'Extension' => extension,
53
- 'ExtensionContext' => extension_context,
54
- 'ExtensionEnvironment' => Twilio.serialize_object(extension_environment),
55
- 'StatusCallback' => status_callback,
56
- 'StatusCallbackMethod' => status_callback_method,
57
- 'MaxDuration' => max_duration,
58
- })
59
-
60
-
61
- payload = @version.create('POST', @uri, data: data)
62
- MediaProcessorInstance.new(
63
- @version,
64
- payload,
65
- )
66
- end
67
-
68
-
69
- ##
70
- # Lists MediaProcessorInstance records from the API as a list.
71
- # Unlike stream(), this operation is eager and will load `limit` records into
72
- # memory before returning.
73
- # @param [Order] order The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
74
- # @param [Status] status Status to filter by, with possible values `started`, `ended` or `failed`.
75
- # @param [Integer] limit Upper limit for the number of records to return. stream()
76
- # guarantees to never return more than limit. Default is no limit
77
- # @param [Integer] page_size Number of records to fetch per request, when
78
- # not set will use the default value of 50 records. If no page_size is defined
79
- # but a limit is defined, stream() will attempt to read the limit with the most
80
- # efficient page size, i.e. min(limit, 1000)
81
- # @return [Array] Array of up to limit results
82
- def list(order: :unset, status: :unset, limit: nil, page_size: nil)
83
- self.stream(
84
- order: order,
85
- status: status,
86
- limit: limit,
87
- page_size: page_size
88
- ).entries
89
- end
90
-
91
- ##
92
- # Streams Instance records from the API as an Enumerable.
93
- # This operation lazily loads records as efficiently as possible until the limit
94
- # is reached.
95
- # @param [Order] order The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
96
- # @param [Status] status Status to filter by, with possible values `started`, `ended` or `failed`.
97
- # @param [Integer] limit Upper limit for the number of records to return. stream()
98
- # guarantees to never return more than limit. Default is no limit
99
- # @param [Integer] page_size Number of records to fetch per request, when
100
- # not set will use the default value of 50 records. If no page_size is defined
101
- # but a limit is defined, stream() will attempt to read the limit with the most
102
- # efficient page size, i.e. min(limit, 1000)
103
- # @return [Enumerable] Enumerable that will yield up to limit results
104
- def stream(order: :unset, status: :unset, limit: nil, page_size: nil)
105
- limits = @version.read_limits(limit, page_size)
106
-
107
- page = self.page(
108
- order: order,
109
- status: status,
110
- page_size: limits[:page_size], )
111
-
112
- @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
113
- end
114
-
115
- ##
116
- # When passed a block, yields MediaProcessorInstance records from the API.
117
- # This operation lazily loads records as efficiently as possible until the limit
118
- # is reached.
119
- def each
120
- limits = @version.read_limits
121
-
122
- page = self.page(page_size: limits[:page_size], )
123
-
124
- @version.stream(page,
125
- limit: limits[:limit],
126
- page_limit: limits[:page_limit]).each {|x| yield x}
127
- end
128
-
129
- ##
130
- # Retrieve a single page of MediaProcessorInstance records from the API.
131
- # Request is executed immediately.
132
- # @param [Order] order The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
133
- # @param [Status] status Status to filter by, with possible values `started`, `ended` or `failed`.
134
- # @param [String] page_token PageToken provided by the API
135
- # @param [Integer] page_number Page Number, this value is simply for client state
136
- # @param [Integer] page_size Number of records to return, defaults to 50
137
- # @return [Page] Page of MediaProcessorInstance
138
- def page(order: :unset, status: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
139
- params = Twilio::Values.of({
140
- 'Order' => order,
141
- 'Status' => status,
142
- 'PageToken' => page_token,
143
- 'Page' => page_number,
144
- 'PageSize' => page_size,
145
- })
146
-
147
- response = @version.page('GET', @uri, params: params)
148
-
149
- MediaProcessorPage.new(@version, response, @solution)
150
- end
151
-
152
- ##
153
- # Retrieve a single page of MediaProcessorInstance records from the API.
154
- # Request is executed immediately.
155
- # @param [String] target_url API-generated URL for the requested results page
156
- # @return [Page] Page of MediaProcessorInstance
157
- def get_page(target_url)
158
- response = @version.domain.request(
159
- 'GET',
160
- target_url
161
- )
162
- MediaProcessorPage.new(@version, response, @solution)
163
- end
164
-
165
-
166
-
167
- # Provide a user friendly representation
168
- def to_s
169
- '#<Twilio.Media.V1.MediaProcessorList>'
170
- end
171
- end
172
-
173
-
174
- class MediaProcessorContext < InstanceContext
175
- ##
176
- # Initialize the MediaProcessorContext
177
- # @param [Version] version Version that contains the resource
178
- # @param [String] sid The SID of the MediaProcessor resource to update.
179
- # @return [MediaProcessorContext] MediaProcessorContext
180
- def initialize(version, sid)
181
- super(version)
182
-
183
- # Path Solution
184
- @solution = { sid: sid, }
185
- @uri = "/MediaProcessors/#{@solution[:sid]}"
186
-
187
-
188
- end
189
- ##
190
- # Fetch the MediaProcessorInstance
191
- # @return [MediaProcessorInstance] Fetched MediaProcessorInstance
192
- def fetch
193
-
194
-
195
- payload = @version.fetch('GET', @uri)
196
- MediaProcessorInstance.new(
197
- @version,
198
- payload,
199
- sid: @solution[:sid],
200
- )
201
- end
202
-
203
- ##
204
- # Update the MediaProcessorInstance
205
- # @param [UpdateStatus] status
206
- # @return [MediaProcessorInstance] Updated MediaProcessorInstance
207
- def update(
208
- status: nil
209
- )
210
-
211
- data = Twilio::Values.of({
212
- 'Status' => status,
213
- })
214
-
215
-
216
- payload = @version.update('POST', @uri, data: data)
217
- MediaProcessorInstance.new(
218
- @version,
219
- payload,
220
- sid: @solution[:sid],
221
- )
222
- end
223
-
224
-
225
- ##
226
- # Provide a user friendly representation
227
- def to_s
228
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
229
- "#<Twilio.Media.V1.MediaProcessorContext #{context}>"
230
- end
231
-
232
- ##
233
- # Provide a detailed, user friendly representation
234
- def inspect
235
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
236
- "#<Twilio.Media.V1.MediaProcessorContext #{context}>"
237
- end
238
- end
239
-
240
- class MediaProcessorPage < Page
241
- ##
242
- # Initialize the MediaProcessorPage
243
- # @param [Version] version Version that contains the resource
244
- # @param [Response] response Response from the API
245
- # @param [Hash] solution Path solution for the resource
246
- # @return [MediaProcessorPage] MediaProcessorPage
247
- def initialize(version, response, solution)
248
- super(version, response)
249
-
250
- # Path Solution
251
- @solution = solution
252
- end
253
-
254
- ##
255
- # Build an instance of MediaProcessorInstance
256
- # @param [Hash] payload Payload response from the API
257
- # @return [MediaProcessorInstance] MediaProcessorInstance
258
- def get_instance(payload)
259
- MediaProcessorInstance.new(@version, payload)
260
- end
261
-
262
- ##
263
- # Provide a user friendly representation
264
- def to_s
265
- '<Twilio.Media.V1.MediaProcessorPage>'
266
- end
267
- end
268
- class MediaProcessorInstance < InstanceResource
269
- ##
270
- # Initialize the MediaProcessorInstance
271
- # @param [Version] version Version that contains the resource
272
- # @param [Hash] payload payload that contains response from Twilio
273
- # @param [String] account_sid The SID of the
274
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this MediaProcessor
275
- # resource.
276
- # @param [String] sid The SID of the Call resource to fetch.
277
- # @return [MediaProcessorInstance] MediaProcessorInstance
278
- def initialize(version, payload , sid: nil)
279
- super(version)
280
-
281
- # Marshaled Properties
282
- @properties = {
283
- 'account_sid' => payload['account_sid'],
284
- 'sid' => payload['sid'],
285
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
286
- 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
287
- 'extension' => payload['extension'],
288
- 'extension_context' => payload['extension_context'],
289
- 'status' => payload['status'],
290
- 'url' => payload['url'],
291
- 'ended_reason' => payload['ended_reason'],
292
- 'status_callback' => payload['status_callback'],
293
- 'status_callback_method' => payload['status_callback_method'],
294
- 'max_duration' => payload['max_duration'] == nil ? payload['max_duration'] : payload['max_duration'].to_i,
295
- }
296
-
297
- # Context
298
- @instance_context = nil
299
- @params = { 'sid' => sid || @properties['sid'] , }
300
- end
301
-
302
- ##
303
- # Generate an instance context for the instance, the context is capable of
304
- # performing various actions. All instance actions are proxied to the context
305
- # @return [MediaProcessorContext] CallContext for this CallInstance
306
- def context
307
- unless @instance_context
308
- @instance_context = MediaProcessorContext.new(@version , @params['sid'])
309
- end
310
- @instance_context
311
- end
312
-
313
- ##
314
- # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MediaProcessor resource.
315
- def account_sid
316
- @properties['account_sid']
317
- end
318
-
319
- ##
320
- # @return [String] The unique string generated to identify the MediaProcessor resource.
321
- def sid
322
- @properties['sid']
323
- end
324
-
325
- ##
326
- # @return [Time] The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
327
- def date_created
328
- @properties['date_created']
329
- end
330
-
331
- ##
332
- # @return [Time] The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
333
- def date_updated
334
- @properties['date_updated']
335
- end
336
-
337
- ##
338
- # @return [String] The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2`
339
- def extension
340
- @properties['extension']
341
- end
342
-
343
- ##
344
- # @return [String] The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send.
345
- def extension_context
346
- @properties['extension_context']
347
- end
348
-
349
- ##
350
- # @return [Status]
351
- def status
352
- @properties['status']
353
- end
354
-
355
- ##
356
- # @return [String] The absolute URL of the resource.
357
- def url
358
- @properties['url']
359
- end
360
-
361
- ##
362
- # @return [String] The reason why a MediaProcessor ended. When a MediaProcessor is in progress, will be `null`. When a MediaProcessor is completed, can be `ended-via-api`, `max-duration-exceeded`, `error-loading-extension`, `error-streaming-media` or `internal-service-error`. See [ended reasons](/docs/live/api/mediaprocessors#mediaprocessor-ended-reason-values) for more details.
363
- def ended_reason
364
- @properties['ended_reason']
365
- end
366
-
367
- ##
368
- # @return [String] The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details.
369
- def status_callback
370
- @properties['status_callback']
371
- end
372
-
373
- ##
374
- # @return [String] The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
375
- def status_callback_method
376
- @properties['status_callback_method']
377
- end
378
-
379
- ##
380
- # @return [String] The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming.
381
- def max_duration
382
- @properties['max_duration']
383
- end
384
-
385
- ##
386
- # Fetch the MediaProcessorInstance
387
- # @return [MediaProcessorInstance] Fetched MediaProcessorInstance
388
- def fetch
389
-
390
- context.fetch
391
- end
392
-
393
- ##
394
- # Update the MediaProcessorInstance
395
- # @param [UpdateStatus] status
396
- # @return [MediaProcessorInstance] Updated MediaProcessorInstance
397
- def update(
398
- status: nil
399
- )
400
-
401
- context.update(
402
- status: status,
403
- )
404
- end
405
-
406
- ##
407
- # Provide a user friendly representation
408
- def to_s
409
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
410
- "<Twilio.Media.V1.MediaProcessorInstance #{values}>"
411
- end
412
-
413
- ##
414
- # Provide a detailed, user friendly representation
415
- def inspect
416
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
417
- "<Twilio.Media.V1.MediaProcessorInstance #{values}>"
418
- end
419
- end
420
-
421
- end
422
- end
423
- end
424
- end