twilio-ruby 5.40.4 → 5.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +22 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/accounts.rb +12 -0
  5. data/lib/twilio-ruby/rest/accounts/v1.rb +14 -0
  6. data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +186 -0
  7. data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +200 -0
  8. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +10 -2
  9. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +13 -3
  10. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +7 -0
  11. data/lib/twilio-ruby/rest/preview.rb +8 -0
  12. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +15 -0
  13. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +225 -0
  14. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +165 -0
  15. data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +0 -26
  16. data/lib/twilio-ruby/rest/verify/v2/service.rb +51 -30
  17. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +12 -15
  18. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +38 -18
  19. data/lib/twilio-ruby/version.rb +1 -1
  20. data/spec/integration/accounts/v1/auth_token_promotion_spec.rb +44 -0
  21. data/spec/integration/accounts/v1/secondary_auth_token_spec.rb +69 -0
  22. data/spec/integration/conversations/v1/conversation_spec.rb +1 -1
  23. data/spec/integration/conversations/v1/service/conversation_spec.rb +1 -1
  24. data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
  25. data/spec/integration/preview/trusted_comms/{business/brand/branded_channel → branded_channel}/channel_spec.rb +4 -8
  26. data/spec/integration/preview/trusted_comms/{business/brand/branded_channel_spec.rb → branded_channel_spec.rb} +5 -9
  27. data/spec/integration/preview/trusted_comms/business_spec.rb +0 -1
  28. data/spec/integration/verify/v2/service/entity/challenge_spec.rb +52 -8
  29. data/spec/integration/verify/v2/service/entity/factor_spec.rb +7 -12
  30. data/spec/integration/verify/v2/service_spec.rb +8 -4
  31. metadata +14 -11
  32. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +0 -233
  33. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +0 -260
  34. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +0 -189
  35. data/spec/integration/preview/trusted_comms/business/brand_spec.rb +0 -48
@@ -79,7 +79,6 @@ module Twilio
79
79
  @uri = "/Businesses/#{@solution[:sid]}"
80
80
 
81
81
  # Dependents
82
- @brands = nil
83
82
  @insights = nil
84
83
  end
85
84
 
@@ -92,24 +91,6 @@ module Twilio
92
91
  BusinessInstance.new(@version, payload, sid: @solution[:sid], )
93
92
  end
94
93
 
95
- ##
96
- # Access the brands
97
- # @return [BrandList]
98
- # @return [BrandContext] if sid was passed.
99
- def brands(sid=:unset)
100
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
101
-
102
- if sid != :unset
103
- return BrandContext.new(@version, @solution[:sid], sid, )
104
- end
105
-
106
- unless @brands
107
- @brands = BrandList.new(@version, business_sid: @solution[:sid], )
108
- end
109
-
110
- @brands
111
- end
112
-
113
94
  ##
114
95
  # Access the insights
115
96
  # @return [InsightsList]
@@ -205,13 +186,6 @@ module Twilio
205
186
  context.fetch
206
187
  end
207
188
 
208
- ##
209
- # Access the brands
210
- # @return [brands] brands
211
- def brands
212
- context.brands
213
- end
214
-
215
189
  ##
216
190
  # Access the insights
217
191
  # @return [insights] insights
@@ -47,16 +47,21 @@ module Twilio
47
47
  # @param [Boolean] custom_code_enabled Whether to allow sending verifications with
48
48
  # a custom code instead of a randomly generated one. Not available for all
49
49
  # customers.
50
- # @param [Hash] push Configurations for the Push factors (channel) created under
51
- # this Service. If present, it must be a json string with the following format:
52
- # {"notify_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "include_date":
53
- # true}. If `include_date` is set to `true`, which is the default, that means that
54
- # the push challenge’s response will include the date created value. If
55
- # `include_date` is set to `false`, then the date created value will not be
56
- # included. See {Challenge}[https://www.twilio.com/docs/verify/api/challenge]
57
- # resource’s details parameter for more info
50
+ # @param [Boolean] push_include_date Optional configuration for the Push factors.
51
+ # If true, include the date in the Challenge's reponse. Otherwise, the date is
52
+ # omitted from the response. See
53
+ # {Challenge}[https://www.twilio.com/docs/verify/api/challenge] resource’s details
54
+ # parameter for more info. Default: true
55
+ # @param [String] push_apn_credential_sid Optional configuration for the Push
56
+ # factors. Set the APN Credential for this service. This will allow to send push
57
+ # notifications to iOS devices. See {Credential
58
+ # Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
59
+ # @param [String] push_fcm_credential_sid Optional configuration for the Push
60
+ # factors. Set the FCM Credential for this service. This will allow to send push
61
+ # notifications to Android devices. See {Credential
62
+ # Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
58
63
  # @return [ServiceInstance] Created ServiceInstance
59
- def create(friendly_name: nil, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push: :unset)
64
+ def create(friendly_name: nil, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset)
60
65
  data = Twilio::Values.of({
61
66
  'FriendlyName' => friendly_name,
62
67
  'CodeLength' => code_length,
@@ -67,7 +72,9 @@ module Twilio
67
72
  'Psd2Enabled' => psd2_enabled,
68
73
  'DoNotShareWarningEnabled' => do_not_share_warning_enabled,
69
74
  'CustomCodeEnabled' => custom_code_enabled,
70
- 'Push' => Twilio.serialize_object(push),
75
+ 'Push.IncludeDate' => push_include_date,
76
+ 'Push.ApnCredentialSid' => push_apn_credential_sid,
77
+ 'Push.FcmCredentialSid' => push_fcm_credential_sid,
71
78
  })
72
79
 
73
80
  payload = @version.create('POST', @uri, data: data)
@@ -253,16 +260,21 @@ module Twilio
253
260
  # @param [Boolean] custom_code_enabled Whether to allow sending verifications with
254
261
  # a custom code instead of a randomly generated one. Not available for all
255
262
  # customers.
256
- # @param [Hash] push Configurations for the Push factors (channel) created under
257
- # this Service. If present, it must be a json string with the following format:
258
- # {"notify_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "include_date":
259
- # true}. If `include_date` is set to `true`, which is the default, that means that
260
- # the push challenge’s response will include the date created value. If
261
- # `include_date` is set to `false`, then the date created value will not be
262
- # included. See {Challenge}[https://www.twilio.com/docs/verify/api/challenge]
263
- # resource’s details parameter for more info
263
+ # @param [Boolean] push_include_date Optional configuration for the Push factors.
264
+ # If true, include the date in the Challenge's reponse. Otherwise, the date is
265
+ # omitted from the response. See
266
+ # {Challenge}[https://www.twilio.com/docs/verify/api/challenge] resource’s details
267
+ # parameter for more info. Default: true
268
+ # @param [String] push_apn_credential_sid Optional configuration for the Push
269
+ # factors. Set the APN Credential for this service. This will allow to send push
270
+ # notifications to iOS devices. See {Credential
271
+ # Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
272
+ # @param [String] push_fcm_credential_sid Optional configuration for the Push
273
+ # factors. Set the FCM Credential for this service. This will allow to send push
274
+ # notifications to Android devices. See {Credential
275
+ # Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
264
276
  # @return [ServiceInstance] Updated ServiceInstance
265
- def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push: :unset)
277
+ def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset)
266
278
  data = Twilio::Values.of({
267
279
  'FriendlyName' => friendly_name,
268
280
  'CodeLength' => code_length,
@@ -273,7 +285,9 @@ module Twilio
273
285
  'Psd2Enabled' => psd2_enabled,
274
286
  'DoNotShareWarningEnabled' => do_not_share_warning_enabled,
275
287
  'CustomCodeEnabled' => custom_code_enabled,
276
- 'Push' => Twilio.serialize_object(push),
288
+ 'Push.IncludeDate' => push_include_date,
289
+ 'Push.ApnCredentialSid' => push_apn_credential_sid,
290
+ 'Push.FcmCredentialSid' => push_fcm_credential_sid,
277
291
  })
278
292
 
279
293
  payload = @version.update('POST', @uri, data: data)
@@ -589,16 +603,21 @@ module Twilio
589
603
  # @param [Boolean] custom_code_enabled Whether to allow sending verifications with
590
604
  # a custom code instead of a randomly generated one. Not available for all
591
605
  # customers.
592
- # @param [Hash] push Configurations for the Push factors (channel) created under
593
- # this Service. If present, it must be a json string with the following format:
594
- # {"notify_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "include_date":
595
- # true}. If `include_date` is set to `true`, which is the default, that means that
596
- # the push challenge’s response will include the date created value. If
597
- # `include_date` is set to `false`, then the date created value will not be
598
- # included. See {Challenge}[https://www.twilio.com/docs/verify/api/challenge]
599
- # resource’s details parameter for more info
606
+ # @param [Boolean] push_include_date Optional configuration for the Push factors.
607
+ # If true, include the date in the Challenge's reponse. Otherwise, the date is
608
+ # omitted from the response. See
609
+ # {Challenge}[https://www.twilio.com/docs/verify/api/challenge] resource’s details
610
+ # parameter for more info. Default: true
611
+ # @param [String] push_apn_credential_sid Optional configuration for the Push
612
+ # factors. Set the APN Credential for this service. This will allow to send push
613
+ # notifications to iOS devices. See {Credential
614
+ # Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
615
+ # @param [String] push_fcm_credential_sid Optional configuration for the Push
616
+ # factors. Set the FCM Credential for this service. This will allow to send push
617
+ # notifications to Android devices. See {Credential
618
+ # Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
600
619
  # @return [ServiceInstance] Updated ServiceInstance
601
- def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push: :unset)
620
+ def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset)
602
621
  context.update(
603
622
  friendly_name: friendly_name,
604
623
  code_length: code_length,
@@ -609,7 +628,9 @@ module Twilio
609
628
  psd2_enabled: psd2_enabled,
610
629
  do_not_share_warning_enabled: do_not_share_warning_enabled,
611
630
  custom_code_enabled: custom_code_enabled,
612
- push: push,
631
+ push_include_date: push_include_date,
632
+ push_apn_credential_sid: push_apn_credential_sid,
633
+ push_fcm_credential_sid: push_fcm_credential_sid,
613
634
  )
614
635
  end
615
636
 
@@ -35,26 +35,23 @@ module Twilio
35
35
  # @param [String] factor_sid The unique SID identifier of the Factor.
36
36
  # @param [Time] expiration_date The future date in which this Challenge will
37
37
  # expire, given in {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
38
- # @param [String] details Details provided to give context about the Challenge.
39
- # Shown to the end user. It must be a stringified JSON with the following
40
- # structure: {"message": "string", "fields": { { "label": "string", "value":
41
- # "string"}]}. `message` is required. If you send the `fields` property, each
42
- # field has to include `label` and `value` properties. If you had set
43
- # `include_date=true` in the `push` configuration of the
44
- # [service}[https://www.twilio.com/docs/verify/api/service], the response will
45
- # also include the challenge's date created value as an additional field called
46
- # `date`
47
- # @param [String] hidden_details Details provided to give context about the
38
+ # @param [String] details_message Shown to the user when the push notification
39
+ # arrives. Required when `factor_type` is `push`
40
+ # @param [Hash] details_fields A list of objects that describe the Fields included
41
+ # in the Challenge. Each object contains the label and value of the field. Used
42
+ # when `factor_type` is `push`.
43
+ # @param [Hash] hidden_details Details provided to give context about the
48
44
  # Challenge. Not shown to the end user. It must be a stringified JSON with only
49
45
  # strings values eg. `{"ip": "172.168.1.234"}`
50
46
  # @param [String] twilio_sandbox_mode The Twilio-Sandbox-Mode HTTP request header
51
47
  # @return [ChallengeInstance] Created ChallengeInstance
52
- def create(factor_sid: nil, expiration_date: :unset, details: :unset, hidden_details: :unset, twilio_sandbox_mode: :unset)
48
+ def create(factor_sid: nil, expiration_date: :unset, details_message: :unset, details_fields: :unset, hidden_details: :unset, twilio_sandbox_mode: :unset)
53
49
  data = Twilio::Values.of({
54
50
  'FactorSid' => factor_sid,
55
51
  'ExpirationDate' => Twilio.serialize_iso8601_datetime(expiration_date),
56
- 'Details' => details,
57
- 'HiddenDetails' => hidden_details,
52
+ 'Details.Message' => details_message,
53
+ 'Details.Fields' => Twilio.serialize_list(details_fields) { |e| Twilio.serialize_object(e) },
54
+ 'HiddenDetails' => Twilio.serialize_object(hidden_details),
58
55
  })
59
56
  headers = Twilio::Values.of({'Twilio-Sandbox-Mode' => twilio_sandbox_mode, })
60
57
 
@@ -422,13 +419,13 @@ module Twilio
422
419
  end
423
420
 
424
421
  ##
425
- # @return [String] Public details provided to contextualize the Challenge
422
+ # @return [Hash] The details
426
423
  def details
427
424
  @properties['details']
428
425
  end
429
426
 
430
427
  ##
431
- # @return [String] Hidden details provided to contextualize the Challenge
428
+ # @return [Hash] Hidden details provided to contextualize the Challenge
432
429
  def hidden_details
433
430
  @properties['hidden_details']
434
431
  end
@@ -33,24 +33,36 @@ module Twilio
33
33
 
34
34
  ##
35
35
  # Create the FactorInstance
36
- # @param [String] binding A unique binding for this Factor that identifies it.
37
- # E.g. the algorithm and public key for `push` factors. It must be a json string
38
- # with the required properties for the given factor type. Required when creating a
39
- # new Factor. This value is never returned because it can contain customer
40
- # secrets.
41
36
  # @param [String] friendly_name The friendly name of this Factor
42
37
  # @param [factor.FactorTypes] factor_type The Type of this Factor. Currently only
43
38
  # `push` is supported
44
- # @param [String] config The config required for this Factor. It must be a json
45
- # string with the required properties for the given factor type
39
+ # @param [String] binding_alg The algorithm used when `factor_type` is `push`.
40
+ # Algorithm supported: `ES256`
41
+ # @param [String] binding_public_key The Ecdsa public key in PKIX, ASN.1 DER
42
+ # format encoded in Base64
43
+ # @param [String] config_app_id The ID that uniquely identifies your app in the
44
+ # Google or Apple store, such as `com.example.myapp`. Required when `factor_type`
45
+ # is `push`
46
+ # @param [factor.NotificationPlatforms] config_notification_platform The transport
47
+ # technology used to generate the Notification Token. Can be `apn` or `fcm`.
48
+ # Required when `factor_type` is `push`
49
+ # @param [String] config_notification_token For APN, the device token. For FCM the
50
+ # registration token. It used to send the push notifications. Required when
51
+ # `factor_type` is `push`
52
+ # @param [String] config_sdk_version The Verify Push SDK version used to configure
53
+ # the factor
46
54
  # @param [String] twilio_sandbox_mode The Twilio-Sandbox-Mode HTTP request header
47
55
  # @return [FactorInstance] Created FactorInstance
48
- def create(binding: nil, friendly_name: nil, factor_type: nil, config: nil, twilio_sandbox_mode: :unset)
56
+ def create(friendly_name: nil, factor_type: nil, binding_alg: :unset, binding_public_key: :unset, config_app_id: :unset, config_notification_platform: :unset, config_notification_token: :unset, config_sdk_version: :unset, twilio_sandbox_mode: :unset)
49
57
  data = Twilio::Values.of({
50
- 'Binding' => binding,
51
58
  'FriendlyName' => friendly_name,
52
59
  'FactorType' => factor_type,
53
- 'Config' => config,
60
+ 'Binding.Alg' => binding_alg,
61
+ 'Binding.PublicKey' => binding_public_key,
62
+ 'Config.AppId' => config_app_id,
63
+ 'Config.NotificationPlatform' => config_notification_platform,
64
+ 'Config.NotificationToken' => config_notification_token,
65
+ 'Config.SdkVersion' => config_sdk_version,
54
66
  })
55
67
  headers = Twilio::Values.of({'Twilio-Sandbox-Mode' => twilio_sandbox_mode, })
56
68
 
@@ -243,15 +255,19 @@ module Twilio
243
255
  # @param [String] auth_payload The optional payload needed to verify the Factor
244
256
  # for the first time. E.g. for a TOTP, the numeric code.
245
257
  # @param [String] friendly_name The new friendly name of this Factor
246
- # @param [String] config The new config for this Factor. It must be a json string
247
- # with the required properties for the given factor type
258
+ # @param [String] config_notification_token For APN, the device token. For FCM the
259
+ # registration token. It used to send the push notifications. Required when
260
+ # `factor_type` is `push`
261
+ # @param [String] config_sdk_version The Verify Push SDK version used to configure
262
+ # the factor
248
263
  # @param [String] twilio_sandbox_mode The Twilio-Sandbox-Mode HTTP request header
249
264
  # @return [FactorInstance] Updated FactorInstance
250
- def update(auth_payload: :unset, friendly_name: :unset, config: :unset, twilio_sandbox_mode: :unset)
265
+ def update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset, twilio_sandbox_mode: :unset)
251
266
  data = Twilio::Values.of({
252
267
  'AuthPayload' => auth_payload,
253
268
  'FriendlyName' => friendly_name,
254
- 'Config' => config,
269
+ 'Config.NotificationToken' => config_notification_token,
270
+ 'Config.SdkVersion' => config_sdk_version,
255
271
  })
256
272
  headers = Twilio::Values.of({'Twilio-Sandbox-Mode' => twilio_sandbox_mode, })
257
273
 
@@ -427,15 +443,19 @@ module Twilio
427
443
  # @param [String] auth_payload The optional payload needed to verify the Factor
428
444
  # for the first time. E.g. for a TOTP, the numeric code.
429
445
  # @param [String] friendly_name The new friendly name of this Factor
430
- # @param [String] config The new config for this Factor. It must be a json string
431
- # with the required properties for the given factor type
446
+ # @param [String] config_notification_token For APN, the device token. For FCM the
447
+ # registration token. It used to send the push notifications. Required when
448
+ # `factor_type` is `push`
449
+ # @param [String] config_sdk_version The Verify Push SDK version used to configure
450
+ # the factor
432
451
  # @param [String] twilio_sandbox_mode The Twilio-Sandbox-Mode HTTP request header
433
452
  # @return [FactorInstance] Updated FactorInstance
434
- def update(auth_payload: :unset, friendly_name: :unset, config: :unset, twilio_sandbox_mode: :unset)
453
+ def update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset, twilio_sandbox_mode: :unset)
435
454
  context.update(
436
455
  auth_payload: auth_payload,
437
456
  friendly_name: friendly_name,
438
- config: config,
457
+ config_notification_token: config_notification_token,
458
+ config_sdk_version: config_sdk_version,
439
459
  twilio_sandbox_mode: twilio_sandbox_mode,
440
460
  )
441
461
  end
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.40.4'
2
+ VERSION = '5.41.0'
3
3
  end
@@ -0,0 +1,44 @@
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 'AuthTokenPromotion' do
12
+ it "can update" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.accounts.v1.auth_token_promotion().update()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ expect(
20
+ @holodeck.has_request?(Holodeck::Request.new(
21
+ method: 'post',
22
+ url: 'https://accounts.twilio.com/v1/AuthTokens/Promote',
23
+ ))).to eq(true)
24
+ end
25
+
26
+ it "receives update responses" do
27
+ @holodeck.mock(Twilio::Response.new(
28
+ 200,
29
+ %q[
30
+ {
31
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
32
+ "auth_token": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
33
+ "date_created": "2015-07-31T04:00:00Z",
34
+ "date_updated": "2015-07-31T04:00:00Z",
35
+ "url": "https://accounts.twilio.com/v1/AuthTokens/Promote"
36
+ }
37
+ ]
38
+ ))
39
+
40
+ actual = @client.accounts.v1.auth_token_promotion().update()
41
+
42
+ expect(actual).to_not eq(nil)
43
+ end
44
+ end
@@ -0,0 +1,69 @@
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 'SecondaryAuthToken' do
12
+ it "can create" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.accounts.v1.secondary_auth_token().create()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ expect(
20
+ @holodeck.has_request?(Holodeck::Request.new(
21
+ method: 'post',
22
+ url: 'https://accounts.twilio.com/v1/AuthTokens/Secondary',
23
+ ))).to eq(true)
24
+ end
25
+
26
+ it "receives create responses" do
27
+ @holodeck.mock(Twilio::Response.new(
28
+ 201,
29
+ %q[
30
+ {
31
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
32
+ "date_created": "2015-07-31T04:00:00Z",
33
+ "date_updated": "2015-07-31T04:00:00Z",
34
+ "secondary_auth_token": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
35
+ "url": "https://accounts.twilio.com/v1/AuthTokens/Secondary"
36
+ }
37
+ ]
38
+ ))
39
+
40
+ actual = @client.accounts.v1.secondary_auth_token().create()
41
+
42
+ expect(actual).to_not eq(nil)
43
+ end
44
+
45
+ it "can delete" do
46
+ @holodeck.mock(Twilio::Response.new(500, ''))
47
+
48
+ expect {
49
+ @client.accounts.v1.secondary_auth_token().delete()
50
+ }.to raise_exception(Twilio::REST::TwilioError)
51
+
52
+ expect(
53
+ @holodeck.has_request?(Holodeck::Request.new(
54
+ method: 'delete',
55
+ url: 'https://accounts.twilio.com/v1/AuthTokens/Secondary',
56
+ ))).to eq(true)
57
+ end
58
+
59
+ it "receives delete responses" do
60
+ @holodeck.mock(Twilio::Response.new(
61
+ 204,
62
+ nil,
63
+ ))
64
+
65
+ actual = @client.accounts.v1.secondary_auth_token().delete()
66
+
67
+ expect(actual).to eq(true)
68
+ end
69
+ end
@@ -116,7 +116,7 @@ describe 'Conversation' do
116
116
  "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
117
117
  "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
118
118
  "friendly_name": "friendly_name",
119
- "unique_name": null,
119
+ "unique_name": "unique_name",
120
120
  "attributes": "{ \\"topic\\": \\"feedback\\" }",
121
121
  "date_created": "2015-12-16T22:18:37Z",
122
122
  "date_updated": "2015-12-16T22:18:38Z",
@@ -120,7 +120,7 @@ describe 'Conversation' do
120
120
  "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
121
121
  "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
122
122
  "friendly_name": "friendly_name",
123
- "unique_name": null,
123
+ "unique_name": "unique_name",
124
124
  "attributes": "{ \\"topic\\": \\"feedback\\" }",
125
125
  "date_created": "2015-12-16T22:18:37Z",
126
126
  "date_updated": "2015-12-16T22:18:38Z",