twilio-ruby 5.69.0 → 5.71.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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +43 -1
  3. data/Makefile +6 -2
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +4 -4
  6. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +3 -3
  7. data/lib/twilio-ruby/rest/client.rb +14 -0
  8. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +22 -1
  9. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +4 -4
  10. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +2 -2
  11. data/lib/twilio-ruby/rest/microvisor/v1/app.rb +305 -0
  12. data/lib/twilio-ruby/rest/microvisor/v1/device.rb +332 -0
  13. data/lib/twilio-ruby/rest/microvisor/v1.rb +60 -0
  14. data/lib/twilio-ruby/rest/microvisor.rb +54 -0
  15. data/lib/twilio-ruby/rest/preview.rb +0 -25
  16. data/lib/twilio-ruby/rest/routes/v2/phone_number.rb +235 -0
  17. data/lib/twilio-ruby/rest/routes/v2/sip_domain.rb +231 -0
  18. data/lib/twilio-ruby/rest/routes/v2/trunk.rb +235 -0
  19. data/lib/twilio-ruby/rest/routes/v2.rb +76 -0
  20. data/lib/twilio-ruby/rest/routes.rb +62 -0
  21. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +16 -6
  22. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +7 -8
  23. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +10 -3
  24. data/lib/twilio-ruby/security/request_validator.rb +1 -1
  25. data/lib/twilio-ruby/version.rb +1 -1
  26. metadata +11 -8
  27. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +0 -294
  28. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +0 -275
  29. data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +0 -249
  30. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +0 -251
  31. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +0 -234
  32. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +0 -62
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dfd0266c044e0696ec36adbe6b650a715bb222c
4
- data.tar.gz: 72cdf92cb46568d1b314f2ae67c1d96f9129d0ef
3
+ metadata.gz: 7d7e60b68cf1a5f9620b2f01e94b16ed38b39af8
4
+ data.tar.gz: edcf56d0de5fb32699a9b59558b1df3b300a3cd3
5
5
  SHA512:
6
- metadata.gz: e18aee13b94d15e4a19b152d0c730caf8c7ea176e3ab422584a938e7934f415a868e8b592334fab20ccd8d927e6db0dd476d759c95ea0aa035c64658fe33bf9e
7
- data.tar.gz: e482fefb1d0b50b0f7c3b79f829b5c3f899efede7dd85b0b0c10b7ba375efa7a7b4545367d1635e54356c0de6219a6080458dee1cb1fea358b0da8a3b00a204b
6
+ metadata.gz: 1e5d000f1bcef5af1371aa474d87968fac4320540223516476d577ad7f97970dadb5658e1819cc8f05182ad708901e798f380ebadd9807ef7bd30782ba669310
7
+ data.tar.gz: 9e7ab524c31d2502af6a0e0619b92308c25964500220f0a1dc67e39b4b462b837621347c0d2ef0cc7334e7f7ff8fd88bc3dc99d16bcdc661f053e24f883a2bb1
data/CHANGES.md CHANGED
@@ -1,6 +1,48 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2022-08-24] Version 5.71.0
5
+ ---------------------------
6
+ **Library - Test**
7
+ - [PR #615](https://github.com/twilio/twilio-ruby/pull/615): add test-docker rule. Thanks to [@beebzz](https://github.com/beebzz)!
8
+
9
+ **Api**
10
+ - Remove `beta feature` from scheduling params and remove optimize parameters. **(breaking change)**
11
+
12
+ **Routes**
13
+ - Remove Duplicate Create Method - Update Method will work even if Inbound Processing Region is currently empty/404. **(breaking change)**
14
+
15
+ **Twiml**
16
+ - Add new Polly Neural voices
17
+ - Add new languages to SSML `<lang>`.
18
+
19
+
20
+ [2022-08-10] Version 5.70.1
21
+ ---------------------------
22
+ **Library - Fix**
23
+ - [PR #614](https://github.com/twilio/twilio-ruby/pull/614): Make RequestValidator#validate fail if URL has no query params. Thanks to [@haffla](https://github.com/haffla)!
24
+
25
+ **Routes**
26
+ - Inbound Proccessing Region API - Public GA
27
+
28
+ **Supersim**
29
+ - Allow updating `DataLimit` on a Fleet
30
+
31
+
32
+ [2022-07-21] Version 5.70.0
33
+ ---------------------------
34
+ **Flex**
35
+ - Add `status`, `error_code`, and `error_message` fields to Interaction `Channel`
36
+ - Adding `messenger` and `gbm` as supported channels for Interactions API
37
+
38
+ **Messaging**
39
+ - Update alpha_sender docs with new valid characters
40
+
41
+ **Verify**
42
+ - Reorder Verification Check parameters so `code` stays as the first parameter **(breaking change)**
43
+ - Rollback List Attempts API V2 back to pilot stage.
44
+
45
+
4
46
  [2022-07-13] Version 5.69.0
5
47
  ---------------------------
6
48
  **Library - Fix**
@@ -20,7 +62,7 @@ twilio-ruby changelog
20
62
 
21
63
  **Verify**
22
64
  - Changed summary param `service_sid` to `verify_service_sid` to be consistent with list attempts API **(breaking change)**
23
- - Make `code` optional on Verification check to support `sna` attempts.
65
+ - Make `code` optional on Verification check to support `sna` attempts. **(breaking change)**
24
66
 
25
67
 
26
68
  [2022-06-29] Version 5.68.0
data/Makefile CHANGED
@@ -1,4 +1,4 @@
1
- .PHONY: githooks install test lint docs docker-build docker-push
1
+ .PHONY: githooks install test test-docker lint docs docker-build docker-push
2
2
 
3
3
  githooks:
4
4
  ln -sf ../../githooks/pre-commit .git/hooks/pre-commit
@@ -9,6 +9,10 @@ install:
9
9
  test:
10
10
  bundle exec rake spec
11
11
 
12
+ test-docker:
13
+ docker build -t twilio/twilio-ruby .
14
+ docker run twilio/twilio-ruby bundle exec rake spec
15
+
12
16
  docs:
13
17
  bundle exec yard doc --output-dir ./doc
14
18
 
@@ -17,7 +21,7 @@ authors:
17
21
  git log --raw | grep "^Author: " | cut -d ' ' -f2- | cut -d '<' -f1 | sed 's/^/- /' | sort | uniq >> AUTHORS.md
18
22
 
19
23
  API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5)
20
- CURRENT_TAG=$(shell [[ "${GITHUB_TAG}" == *"-rc"* ]] && echo "rc" || echo "latest")
24
+ CURRENT_TAG=$(shell expr "${GITHUB_TAG}" : ".*-rc.*" >/dev/null && echo "rc" || echo "latest")
21
25
  docker-build:
22
26
  docker build -t twilio/twilio-ruby .
23
27
  docker tag twilio/twilio-ruby twilio/twilio-ruby:${GITHUB_TAG}
data/README.md CHANGED
@@ -34,13 +34,13 @@ This library supports the following Ruby implementations:
34
34
  To install using [Bundler][bundler] grab the latest stable version:
35
35
 
36
36
  ```ruby
37
- gem 'twilio-ruby', '~> 5.69.0'
37
+ gem 'twilio-ruby', '~> 5.71.0'
38
38
  ```
39
39
 
40
40
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
41
41
 
42
42
  ```bash
43
- gem install twilio-ruby -v 5.69.0
43
+ gem install twilio-ruby -v 5.71.0
44
44
  ```
45
45
 
46
46
  To build and install the development branch yourself from the latest source:
@@ -113,7 +113,7 @@ module Twilio
113
113
  ##
114
114
  # Create the IpAddressInstance
115
115
  # @param [String] friendly_name A human readable descriptive text for this
116
- # resource, up to 64 characters long.
116
+ # resource, up to 255 characters long.
117
117
  # @param [String] ip_address An IP address in dotted decimal notation from which
118
118
  # you want to accept traffic. Any SIP requests from this IP address will be
119
119
  # allowed by Twilio. IPv4 only supported today.
@@ -224,7 +224,7 @@ module Twilio
224
224
  # you want to accept traffic. Any SIP requests from this IP address will be
225
225
  # allowed by Twilio. IPv4 only supported today.
226
226
  # @param [String] friendly_name A human readable descriptive text for this
227
- # resource, up to 64 characters long.
227
+ # resource, up to 255 characters long.
228
228
  # @param [String] cidr_prefix_length An integer representing the length of the
229
229
  # CIDR prefix to use with this IP address when accepting traffic. By default the
230
230
  # entire IP address is used.
@@ -335,7 +335,7 @@ module Twilio
335
335
  end
336
336
 
337
337
  ##
338
- # @return [String] A human readable descriptive text for this resource, up to 64 characters long.
338
+ # @return [String] A human readable descriptive text for this resource, up to 255 characters long.
339
339
  def friendly_name
340
340
  @properties['friendly_name']
341
341
  end
@@ -389,7 +389,7 @@ module Twilio
389
389
  # you want to accept traffic. Any SIP requests from this IP address will be
390
390
  # allowed by Twilio. IPv4 only supported today.
391
391
  # @param [String] friendly_name A human readable descriptive text for this
392
- # resource, up to 64 characters long.
392
+ # resource, up to 255 characters long.
393
393
  # @param [String] cidr_prefix_length An integer representing the length of the
394
394
  # CIDR prefix to use with this IP address when accepting traffic. By default the
395
395
  # entire IP address is used.
@@ -110,7 +110,7 @@ module Twilio
110
110
  ##
111
111
  # Create the IpAccessControlListInstance
112
112
  # @param [String] friendly_name A human readable descriptive text that describes
113
- # the IpAccessControlList, up to 64 characters long.
113
+ # the IpAccessControlList, up to 255 characters long.
114
114
  # @return [IpAccessControlListInstance] Created IpAccessControlListInstance
115
115
  def create(friendly_name: nil)
116
116
  data = Twilio::Values.of({'FriendlyName' => friendly_name, })
@@ -193,7 +193,7 @@ module Twilio
193
193
 
194
194
  ##
195
195
  # Update the IpAccessControlListInstance
196
- # @param [String] friendly_name A human readable descriptive text, up to 64
196
+ # @param [String] friendly_name A human readable descriptive text, up to 255
197
197
  # characters long.
198
198
  # @return [IpAccessControlListInstance] Updated IpAccessControlListInstance
199
199
  def update(friendly_name: nil)
@@ -344,7 +344,7 @@ module Twilio
344
344
 
345
345
  ##
346
346
  # Update the IpAccessControlListInstance
347
- # @param [String] friendly_name A human readable descriptive text, up to 64
347
+ # @param [String] friendly_name A human readable descriptive text, up to 255
348
348
  # characters long.
349
349
  # @return [IpAccessControlListInstance] Updated IpAccessControlListInstance
350
350
  def update(friendly_name: nil)
@@ -49,6 +49,7 @@ module Twilio
49
49
  @preview = nil
50
50
  @pricing = nil
51
51
  @proxy = nil
52
+ @routes = nil
52
53
  @serverless = nil
53
54
  @studio = nil
54
55
  @sync = nil
@@ -61,6 +62,7 @@ module Twilio
61
62
  @wireless = nil
62
63
  @supersim = nil
63
64
  @bulkexports = nil
65
+ @microvisor = nil
64
66
  end
65
67
 
66
68
  ##
@@ -275,6 +277,12 @@ module Twilio
275
277
  @proxy ||= Proxy.new self
276
278
  end
277
279
 
280
+ ##
281
+ # Access the Routes Twilio Domain
282
+ def routes
283
+ @routes ||= Routes.new self
284
+ end
285
+
278
286
  ##
279
287
  # Access the Serverless Twilio Domain
280
288
  def serverless
@@ -347,6 +355,12 @@ module Twilio
347
355
  @bulkexports ||= Bulkexports.new self
348
356
  end
349
357
 
358
+ ##
359
+ # Access the Microvisor Twilio Domain
360
+ def microvisor
361
+ @microvisor ||= Microvisor.new self
362
+ end
363
+
350
364
  ##
351
365
  # @param [String] sid The unique string that that we created to identify the
352
366
  # Address resource.
@@ -275,6 +275,9 @@ module Twilio
275
275
  'sid' => payload['sid'],
276
276
  'interaction_sid' => payload['interaction_sid'],
277
277
  'type' => payload['type'],
278
+ 'status' => payload['status'],
279
+ 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
280
+ 'error_message' => payload['error_message'],
278
281
  'url' => payload['url'],
279
282
  'links' => payload['links'],
280
283
  }
@@ -306,7 +309,7 @@ module Twilio
306
309
  end
307
310
 
308
311
  ##
309
- # @return [String] The unique string that identifies the resource
312
+ # @return [String] The unique string that identifies the resource.
310
313
  def interaction_sid
311
314
  @properties['interaction_sid']
312
315
  end
@@ -317,6 +320,24 @@ module Twilio
317
320
  @properties['type']
318
321
  end
319
322
 
323
+ ##
324
+ # @return [interaction_channel.ChannelStatus] The status of this channel.
325
+ def status
326
+ @properties['status']
327
+ end
328
+
329
+ ##
330
+ # @return [String] The Twilio error code for a failed channel.
331
+ def error_code
332
+ @properties['error_code']
333
+ end
334
+
335
+ ##
336
+ # @return [String] The error message for a failed channel.
337
+ def error_message
338
+ @properties['error_message']
339
+ end
340
+
320
341
  ##
321
342
  # @return [String] The url
322
343
  def url
@@ -33,10 +33,10 @@ module Twilio
33
33
  # @param [String] status_callback_method The HTTP method Twilio should use to call
34
34
  # the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
35
35
  # @param [String] max_duration The maximum time, in seconds, that the
36
- # PlayerStreamer can run before automatically ends. The default value is 300
37
- # seconds, and the maximum value is 90000 seconds. Once this maximum duration is
38
- # reached, Twilio will end the PlayerStreamer, regardless of whether media is
39
- # still streaming.
36
+ # PlayerStreamer is active (`created` or `started`) before automatically ends. The
37
+ # default value is 300 seconds, and the maximum value is 90000 seconds. Once this
38
+ # maximum duration is reached, Twilio will end the PlayerStreamer, regardless of
39
+ # whether media is still streaming.
40
40
  # @return [PlayerStreamerInstance] Created PlayerStreamerInstance
41
41
  def create(video: :unset, status_callback: :unset, status_callback_method: :unset, max_duration: :unset)
42
42
  data = Twilio::Values.of({
@@ -32,8 +32,8 @@ module Twilio
32
32
  ##
33
33
  # Create the AlphaSenderInstance
34
34
  # @param [String] alpha_sender The Alphanumeric Sender ID string. Can be up to 11
35
- # characters long. Valid characters are A-Z, a-z, 0-9, space, and hyphen `-`. This
36
- # value cannot contain only numbers.
35
+ # characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus
36
+ # `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers.
37
37
  # @return [AlphaSenderInstance] Created AlphaSenderInstance
38
38
  def create(alpha_sender: nil)
39
39
  data = Twilio::Values.of({'AlphaSender' => alpha_sender, })
@@ -0,0 +1,305 @@
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 Microvisor < Domain
12
+ class V1 < Version
13
+ ##
14
+ # 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.
15
+ class AppList < ListResource
16
+ ##
17
+ # Initialize the AppList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [AppList] AppList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/Apps"
26
+ end
27
+
28
+ ##
29
+ # Lists AppInstance records from the API as a list.
30
+ # Unlike stream(), this operation is eager and will load `limit` records into
31
+ # memory before returning.
32
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
33
+ # guarantees to never return more than limit. Default is no limit
34
+ # @param [Integer] page_size Number of records to fetch per request, when
35
+ # not set will use the default value of 50 records. If no page_size is defined
36
+ # but a limit is defined, stream() will attempt to read the limit with the most
37
+ # efficient page size, i.e. min(limit, 1000)
38
+ # @return [Array] Array of up to limit results
39
+ def list(limit: nil, page_size: nil)
40
+ self.stream(limit: limit, page_size: page_size).entries
41
+ end
42
+
43
+ ##
44
+ # Streams AppInstance records from the API as an Enumerable.
45
+ # This operation lazily loads records as efficiently as possible until the limit
46
+ # is reached.
47
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
48
+ # guarantees to never return more than limit. Default is no limit.
49
+ # @param [Integer] page_size Number of records to fetch per request, when
50
+ # not set will use the default value of 50 records. If no page_size is defined
51
+ # but a limit is defined, stream() will attempt to read the limit with the most
52
+ # efficient page size, i.e. min(limit, 1000)
53
+ # @return [Enumerable] Enumerable that will yield up to limit results
54
+ def stream(limit: nil, page_size: nil)
55
+ limits = @version.read_limits(limit, page_size)
56
+
57
+ page = self.page(page_size: limits[:page_size], )
58
+
59
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
60
+ end
61
+
62
+ ##
63
+ # When passed a block, yields AppInstance records from the API.
64
+ # This operation lazily loads records as efficiently as possible until the limit
65
+ # is reached.
66
+ def each
67
+ limits = @version.read_limits
68
+
69
+ page = self.page(page_size: limits[:page_size], )
70
+
71
+ @version.stream(page,
72
+ limit: limits[:limit],
73
+ page_limit: limits[:page_limit]).each {|x| yield x}
74
+ end
75
+
76
+ ##
77
+ # Retrieve a single page of AppInstance records from the API.
78
+ # Request is executed immediately.
79
+ # @param [String] page_token PageToken provided by the API
80
+ # @param [Integer] page_number Page Number, this value is simply for client state
81
+ # @param [Integer] page_size Number of records to return, defaults to 50
82
+ # @return [Page] Page of AppInstance
83
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
84
+ params = Twilio::Values.of({
85
+ 'PageToken' => page_token,
86
+ 'Page' => page_number,
87
+ 'PageSize' => page_size,
88
+ })
89
+
90
+ response = @version.page('GET', @uri, params: params)
91
+
92
+ AppPage.new(@version, response, @solution)
93
+ end
94
+
95
+ ##
96
+ # Retrieve a single page of AppInstance 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 AppInstance
100
+ def get_page(target_url)
101
+ response = @version.domain.request(
102
+ 'GET',
103
+ target_url
104
+ )
105
+ AppPage.new(@version, response, @solution)
106
+ end
107
+
108
+ ##
109
+ # Provide a user friendly representation
110
+ def to_s
111
+ '#<Twilio.Microvisor.V1.AppList>'
112
+ end
113
+ end
114
+
115
+ ##
116
+ # 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.
117
+ class AppPage < Page
118
+ ##
119
+ # Initialize the AppPage
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 [AppPage] AppPage
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 AppInstance
133
+ # @param [Hash] payload Payload response from the API
134
+ # @return [AppInstance] AppInstance
135
+ def get_instance(payload)
136
+ AppInstance.new(@version, payload, )
137
+ end
138
+
139
+ ##
140
+ # Provide a user friendly representation
141
+ def to_s
142
+ '<Twilio.Microvisor.V1.AppPage>'
143
+ end
144
+ end
145
+
146
+ ##
147
+ # 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.
148
+ class AppContext < InstanceContext
149
+ ##
150
+ # Initialize the AppContext
151
+ # @param [Version] version Version that contains the resource
152
+ # @param [String] sid A 34-character string that uniquely identifies this App.
153
+ # @return [AppContext] AppContext
154
+ def initialize(version, sid)
155
+ super(version)
156
+
157
+ # Path Solution
158
+ @solution = {sid: sid, }
159
+ @uri = "/Apps/#{@solution[:sid]}"
160
+ end
161
+
162
+ ##
163
+ # Fetch the AppInstance
164
+ # @return [AppInstance] Fetched AppInstance
165
+ def fetch
166
+ payload = @version.fetch('GET', @uri)
167
+
168
+ AppInstance.new(@version, payload, sid: @solution[:sid], )
169
+ end
170
+
171
+ ##
172
+ # Delete the AppInstance
173
+ # @return [Boolean] true if delete succeeds, false otherwise
174
+ def delete
175
+ @version.delete('DELETE', @uri)
176
+ end
177
+
178
+ ##
179
+ # Provide a user friendly representation
180
+ def to_s
181
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
182
+ "#<Twilio.Microvisor.V1.AppContext #{context}>"
183
+ end
184
+
185
+ ##
186
+ # Provide a detailed, user friendly representation
187
+ def inspect
188
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
189
+ "#<Twilio.Microvisor.V1.AppContext #{context}>"
190
+ end
191
+ end
192
+
193
+ ##
194
+ # 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.
195
+ class AppInstance < InstanceResource
196
+ ##
197
+ # Initialize the AppInstance
198
+ # @param [Version] version Version that contains the resource
199
+ # @param [Hash] payload payload that contains response from Twilio
200
+ # @param [String] sid A 34-character string that uniquely identifies this App.
201
+ # @return [AppInstance] AppInstance
202
+ def initialize(version, payload, sid: nil)
203
+ super(version)
204
+
205
+ # Marshaled Properties
206
+ @properties = {
207
+ 'sid' => payload['sid'],
208
+ 'account_sid' => payload['account_sid'],
209
+ 'hash' => payload['hash'],
210
+ 'unique_name' => payload['unique_name'],
211
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
212
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
213
+ 'url' => payload['url'],
214
+ }
215
+
216
+ # Context
217
+ @instance_context = nil
218
+ @params = {'sid' => sid || @properties['sid'], }
219
+ end
220
+
221
+ ##
222
+ # Generate an instance context for the instance, the context is capable of
223
+ # performing various actions. All instance actions are proxied to the context
224
+ # @return [AppContext] AppContext for this AppInstance
225
+ def context
226
+ unless @instance_context
227
+ @instance_context = AppContext.new(@version, @params['sid'], )
228
+ end
229
+ @instance_context
230
+ end
231
+
232
+ ##
233
+ # @return [String] A string that uniquely identifies this App.
234
+ def sid
235
+ @properties['sid']
236
+ end
237
+
238
+ ##
239
+ # @return [String] The Account SID.
240
+ def account_sid
241
+ @properties['account_sid']
242
+ end
243
+
244
+ ##
245
+ # @return [String] App manifest hash represented as hash_algorithm:hash_value.
246
+ def hash
247
+ @properties['hash']
248
+ end
249
+
250
+ ##
251
+ # @return [String] An developer-defined string that uniquely identifies the App.
252
+ def unique_name
253
+ @properties['unique_name']
254
+ end
255
+
256
+ ##
257
+ # @return [Time] The date that this App was created.
258
+ def date_created
259
+ @properties['date_created']
260
+ end
261
+
262
+ ##
263
+ # @return [Time] The date that this App was last updated.
264
+ def date_updated
265
+ @properties['date_updated']
266
+ end
267
+
268
+ ##
269
+ # @return [String] The URL of this resource.
270
+ def url
271
+ @properties['url']
272
+ end
273
+
274
+ ##
275
+ # Fetch the AppInstance
276
+ # @return [AppInstance] Fetched AppInstance
277
+ def fetch
278
+ context.fetch
279
+ end
280
+
281
+ ##
282
+ # Delete the AppInstance
283
+ # @return [Boolean] true if delete succeeds, false otherwise
284
+ def delete
285
+ context.delete
286
+ end
287
+
288
+ ##
289
+ # Provide a user friendly representation
290
+ def to_s
291
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
292
+ "<Twilio.Microvisor.V1.AppInstance #{values}>"
293
+ end
294
+
295
+ ##
296
+ # Provide a detailed, user friendly representation
297
+ def inspect
298
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
299
+ "<Twilio.Microvisor.V1.AppInstance #{values}>"
300
+ end
301
+ end
302
+ end
303
+ end
304
+ end
305
+ end