twilio-ruby 5.6.1 → 5.6.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1730c56fd67a4a8a538aa475394d5ffff5f45608
4
- data.tar.gz: 9713a07ed9639618bbacf581f8b38f5c826cbca9
3
+ metadata.gz: f8a92e178cfc380c3fc508787840bf7988811dab
4
+ data.tar.gz: 597a1df255cfd8542a868c06e5519d1576f0d80d
5
5
  SHA512:
6
- metadata.gz: 9a476d20c60f239465c765c1f77e6785bf4da6768d77a63b40aadc960f4a39129eff164f67653c2801e784a1921499dd4cad7cd8cbefd7c4262b55b7ac4afd9b
7
- data.tar.gz: be0a53c0177968fd0536c0dc62723a795d9e9972652fe0615ecd80cebee20a2f90da9c982f56dc15702ebb472c45b2404bd010da1121d5c29b1d18e82263156e
6
+ metadata.gz: d3ac5a9a007c736cc73ead9711c5790fe51d9ad7750f4b9f82e55c59f1c6f9af3682d1710069d594c4ca74b1afadf0c5bf41c9e9ab64c00ee5f94d4add8ba3fa
7
+ data.tar.gz: 31cb8f8246a185a8bad889687e4f321df5a32e6307431fb8902f7be355e27dded56856a2a9be1b42fc2cd29402dad60d7826d8d115f417a0f89d64b54449dcbc
data/CHANGES.md CHANGED
@@ -1,6 +1,24 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2018-01-30] Version 5.6.2
5
+ ---------------------------
6
+ **Api**
7
+ - Add `studio-engagements` usage key
8
+
9
+ **Preview**
10
+ - Remove Studio Engagement Deletion
11
+
12
+ **Studio**
13
+ - Initial Release
14
+
15
+ **Video**
16
+ - [omit] Beta: Allow updates to `SubscribedTracks`.
17
+ - Add `SubscribedTracks`.
18
+ - Add track name to Video Recording resource
19
+ - Add Composition and Composition Media resources
20
+
21
+
4
22
  [2018-01-22] Version 5.6.1
5
23
  ---------------------------
6
24
  **Api**
data/README.md CHANGED
@@ -27,13 +27,13 @@ in-line code documentation here in the library.
27
27
  To install using [Bundler][bundler] grab the latest stable version:
28
28
 
29
29
  ```ruby
30
- gem 'twilio-ruby', '~> 5.6.1'
30
+ gem 'twilio-ruby', '~> 5.6.2'
31
31
  ```
32
32
 
33
33
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
34
34
 
35
35
  ```bash
36
- gem install twilio-ruby -v 5.6.1
36
+ gem install twilio-ruby -v 5.6.2
37
37
  ```
38
38
 
39
39
  To build and install the development branch yourself from the latest source:
@@ -40,6 +40,7 @@ module Twilio
40
40
  @messaging = nil
41
41
  @wireless = nil
42
42
  @sync = nil
43
+ @studio = nil
43
44
  end
44
45
 
45
46
  ##
@@ -183,6 +184,12 @@ module Twilio
183
184
  @sync ||= Sync.new self
184
185
  end
185
186
 
187
+ ##
188
+ # Access the Studio Twilio Domain
189
+ def studio
190
+ @studio ||= Studio.new self
191
+ end
192
+
186
193
  ##
187
194
  # @param [String] sid The sid
188
195
  # @return [Twilio::REST::Api::V2010::AccountContext::AddressInstance] if sid was passed.
@@ -199,13 +199,6 @@ module Twilio
199
199
  EngagementInstance.new(@version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid], )
200
200
  end
201
201
 
202
- ##
203
- # Deletes the EngagementInstance
204
- # @return [Boolean] true if delete succeeds, true otherwise
205
- def delete
206
- @version.delete('delete', @uri)
207
- end
208
-
209
202
  ##
210
203
  # Access the steps
211
204
  # @return [StepList]
@@ -349,13 +342,6 @@ module Twilio
349
342
  context.fetch
350
343
  end
351
344
 
352
- ##
353
- # Deletes the EngagementInstance
354
- # @return [Boolean] true if delete succeeds, true otherwise
355
- def delete
356
- context.delete
357
- end
358
-
359
345
  ##
360
346
  # Access the steps
361
347
  # @return [steps] steps
@@ -0,0 +1,44 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Studio < Domain
10
+ ##
11
+ # Initialize the Studio Domain
12
+ def initialize(twilio)
13
+ super
14
+
15
+ @base_url = 'https://studio.twilio.com'
16
+ @host = 'studio.twilio.com'
17
+ @port = 443
18
+
19
+ # Versions
20
+ @v1 = nil
21
+ end
22
+
23
+ ##
24
+ # Version v1 of studio
25
+ def v1
26
+ @v1 ||= V1.new self
27
+ end
28
+
29
+ ##
30
+ # @param [String] sid The sid
31
+ # @return [Twilio::REST::Studio::V1::FlowInstance] if sid was passed.
32
+ # @return [Twilio::REST::Studio::V1::FlowList]
33
+ def flows(sid=:unset)
34
+ self.v1.flows(sid)
35
+ end
36
+
37
+ ##
38
+ # Provide a user friendly representation
39
+ def to_s
40
+ '#<Twilio::REST::Studio>'
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,41 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Studio
10
+ class V1 < Version
11
+ ##
12
+ # Initialize the V1 version of Studio
13
+ def initialize(domain)
14
+ super
15
+ @version = 'v1'
16
+ @flows = nil
17
+ end
18
+
19
+ ##
20
+ # @param [String] sid The sid
21
+ # @return [Twilio::REST::Studio::V1::FlowContext] if sid was passed.
22
+ # @return [Twilio::REST::Studio::V1::FlowList]
23
+ def flows(sid=:unset)
24
+ if sid.nil?
25
+ raise ArgumentError, 'sid cannot be nil'
26
+ elsif sid == :unset
27
+ @flows ||= FlowList.new self
28
+ else
29
+ FlowContext.new(self, sid)
30
+ end
31
+ end
32
+
33
+ ##
34
+ # Provide a user friendly representation
35
+ def to_s
36
+ '<Twilio::REST::Studio::V1>'
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,346 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Studio < Domain
10
+ class V1 < Version
11
+ ##
12
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
13
+ class FlowList < ListResource
14
+ ##
15
+ # Initialize the FlowList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [FlowList] FlowList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/Flows"
24
+ end
25
+
26
+ ##
27
+ # Lists FlowInstance records from the API as a list.
28
+ # Unlike stream(), this operation is eager and will load `limit` records into
29
+ # memory before returning.
30
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
31
+ # guarantees to never return more than limit. Default is no limit
32
+ # @param [Integer] page_size Number of records to fetch per request, when
33
+ # not set will use the default value of 50 records. If no page_size is defined
34
+ # but a limit is defined, stream() will attempt to read the limit with the most
35
+ # efficient page size, i.e. min(limit, 1000)
36
+ # @return [Array] Array of up to limit results
37
+ def list(limit: nil, page_size: nil)
38
+ self.stream(limit: limit, page_size: page_size).entries
39
+ end
40
+
41
+ ##
42
+ # Streams FlowInstance records from the API as an Enumerable.
43
+ # This operation lazily loads records as efficiently as possible until the limit
44
+ # is reached.
45
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
46
+ # guarantees to never return more than limit. Default is no limit.
47
+ # @param [Integer] page_size Number of records to fetch per request, when
48
+ # not set will use the default value of 50 records. If no page_size is defined
49
+ # but a limit is defined, stream() will attempt to read the limit with the most
50
+ # efficient page size, i.e. min(limit, 1000)
51
+ # @return [Enumerable] Enumerable that will yield up to limit results
52
+ def stream(limit: nil, page_size: nil)
53
+ limits = @version.read_limits(limit, page_size)
54
+
55
+ page = self.page(page_size: limits[:page_size], )
56
+
57
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
58
+ end
59
+
60
+ ##
61
+ # When passed a block, yields FlowInstance records from the API.
62
+ # This operation lazily loads records as efficiently as possible until the limit
63
+ # is reached.
64
+ def each
65
+ limits = @version.read_limits
66
+
67
+ page = self.page(page_size: limits[:page_size], )
68
+
69
+ @version.stream(page,
70
+ limit: limits[:limit],
71
+ page_limit: limits[:page_limit]).each {|x| yield x}
72
+ end
73
+
74
+ ##
75
+ # Retrieve a single page of FlowInstance records from the API.
76
+ # Request is executed immediately.
77
+ # @param [String] page_token PageToken provided by the API
78
+ # @param [Integer] page_number Page Number, this value is simply for client state
79
+ # @param [Integer] page_size Number of records to return, defaults to 50
80
+ # @return [Page] Page of FlowInstance
81
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
82
+ params = Twilio::Values.of({
83
+ 'PageToken' => page_token,
84
+ 'Page' => page_number,
85
+ 'PageSize' => page_size,
86
+ })
87
+ response = @version.page(
88
+ 'GET',
89
+ @uri,
90
+ params
91
+ )
92
+ FlowPage.new(@version, response, @solution)
93
+ end
94
+
95
+ ##
96
+ # Retrieve a single page of FlowInstance records from the API.
97
+ # Request is executed immediately.
98
+ # @param [String] target_url API-generated URL for the requested results page
99
+ # @return [Page] Page of FlowInstance
100
+ def get_page(target_url)
101
+ response = @version.domain.request(
102
+ 'GET',
103
+ target_url
104
+ )
105
+ FlowPage.new(@version, response, @solution)
106
+ end
107
+
108
+ ##
109
+ # Provide a user friendly representation
110
+ def to_s
111
+ '#<Twilio.Studio.V1.FlowList>'
112
+ end
113
+ end
114
+
115
+ ##
116
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
117
+ class FlowPage < Page
118
+ ##
119
+ # Initialize the FlowPage
120
+ # @param [Version] version Version that contains the resource
121
+ # @param [Response] response Response from the API
122
+ # @param [Hash] solution Path solution for the resource
123
+ # @return [FlowPage] FlowPage
124
+ def initialize(version, response, solution)
125
+ super(version, response)
126
+
127
+ # Path Solution
128
+ @solution = solution
129
+ end
130
+
131
+ ##
132
+ # Build an instance of FlowInstance
133
+ # @param [Hash] payload Payload response from the API
134
+ # @return [FlowInstance] FlowInstance
135
+ def get_instance(payload)
136
+ FlowInstance.new(@version, payload, )
137
+ end
138
+
139
+ ##
140
+ # Provide a user friendly representation
141
+ def to_s
142
+ '<Twilio.Studio.V1.FlowPage>'
143
+ end
144
+ end
145
+
146
+ ##
147
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
148
+ class FlowContext < InstanceContext
149
+ ##
150
+ # Initialize the FlowContext
151
+ # @param [Version] version Version that contains the resource
152
+ # @param [String] sid The sid
153
+ # @return [FlowContext] FlowContext
154
+ def initialize(version, sid)
155
+ super(version)
156
+
157
+ # Path Solution
158
+ @solution = {sid: sid, }
159
+ @uri = "/Flows/#{@solution[:sid]}"
160
+
161
+ # Dependents
162
+ @engagements = nil
163
+ end
164
+
165
+ ##
166
+ # Fetch a FlowInstance
167
+ # @return [FlowInstance] Fetched FlowInstance
168
+ def fetch
169
+ params = Twilio::Values.of({})
170
+
171
+ payload = @version.fetch(
172
+ 'GET',
173
+ @uri,
174
+ params,
175
+ )
176
+
177
+ FlowInstance.new(@version, payload, sid: @solution[:sid], )
178
+ end
179
+
180
+ ##
181
+ # Deletes the FlowInstance
182
+ # @return [Boolean] true if delete succeeds, true otherwise
183
+ def delete
184
+ @version.delete('delete', @uri)
185
+ end
186
+
187
+ ##
188
+ # Access the engagements
189
+ # @return [EngagementList]
190
+ # @return [EngagementContext] if sid was passed.
191
+ def engagements(sid=:unset)
192
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
193
+
194
+ if sid != :unset
195
+ return EngagementContext.new(@version, @solution[:sid], sid, )
196
+ end
197
+
198
+ unless @engagements
199
+ @engagements = EngagementList.new(@version, flow_sid: @solution[:sid], )
200
+ end
201
+
202
+ @engagements
203
+ end
204
+
205
+ ##
206
+ # Provide a user friendly representation
207
+ def to_s
208
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
209
+ "#<Twilio.Studio.V1.FlowContext #{context}>"
210
+ end
211
+ end
212
+
213
+ ##
214
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
215
+ class FlowInstance < InstanceResource
216
+ ##
217
+ # Initialize the FlowInstance
218
+ # @param [Version] version Version that contains the resource
219
+ # @param [Hash] payload payload that contains response from Twilio
220
+ # @param [String] sid The sid
221
+ # @return [FlowInstance] FlowInstance
222
+ def initialize(version, payload, sid: nil)
223
+ super(version)
224
+
225
+ # Marshaled Properties
226
+ @properties = {
227
+ 'sid' => payload['sid'],
228
+ 'account_sid' => payload['account_sid'],
229
+ 'friendly_name' => payload['friendly_name'],
230
+ 'status' => payload['status'],
231
+ 'version' => payload['version'].to_i,
232
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
233
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
234
+ 'url' => payload['url'],
235
+ 'links' => payload['links'],
236
+ }
237
+
238
+ # Context
239
+ @instance_context = nil
240
+ @params = {'sid' => sid || @properties['sid'], }
241
+ end
242
+
243
+ ##
244
+ # Generate an instance context for the instance, the context is capable of
245
+ # performing various actions. All instance actions are proxied to the context
246
+ # @return [FlowContext] FlowContext for this FlowInstance
247
+ def context
248
+ unless @instance_context
249
+ @instance_context = FlowContext.new(@version, @params['sid'], )
250
+ end
251
+ @instance_context
252
+ end
253
+
254
+ ##
255
+ # @return [String] The sid
256
+ def sid
257
+ @properties['sid']
258
+ end
259
+
260
+ ##
261
+ # @return [String] The account_sid
262
+ def account_sid
263
+ @properties['account_sid']
264
+ end
265
+
266
+ ##
267
+ # @return [String] The friendly_name
268
+ def friendly_name
269
+ @properties['friendly_name']
270
+ end
271
+
272
+ ##
273
+ # @return [flow.Status] The status
274
+ def status
275
+ @properties['status']
276
+ end
277
+
278
+ ##
279
+ # @return [String] The version
280
+ def version
281
+ @properties['version']
282
+ end
283
+
284
+ ##
285
+ # @return [Time] The date_created
286
+ def date_created
287
+ @properties['date_created']
288
+ end
289
+
290
+ ##
291
+ # @return [Time] The date_updated
292
+ def date_updated
293
+ @properties['date_updated']
294
+ end
295
+
296
+ ##
297
+ # @return [String] The url
298
+ def url
299
+ @properties['url']
300
+ end
301
+
302
+ ##
303
+ # @return [String] The links
304
+ def links
305
+ @properties['links']
306
+ end
307
+
308
+ ##
309
+ # Fetch a FlowInstance
310
+ # @return [FlowInstance] Fetched FlowInstance
311
+ def fetch
312
+ context.fetch
313
+ end
314
+
315
+ ##
316
+ # Deletes the FlowInstance
317
+ # @return [Boolean] true if delete succeeds, true otherwise
318
+ def delete
319
+ context.delete
320
+ end
321
+
322
+ ##
323
+ # Access the engagements
324
+ # @return [engagements] engagements
325
+ def engagements
326
+ context.engagements
327
+ end
328
+
329
+ ##
330
+ # Provide a user friendly representation
331
+ def to_s
332
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
333
+ "<Twilio.Studio.V1.FlowInstance #{values}>"
334
+ end
335
+
336
+ ##
337
+ # Provide a detailed, user friendly representation
338
+ def inspect
339
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
340
+ "<Twilio.Studio.V1.FlowInstance #{values}>"
341
+ end
342
+ end
343
+ end
344
+ end
345
+ end
346
+ end