twilio-ruby 5.40.4 → 5.45.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +104 -0
  3. data/{LICENSE.md → LICENSE} +0 -0
  4. data/PULL_REQUEST_TEMPLATE.md +3 -3
  5. data/README.md +18 -2
  6. data/lib/twilio-ruby.rb +1 -1
  7. data/lib/twilio-ruby/jwt/access_token.rb +7 -2
  8. data/lib/twilio-ruby/rest/accounts.rb +12 -0
  9. data/lib/twilio-ruby/rest/accounts/v1.rb +14 -0
  10. data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +186 -0
  11. data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +200 -0
  12. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +26 -1
  13. data/lib/twilio-ruby/rest/api/v2010/account/call/event.rb +201 -0
  14. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +13 -1
  15. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +6 -1
  16. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +5 -22
  17. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +25 -40
  18. data/lib/twilio-ruby/rest/client.rb +29 -3
  19. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +10 -2
  20. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +13 -3
  21. data/lib/twilio-ruby/rest/events/v1/subscription.rb +12 -5
  22. data/lib/twilio-ruby/rest/insights.rb +8 -0
  23. data/lib/twilio-ruby/rest/insights/v1.rb +15 -0
  24. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +7 -0
  25. data/lib/twilio-ruby/rest/insights/v1/room.rb +487 -0
  26. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +378 -0
  27. data/lib/twilio-ruby/rest/ip_messaging.rb +8 -10
  28. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +6 -8
  29. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +29 -68
  30. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +198 -313
  31. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +32 -59
  32. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +23 -55
  33. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +28 -71
  34. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +31 -59
  35. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +19 -39
  36. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +29 -51
  37. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +12 -18
  38. data/lib/twilio-ruby/rest/ip_messaging/v2.rb +6 -6
  39. data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +29 -66
  40. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +116 -205
  41. data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +23 -50
  42. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +41 -91
  43. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +23 -50
  44. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +42 -118
  45. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +46 -100
  46. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +36 -89
  47. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +19 -41
  48. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +29 -53
  49. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +23 -53
  50. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +27 -56
  51. data/lib/twilio-ruby/rest/preview.rb +5 -18
  52. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +5 -22
  53. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +21 -39
  54. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +12 -27
  55. data/lib/twilio-ruby/rest/preview/trusted_comms/{business.rb → branded_channel.rb} +63 -77
  56. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +165 -0
  57. data/lib/twilio-ruby/rest/serverless/v1/service.rb +5 -5
  58. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +4 -4
  59. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +4 -4
  60. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +4 -4
  61. data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +4 -4
  62. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +4 -4
  63. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +4 -4
  64. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +4 -4
  65. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +4 -4
  66. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
  67. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +4 -4
  68. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +4 -4
  69. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +15 -5
  70. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +15 -5
  71. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +28 -5
  72. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +15 -5
  73. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +28 -5
  74. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +15 -5
  75. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +12 -9
  76. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +16 -16
  77. data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +21 -24
  78. data/lib/twilio-ruby/rest/verify/v2/form.rb +4 -4
  79. data/lib/twilio-ruby/rest/verify/v2/service.rb +54 -33
  80. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +3 -3
  81. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +23 -35
  82. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +36 -61
  83. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +59 -57
  84. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +4 -4
  85. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +6 -6
  86. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +6 -6
  87. data/lib/twilio-ruby/rest/video/v1/room.rb +20 -0
  88. data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +150 -0
  89. data/lib/twilio-ruby/twiml/voice_response.rb +7 -4
  90. data/lib/twilio-ruby/util/configuration.rb +5 -1
  91. data/lib/twilio-ruby/version.rb +1 -1
  92. data/spec/integration/accounts/v1/auth_token_promotion_spec.rb +44 -0
  93. data/spec/integration/accounts/v1/secondary_auth_token_spec.rb +69 -0
  94. data/spec/integration/api/v2010/account/call/event_spec.rb +102 -0
  95. data/spec/integration/api/v2010/account/call/recording_spec.rb +4 -0
  96. data/spec/integration/api/v2010/account/call_spec.rb +20 -10
  97. data/spec/integration/api/v2010/account/conference/participant_spec.rb +30 -0
  98. data/spec/integration/bulkexports/v1/export/export_custom_job_spec.rb +4 -2
  99. data/spec/integration/conversations/v1/conversation_spec.rb +1 -1
  100. data/spec/integration/conversations/v1/service/conversation_spec.rb +1 -1
  101. data/spec/integration/events/v1/sink/sink_test_spec.rb +1 -1
  102. data/spec/integration/events/v1/subscription_spec.rb +49 -0
  103. data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
  104. data/spec/integration/insights/v1/room/participant_spec.rb +147 -0
  105. data/spec/integration/insights/v1/room_spec.rb +164 -0
  106. data/spec/integration/ip_messaging/v1/credential_spec.rb +13 -13
  107. data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +11 -11
  108. data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +14 -14
  109. data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +14 -14
  110. data/spec/integration/ip_messaging/v1/service/channel_spec.rb +25 -25
  111. data/spec/integration/ip_messaging/v1/service/role_spec.rb +13 -13
  112. data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +7 -7
  113. data/spec/integration/ip_messaging/v1/service/user_spec.rb +17 -17
  114. data/spec/integration/ip_messaging/v1/service_spec.rb +9 -9
  115. data/spec/integration/ip_messaging/v2/credential_spec.rb +13 -13
  116. data/spec/integration/ip_messaging/v2/service/binding_spec.rb +11 -11
  117. data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +11 -11
  118. data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +13 -13
  119. data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +17 -17
  120. data/spec/integration/ip_messaging/v2/service/channel/webhook_spec.rb +15 -15
  121. data/spec/integration/ip_messaging/v2/service/channel_spec.rb +29 -29
  122. data/spec/integration/ip_messaging/v2/service/role_spec.rb +13 -13
  123. data/spec/integration/ip_messaging/v2/service/user/user_binding_spec.rb +9 -9
  124. data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +20 -20
  125. data/spec/integration/ip_messaging/v2/service/user_spec.rb +21 -21
  126. data/spec/integration/ip_messaging/v2/service_spec.rb +29 -29
  127. data/spec/integration/lookups/v1/phone_number_spec.rb +7 -7
  128. data/spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb +4 -2
  129. data/spec/integration/preview/trusted_comms/{business/brand/branded_channel → branded_channel}/channel_spec.rb +4 -8
  130. data/spec/integration/preview/trusted_comms/{business/brand/branded_channel_spec.rb → branded_channel_spec.rb} +5 -9
  131. data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +1 -1
  132. data/spec/integration/trunking/v1/trunk/recording_spec.rb +2 -6
  133. data/spec/integration/verify/v2/service/entity/challenge_spec.rb +56 -20
  134. data/spec/integration/verify/v2/service/entity/factor_spec.rb +11 -26
  135. data/spec/integration/verify/v2/service/entity_spec.rb +4 -12
  136. data/spec/integration/verify/v2/service_spec.rb +8 -4
  137. data/spec/integration/video/v1/room/room_recording_rule_spec.rb +89 -0
  138. data/spec/integration/video/v1/room_spec.rb +10 -5
  139. data/spec/jwt/access_token_spec.rb +9 -1
  140. data/spec/rest/client_spec.rb +24 -2
  141. data/twilio-ruby.gemspec +2 -1
  142. metadata +42 -28
  143. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb +0 -243
  144. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +0 -233
  145. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +0 -260
  146. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +0 -189
  147. data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +0 -108
  148. data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb +0 -260
  149. data/lib/twilio-ruby/rest/preview/trusted_comms/phone_call.rb +0 -342
  150. data/spec/integration/preview/trusted_comms/branded_call_spec.rb +0 -59
  151. data/spec/integration/preview/trusted_comms/business/brand_spec.rb +0 -48
  152. data/spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb +0 -56
  153. data/spec/integration/preview/trusted_comms/business/insights_spec.rb +0 -12
  154. data/spec/integration/preview/trusted_comms/business_spec.rb +0 -46
  155. data/spec/integration/preview/trusted_comms/phone_call_spec.rb +0 -59
@@ -31,10 +31,6 @@ module Twilio
31
31
  # Lists ExportCustomJobInstance records from the API as a list.
32
32
  # Unlike stream(), this operation is eager and will load `limit` records into
33
33
  # memory before returning.
34
- # @param [String] next_token The token for the next page of job results, and may
35
- # be null if there are no more pages
36
- # @param [String] previous_token The token for the previous page of results, and
37
- # may be null if this is the first page
38
34
  # @param [Integer] limit Upper limit for the number of records to return. stream()
39
35
  # guarantees to never return more than limit. Default is no limit
40
36
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -42,23 +38,14 @@ module Twilio
42
38
  # but a limit is defined, stream() will attempt to read the limit with the most
43
39
  # efficient page size, i.e. min(limit, 1000)
44
40
  # @return [Array] Array of up to limit results
45
- def list(next_token: :unset, previous_token: :unset, limit: nil, page_size: nil)
46
- self.stream(
47
- next_token: next_token,
48
- previous_token: previous_token,
49
- limit: limit,
50
- page_size: page_size
51
- ).entries
41
+ def list(limit: nil, page_size: nil)
42
+ self.stream(limit: limit, page_size: page_size).entries
52
43
  end
53
44
 
54
45
  ##
55
46
  # Streams ExportCustomJobInstance records from the API as an Enumerable.
56
47
  # This operation lazily loads records as efficiently as possible until the limit
57
48
  # is reached.
58
- # @param [String] next_token The token for the next page of job results, and may
59
- # be null if there are no more pages
60
- # @param [String] previous_token The token for the previous page of results, and
61
- # may be null if this is the first page
62
49
  # @param [Integer] limit Upper limit for the number of records to return. stream()
63
50
  # guarantees to never return more than limit. Default is no limit.
64
51
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -66,14 +53,10 @@ module Twilio
66
53
  # but a limit is defined, stream() will attempt to read the limit with the most
67
54
  # efficient page size, i.e. min(limit, 1000)
68
55
  # @return [Enumerable] Enumerable that will yield up to limit results
69
- def stream(next_token: :unset, previous_token: :unset, limit: nil, page_size: nil)
56
+ def stream(limit: nil, page_size: nil)
70
57
  limits = @version.read_limits(limit, page_size)
71
58
 
72
- page = self.page(
73
- next_token: next_token,
74
- previous_token: previous_token,
75
- page_size: limits[:page_size],
76
- )
59
+ page = self.page(page_size: limits[:page_size], )
77
60
 
78
61
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
79
62
  end
@@ -95,18 +78,12 @@ module Twilio
95
78
  ##
96
79
  # Retrieve a single page of ExportCustomJobInstance records from the API.
97
80
  # Request is executed immediately.
98
- # @param [String] next_token The token for the next page of job results, and may
99
- # be null if there are no more pages
100
- # @param [String] previous_token The token for the previous page of results, and
101
- # may be null if this is the first page
102
81
  # @param [String] page_token PageToken provided by the API
103
82
  # @param [Integer] page_number Page Number, this value is simply for client state
104
83
  # @param [Integer] page_size Number of records to return, defaults to 50
105
84
  # @return [Page] Page of ExportCustomJobInstance
106
- def page(next_token: :unset, previous_token: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
85
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
107
86
  params = Twilio::Values.of({
108
- 'NextToken' => next_token,
109
- 'PreviousToken' => previous_token,
110
87
  'PageToken' => page_token,
111
88
  'Page' => page_number,
112
89
  'PageSize' => page_size,
@@ -132,18 +109,23 @@ module Twilio
132
109
 
133
110
  ##
134
111
  # Create the ExportCustomJobInstance
135
- # @param [String] friendly_name The friendly_name
136
- # @param [String] start_day The start_day
137
- # @param [String] end_day The end_day
138
- # @param [String] webhook_url The webhook_url
139
- # @param [String] webhook_method The webhook_method
140
- # @param [String] email The email
112
+ # @param [String] start_day The start day for the custom export specified as a
113
+ # string in the format of yyyy-mm-dd
114
+ # @param [String] end_day The end day for the custom export specified as a string
115
+ # in the format of yyyy-mm-dd. End day is inclusive and must be 2 days earlier
116
+ # than the current UTC day.
117
+ # @param [String] friendly_name The friendly name specified when creating the job
118
+ # @param [String] webhook_url The optional webhook url called on completion of the
119
+ # job. If this is supplied, `WebhookMethod` must also be supplied.
120
+ # @param [String] webhook_method This is the method used to call the webhook on
121
+ # completion of the job. If this is supplied, `WebhookUrl` must also be supplied.
122
+ # @param [String] email The optional email to send the completion notification to
141
123
  # @return [ExportCustomJobInstance] Created ExportCustomJobInstance
142
- def create(friendly_name: :unset, start_day: :unset, end_day: :unset, webhook_url: :unset, webhook_method: :unset, email: :unset)
124
+ def create(start_day: nil, end_day: nil, friendly_name: nil, webhook_url: :unset, webhook_method: :unset, email: :unset)
143
125
  data = Twilio::Values.of({
144
- 'FriendlyName' => friendly_name,
145
126
  'StartDay' => start_day,
146
127
  'EndDay' => end_day,
128
+ 'FriendlyName' => friendly_name,
147
129
  'WebhookUrl' => webhook_url,
148
130
  'WebhookMethod' => webhook_method,
149
131
  'Email' => email,
@@ -231,13 +213,13 @@ module Twilio
231
213
  end
232
214
 
233
215
  ##
234
- # @return [String] The start time for the export specified when creating the job
216
+ # @return [String] The start day for the custom export specified as a string in the format of yyyy-MM-dd
235
217
  def start_day
236
218
  @properties['start_day']
237
219
  end
238
220
 
239
221
  ##
240
- # @return [String] The end time for the export specified when creating the job
222
+ # @return [String] The end day for the custom export specified as a string in the format of yyyy-MM-dd
241
223
  def end_day
242
224
  @properties['end_day']
243
225
  end
@@ -261,7 +243,7 @@ module Twilio
261
243
  end
262
244
 
263
245
  ##
264
- # @return [String] The job_sid returned when the export was created
246
+ # @return [String] The unique job_sid returned when the custom export was created. This can be used to look up the status of the job.
265
247
  def job_sid
266
248
  @properties['job_sid']
267
249
  end
@@ -15,18 +15,24 @@ module Twilio
15
15
  def initialize(domain)
16
16
  super
17
17
  @version = 'TrustedComms'
18
- @branded_calls = nil
18
+ @branded_channels = nil
19
19
  @brands_information = nil
20
- @businesses = nil
21
20
  @cps = nil
22
21
  @current_calls = nil
23
- @phone_calls = nil
24
22
  end
25
23
 
26
24
  ##
27
- # @return [Twilio::REST::Preview::TrustedComms::BrandedCallContext]
28
- def branded_calls
29
- @branded_calls ||= BrandedCallList.new self
25
+ # @param [String] sid The unique SID identifier of the Branded Channel.
26
+ # @return [Twilio::REST::Preview::TrustedComms::BrandedChannelContext] if sid was passed.
27
+ # @return [Twilio::REST::Preview::TrustedComms::BrandedChannelList]
28
+ def branded_channels(sid=:unset)
29
+ if sid.nil?
30
+ raise ArgumentError, 'sid cannot be nil'
31
+ elsif sid == :unset
32
+ @branded_channels ||= BrandedChannelList.new self
33
+ else
34
+ BrandedChannelContext.new(self, sid)
35
+ end
30
36
  end
31
37
 
32
38
  ##
@@ -35,21 +41,6 @@ module Twilio
35
41
  @brands_information ||= BrandsInformationContext.new self
36
42
  end
37
43
 
38
- ##
39
- # @param [String] sid A 34 character string that uniquely identifies this
40
- # Business.
41
- # @return [Twilio::REST::Preview::TrustedComms::BusinessContext] if sid was passed.
42
- # @return [Twilio::REST::Preview::TrustedComms::BusinessList]
43
- def businesses(sid=:unset)
44
- if sid.nil?
45
- raise ArgumentError, 'sid cannot be nil'
46
- elsif sid == :unset
47
- @businesses ||= BusinessList.new self
48
- else
49
- BusinessContext.new(self, sid)
50
- end
51
- end
52
-
53
44
  ##
54
45
  # @return [Twilio::REST::Preview::TrustedComms::CpsContext]
55
46
  def cps
@@ -62,12 +53,6 @@ module Twilio
62
53
  @current_calls ||= CurrentCallContext.new self
63
54
  end
64
55
 
65
- ##
66
- # @return [Twilio::REST::Preview::TrustedComms::PhoneCallContext]
67
- def phone_calls
68
- @phone_calls ||= PhoneCallList.new self
69
- end
70
-
71
56
  ##
72
57
  # Provide a user friendly representation
73
58
  def to_s
@@ -12,11 +12,11 @@ module Twilio
12
12
  class TrustedComms < Version
13
13
  ##
14
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 BusinessList < ListResource
15
+ class BrandedChannelList < ListResource
16
16
  ##
17
- # Initialize the BusinessList
17
+ # Initialize the BrandedChannelList
18
18
  # @param [Version] version Version that contains the resource
19
- # @return [BusinessList] BusinessList
19
+ # @return [BrandedChannelList] BrandedChannelList
20
20
  def initialize(version)
21
21
  super(version)
22
22
 
@@ -27,19 +27,19 @@ module Twilio
27
27
  ##
28
28
  # Provide a user friendly representation
29
29
  def to_s
30
- '#<Twilio.Preview.TrustedComms.BusinessList>'
30
+ '#<Twilio.Preview.TrustedComms.BrandedChannelList>'
31
31
  end
32
32
  end
33
33
 
34
34
  ##
35
35
  # 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.
36
- class BusinessPage < Page
36
+ class BrandedChannelPage < Page
37
37
  ##
38
- # Initialize the BusinessPage
38
+ # Initialize the BrandedChannelPage
39
39
  # @param [Version] version Version that contains the resource
40
40
  # @param [Response] response Response from the API
41
41
  # @param [Hash] solution Path solution for the resource
42
- # @return [BusinessPage] BusinessPage
42
+ # @return [BrandedChannelPage] BrandedChannelPage
43
43
  def initialize(version, response, solution)
44
44
  super(version, response)
45
45
 
@@ -48,114 +48,95 @@ module Twilio
48
48
  end
49
49
 
50
50
  ##
51
- # Build an instance of BusinessInstance
51
+ # Build an instance of BrandedChannelInstance
52
52
  # @param [Hash] payload Payload response from the API
53
- # @return [BusinessInstance] BusinessInstance
53
+ # @return [BrandedChannelInstance] BrandedChannelInstance
54
54
  def get_instance(payload)
55
- BusinessInstance.new(@version, payload, )
55
+ BrandedChannelInstance.new(@version, payload, )
56
56
  end
57
57
 
58
58
  ##
59
59
  # Provide a user friendly representation
60
60
  def to_s
61
- '<Twilio.Preview.TrustedComms.BusinessPage>'
61
+ '<Twilio.Preview.TrustedComms.BrandedChannelPage>'
62
62
  end
63
63
  end
64
64
 
65
65
  ##
66
66
  # 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.
67
- class BusinessContext < InstanceContext
67
+ class BrandedChannelContext < InstanceContext
68
68
  ##
69
- # Initialize the BusinessContext
69
+ # Initialize the BrandedChannelContext
70
70
  # @param [Version] version Version that contains the resource
71
- # @param [String] sid A 34 character string that uniquely identifies this
72
- # Business.
73
- # @return [BusinessContext] BusinessContext
71
+ # @param [String] sid The unique SID identifier of the Branded Channel.
72
+ # @return [BrandedChannelContext] BrandedChannelContext
74
73
  def initialize(version, sid)
75
74
  super(version)
76
75
 
77
76
  # Path Solution
78
77
  @solution = {sid: sid, }
79
- @uri = "/Businesses/#{@solution[:sid]}"
78
+ @uri = "/BrandedChannels/#{@solution[:sid]}"
80
79
 
81
80
  # Dependents
82
- @brands = nil
83
- @insights = nil
81
+ @channels = nil
84
82
  end
85
83
 
86
84
  ##
87
- # Fetch the BusinessInstance
88
- # @return [BusinessInstance] Fetched BusinessInstance
85
+ # Fetch the BrandedChannelInstance
86
+ # @return [BrandedChannelInstance] Fetched BrandedChannelInstance
89
87
  def fetch
90
88
  payload = @version.fetch('GET', @uri)
91
89
 
92
- BusinessInstance.new(@version, payload, sid: @solution[:sid], )
90
+ BrandedChannelInstance.new(@version, payload, sid: @solution[:sid], )
93
91
  end
94
92
 
95
93
  ##
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
- ##
114
- # Access the insights
115
- # @return [InsightsList]
116
- # @return [InsightsContext]
117
- def insights
118
- unless @insights
119
- @insights = InsightsList.new(@version, business_sid: @solution[:sid], )
94
+ # Access the channels
95
+ # @return [ChannelList]
96
+ # @return [ChannelContext]
97
+ def channels
98
+ unless @channels
99
+ @channels = ChannelList.new(@version, branded_channel_sid: @solution[:sid], )
120
100
  end
121
101
 
122
- @insights
102
+ @channels
123
103
  end
124
104
 
125
105
  ##
126
106
  # Provide a user friendly representation
127
107
  def to_s
128
108
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
129
- "#<Twilio.Preview.TrustedComms.BusinessContext #{context}>"
109
+ "#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
130
110
  end
131
111
 
132
112
  ##
133
113
  # Provide a detailed, user friendly representation
134
114
  def inspect
135
115
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
136
- "#<Twilio.Preview.TrustedComms.BusinessContext #{context}>"
116
+ "#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
137
117
  end
138
118
  end
139
119
 
140
120
  ##
141
121
  # 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.
142
- class BusinessInstance < InstanceResource
122
+ class BrandedChannelInstance < InstanceResource
143
123
  ##
144
- # Initialize the BusinessInstance
124
+ # Initialize the BrandedChannelInstance
145
125
  # @param [Version] version Version that contains the resource
146
126
  # @param [Hash] payload payload that contains response from Twilio
147
- # @param [String] sid A 34 character string that uniquely identifies this
148
- # Business.
149
- # @return [BusinessInstance] BusinessInstance
127
+ # @param [String] sid The unique SID identifier of the Branded Channel.
128
+ # @return [BrandedChannelInstance] BrandedChannelInstance
150
129
  def initialize(version, payload, sid: nil)
151
130
  super(version)
152
131
 
153
132
  # Marshaled Properties
154
133
  @properties = {
155
134
  'account_sid' => payload['account_sid'],
135
+ 'business_sid' => payload['business_sid'],
136
+ 'brand_sid' => payload['brand_sid'],
156
137
  'sid' => payload['sid'],
157
- 'url' => payload['url'],
158
138
  'links' => payload['links'],
139
+ 'url' => payload['url'],
159
140
  }
160
141
 
161
142
  # Context
@@ -166,10 +147,10 @@ module Twilio
166
147
  ##
167
148
  # Generate an instance context for the instance, the context is capable of
168
149
  # performing various actions. All instance actions are proxied to the context
169
- # @return [BusinessContext] BusinessContext for this BusinessInstance
150
+ # @return [BrandedChannelContext] BrandedChannelContext for this BrandedChannelInstance
170
151
  def context
171
152
  unless @instance_context
172
- @instance_context = BusinessContext.new(@version, @params['sid'], )
153
+ @instance_context = BrandedChannelContext.new(@version, @params['sid'], )
173
154
  end
174
155
  @instance_context
175
156
  end
@@ -181,15 +162,21 @@ module Twilio
181
162
  end
182
163
 
183
164
  ##
184
- # @return [String] A string that uniquely identifies this Business.
185
- def sid
186
- @properties['sid']
165
+ # @return [String] Business Sid.
166
+ def business_sid
167
+ @properties['business_sid']
187
168
  end
188
169
 
189
170
  ##
190
- # @return [String] The URL of this resource.
191
- def url
192
- @properties['url']
171
+ # @return [String] Brand Sid.
172
+ def brand_sid
173
+ @properties['brand_sid']
174
+ end
175
+
176
+ ##
177
+ # @return [String] Branded Channel Sid.
178
+ def sid
179
+ @properties['sid']
193
180
  end
194
181
 
195
182
  ##
@@ -199,38 +186,37 @@ module Twilio
199
186
  end
200
187
 
201
188
  ##
202
- # Fetch the BusinessInstance
203
- # @return [BusinessInstance] Fetched BusinessInstance
204
- def fetch
205
- context.fetch
189
+ # @return [String] The URL of this resource.
190
+ def url
191
+ @properties['url']
206
192
  end
207
193
 
208
194
  ##
209
- # Access the brands
210
- # @return [brands] brands
211
- def brands
212
- context.brands
195
+ # Fetch the BrandedChannelInstance
196
+ # @return [BrandedChannelInstance] Fetched BrandedChannelInstance
197
+ def fetch
198
+ context.fetch
213
199
  end
214
200
 
215
201
  ##
216
- # Access the insights
217
- # @return [insights] insights
218
- def insights
219
- context.insights
202
+ # Access the channels
203
+ # @return [channels] channels
204
+ def channels
205
+ context.channels
220
206
  end
221
207
 
222
208
  ##
223
209
  # Provide a user friendly representation
224
210
  def to_s
225
211
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
226
- "<Twilio.Preview.TrustedComms.BusinessInstance #{values}>"
212
+ "<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
227
213
  end
228
214
 
229
215
  ##
230
216
  # Provide a detailed, user friendly representation
231
217
  def inspect
232
218
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
233
- "<Twilio.Preview.TrustedComms.BusinessInstance #{values}>"
219
+ "<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
234
220
  end
235
221
  end
236
222
  end