twilio-ruby 5.33.0 → 5.36.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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -0
  3. data/.rubocop_todo.yml +5 -26
  4. data/.travis.yml +9 -1
  5. data/CHANGES.md +110 -0
  6. data/README.md +17 -2
  7. data/lib/twilio-ruby.rb +4 -12
  8. data/lib/twilio-ruby/framework/error.rb +3 -3
  9. data/lib/twilio-ruby/jwt/jwt.rb +6 -0
  10. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +90 -90
  11. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +14 -0
  12. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +75 -72
  13. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +29 -29
  14. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
  15. data/lib/twilio-ruby/rest/autopilot.rb +6 -0
  16. data/lib/twilio-ruby/rest/autopilot/v1.rb +7 -0
  17. data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +198 -0
  18. data/lib/twilio-ruby/rest/client.rb +35 -8
  19. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +19 -3
  20. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +27 -4
  21. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +2 -1
  22. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  23. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +20 -11
  24. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +26 -0
  25. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +324 -0
  26. data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +26 -0
  27. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +239 -0
  28. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +266 -0
  29. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +197 -0
  30. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +7 -0
  31. data/lib/twilio-ruby/rest/studio.rb +2 -2
  32. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +26 -0
  33. data/lib/twilio-ruby/rest/studio/v2.rb +3 -3
  34. data/lib/twilio-ruby/rest/studio/v2/flow.rb +7 -0
  35. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +71 -24
  36. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +12 -11
  37. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +21 -20
  38. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +18 -15
  39. data/lib/twilio-ruby/rest/supersim.rb +18 -0
  40. data/lib/twilio-ruby/rest/supersim/v1.rb +30 -0
  41. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +53 -10
  42. data/lib/twilio-ruby/rest/supersim/v1/network.rb +315 -0
  43. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +378 -0
  44. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +352 -0
  45. data/lib/twilio-ruby/rest/verify.rb +9 -0
  46. data/lib/twilio-ruby/rest/verify/v2.rb +16 -0
  47. data/lib/twilio-ruby/rest/verify/v2/form.rb +197 -0
  48. data/lib/twilio-ruby/rest/verify/v2/service.rb +48 -3
  49. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +379 -0
  50. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +500 -0
  51. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor/challenge.rb +494 -0
  52. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
  53. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +8 -12
  54. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +8 -12
  55. data/lib/twilio-ruby/rest/voice.rb +36 -0
  56. data/lib/twilio-ruby/rest/voice/v1.rb +64 -0
  57. data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +513 -0
  58. data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +379 -0
  59. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +458 -0
  60. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +366 -0
  61. data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +346 -0
  62. data/lib/twilio-ruby/twiml/twiml.rb +4 -0
  63. data/lib/twilio-ruby/twiml/voice_response.rb +3 -2
  64. data/lib/twilio-ruby/util/configuration.rb +9 -1
  65. data/lib/twilio-ruby/version.rb +1 -1
  66. data/spec/integration/api/v2010/account/call_spec.rb +5 -5
  67. data/spec/integration/api/v2010/account/conference_spec.rb +42 -14
  68. data/spec/integration/api/v2010/account/sip/domain_spec.rb +12 -4
  69. data/spec/integration/api/v2010/account/token_spec.rb +23 -11
  70. data/spec/integration/autopilot/v1/restore_assistant_spec.rb +53 -0
  71. data/spec/integration/bulkexports/v1/export/day_spec.rb +1 -1
  72. data/spec/integration/conversations/v1/conversation/participant_spec.rb +7 -0
  73. data/spec/integration/conversations/v1/conversation_spec.rb +4 -0
  74. data/spec/integration/flex_api/v1/configuration_spec.rb +3 -0
  75. data/spec/integration/numbers/v2/regulatory_compliance/bundle/evaluation_spec.rb +623 -0
  76. data/spec/integration/numbers/v2/regulatory_compliance/bundle_spec.rb +4 -0
  77. data/spec/integration/preview/bulk_exports/export/day_spec.rb +1 -1
  78. data/spec/integration/preview/trusted_comms/business/brand/branded_channel/channel_spec.rb +54 -0
  79. data/spec/integration/preview/trusted_comms/business/brand/branded_channel_spec.rb +52 -0
  80. data/spec/integration/preview/trusted_comms/business/brand_spec.rb +49 -0
  81. data/spec/integration/preview/trusted_comms/business_spec.rb +1 -0
  82. data/spec/integration/serverless/v1/service/asset/asset_version_spec.rb +1 -1
  83. data/spec/integration/serverless/v1/service/build_spec.rb +4 -4
  84. data/spec/integration/serverless/v1/service/environment/log_spec.rb +1 -0
  85. data/spec/integration/serverless/v1/service/function/function_version_spec.rb +1 -1
  86. data/spec/integration/studio/v1/flow/execution_spec.rb +46 -0
  87. data/spec/integration/studio/v2/flow/execution_spec.rb +45 -0
  88. data/spec/integration/studio/v2/flow_spec.rb +4 -0
  89. data/spec/integration/studio/v2/flow_validate_spec.rb +2 -2
  90. data/spec/integration/supersim/v1/fleet_spec.rb +12 -4
  91. data/spec/integration/supersim/v1/network_access_profile/network_access_profile_network_spec.rb +179 -0
  92. data/spec/integration/supersim/v1/network_access_profile_spec.rb +223 -0
  93. data/spec/integration/supersim/v1/network_spec.rb +139 -0
  94. data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +13 -13
  95. data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +23 -23
  96. data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
  97. data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +17 -17
  98. data/spec/integration/trunking/v1/trunk_spec.rb +33 -33
  99. data/spec/integration/verify/v2/form_spec.rb +48 -0
  100. data/spec/integration/verify/v2/service/entity/factor/challenge_spec.rb +353 -0
  101. data/spec/integration/verify/v2/service/entity/factor_spec.rb +298 -0
  102. data/spec/integration/verify/v2/service/entity_spec.rb +201 -0
  103. data/spec/integration/verify/v2/service_spec.rb +28 -4
  104. data/spec/integration/video/v1/composition_settings_spec.rb +2 -2
  105. data/spec/integration/video/v1/recording_settings_spec.rb +2 -2
  106. data/spec/integration/video/v1/recording_spec.rb +2 -2
  107. data/spec/integration/video/v1/room/recording_spec.rb +2 -2
  108. data/spec/integration/voice/v1/byoc_trunk_spec.rb +250 -0
  109. data/spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb +246 -0
  110. data/spec/integration/voice/v1/connection_policy_spec.rb +226 -0
  111. data/spec/integration/voice/v1/ip_record_spec.rb +223 -0
  112. data/spec/integration/voice/v1/source_ip_mapping_spec.rb +219 -0
  113. data/spec/rest/client_spec.rb +173 -23
  114. data/spec/util/configuration_spec.rb +12 -0
  115. data/twilio-ruby.gemspec +4 -4
  116. metadata +67 -10
@@ -79,6 +79,7 @@ module Twilio
79
79
  @uri = "/Businesses/#{@solution[:sid]}"
80
80
 
81
81
  # Dependents
82
+ @brands = nil
82
83
  @insights = nil
83
84
  end
84
85
 
@@ -97,6 +98,24 @@ module Twilio
97
98
  BusinessInstance.new(@version, payload, sid: @solution[:sid], )
98
99
  end
99
100
 
101
+ ##
102
+ # Access the brands
103
+ # @return [BrandList]
104
+ # @return [BrandContext] if sid was passed.
105
+ def brands(sid=:unset)
106
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
107
+
108
+ if sid != :unset
109
+ return BrandContext.new(@version, @solution[:sid], sid, )
110
+ end
111
+
112
+ unless @brands
113
+ @brands = BrandList.new(@version, business_sid: @solution[:sid], )
114
+ end
115
+
116
+ @brands
117
+ end
118
+
100
119
  ##
101
120
  # Access the insights
102
121
  # @return [InsightsList]
@@ -192,6 +211,13 @@ module Twilio
192
211
  context.fetch
193
212
  end
194
213
 
214
+ ##
215
+ # Access the brands
216
+ # @return [brands] brands
217
+ def brands
218
+ context.brands
219
+ end
220
+
195
221
  ##
196
222
  # Access the insights
197
223
  # @return [insights] insights
@@ -0,0 +1,239 @@
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 a BrandInstance
89
+ # @return [BrandInstance] Fetched BrandInstance
90
+ def fetch
91
+ params = Twilio::Values.of({})
92
+
93
+ payload = @version.fetch(
94
+ 'GET',
95
+ @uri,
96
+ params,
97
+ )
98
+
99
+ BrandInstance.new(@version, payload, business_sid: @solution[:business_sid], sid: @solution[:sid], )
100
+ end
101
+
102
+ ##
103
+ # Access the branded_channels
104
+ # @return [BrandedChannelList]
105
+ # @return [BrandedChannelContext] if sid was passed.
106
+ def branded_channels(sid=:unset)
107
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
108
+
109
+ if sid != :unset
110
+ return BrandedChannelContext.new(@version, @solution[:business_sid], @solution[:sid], sid, )
111
+ end
112
+
113
+ unless @branded_channels
114
+ @branded_channels = BrandedChannelList.new(
115
+ @version,
116
+ business_sid: @solution[:business_sid],
117
+ brand_sid: @solution[:sid],
118
+ )
119
+ end
120
+
121
+ @branded_channels
122
+ end
123
+
124
+ ##
125
+ # Provide a user friendly representation
126
+ def to_s
127
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
128
+ "#<Twilio.Preview.TrustedComms.BrandContext #{context}>"
129
+ end
130
+
131
+ ##
132
+ # Provide a detailed, user friendly representation
133
+ def inspect
134
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
135
+ "#<Twilio.Preview.TrustedComms.BrandContext #{context}>"
136
+ end
137
+ end
138
+
139
+ ##
140
+ # 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.
141
+ class BrandInstance < InstanceResource
142
+ ##
143
+ # Initialize the BrandInstance
144
+ # @param [Version] version Version that contains the resource
145
+ # @param [Hash] payload payload that contains response from Twilio
146
+ # @param [String] business_sid The unique SID identifier of the Business.
147
+ # @param [String] sid The unique SID identifier of the Brand.
148
+ # @return [BrandInstance] BrandInstance
149
+ def initialize(version, payload, business_sid: nil, sid: nil)
150
+ super(version)
151
+
152
+ # Marshaled Properties
153
+ @properties = {
154
+ 'account_sid' => payload['account_sid'],
155
+ 'business_sid' => payload['business_sid'],
156
+ 'sid' => payload['sid'],
157
+ 'links' => payload['links'],
158
+ 'url' => payload['url'],
159
+ }
160
+
161
+ # Context
162
+ @instance_context = nil
163
+ @params = {'business_sid' => business_sid, 'sid' => sid || @properties['sid'], }
164
+ end
165
+
166
+ ##
167
+ # Generate an instance context for the instance, the context is capable of
168
+ # performing various actions. All instance actions are proxied to the context
169
+ # @return [BrandContext] BrandContext for this BrandInstance
170
+ def context
171
+ unless @instance_context
172
+ @instance_context = BrandContext.new(@version, @params['business_sid'], @params['sid'], )
173
+ end
174
+ @instance_context
175
+ end
176
+
177
+ ##
178
+ # @return [String] Account Sid.
179
+ def account_sid
180
+ @properties['account_sid']
181
+ end
182
+
183
+ ##
184
+ # @return [String] Business Sid.
185
+ def business_sid
186
+ @properties['business_sid']
187
+ end
188
+
189
+ ##
190
+ # @return [String] Brand Sid.
191
+ def sid
192
+ @properties['sid']
193
+ end
194
+
195
+ ##
196
+ # @return [String] Nested resource URLs.
197
+ def links
198
+ @properties['links']
199
+ end
200
+
201
+ ##
202
+ # @return [String] The URL of this resource.
203
+ def url
204
+ @properties['url']
205
+ end
206
+
207
+ ##
208
+ # Fetch a BrandInstance
209
+ # @return [BrandInstance] Fetched BrandInstance
210
+ def fetch
211
+ context.fetch
212
+ end
213
+
214
+ ##
215
+ # Access the branded_channels
216
+ # @return [branded_channels] branded_channels
217
+ def branded_channels
218
+ context.branded_channels
219
+ end
220
+
221
+ ##
222
+ # Provide a user friendly representation
223
+ def to_s
224
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
225
+ "<Twilio.Preview.TrustedComms.BrandInstance #{values}>"
226
+ end
227
+
228
+ ##
229
+ # Provide a detailed, user friendly representation
230
+ def inspect
231
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
232
+ "<Twilio.Preview.TrustedComms.BrandInstance #{values}>"
233
+ end
234
+ end
235
+ end
236
+ end
237
+ end
238
+ end
239
+ end
@@ -0,0 +1,266 @@
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
+ class BrandContext < InstanceContext
15
+ ##
16
+ # 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.
17
+ class BrandedChannelList < ListResource
18
+ ##
19
+ # Initialize the BrandedChannelList
20
+ # @param [Version] version Version that contains the resource
21
+ # @param [String] business_sid The unique SID identifier of the Business.
22
+ # @param [String] brand_sid The unique SID identifier of the Brand.
23
+ # @return [BrandedChannelList] BrandedChannelList
24
+ def initialize(version, business_sid: nil, brand_sid: nil)
25
+ super(version)
26
+
27
+ # Path Solution
28
+ @solution = {business_sid: business_sid, brand_sid: brand_sid}
29
+ end
30
+
31
+ ##
32
+ # Provide a user friendly representation
33
+ def to_s
34
+ '#<Twilio.Preview.TrustedComms.BrandedChannelList>'
35
+ end
36
+ end
37
+
38
+ ##
39
+ # 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.
40
+ class BrandedChannelPage < Page
41
+ ##
42
+ # Initialize the BrandedChannelPage
43
+ # @param [Version] version Version that contains the resource
44
+ # @param [Response] response Response from the API
45
+ # @param [Hash] solution Path solution for the resource
46
+ # @return [BrandedChannelPage] BrandedChannelPage
47
+ def initialize(version, response, solution)
48
+ super(version, response)
49
+
50
+ # Path Solution
51
+ @solution = solution
52
+ end
53
+
54
+ ##
55
+ # Build an instance of BrandedChannelInstance
56
+ # @param [Hash] payload Payload response from the API
57
+ # @return [BrandedChannelInstance] BrandedChannelInstance
58
+ def get_instance(payload)
59
+ BrandedChannelInstance.new(
60
+ @version,
61
+ payload,
62
+ business_sid: @solution[:business_sid],
63
+ brand_sid: @solution[:brand_sid],
64
+ )
65
+ end
66
+
67
+ ##
68
+ # Provide a user friendly representation
69
+ def to_s
70
+ '<Twilio.Preview.TrustedComms.BrandedChannelPage>'
71
+ end
72
+ end
73
+
74
+ ##
75
+ # 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.
76
+ class BrandedChannelContext < InstanceContext
77
+ ##
78
+ # Initialize the BrandedChannelContext
79
+ # @param [Version] version Version that contains the resource
80
+ # @param [String] business_sid The unique SID identifier of the Business.
81
+ # @param [String] brand_sid The unique SID identifier of the Brand.
82
+ # @param [String] sid The unique SID identifier of the Branded Channel.
83
+ # @return [BrandedChannelContext] BrandedChannelContext
84
+ def initialize(version, business_sid, brand_sid, sid)
85
+ super(version)
86
+
87
+ # Path Solution
88
+ @solution = {business_sid: business_sid, brand_sid: brand_sid, sid: sid, }
89
+ @uri = "/Businesses/#{@solution[:business_sid]}/Brands/#{@solution[:brand_sid]}/BrandedChannels/#{@solution[:sid]}"
90
+
91
+ # Dependents
92
+ @channels = nil
93
+ end
94
+
95
+ ##
96
+ # Fetch a BrandedChannelInstance
97
+ # @return [BrandedChannelInstance] Fetched BrandedChannelInstance
98
+ def fetch
99
+ params = Twilio::Values.of({})
100
+
101
+ payload = @version.fetch(
102
+ 'GET',
103
+ @uri,
104
+ params,
105
+ )
106
+
107
+ BrandedChannelInstance.new(
108
+ @version,
109
+ payload,
110
+ business_sid: @solution[:business_sid],
111
+ brand_sid: @solution[:brand_sid],
112
+ sid: @solution[:sid],
113
+ )
114
+ end
115
+
116
+ ##
117
+ # Access the channels
118
+ # @return [ChannelList]
119
+ # @return [ChannelContext]
120
+ def channels
121
+ unless @channels
122
+ @channels = ChannelList.new(
123
+ @version,
124
+ business_sid: @solution[:business_sid],
125
+ brand_sid: @solution[:brand_sid],
126
+ branded_channel_sid: @solution[:sid],
127
+ )
128
+ end
129
+
130
+ @channels
131
+ end
132
+
133
+ ##
134
+ # Provide a user friendly representation
135
+ def to_s
136
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
137
+ "#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
138
+ end
139
+
140
+ ##
141
+ # Provide a detailed, user friendly representation
142
+ def inspect
143
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
144
+ "#<Twilio.Preview.TrustedComms.BrandedChannelContext #{context}>"
145
+ end
146
+ end
147
+
148
+ ##
149
+ # 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.
150
+ class BrandedChannelInstance < InstanceResource
151
+ ##
152
+ # Initialize the BrandedChannelInstance
153
+ # @param [Version] version Version that contains the resource
154
+ # @param [Hash] payload payload that contains response from Twilio
155
+ # @param [String] business_sid The unique SID identifier of the Business.
156
+ # @param [String] brand_sid The unique SID identifier of the Brand.
157
+ # @param [String] sid The unique SID identifier of the Branded Channel.
158
+ # @return [BrandedChannelInstance] BrandedChannelInstance
159
+ def initialize(version, payload, business_sid: nil, brand_sid: nil, sid: nil)
160
+ super(version)
161
+
162
+ # Marshaled Properties
163
+ @properties = {
164
+ 'account_sid' => payload['account_sid'],
165
+ 'business_sid' => payload['business_sid'],
166
+ 'brand_sid' => payload['brand_sid'],
167
+ 'sid' => payload['sid'],
168
+ 'links' => payload['links'],
169
+ 'url' => payload['url'],
170
+ }
171
+
172
+ # Context
173
+ @instance_context = nil
174
+ @params = {
175
+ 'business_sid' => business_sid,
176
+ 'brand_sid' => brand_sid,
177
+ 'sid' => sid || @properties['sid'],
178
+ }
179
+ end
180
+
181
+ ##
182
+ # Generate an instance context for the instance, the context is capable of
183
+ # performing various actions. All instance actions are proxied to the context
184
+ # @return [BrandedChannelContext] BrandedChannelContext for this BrandedChannelInstance
185
+ def context
186
+ unless @instance_context
187
+ @instance_context = BrandedChannelContext.new(
188
+ @version,
189
+ @params['business_sid'],
190
+ @params['brand_sid'],
191
+ @params['sid'],
192
+ )
193
+ end
194
+ @instance_context
195
+ end
196
+
197
+ ##
198
+ # @return [String] Account Sid.
199
+ def account_sid
200
+ @properties['account_sid']
201
+ end
202
+
203
+ ##
204
+ # @return [String] Business Sid.
205
+ def business_sid
206
+ @properties['business_sid']
207
+ end
208
+
209
+ ##
210
+ # @return [String] Brand Sid.
211
+ def brand_sid
212
+ @properties['brand_sid']
213
+ end
214
+
215
+ ##
216
+ # @return [String] Branded Channel Sid.
217
+ def sid
218
+ @properties['sid']
219
+ end
220
+
221
+ ##
222
+ # @return [String] Nested resource URLs.
223
+ def links
224
+ @properties['links']
225
+ end
226
+
227
+ ##
228
+ # @return [String] The URL of this resource.
229
+ def url
230
+ @properties['url']
231
+ end
232
+
233
+ ##
234
+ # Fetch a BrandedChannelInstance
235
+ # @return [BrandedChannelInstance] Fetched BrandedChannelInstance
236
+ def fetch
237
+ context.fetch
238
+ end
239
+
240
+ ##
241
+ # Access the channels
242
+ # @return [channels] channels
243
+ def channels
244
+ context.channels
245
+ end
246
+
247
+ ##
248
+ # Provide a user friendly representation
249
+ def to_s
250
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
251
+ "<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
252
+ end
253
+
254
+ ##
255
+ # Provide a detailed, user friendly representation
256
+ def inspect
257
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
258
+ "<Twilio.Preview.TrustedComms.BrandedChannelInstance #{values}>"
259
+ end
260
+ end
261
+ end
262
+ end
263
+ end
264
+ end
265
+ end
266
+ end