twilio-ruby 5.28.0 → 5.29.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 (63) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +11 -6
  3. data/CHANGES.md +33 -0
  4. data/README.md +3 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +18 -20
  6. data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +7 -6
  7. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +7 -6
  8. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +6 -4
  9. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +0 -14
  10. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +1 -1
  11. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +6 -4
  12. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +9 -6
  13. data/lib/twilio-ruby/rest/authy.rb +8 -8
  14. data/lib/twilio-ruby/rest/authy/v1.rb +15 -15
  15. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +6 -3
  16. data/lib/twilio-ruby/rest/flex_api.rb +15 -15
  17. data/lib/twilio-ruby/rest/flex_api/v1.rb +20 -20
  18. data/lib/twilio-ruby/rest/messaging.rb +9 -9
  19. data/lib/twilio-ruby/rest/messaging/v1.rb +13 -13
  20. data/lib/twilio-ruby/rest/preview.rb +20 -20
  21. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +38 -0
  22. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +298 -0
  23. data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +232 -0
  24. data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
  25. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +14 -14
  26. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb +40 -5
  27. data/lib/twilio-ruby/rest/preview/trusted_comms/cps.rb +7 -7
  28. data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +51 -51
  29. data/lib/twilio-ruby/rest/preview/trusted_comms/device.rb +10 -10
  30. data/lib/twilio-ruby/rest/preview/trusted_comms/phone_call.rb +96 -19
  31. data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
  32. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +8 -2
  33. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +10 -6
  34. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +10 -6
  35. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +271 -176
  36. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +282 -137
  37. data/lib/twilio-ruby/rest/video.rb +9 -9
  38. data/lib/twilio-ruby/rest/video/v1.rb +15 -15
  39. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +2 -1
  40. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +9 -7
  41. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb +3 -3
  42. data/lib/twilio-ruby/rest/wireless.rb +6 -6
  43. data/lib/twilio-ruby/rest/wireless/v1.rb +8 -8
  44. data/lib/twilio-ruby/rest/wireless/v1/command.rb +5 -4
  45. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -5
  46. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +114 -98
  47. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +4 -4
  48. data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +16 -10
  49. data/lib/twilio-ruby/security/request_validator.rb +61 -8
  50. data/lib/twilio-ruby/version.rb +1 -1
  51. data/spec/integration/api/v2010/account/message_spec.rb +4 -4
  52. data/spec/integration/api/v2010/account/notification_spec.rb +0 -28
  53. data/spec/integration/conversations/v1/conversation/participant_spec.rb +27 -0
  54. data/spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb +129 -0
  55. data/spec/integration/preview/bulk_exports/export/job_spec.rb +77 -0
  56. data/spec/integration/preview/trusted_comms/branded_call_spec.rb +6 -1
  57. data/spec/integration/preview/trusted_comms/cps_spec.rb +1 -1
  58. data/spec/integration/preview/trusted_comms/current_call_spec.rb +10 -10
  59. data/spec/integration/preview/trusted_comms/device_spec.rb +1 -1
  60. data/spec/integration/preview/trusted_comms/phone_call_spec.rb +15 -4
  61. data/spec/integration/wireless/v1/sim_spec.rb +84 -0
  62. data/spec/security/request_validator_spec.rb +41 -0
  63. metadata +9 -4
@@ -28,6 +28,15 @@ module Twilio
28
28
  @v1 ||= V1.new self
29
29
  end
30
30
 
31
+ ##
32
+ # @param [String] sid The unique string that we created to identify the
33
+ # Composition resource.
34
+ # @return [Twilio::REST::Video::V1::CompositionInstance] if sid was passed.
35
+ # @return [Twilio::REST::Video::V1::CompositionList]
36
+ def compositions(sid=:unset)
37
+ self.v1.compositions(sid)
38
+ end
39
+
31
40
  ##
32
41
  # @param [String] sid The unique string that we created to identify the
33
42
  # CompositionHook resource.
@@ -58,15 +67,6 @@ module Twilio
58
67
  self.v1.recording_settings()
59
68
  end
60
69
 
61
- ##
62
- # @param [String] sid The unique string that we created to identify the
63
- # Composition resource.
64
- # @return [Twilio::REST::Video::V1::CompositionInstance] if sid was passed.
65
- # @return [Twilio::REST::Video::V1::CompositionList]
66
- def compositions(sid=:unset)
67
- self.v1.compositions(sid)
68
- end
69
-
70
70
  ##
71
71
  # @param [String] sid The unique string that we created to identify the Room
72
72
  # resource.
@@ -15,14 +15,28 @@ module Twilio
15
15
  def initialize(domain)
16
16
  super
17
17
  @version = 'v1'
18
+ @compositions = nil
18
19
  @composition_hooks = nil
19
20
  @composition_settings = nil
20
21
  @recordings = nil
21
22
  @recording_settings = nil
22
- @compositions = nil
23
23
  @rooms = nil
24
24
  end
25
25
 
26
+ ##
27
+ # @param [String] sid The SID of the Composition resource to fetch.
28
+ # @return [Twilio::REST::Video::V1::CompositionContext] if sid was passed.
29
+ # @return [Twilio::REST::Video::V1::CompositionList]
30
+ def compositions(sid=:unset)
31
+ if sid.nil?
32
+ raise ArgumentError, 'sid cannot be nil'
33
+ elsif sid == :unset
34
+ @compositions ||= CompositionList.new self
35
+ else
36
+ CompositionContext.new(self, sid)
37
+ end
38
+ end
39
+
26
40
  ##
27
41
  # @param [String] sid The SID of the CompositionHook resource to fetch.
28
42
  # @return [Twilio::REST::Video::V1::CompositionHookContext] if sid was passed.
@@ -63,20 +77,6 @@ module Twilio
63
77
  @recording_settings ||= RecordingSettingsContext.new self
64
78
  end
65
79
 
66
- ##
67
- # @param [String] sid The SID of the Composition resource to fetch.
68
- # @return [Twilio::REST::Video::V1::CompositionContext] if sid was passed.
69
- # @return [Twilio::REST::Video::V1::CompositionList]
70
- def compositions(sid=:unset)
71
- if sid.nil?
72
- raise ArgumentError, 'sid cannot be nil'
73
- elsif sid == :unset
74
- @compositions ||= CompositionList.new self
75
- else
76
- CompositionContext.new(self, sid)
77
- end
78
- end
79
-
80
80
  ##
81
81
  # @param [String] sid The SID of the Room resource to fetch.
82
82
  # @return [Twilio::REST::Video::V1::RoomContext] if sid was passed.
@@ -32,7 +32,8 @@ module Twilio
32
32
  ##
33
33
  # Access the countries
34
34
  # @param [String] iso_code The [ISO country
35
- # code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
35
+ # code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the
36
+ # DialingPermissions Country resource to fetch
36
37
  # @return [CountryList]
37
38
  # @return [CountryContext] if iso_code was passed.
38
39
  def countries(iso_code=:unset)
@@ -224,7 +224,8 @@ module Twilio
224
224
  # Initialize the CountryContext
225
225
  # @param [Version] version Version that contains the resource
226
226
  # @param [String] iso_code The [ISO country
227
- # code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
227
+ # code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the
228
+ # DialingPermissions Country resource to fetch
228
229
  # @return [CountryContext] CountryContext
229
230
  def initialize(version, iso_code)
230
231
  super(version)
@@ -287,7 +288,8 @@ module Twilio
287
288
  # @param [Version] version Version that contains the resource
288
289
  # @param [Hash] payload payload that contains response from Twilio
289
290
  # @param [String] iso_code The [ISO country
290
- # code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
291
+ # code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the
292
+ # DialingPermissions Country resource to fetch
291
293
  # @return [CountryInstance] CountryInstance
292
294
  def initialize(version, payload, iso_code: nil)
293
295
  super(version)
@@ -328,13 +330,13 @@ module Twilio
328
330
  end
329
331
 
330
332
  ##
331
- # @return [String] Name of the country
333
+ # @return [String] The name of the country
332
334
  def name
333
335
  @properties['name']
334
336
  end
335
337
 
336
338
  ##
337
- # @return [String] Name of the continent
339
+ # @return [String] The name of the continent in which the country is located
338
340
  def continent
339
341
  @properties['continent']
340
342
  end
@@ -346,19 +348,19 @@ module Twilio
346
348
  end
347
349
 
348
350
  ##
349
- # @return [Boolean] `true`, if dialing to low-risk numbers is enabled, else `false`
351
+ # @return [Boolean] Whether dialing to low-risk numbers is enabled
350
352
  def low_risk_numbers_enabled
351
353
  @properties['low_risk_numbers_enabled']
352
354
  end
353
355
 
354
356
  ##
355
- # @return [Boolean] `true`, if dialing to high-risk special services numbers is enabled, else `false`
357
+ # @return [Boolean] Whether dialing to high-risk special services numbers is enabled
356
358
  def high_risk_special_numbers_enabled
357
359
  @properties['high_risk_special_numbers_enabled']
358
360
  end
359
361
 
360
362
  ##
361
- # @return [Boolean] `true`, if dialing to high-risk toll fraud numbers is enabled, else `false`
363
+ # @return [Boolean] Whether dialing to high-risk toll fraud numbers is enabled, else `false`
362
364
  def high_risk_tollfraud_numbers_enabled
363
365
  @properties['high_risk_tollfraud_numbers_enabled']
364
366
  end
@@ -95,7 +95,7 @@ module Twilio
95
95
 
96
96
  ##
97
97
  # Update the SettingsInstance
98
- # @param [Boolean] dialing_permissions_inheritance `true` for this sub-account to
98
+ # @param [Boolean] dialing_permissions_inheritance `true` for the sub-account to
99
99
  # inherit voice dialing permissions from the Master Project; otherwise `false`.
100
100
  # @return [SettingsInstance] Updated SettingsInstance
101
101
  def update(dialing_permissions_inheritance: :unset)
@@ -159,7 +159,7 @@ module Twilio
159
159
  end
160
160
 
161
161
  ##
162
- # @return [Boolean] `true` if this sub-account will inherit voice dialing permissions from the Master Project; otherwise `false`
162
+ # @return [Boolean] `true` if the sub-account will inherit voice dialing permissions from the Master Project; otherwise `false`
163
163
  def dialing_permissions_inheritance
164
164
  @properties['dialing_permissions_inheritance']
165
165
  end
@@ -179,7 +179,7 @@ module Twilio
179
179
 
180
180
  ##
181
181
  # Update the SettingsInstance
182
- # @param [Boolean] dialing_permissions_inheritance `true` for this sub-account to
182
+ # @param [Boolean] dialing_permissions_inheritance `true` for the sub-account to
183
183
  # inherit voice dialing permissions from the Master Project; otherwise `false`.
184
184
  # @return [SettingsInstance] Updated SettingsInstance
185
185
  def update(dialing_permissions_inheritance: :unset)
@@ -28,6 +28,12 @@ module Twilio
28
28
  @v1 ||= V1.new self
29
29
  end
30
30
 
31
+ ##
32
+ # @return [Twilio::REST::Wireless::V1::UsageRecordInstance]
33
+ def usage_records
34
+ self.v1.usage_records()
35
+ end
36
+
31
37
  ##
32
38
  # @param [String] sid The unique string that we created to identify the Command
33
39
  # resource.
@@ -46,12 +52,6 @@ module Twilio
46
52
  self.v1.rate_plans(sid)
47
53
  end
48
54
 
49
- ##
50
- # @return [Twilio::REST::Wireless::V1::UsageRecordInstance]
51
- def usage_records
52
- self.v1.usage_records()
53
- end
54
-
55
55
  ##
56
56
  # @param [String] sid The unique string that we created to identify the Sim
57
57
  # resource.
@@ -15,12 +15,18 @@ module Twilio
15
15
  def initialize(domain)
16
16
  super
17
17
  @version = 'v1'
18
+ @usage_records = nil
18
19
  @commands = nil
19
20
  @rate_plans = nil
20
- @usage_records = nil
21
21
  @sims = nil
22
22
  end
23
23
 
24
+ ##
25
+ # @return [Twilio::REST::Wireless::V1::UsageRecordContext]
26
+ def usage_records
27
+ @usage_records ||= UsageRecordList.new self
28
+ end
29
+
24
30
  ##
25
31
  # @param [String] sid The SID of the Command resource to fetch.
26
32
  # @return [Twilio::REST::Wireless::V1::CommandContext] if sid was passed.
@@ -50,13 +56,7 @@ module Twilio
50
56
  end
51
57
 
52
58
  ##
53
- # @return [Twilio::REST::Wireless::V1::UsageRecordContext]
54
- def usage_records
55
- @usage_records ||= UsageRecordList.new self
56
- end
57
-
58
- ##
59
- # @param [String] sid The SID of the Sim resource to fetch.
59
+ # @param [String] sid The SID or the `unique_name` of the Sim resource to fetch.
60
60
  # @return [Twilio::REST::Wireless::V1::SimContext] if sid was passed.
61
61
  # @return [Twilio::REST::Wireless::V1::SimList]
62
62
  def sims(sid=:unset)
@@ -28,7 +28,7 @@ module Twilio
28
28
  # Unlike stream(), this operation is eager and will load `limit` records into
29
29
  # memory before returning.
30
30
  # @param [String] sim The `sid` or `unique_name` of the [Sim
31
- # resources](https://www.twilio.com/docs/wireless/api/sim) to read.
31
+ # resources](https://www.twilio.com/docs/wireless/api/sim-resource) to read.
32
32
  # @param [command.Status] status The status of the resources to read. Can be:
33
33
  # `queued`, `sent`, `delivered`, `received`, or `failed`.
34
34
  # @param [command.Direction] direction Only return Commands with this direction
@@ -58,7 +58,7 @@ module Twilio
58
58
  # This operation lazily loads records as efficiently as possible until the limit
59
59
  # is reached.
60
60
  # @param [String] sim The `sid` or `unique_name` of the [Sim
61
- # resources](https://www.twilio.com/docs/wireless/api/sim) to read.
61
+ # resources](https://www.twilio.com/docs/wireless/api/sim-resource) to read.
62
62
  # @param [command.Status] status The status of the resources to read. Can be:
63
63
  # `queued`, `sent`, `delivered`, `received`, or `failed`.
64
64
  # @param [command.Direction] direction Only return Commands with this direction
@@ -104,7 +104,7 @@ module Twilio
104
104
  # Retrieve a single page of CommandInstance records from the API.
105
105
  # Request is executed immediately.
106
106
  # @param [String] sim The `sid` or `unique_name` of the [Sim
107
- # resources](https://www.twilio.com/docs/wireless/api/sim) to read.
107
+ # resources](https://www.twilio.com/docs/wireless/api/sim-resource) to read.
108
108
  # @param [command.Status] status The status of the resources to read. Can be:
109
109
  # `queued`, `sent`, `delivered`, `received`, or `failed`.
110
110
  # @param [command.Direction] direction Only return Commands with this direction
@@ -152,7 +152,8 @@ module Twilio
152
152
  # @param [String] command The message body of the Command. Can be plain text in
153
153
  # text mode or a Base64 encoded byte string in binary mode.
154
154
  # @param [String] sim The `sid` or `unique_name` of the
155
- # [SIM](https://www.twilio.com/docs/wireless/api/sim) to send the Command to.
155
+ # [SIM](https://www.twilio.com/docs/wireless/api/sim-resource) to send the Command
156
+ # to.
156
157
  # @param [String] callback_method The HTTP method we use to call `callback_url`.
157
158
  # Can be: `POST` or `GET`, and the default is `POST`.
158
159
  # @param [String] callback_url The URL we call using the `callback_url` when the
@@ -123,13 +123,13 @@ module Twilio
123
123
  # @param [String] data_metering The model used to meter data usage. Can be: `payg`
124
124
  # and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data
125
125
  # metering
126
- # models](https://www.twilio.com/docs/wireless/api/rate-plan#payg-vs-quota-data-plans).
126
+ # models](https://www.twilio.com/docs/wireless/api/rateplan-resource#payg-vs-quota-data-plans).
127
127
  # @param [Boolean] messaging_enabled Whether SIMs can make, send, and receive SMS
128
- # using [Commands](https://www.twilio.com/docs/wireless/api/commands).
128
+ # using [Commands](https://www.twilio.com/docs/wireless/api/command-resource).
129
129
  # @param [Boolean] voice_enabled Whether SIMs can make and receive voice calls.
130
130
  # @param [Boolean] national_roaming_enabled Whether SIMs can roam on networks
131
131
  # other than the home network (T-Mobile USA) in the United States. See [national
132
- # roaming](https://www.twilio.com/docs/wireless/api/rate-plan#national-roaming).
132
+ # roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming).
133
133
  # @param [String] international_roaming The list of services that SIMs capable of
134
134
  # using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can
135
135
  # be: `data`, `voice`, and `messaging`.
@@ -138,8 +138,7 @@ module Twilio
138
138
  # non-home networks in the United States. The metering period begins the day of
139
139
  # activation and ends on the same day in the following month. Can be up to 2TB.
140
140
  # See [national
141
- # roaming](https://www.twilio.com/docs/wireless/api/rate-plan#national-roaming)
142
- # for more info.
141
+ # roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming) for more info.
143
142
  # @param [String] international_roaming_data_limit The total data usage (download
144
143
  # and upload combined) in Megabytes that the Network allows during one month when
145
144
  # roaming outside the United States. Can be up to 2TB.
@@ -28,14 +28,14 @@ module Twilio
28
28
  # Unlike stream(), this operation is eager and will load `limit` records into
29
29
  # memory before returning.
30
30
  # @param [sim.Status] status Only return Sim resources with this status.
31
- # @param [String] iccid Only return Sim resources with this ICCID. Currently this
32
- # should be a list with maximum size 1.
33
- # @param [String] rate_plan The `sid` or `unique_name` of the [RatePlan
34
- # resource](https://www.twilio.com/docs/wireless/api/rate-plan) used by the Sim
35
- # resources to read.
31
+ # @param [String] iccid Only return Sim resources with this ICCID. This will
32
+ # return a list with a maximum size of 1.
33
+ # @param [String] rate_plan The SID or unique name of a [RatePlan
34
+ # resource](https://www.twilio.com/docs/wireless/api/rateplan-resource). Only
35
+ # return Sim resources assigned to this RatePlan resource.
36
36
  # @param [String] e_id Deprecated.
37
37
  # @param [String] sim_registration_code Only return Sim resources with this
38
- # registration code.
38
+ # registration code. This will return a list with a maximum size of 1.
39
39
  # @param [Integer] limit Upper limit for the number of records to return. stream()
40
40
  # guarantees to never return more than limit. Default is no limit
41
41
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -60,14 +60,14 @@ module Twilio
60
60
  # This operation lazily loads records as efficiently as possible until the limit
61
61
  # is reached.
62
62
  # @param [sim.Status] status Only return Sim resources with this status.
63
- # @param [String] iccid Only return Sim resources with this ICCID. Currently this
64
- # should be a list with maximum size 1.
65
- # @param [String] rate_plan The `sid` or `unique_name` of the [RatePlan
66
- # resource](https://www.twilio.com/docs/wireless/api/rate-plan) used by the Sim
67
- # resources to read.
63
+ # @param [String] iccid Only return Sim resources with this ICCID. This will
64
+ # return a list with a maximum size of 1.
65
+ # @param [String] rate_plan The SID or unique name of a [RatePlan
66
+ # resource](https://www.twilio.com/docs/wireless/api/rateplan-resource). Only
67
+ # return Sim resources assigned to this RatePlan resource.
68
68
  # @param [String] e_id Deprecated.
69
69
  # @param [String] sim_registration_code Only return Sim resources with this
70
- # registration code.
70
+ # registration code. This will return a list with a maximum size of 1.
71
71
  # @param [Integer] limit Upper limit for the number of records to return. stream()
72
72
  # guarantees to never return more than limit. Default is no limit.
73
73
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -108,14 +108,14 @@ module Twilio
108
108
  # Retrieve a single page of SimInstance records from the API.
109
109
  # Request is executed immediately.
110
110
  # @param [sim.Status] status Only return Sim resources with this status.
111
- # @param [String] iccid Only return Sim resources with this ICCID. Currently this
112
- # should be a list with maximum size 1.
113
- # @param [String] rate_plan The `sid` or `unique_name` of the [RatePlan
114
- # resource](https://www.twilio.com/docs/wireless/api/rate-plan) used by the Sim
115
- # resources to read.
111
+ # @param [String] iccid Only return Sim resources with this ICCID. This will
112
+ # return a list with a maximum size of 1.
113
+ # @param [String] rate_plan The SID or unique name of a [RatePlan
114
+ # resource](https://www.twilio.com/docs/wireless/api/rateplan-resource). Only
115
+ # return Sim resources assigned to this RatePlan resource.
116
116
  # @param [String] e_id Deprecated.
117
117
  # @param [String] sim_registration_code Only return Sim resources with this
118
- # registration code.
118
+ # registration code. This will return a list with a maximum size of 1.
119
119
  # @param [String] page_token PageToken provided by the API
120
120
  # @param [Integer] page_number Page Number, this value is simply for client state
121
121
  # @param [Integer] page_size Number of records to return, defaults to 50
@@ -192,7 +192,7 @@ module Twilio
192
192
  ##
193
193
  # Initialize the SimContext
194
194
  # @param [Version] version Version that contains the resource
195
- # @param [String] sid The SID of the Sim resource to fetch.
195
+ # @param [String] sid The SID or the `unique_name` of the Sim resource to fetch.
196
196
  # @return [SimContext] SimContext
197
197
  def initialize(version, sid)
198
198
  super(version)
@@ -226,51 +226,58 @@ module Twilio
226
226
  # @param [String] unique_name An application-defined string that uniquely
227
227
  # identifies the resource. It can be used in place of the `sid` in the URL path to
228
228
  # address the resource.
229
- # @param [String] callback_method The HTTP method we use to call `callback_url`.
230
- # Can be: `POST` or `GET`, and the default is `POST`.
231
- # @param [String] callback_url The URL we call using the `callback_url` when the
232
- # SIM has finished updating. When the SIM transitions from `new` to `ready` or
233
- # from any status to `deactivated`, we call this URL when the status changes to an
234
- # intermediate status (`ready` or `deactivated`) and again when the status changes
235
- # to its final status (`active` or `canceled`).
229
+ # @param [String] callback_method The HTTP method we should use to call
230
+ # `callback_url`. Can be: `POST` or `GET`. The default is `POST`.
231
+ # @param [String] callback_url The URL we should call using the `callback_url`
232
+ # when the SIM has finished updating. When the SIM transitions from `new` to
233
+ # `ready` or from any status to `deactivated`, we call this URL when the status
234
+ # changes to an intermediate status (`ready` or `deactivated`) and again when the
235
+ # status changes to its final status (`active` or `canceled`).
236
236
  # @param [String] friendly_name A descriptive string that you create to describe
237
- # the resource. It does not need to be unique.
238
- # @param [String] rate_plan The `sid` or `unique_name` of the [RatePlan
239
- # resource](https://www.twilio.com/docs/wireless/api/rate-plan) that this SIM
240
- # should use.
241
- # @param [sim.Status] status The new status of the resource. Can be: `ready`,
242
- # `active`, `suspended` or `deactivated`; however the SIM might support additional
243
- # values.
244
- # @param [String] commands_callback_method The HTTP method we use to call
245
- # `commands_callback_url`. Can be: `POST` or `GET`, and the default is `POST`.
246
- # @param [String] commands_callback_url The URL we call using the
247
- # `commands_callback_method` when the SIM originates a
248
- # [Command](https://www.twilio.com/docs/wireless/api/commands). Your server should
249
- # respond with an HTTP status code in the 200 range; any response body is ignored.
250
- # @param [String] sms_fallback_method The HTTP method we use to call
251
- # `sms_fallback_url`. Can be: `GET` or `POST`.
252
- # @param [String] sms_fallback_url The URL we call using the `sms_fallback_method`
253
- # when an error occurs while retrieving or executing the TwiML requested from
254
- # `sms_url`.
255
- # @param [String] sms_method The HTTP method we use to call `sms_url`. Can be:
256
- # `GET` or `POST`.
257
- # @param [String] sms_url The URL we call using the `sms_method` when the
237
+ # the Sim resource. It does not need to be unique.
238
+ # @param [String] rate_plan The SID or unique name of the [RatePlan
239
+ # resource](https://www.twilio.com/docs/wireless/api/rateplan-resource) to which
240
+ # the Sim resource should be assigned.
241
+ # @param [sim.Status] status The new status of the Sim resource. Can be: `ready`,
242
+ # `active`, `suspended`, or `deactivated`.
243
+ # @param [String] commands_callback_method The HTTP method we should use to call
244
+ # `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`.
245
+ # @param [String] commands_callback_url The URL we should call using the
246
+ # `commands_callback_method` when the SIM sends a
247
+ # [Command](https://www.twilio.com/docs/wireless/api/command-resource). Your
248
+ # server should respond with an HTTP status code in the 200 range; any response
249
+ # body is ignored.
250
+ # @param [String] sms_fallback_method The HTTP method we should use to call
251
+ # `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`.
252
+ # @param [String] sms_fallback_url The URL we should call using the
253
+ # `sms_fallback_method` when an error occurs while retrieving or executing the
254
+ # TwiML requested from `sms_url`.
255
+ # @param [String] sms_method The HTTP method we should use to call `sms_url`. Can
256
+ # be: `GET` or `POST`. Default is `POST`.
257
+ # @param [String] sms_url The URL we should call using the `sms_method` when the
258
258
  # SIM-connected device sends an SMS message that is not a
259
- # [Command](https://www.twilio.com/docs/wireless/api/commands).
260
- # @param [String] voice_fallback_method The HTTP method we use to call
259
+ # [Command](https://www.twilio.com/docs/wireless/api/command-resource).
260
+ # @param [String] voice_fallback_method The HTTP method we should use to call
261
261
  # `voice_fallback_url`. Can be: `GET` or `POST`.
262
- # @param [String] voice_fallback_url The URL we call using the
262
+ # @param [String] voice_fallback_url The URL we should call using the
263
263
  # `voice_fallback_method` when an error occurs while retrieving or executing the
264
264
  # TwiML requested from `voice_url`.
265
- # @param [String] voice_method The HTTP method we use when we call `voice_url`.
266
- # Can be: `GET` or `POST`.
267
- # @param [String] voice_url The URL we call using the `voice_method` when the
268
- # SIM-connected device makes a voice call.
265
+ # @param [String] voice_method The HTTP method we should use when we call
266
+ # `voice_url`. Can be: `GET` or `POST`.
267
+ # @param [String] voice_url The URL we should call using the `voice_method` when
268
+ # the SIM-connected device makes a voice call.
269
269
  # @param [sim.ResetStatus] reset_status Initiate a connectivity reset on the SIM.
270
270
  # Set to `resetting` to initiate a connectivity reset on the SIM. No other value
271
271
  # is valid.
272
+ # @param [String] account_sid The SID of the
273
+ # [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource
274
+ # should belong. The Account SID can only be that of the requesting Account or
275
+ # that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the
276
+ # requesting Account. Only valid when the Sim resource's status is `new`. For more
277
+ # information, see the [Move SIMs between Subaccounts
278
+ # documentation](https://www.twilio.com/docs/wireless/api/sim-resource#move-sims-between-subaccounts).
272
279
  # @return [SimInstance] Updated SimInstance
273
- def update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, reset_status: :unset)
280
+ def update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, reset_status: :unset, account_sid: :unset)
274
281
  data = Twilio::Values.of({
275
282
  'UniqueName' => unique_name,
276
283
  'CallbackMethod' => callback_method,
@@ -289,6 +296,7 @@ module Twilio
289
296
  'VoiceMethod' => voice_method,
290
297
  'VoiceUrl' => voice_url,
291
298
  'ResetStatus' => reset_status,
299
+ 'AccountSid' => account_sid,
292
300
  })
293
301
 
294
302
  payload = @version.update(
@@ -351,7 +359,7 @@ module Twilio
351
359
  # Initialize the SimInstance
352
360
  # @param [Version] version Version that contains the resource
353
361
  # @param [Hash] payload payload that contains response from Twilio
354
- # @param [String] sid The SID of the Sim resource to fetch.
362
+ # @param [String] sid The SID or the `unique_name` of the Sim resource to fetch.
355
363
  # @return [SimInstance] SimInstance
356
364
  def initialize(version, payload, sid: nil)
357
365
  super(version)
@@ -401,7 +409,7 @@ module Twilio
401
409
  end
402
410
 
403
411
  ##
404
- # @return [String] The unique string that identifies the resource
412
+ # @return [String] The unique string that identifies the Sim resource
405
413
  def sid
406
414
  @properties['sid']
407
415
  end
@@ -413,19 +421,19 @@ module Twilio
413
421
  end
414
422
 
415
423
  ##
416
- # @return [String] The SID of the Account that created the resource
424
+ # @return [String] The SID of the Account to which the Sim resource belongs
417
425
  def account_sid
418
426
  @properties['account_sid']
419
427
  end
420
428
 
421
429
  ##
422
- # @return [String] The SID of the RatePlan resource configured for this SIM
430
+ # @return [String] The SID of the RatePlan resource to which the Sim resource is assigned.
423
431
  def rate_plan_sid
424
432
  @properties['rate_plan_sid']
425
433
  end
426
434
 
427
435
  ##
428
- # @return [String] The string that you assigned to describe the resource
436
+ # @return [String] The string that you assigned to describe the Sim resource
429
437
  def friendly_name
430
438
  @properties['friendly_name']
431
439
  end
@@ -443,7 +451,7 @@ module Twilio
443
451
  end
444
452
 
445
453
  ##
446
- # @return [sim.Status] The status of the SIM
454
+ # @return [sim.Status] The status of the Sim resource
447
455
  def status
448
456
  @properties['status']
449
457
  end
@@ -521,7 +529,7 @@ module Twilio
521
529
  end
522
530
 
523
531
  ##
524
- # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
532
+ # @return [Time] The ISO 8601 date and time in GMT when the Sim resource was last updated
525
533
  def date_updated
526
534
  @properties['date_updated']
527
535
  end
@@ -556,51 +564,58 @@ module Twilio
556
564
  # @param [String] unique_name An application-defined string that uniquely
557
565
  # identifies the resource. It can be used in place of the `sid` in the URL path to
558
566
  # address the resource.
559
- # @param [String] callback_method The HTTP method we use to call `callback_url`.
560
- # Can be: `POST` or `GET`, and the default is `POST`.
561
- # @param [String] callback_url The URL we call using the `callback_url` when the
562
- # SIM has finished updating. When the SIM transitions from `new` to `ready` or
563
- # from any status to `deactivated`, we call this URL when the status changes to an
564
- # intermediate status (`ready` or `deactivated`) and again when the status changes
565
- # to its final status (`active` or `canceled`).
567
+ # @param [String] callback_method The HTTP method we should use to call
568
+ # `callback_url`. Can be: `POST` or `GET`. The default is `POST`.
569
+ # @param [String] callback_url The URL we should call using the `callback_url`
570
+ # when the SIM has finished updating. When the SIM transitions from `new` to
571
+ # `ready` or from any status to `deactivated`, we call this URL when the status
572
+ # changes to an intermediate status (`ready` or `deactivated`) and again when the
573
+ # status changes to its final status (`active` or `canceled`).
566
574
  # @param [String] friendly_name A descriptive string that you create to describe
567
- # the resource. It does not need to be unique.
568
- # @param [String] rate_plan The `sid` or `unique_name` of the [RatePlan
569
- # resource](https://www.twilio.com/docs/wireless/api/rate-plan) that this SIM
570
- # should use.
571
- # @param [sim.Status] status The new status of the resource. Can be: `ready`,
572
- # `active`, `suspended` or `deactivated`; however the SIM might support additional
573
- # values.
574
- # @param [String] commands_callback_method The HTTP method we use to call
575
- # `commands_callback_url`. Can be: `POST` or `GET`, and the default is `POST`.
576
- # @param [String] commands_callback_url The URL we call using the
577
- # `commands_callback_method` when the SIM originates a
578
- # [Command](https://www.twilio.com/docs/wireless/api/commands). Your server should
579
- # respond with an HTTP status code in the 200 range; any response body is ignored.
580
- # @param [String] sms_fallback_method The HTTP method we use to call
581
- # `sms_fallback_url`. Can be: `GET` or `POST`.
582
- # @param [String] sms_fallback_url The URL we call using the `sms_fallback_method`
583
- # when an error occurs while retrieving or executing the TwiML requested from
584
- # `sms_url`.
585
- # @param [String] sms_method The HTTP method we use to call `sms_url`. Can be:
586
- # `GET` or `POST`.
587
- # @param [String] sms_url The URL we call using the `sms_method` when the
575
+ # the Sim resource. It does not need to be unique.
576
+ # @param [String] rate_plan The SID or unique name of the [RatePlan
577
+ # resource](https://www.twilio.com/docs/wireless/api/rateplan-resource) to which
578
+ # the Sim resource should be assigned.
579
+ # @param [sim.Status] status The new status of the Sim resource. Can be: `ready`,
580
+ # `active`, `suspended`, or `deactivated`.
581
+ # @param [String] commands_callback_method The HTTP method we should use to call
582
+ # `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`.
583
+ # @param [String] commands_callback_url The URL we should call using the
584
+ # `commands_callback_method` when the SIM sends a
585
+ # [Command](https://www.twilio.com/docs/wireless/api/command-resource). Your
586
+ # server should respond with an HTTP status code in the 200 range; any response
587
+ # body is ignored.
588
+ # @param [String] sms_fallback_method The HTTP method we should use to call
589
+ # `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`.
590
+ # @param [String] sms_fallback_url The URL we should call using the
591
+ # `sms_fallback_method` when an error occurs while retrieving or executing the
592
+ # TwiML requested from `sms_url`.
593
+ # @param [String] sms_method The HTTP method we should use to call `sms_url`. Can
594
+ # be: `GET` or `POST`. Default is `POST`.
595
+ # @param [String] sms_url The URL we should call using the `sms_method` when the
588
596
  # SIM-connected device sends an SMS message that is not a
589
- # [Command](https://www.twilio.com/docs/wireless/api/commands).
590
- # @param [String] voice_fallback_method The HTTP method we use to call
597
+ # [Command](https://www.twilio.com/docs/wireless/api/command-resource).
598
+ # @param [String] voice_fallback_method The HTTP method we should use to call
591
599
  # `voice_fallback_url`. Can be: `GET` or `POST`.
592
- # @param [String] voice_fallback_url The URL we call using the
600
+ # @param [String] voice_fallback_url The URL we should call using the
593
601
  # `voice_fallback_method` when an error occurs while retrieving or executing the
594
602
  # TwiML requested from `voice_url`.
595
- # @param [String] voice_method The HTTP method we use when we call `voice_url`.
596
- # Can be: `GET` or `POST`.
597
- # @param [String] voice_url The URL we call using the `voice_method` when the
598
- # SIM-connected device makes a voice call.
603
+ # @param [String] voice_method The HTTP method we should use when we call
604
+ # `voice_url`. Can be: `GET` or `POST`.
605
+ # @param [String] voice_url The URL we should call using the `voice_method` when
606
+ # the SIM-connected device makes a voice call.
599
607
  # @param [sim.ResetStatus] reset_status Initiate a connectivity reset on the SIM.
600
608
  # Set to `resetting` to initiate a connectivity reset on the SIM. No other value
601
609
  # is valid.
610
+ # @param [String] account_sid The SID of the
611
+ # [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource
612
+ # should belong. The Account SID can only be that of the requesting Account or
613
+ # that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the
614
+ # requesting Account. Only valid when the Sim resource's status is `new`. For more
615
+ # information, see the [Move SIMs between Subaccounts
616
+ # documentation](https://www.twilio.com/docs/wireless/api/sim-resource#move-sims-between-subaccounts).
602
617
  # @return [SimInstance] Updated SimInstance
603
- def update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, reset_status: :unset)
618
+ def update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, reset_status: :unset, account_sid: :unset)
604
619
  context.update(
605
620
  unique_name: unique_name,
606
621
  callback_method: callback_method,
@@ -619,6 +634,7 @@ module Twilio
619
634
  voice_method: voice_method,
620
635
  voice_url: voice_url,
621
636
  reset_status: reset_status,
637
+ account_sid: account_sid,
622
638
  )
623
639
  end
624
640