twilio-ruby 5.40.4 → 5.45.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 (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
@@ -1,243 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # \ / _ _ _| _ _
4
- # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
- # / /
6
- #
7
- # frozen_string_literal: true
8
-
9
- module Twilio
10
- module REST
11
- class Preview < Domain
12
- class TrustedComms < Version
13
- ##
14
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
15
- class BrandedCallList < ListResource
16
- ##
17
- # Initialize the BrandedCallList
18
- # @param [Version] version Version that contains the resource
19
- # @return [BrandedCallList] BrandedCallList
20
- def initialize(version)
21
- super(version)
22
-
23
- # Path Solution
24
- @solution = {}
25
- @uri = "/Business/BrandedCalls"
26
- end
27
-
28
- ##
29
- # Create the BrandedCallInstance
30
- # @param [String] from The phone number to use as the caller id, given in {E.164
31
- # format}[https://www.twilio.com/docs/glossary/what-e164]. It must be a Twilio
32
- # number that has been set up as a Branded Number in the Business Profile section
33
- # for your account.
34
- # @param [String] to The terminating Phone Number, given in {E.164
35
- # format}[https://www.twilio.com/docs/glossary/what-e164].
36
- # @param [String] reason The business reason for this phone call that will appear
37
- # in the terminating device's screen. Max 50 characters.
38
- # @param [String] call_sid The Call sid this Branded Call should link to.
39
- # @return [BrandedCallInstance] Created BrandedCallInstance
40
- def create(from: nil, to: nil, reason: nil, call_sid: :unset)
41
- data = Twilio::Values.of({'From' => from, 'To' => to, 'Reason' => reason, 'CallSid' => call_sid, })
42
-
43
- payload = @version.create('POST', @uri, data: data)
44
-
45
- BrandedCallInstance.new(@version, payload, )
46
- end
47
-
48
- ##
49
- # Provide a user friendly representation
50
- def to_s
51
- '#<Twilio.Preview.TrustedComms.BrandedCallList>'
52
- end
53
- end
54
-
55
- ##
56
- # 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.
57
- class BrandedCallPage < Page
58
- ##
59
- # Initialize the BrandedCallPage
60
- # @param [Version] version Version that contains the resource
61
- # @param [Response] response Response from the API
62
- # @param [Hash] solution Path solution for the resource
63
- # @return [BrandedCallPage] BrandedCallPage
64
- def initialize(version, response, solution)
65
- super(version, response)
66
-
67
- # Path Solution
68
- @solution = solution
69
- end
70
-
71
- ##
72
- # Build an instance of BrandedCallInstance
73
- # @param [Hash] payload Payload response from the API
74
- # @return [BrandedCallInstance] BrandedCallInstance
75
- def get_instance(payload)
76
- BrandedCallInstance.new(@version, payload, )
77
- end
78
-
79
- ##
80
- # Provide a user friendly representation
81
- def to_s
82
- '<Twilio.Preview.TrustedComms.BrandedCallPage>'
83
- end
84
- end
85
-
86
- ##
87
- # 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.
88
- class BrandedCallInstance < InstanceResource
89
- ##
90
- # Initialize the BrandedCallInstance
91
- # @param [Version] version Version that contains the resource
92
- # @param [Hash] payload payload that contains response from Twilio
93
- # @return [BrandedCallInstance] BrandedCallInstance
94
- def initialize(version, payload)
95
- super(version)
96
-
97
- # Marshaled Properties
98
- @properties = {
99
- 'account_sid' => payload['account_sid'],
100
- 'bg_color' => payload['bg_color'],
101
- 'brand_sid' => payload['brand_sid'],
102
- 'branded_channel_sid' => payload['branded_channel_sid'],
103
- 'business_sid' => payload['business_sid'],
104
- 'call_sid' => payload['call_sid'],
105
- 'caller' => payload['caller'],
106
- 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
107
- 'font_color' => payload['font_color'],
108
- 'from' => payload['from'],
109
- 'logo' => payload['logo'],
110
- 'phone_number_sid' => payload['phone_number_sid'],
111
- 'reason' => payload['reason'],
112
- 'sid' => payload['sid'],
113
- 'status' => payload['status'],
114
- 'to' => payload['to'],
115
- 'url' => payload['url'],
116
- 'use_case' => payload['use_case'],
117
- }
118
- end
119
-
120
- ##
121
- # @return [String] Account Sid.
122
- def account_sid
123
- @properties['account_sid']
124
- end
125
-
126
- ##
127
- # @return [String] Background color of the current phone call
128
- def bg_color
129
- @properties['bg_color']
130
- end
131
-
132
- ##
133
- # @return [String] Brand Sid.
134
- def brand_sid
135
- @properties['brand_sid']
136
- end
137
-
138
- ##
139
- # @return [String] Branded Channel Sid.
140
- def branded_channel_sid
141
- @properties['branded_channel_sid']
142
- end
143
-
144
- ##
145
- # @return [String] Business Sid.
146
- def business_sid
147
- @properties['business_sid']
148
- end
149
-
150
- ##
151
- # @return [String] A string that uniquely identifies this phone call.
152
- def call_sid
153
- @properties['call_sid']
154
- end
155
-
156
- ##
157
- # @return [String] Caller name of the current phone call
158
- def caller
159
- @properties['caller']
160
- end
161
-
162
- ##
163
- # @return [Time] The date this current phone call was created
164
- def created_at
165
- @properties['created_at']
166
- end
167
-
168
- ##
169
- # @return [String] Font color of the current phone call
170
- def font_color
171
- @properties['font_color']
172
- end
173
-
174
- ##
175
- # @return [String] The originating phone number
176
- def from
177
- @properties['from']
178
- end
179
-
180
- ##
181
- # @return [String] Logo URL of the caller
182
- def logo
183
- @properties['logo']
184
- end
185
-
186
- ##
187
- # @return [String] Phone Number Sid.
188
- def phone_number_sid
189
- @properties['phone_number_sid']
190
- end
191
-
192
- ##
193
- # @return [String] The business reason for this current phone call
194
- def reason
195
- @properties['reason']
196
- end
197
-
198
- ##
199
- # @return [String] A string that uniquely identifies this current branded phone call.
200
- def sid
201
- @properties['sid']
202
- end
203
-
204
- ##
205
- # @return [String] The status of the current phone call
206
- def status
207
- @properties['status']
208
- end
209
-
210
- ##
211
- # @return [String] The terminating phone number
212
- def to
213
- @properties['to']
214
- end
215
-
216
- ##
217
- # @return [String] The URL of this resource.
218
- def url
219
- @properties['url']
220
- end
221
-
222
- ##
223
- # @return [String] The use case for the current phone call
224
- def use_case
225
- @properties['use_case']
226
- end
227
-
228
- ##
229
- # Provide a user friendly representation
230
- def to_s
231
- "<Twilio.Preview.TrustedComms.BrandedCallInstance>"
232
- end
233
-
234
- ##
235
- # Provide a detailed, user friendly representation
236
- def inspect
237
- "<Twilio.Preview.TrustedComms.BrandedCallInstance>"
238
- end
239
- end
240
- end
241
- end
242
- end
243
- end
@@ -1,233 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # \ / _ _ _| _ _
4
- # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
- # / /
6
- #
7
- # frozen_string_literal: true
8
-
9
- module Twilio
10
- module REST
11
- class Preview < Domain
12
- class TrustedComms < Version
13
- class BusinessContext < InstanceContext
14
- ##
15
- # 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.
16
- class BrandList < ListResource
17
- ##
18
- # Initialize the BrandList
19
- # @param [Version] version Version that contains the resource
20
- # @param [String] business_sid The unique SID identifier of the Business.
21
- # @return [BrandList] BrandList
22
- def initialize(version, business_sid: nil)
23
- super(version)
24
-
25
- # Path Solution
26
- @solution = {business_sid: business_sid}
27
- end
28
-
29
- ##
30
- # Provide a user friendly representation
31
- def to_s
32
- '#<Twilio.Preview.TrustedComms.BrandList>'
33
- end
34
- end
35
-
36
- ##
37
- # 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.
38
- class BrandPage < Page
39
- ##
40
- # Initialize the BrandPage
41
- # @param [Version] version Version that contains the resource
42
- # @param [Response] response Response from the API
43
- # @param [Hash] solution Path solution for the resource
44
- # @return [BrandPage] BrandPage
45
- def initialize(version, response, solution)
46
- super(version, response)
47
-
48
- # Path Solution
49
- @solution = solution
50
- end
51
-
52
- ##
53
- # Build an instance of BrandInstance
54
- # @param [Hash] payload Payload response from the API
55
- # @return [BrandInstance] BrandInstance
56
- def get_instance(payload)
57
- BrandInstance.new(@version, payload, business_sid: @solution[:business_sid], )
58
- end
59
-
60
- ##
61
- # Provide a user friendly representation
62
- def to_s
63
- '<Twilio.Preview.TrustedComms.BrandPage>'
64
- end
65
- end
66
-
67
- ##
68
- # 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.
69
- class BrandContext < InstanceContext
70
- ##
71
- # Initialize the BrandContext
72
- # @param [Version] version Version that contains the resource
73
- # @param [String] business_sid The unique SID identifier of the Business.
74
- # @param [String] sid The unique SID identifier of the Brand.
75
- # @return [BrandContext] BrandContext
76
- def initialize(version, business_sid, sid)
77
- super(version)
78
-
79
- # Path Solution
80
- @solution = {business_sid: business_sid, sid: sid, }
81
- @uri = "/Businesses/#{@solution[:business_sid]}/Brands/#{@solution[:sid]}"
82
-
83
- # Dependents
84
- @branded_channels = nil
85
- end
86
-
87
- ##
88
- # Fetch the BrandInstance
89
- # @return [BrandInstance] Fetched BrandInstance
90
- def fetch
91
- payload = @version.fetch('GET', @uri)
92
-
93
- BrandInstance.new(@version, payload, business_sid: @solution[:business_sid], sid: @solution[:sid], )
94
- end
95
-
96
- ##
97
- # Access the branded_channels
98
- # @return [BrandedChannelList]
99
- # @return [BrandedChannelContext] if sid was passed.
100
- def branded_channels(sid=:unset)
101
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
102
-
103
- if sid != :unset
104
- return BrandedChannelContext.new(@version, @solution[:business_sid], @solution[:sid], sid, )
105
- end
106
-
107
- unless @branded_channels
108
- @branded_channels = BrandedChannelList.new(
109
- @version,
110
- business_sid: @solution[:business_sid],
111
- brand_sid: @solution[:sid],
112
- )
113
- end
114
-
115
- @branded_channels
116
- end
117
-
118
- ##
119
- # Provide a user friendly representation
120
- def to_s
121
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
122
- "#<Twilio.Preview.TrustedComms.BrandContext #{context}>"
123
- end
124
-
125
- ##
126
- # Provide a detailed, user friendly representation
127
- def inspect
128
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
129
- "#<Twilio.Preview.TrustedComms.BrandContext #{context}>"
130
- end
131
- end
132
-
133
- ##
134
- # 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.
135
- class BrandInstance < InstanceResource
136
- ##
137
- # Initialize the BrandInstance
138
- # @param [Version] version Version that contains the resource
139
- # @param [Hash] payload payload that contains response from Twilio
140
- # @param [String] business_sid The unique SID identifier of the Business.
141
- # @param [String] sid The unique SID identifier of the Brand.
142
- # @return [BrandInstance] BrandInstance
143
- def initialize(version, payload, business_sid: nil, sid: nil)
144
- super(version)
145
-
146
- # Marshaled Properties
147
- @properties = {
148
- 'account_sid' => payload['account_sid'],
149
- 'business_sid' => payload['business_sid'],
150
- 'sid' => payload['sid'],
151
- 'links' => payload['links'],
152
- 'url' => payload['url'],
153
- }
154
-
155
- # Context
156
- @instance_context = nil
157
- @params = {'business_sid' => business_sid, 'sid' => sid || @properties['sid'], }
158
- end
159
-
160
- ##
161
- # Generate an instance context for the instance, the context is capable of
162
- # performing various actions. All instance actions are proxied to the context
163
- # @return [BrandContext] BrandContext for this BrandInstance
164
- def context
165
- unless @instance_context
166
- @instance_context = BrandContext.new(@version, @params['business_sid'], @params['sid'], )
167
- end
168
- @instance_context
169
- end
170
-
171
- ##
172
- # @return [String] Account Sid.
173
- def account_sid
174
- @properties['account_sid']
175
- end
176
-
177
- ##
178
- # @return [String] Business Sid.
179
- def business_sid
180
- @properties['business_sid']
181
- end
182
-
183
- ##
184
- # @return [String] Brand Sid.
185
- def sid
186
- @properties['sid']
187
- end
188
-
189
- ##
190
- # @return [String] Nested resource URLs.
191
- def links
192
- @properties['links']
193
- end
194
-
195
- ##
196
- # @return [String] The URL of this resource.
197
- def url
198
- @properties['url']
199
- end
200
-
201
- ##
202
- # Fetch the BrandInstance
203
- # @return [BrandInstance] Fetched BrandInstance
204
- def fetch
205
- context.fetch
206
- end
207
-
208
- ##
209
- # Access the branded_channels
210
- # @return [branded_channels] branded_channels
211
- def branded_channels
212
- context.branded_channels
213
- end
214
-
215
- ##
216
- # Provide a user friendly representation
217
- def to_s
218
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
219
- "<Twilio.Preview.TrustedComms.BrandInstance #{values}>"
220
- end
221
-
222
- ##
223
- # Provide a detailed, user friendly representation
224
- def inspect
225
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
226
- "<Twilio.Preview.TrustedComms.BrandInstance #{values}>"
227
- end
228
- end
229
- end
230
- end
231
- end
232
- end
233
- end