twilio-ruby 5.25.1 → 5.25.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +12 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/authy.rb +8 -8
  5. data/lib/twilio-ruby/rest/authy/v1.rb +15 -15
  6. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +6 -6
  7. data/lib/twilio-ruby/rest/flex_api.rb +6 -6
  8. data/lib/twilio-ruby/rest/flex_api/v1.rb +7 -7
  9. data/lib/twilio-ruby/rest/insights/v1/summary.rb +7 -0
  10. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +6 -6
  11. data/lib/twilio-ruby/rest/messaging.rb +8 -8
  12. data/lib/twilio-ruby/rest/messaging/v1.rb +14 -14
  13. data/lib/twilio-ruby/rest/preview.rb +23 -17
  14. data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
  15. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +18 -11
  16. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb +205 -0
  17. data/lib/twilio-ruby/rest/serverless/v1/service.rb +14 -0
  18. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +14 -0
  19. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +0 -33
  20. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +14 -0
  21. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +14 -0
  22. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +14 -0
  23. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +0 -33
  24. data/lib/twilio-ruby/rest/verify/v2/service.rb +6 -3
  25. data/lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb +1 -1
  26. data/lib/twilio-ruby/rest/video.rb +9 -9
  27. data/lib/twilio-ruby/rest/video/v1.rb +16 -16
  28. data/lib/twilio-ruby/rest/wireless.rb +6 -6
  29. data/lib/twilio-ruby/rest/wireless/v1.rb +7 -7
  30. data/lib/twilio-ruby/version.rb +1 -1
  31. data/spec/integration/api/v2010/account/conference/participant_spec.rb +1 -1
  32. data/spec/integration/insights/v1/summary_spec.rb +1 -0
  33. data/spec/integration/preview/trusted_comms/branded_call_spec.rb +53 -0
  34. data/spec/integration/serverless/v1/service/asset/asset_version_spec.rb +0 -49
  35. data/spec/integration/serverless/v1/service/asset_spec.rb +28 -0
  36. data/spec/integration/serverless/v1/service/environment/variable_spec.rb +30 -0
  37. data/spec/integration/serverless/v1/service/environment_spec.rb +28 -0
  38. data/spec/integration/serverless/v1/service/function/function_version_spec.rb +0 -49
  39. data/spec/integration/serverless/v1/service/function_spec.rb +28 -0
  40. data/spec/integration/serverless/v1/service_spec.rb +26 -0
  41. metadata +5 -2
@@ -113,32 +113,6 @@ module Twilio
113
113
  FunctionVersionPage.new(@version, response, @solution)
114
114
  end
115
115
 
116
- ##
117
- # Retrieve a single page of FunctionVersionInstance records from the API.
118
- # Request is executed immediately.
119
- # @param [String] path The URL-friendly string by which this Function Version can
120
- # be referenced. (Example: `/functions/example`) Required.
121
- # @param [function_version.Visibility] visibility The access control which
122
- # determines how the Function Version can be accessed. One of `public`,
123
- # `protected`, or `private`. Required.
124
- # @return [FunctionVersionInstance] Newly created FunctionVersionInstance
125
- def create(path: nil, visibility: nil)
126
- data = Twilio::Values.of({'Path' => path, 'Visibility' => visibility, })
127
-
128
- payload = @version.create(
129
- 'POST',
130
- @uri,
131
- data: data
132
- )
133
-
134
- FunctionVersionInstance.new(
135
- @version,
136
- payload,
137
- service_sid: @solution[:service_sid],
138
- function_sid: @solution[:function_sid],
139
- )
140
- end
141
-
142
116
  ##
143
117
  # Provide a user friendly representation
144
118
  def to_s
@@ -261,7 +235,6 @@ module Twilio
261
235
  'service_sid' => payload['service_sid'],
262
236
  'function_sid' => payload['function_sid'],
263
237
  'path' => payload['path'],
264
- 'pre_signed_upload_url' => payload['pre_signed_upload_url'],
265
238
  'visibility' => payload['visibility'],
266
239
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
267
240
  'url' => payload['url'],
@@ -322,12 +295,6 @@ module Twilio
322
295
  @properties['path']
323
296
  end
324
297
 
325
- ##
326
- # @return [Hash] The object which provides the details required for uploading this Function Version.
327
- def pre_signed_upload_url
328
- @properties['pre_signed_upload_url']
329
- end
330
-
331
298
  ##
332
299
  # @return [function_version.Visibility] The access control which determines how the Function Version can be accessed.
333
300
  def visibility
@@ -29,7 +29,8 @@ module Twilio
29
29
  # Retrieve a single page of ServiceInstance records from the API.
30
30
  # Request is executed immediately.
31
31
  # @param [String] friendly_name A descriptive string that you create to describe
32
- # the verification service. It can be up to 64 characters long.
32
+ # the verification service. It can be up to 64 characters long. **This value
33
+ # should not contain PII.**
33
34
  # @param [String] code_length The length of the verification code to generate.
34
35
  # Must be an integer value between 4 and 10, inclusive.
35
36
  # @param [Boolean] lookup_enabled Whether to perform a lookup with each
@@ -231,7 +232,8 @@ module Twilio
231
232
  ##
232
233
  # Update the ServiceInstance
233
234
  # @param [String] friendly_name A descriptive string that you create to describe
234
- # the verification service. It can be up to 64 characters long.
235
+ # the verification service. It can be up to 64 characters long. **This value
236
+ # should not contain PII.**
235
237
  # @param [String] code_length The length of the verification code to generate.
236
238
  # Must be an integer value between 4 and 10, inclusive.
237
239
  # @param [Boolean] lookup_enabled Whether to perform a lookup with each
@@ -487,7 +489,8 @@ module Twilio
487
489
  ##
488
490
  # Update the ServiceInstance
489
491
  # @param [String] friendly_name A descriptive string that you create to describe
490
- # the verification service. It can be up to 64 characters long.
492
+ # the verification service. It can be up to 64 characters long. **This value
493
+ # should not contain PII.**
491
494
  # @param [String] code_length The length of the verification code to generate.
492
495
  # Must be an integer value between 4 and 10, inclusive.
493
496
  # @param [Boolean] lookup_enabled Whether to perform a lookup with each
@@ -34,7 +34,7 @@ module Twilio
34
34
  # Request is executed immediately.
35
35
  # @param [String] unique_name Provides a unique and addressable name to be
36
36
  # assigned to this Rate Limit, assigned by the developer, to be optionally used in
37
- # addition to SID.
37
+ # addition to SID. **This value should not contain PII.**
38
38
  # @param [String] description Description of this Rate Limit
39
39
  # @return [RateLimitInstance] Newly created RateLimitInstance
40
40
  def create(unique_name: nil, description: :unset)
@@ -28,6 +28,15 @@ module Twilio
28
28
  @v1 ||= V1.new self
29
29
  end
30
30
 
31
+ ##
32
+ # @param [String] sid `CJxx…xx` A system-generated 34-character string that
33
+ # uniquely identifies this Composition.
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 `HKxx…xx` A system-generated 34-character string that
33
42
  # uniquely identifies this Composition Hook.
@@ -58,15 +67,6 @@ module Twilio
58
67
  self.v1.recording_settings()
59
68
  end
60
69
 
61
- ##
62
- # @param [String] sid `CJxx…xx` A system-generated 34-character string that
63
- # uniquely identifies this Composition.
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 A system-generated 34-character string that uniquely
72
72
  # identifies this resource.
@@ -15,14 +15,29 @@ 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 Composition Sid that uniquely identifies the Composition
28
+ # to fetch.
29
+ # @return [Twilio::REST::Video::V1::CompositionContext] if sid was passed.
30
+ # @return [Twilio::REST::Video::V1::CompositionList]
31
+ def compositions(sid=:unset)
32
+ if sid.nil?
33
+ raise ArgumentError, 'sid cannot be nil'
34
+ elsif sid == :unset
35
+ @compositions ||= CompositionList.new self
36
+ else
37
+ CompositionContext.new(self, sid)
38
+ end
39
+ end
40
+
26
41
  ##
27
42
  # @param [String] sid The Composition Hook Sid that uniquely identifies the
28
43
  # Composition Hook to fetch.
@@ -65,21 +80,6 @@ module Twilio
65
80
  @recording_settings ||= RecordingSettingsContext.new self
66
81
  end
67
82
 
68
- ##
69
- # @param [String] sid The Composition Sid that uniquely identifies the Composition
70
- # to fetch.
71
- # @return [Twilio::REST::Video::V1::CompositionContext] if sid was passed.
72
- # @return [Twilio::REST::Video::V1::CompositionList]
73
- def compositions(sid=:unset)
74
- if sid.nil?
75
- raise ArgumentError, 'sid cannot be nil'
76
- elsif sid == :unset
77
- @compositions ||= CompositionList.new self
78
- else
79
- CompositionContext.new(self, sid)
80
- end
81
- end
82
-
83
83
  ##
84
84
  # @param [String] sid The Room Sid or name that uniquely identifies this resource.
85
85
  # @return [Twilio::REST::Video::V1::RoomContext] if sid was passed.
@@ -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 A 34 character string that uniquely identifies this
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 A 34 character string that uniquely identifies this
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 A 34 character string that uniquely identifies this
26
32
  # resource.
@@ -50,12 +56,6 @@ module Twilio
50
56
  end
51
57
  end
52
58
 
53
- ##
54
- # @return [Twilio::REST::Wireless::V1::UsageRecordContext]
55
- def usage_records
56
- @usage_records ||= UsageRecordList.new self
57
- end
58
-
59
59
  ##
60
60
  # @param [String] sid A 34 character string that uniquely identifies this
61
61
  # resource.
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.25.1'
2
+ VERSION = '5.25.2'
3
3
  end
@@ -83,7 +83,7 @@ describe 'Participant' do
83
83
  "date_created": "Fri, 18 Feb 2011 21:07:19 +0000",
84
84
  "date_updated": "Fri, 18 Feb 2011 21:07:19 +0000",
85
85
  "end_conference_on_exit": false,
86
- "muted": false,
86
+ "muted": true,
87
87
  "hold": false,
88
88
  "status": "complete",
89
89
  "start_conference_on_enter": true,
@@ -50,6 +50,7 @@ describe 'CallSummary' do
50
50
  "tags"
51
51
  ],
52
52
  "attributes": {},
53
+ "properties": {},
53
54
  "url": "https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Summary"
54
55
  }
55
56
  ]
@@ -0,0 +1,53 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'BrandedCall' do
12
+ it "can create" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.preview.trusted_comms.branded_calls.create(from: 'from', to: 'to', reason: 'reason')
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {'From' => 'from', 'To' => 'to', 'Reason' => 'reason', }
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'post',
23
+ url: 'https://preview.twilio.com/TrustedComms/Business/BrandedCalls',
24
+ data: values,
25
+ ))).to eq(true)
26
+ end
27
+
28
+ it "receives create responses" do
29
+ @holodeck.mock(Twilio::Response.new(
30
+ 201,
31
+ %q[
32
+ {
33
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "bg_color": "#fff",
35
+ "caller": "Owl Bank",
36
+ "created_at": "2019-05-01T20:00:00Z",
37
+ "font_color": "#000",
38
+ "from": "+15000000000",
39
+ "logo": "https://www.twilio.com/marketing/bundles/company/img/logos/red/twilio-logo-red.png",
40
+ "reason": "Hello Jhon, your appointment has been confirmed.",
41
+ "status": "unknown",
42
+ "to": "+573000000000",
43
+ "use_case": "conversational",
44
+ "url": "https://preview.twilio.com/TrustedComms/Business/BrandedCalls"
45
+ }
46
+ ]
47
+ ))
48
+
49
+ actual = @client.preview.trusted_comms.branded_calls.create(from: 'from', to: 'to', reason: 'reason')
50
+
51
+ expect(actual).to_not eq(nil)
52
+ end
53
+ end
@@ -80,7 +80,6 @@ describe 'AssetVersion' do
80
80
  "asset_sid": "ZH00000000000000000000000000000000",
81
81
  "path": "test-path",
82
82
  "visibility": "public",
83
- "pre_signed_upload_url": null,
84
83
  "date_created": "2018-11-10T20:00:00Z",
85
84
  "url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets/ZH00000000000000000000000000000000/Versions/ZN00000000000000000000000000000000"
86
85
  }
@@ -93,52 +92,4 @@ describe 'AssetVersion' do
93
92
 
94
93
  expect(actual).to_not eq(nil)
95
94
  end
96
-
97
- it "can create" do
98
- @holodeck.mock(Twilio::Response.new(500, ''))
99
-
100
- expect {
101
- @client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
102
- .assets('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
103
- .asset_versions.create(path: 'path', visibility: 'public')
104
- }.to raise_exception(Twilio::REST::TwilioError)
105
-
106
- values = {'Path' => 'path', 'Visibility' => 'public', }
107
- expect(
108
- @holodeck.has_request?(Holodeck::Request.new(
109
- method: 'post',
110
- url: 'https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Assets/ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Versions',
111
- data: values,
112
- ))).to eq(true)
113
- end
114
-
115
- it "receives create responses" do
116
- @holodeck.mock(Twilio::Response.new(
117
- 201,
118
- %q[
119
- {
120
- "sid": "ZN00000000000000000000000000000000",
121
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
122
- "service_sid": "ZS00000000000000000000000000000000",
123
- "asset_sid": "ZH00000000000000000000000000000000",
124
- "path": "/some/sample/path",
125
- "visibility": "private",
126
- "date_created": "2018-11-10T20:00:00Z",
127
- "pre_signed_upload_url": {
128
- "url": "https://s3.amazonaws.com/com.twilio.dev.serverless",
129
- "expiration": "2019-01-01T00:08:00.000Z",
130
- "method": "PUT",
131
- "kmsARN": "arn:aws:kms:us-east-1:719084529295:key/2a7bf064-c88c-4fdd-b376-625d7bcd2d98"
132
- },
133
- "url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets/ZH00000000000000000000000000000000/Versions/ZN00000000000000000000000000000000"
134
- }
135
- ]
136
- ))
137
-
138
- actual = @client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
139
- .assets('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
140
- .asset_versions.create(path: 'path', visibility: 'public')
141
-
142
- expect(actual).to_not eq(nil)
143
- end
144
95
  end
@@ -91,6 +91,34 @@ describe 'Asset' do
91
91
  expect(actual).to_not eq(nil)
92
92
  end
93
93
 
94
+ it "can delete" do
95
+ @holodeck.mock(Twilio::Response.new(500, ''))
96
+
97
+ expect {
98
+ @client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
99
+ .assets('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
100
+ }.to raise_exception(Twilio::REST::TwilioError)
101
+
102
+ values = {}
103
+ expect(
104
+ @holodeck.has_request?(Holodeck::Request.new(
105
+ method: 'delete',
106
+ url: 'https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Assets/ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
107
+ ))).to eq(true)
108
+ end
109
+
110
+ it "receives delete responses" do
111
+ @holodeck.mock(Twilio::Response.new(
112
+ 204,
113
+ nil,
114
+ ))
115
+
116
+ actual = @client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
117
+ .assets('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
118
+
119
+ expect(actual).to eq(true)
120
+ end
121
+
94
122
  it "can create" do
95
123
  @holodeck.mock(Twilio::Response.new(500, ''))
96
124
 
@@ -178,4 +178,34 @@ describe 'Variable' do
178
178
 
179
179
  expect(actual).to_not eq(nil)
180
180
  end
181
+
182
+ it "can delete" do
183
+ @holodeck.mock(Twilio::Response.new(500, ''))
184
+
185
+ expect {
186
+ @client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
187
+ .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
188
+ .variables('ZVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
189
+ }.to raise_exception(Twilio::REST::TwilioError)
190
+
191
+ values = {}
192
+ expect(
193
+ @holodeck.has_request?(Holodeck::Request.new(
194
+ method: 'delete',
195
+ url: 'https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Environments/ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Variables/ZVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
196
+ ))).to eq(true)
197
+ end
198
+
199
+ it "receives delete responses" do
200
+ @holodeck.mock(Twilio::Response.new(
201
+ 204,
202
+ nil,
203
+ ))
204
+
205
+ actual = @client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
206
+ .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
207
+ .variables('ZVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
208
+
209
+ expect(actual).to eq(true)
210
+ end
181
211
  end