twilio-ruby 6.12.1 → 7.0.0

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