twilio-ruby 5.34.0 → 5.38.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +126 -0
  3. data/README.md +24 -3
  4. data/lib/twilio-ruby.rb +1 -1
  5. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +87 -87
  6. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +14 -0
  7. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +47 -9
  8. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +71 -71
  9. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +29 -29
  10. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
  11. data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +12 -12
  12. data/lib/twilio-ruby/rest/autopilot.rb +6 -0
  13. data/lib/twilio-ruby/rest/autopilot/v1.rb +7 -0
  14. data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -16
  15. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +12 -3
  16. data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +198 -0
  17. data/lib/twilio-ruby/rest/client.rb +35 -15
  18. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +28 -3
  19. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +27 -4
  20. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +2 -1
  21. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
  22. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +6 -3
  23. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +8 -8
  24. data/lib/twilio-ruby/rest/notify/v1/service.rb +20 -1
  25. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +26 -0
  26. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +324 -0
  27. data/lib/twilio-ruby/rest/preview.rb +6 -0
  28. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +7 -0
  29. data/lib/twilio-ruby/rest/preview/trusted_comms/brands_information.rb +193 -0
  30. data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +26 -0
  31. data/lib/twilio-ruby/rest/{autopilot/v1/assistant/export_assistant.rb → preview/trusted_comms/business/brand.rb} +88 -71
  32. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +266 -0
  33. data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +194 -0
  34. data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +7 -0
  35. data/lib/twilio-ruby/rest/supersim.rb +18 -0
  36. data/lib/twilio-ruby/rest/supersim/v1.rb +30 -0
  37. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +63 -16
  38. data/lib/twilio-ruby/rest/supersim/v1/network.rb +315 -0
  39. data/lib/twilio-ruby/rest/{authy/v1/service.rb → supersim/v1/network_access_profile.rb} +95 -121
  40. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +352 -0
  41. data/lib/twilio-ruby/rest/verify.rb +9 -0
  42. data/lib/twilio-ruby/rest/verify/v2.rb +16 -0
  43. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/form.rb +8 -8
  44. data/lib/twilio-ruby/rest/verify/v2/service.rb +74 -3
  45. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity.rb +32 -8
  46. data/lib/twilio-ruby/rest/verify/v2/service/entity/access_token.rb +141 -0
  47. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity/factor.rb +8 -8
  48. data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity/factor/challenge.rb +8 -8
  49. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
  50. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +425 -0
  51. data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +8 -4
  52. data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +8 -4
  53. data/lib/twilio-ruby/rest/voice.rb +36 -0
  54. data/lib/twilio-ruby/rest/voice/v1.rb +64 -0
  55. data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +513 -0
  56. data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +379 -0
  57. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +458 -0
  58. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +366 -0
  59. data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +346 -0
  60. data/lib/twilio-ruby/util/configuration.rb +9 -1
  61. data/lib/twilio-ruby/version.rb +1 -1
  62. data/spec/integration/api/v2010/account/call_spec.rb +5 -5
  63. data/spec/integration/api/v2010/account/conference/participant_spec.rb +177 -0
  64. data/spec/integration/api/v2010/account/conference_spec.rb +42 -14
  65. data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +8 -14
  66. data/spec/integration/api/v2010/account/sip/domain_spec.rb +12 -4
  67. data/spec/integration/api/v2010/account/token_spec.rb +23 -11
  68. data/spec/integration/api/v2010/account/validation_request_spec.rb +1 -1
  69. data/spec/integration/autopilot/v1/assistant/query_spec.rb +4 -4
  70. data/spec/integration/autopilot/v1/assistant_spec.rb +4 -8
  71. data/spec/integration/autopilot/v1/restore_assistant_spec.rb +53 -0
  72. data/spec/integration/conversations/v1/conversation/participant_spec.rb +7 -0
  73. data/spec/integration/conversations/v1/conversation_spec.rb +16 -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/trusted_comms/brands_information_spec.rb +44 -0
  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/environment/log_spec.rb +1 -0
  83. data/spec/integration/supersim/v1/fleet_spec.rb +16 -7
  84. data/spec/integration/supersim/v1/network_access_profile/network_access_profile_network_spec.rb +179 -0
  85. data/spec/integration/supersim/v1/network_access_profile_spec.rb +223 -0
  86. data/spec/integration/supersim/v1/network_spec.rb +139 -0
  87. data/spec/integration/supersim/v1/sim_spec.rb +78 -6
  88. data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +13 -13
  89. data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +23 -23
  90. data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
  91. data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +17 -17
  92. data/spec/integration/trunking/v1/trunk_spec.rb +33 -33
  93. data/spec/integration/{authy/v1 → verify/v2}/form_spec.rb +4 -4
  94. data/spec/integration/verify/v2/service/entity/access_token_spec.rb +46 -0
  95. data/spec/integration/{authy/v1 → verify/v2}/service/entity/factor/challenge_spec.rb +73 -73
  96. data/spec/integration/{authy/v1 → verify/v2}/service/entity/factor_spec.rb +54 -54
  97. data/spec/integration/verify/v2/service/entity_spec.rb +204 -0
  98. data/spec/integration/verify/v2/service/webhook_spec.rb +262 -0
  99. data/spec/integration/verify/v2/service_spec.rb +32 -4
  100. data/spec/integration/voice/v1/byoc_trunk_spec.rb +250 -0
  101. data/spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb +246 -0
  102. data/spec/integration/voice/v1/connection_policy_spec.rb +226 -0
  103. data/spec/integration/voice/v1/ip_record_spec.rb +223 -0
  104. data/spec/integration/voice/v1/source_ip_mapping_spec.rb +219 -0
  105. data/spec/rest/client_spec.rb +168 -58
  106. data/spec/util/configuration_spec.rb +12 -0
  107. data/twilio-ruby.gemspec +1 -1
  108. metadata +63 -23
  109. data/lib/twilio-ruby/rest/authy.rb +0 -55
  110. data/lib/twilio-ruby/rest/authy/v1.rb +0 -59
  111. data/spec/integration/authy/v1/service/entity_spec.rb +0 -201
  112. data/spec/integration/authy/v1/service_spec.rb +0 -231
  113. data/spec/integration/autopilot/v1/assistant/export_assistant_spec.rb +0 -49
@@ -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
@@ -8,41 +8,40 @@
8
8
 
9
9
  module Twilio
10
10
  module REST
11
- class Autopilot < Domain
12
- class V1 < Version
13
- class AssistantContext < InstanceContext
11
+ class Preview < Domain
12
+ class TrustedComms < Version
13
+ class BusinessContext < InstanceContext
14
14
  ##
15
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 ExportAssistantList < ListResource
16
+ class BrandList < ListResource
17
17
  ##
18
- # Initialize the ExportAssistantList
18
+ # Initialize the BrandList
19
19
  # @param [Version] version Version that contains the resource
20
- # @param [String] assistant_sid The SID of the
21
- # [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) to export.
22
- # @return [ExportAssistantList] ExportAssistantList
23
- def initialize(version, assistant_sid: nil)
20
+ # @param [String] business_sid The unique SID identifier of the Business.
21
+ # @return [BrandList] BrandList
22
+ def initialize(version, business_sid: nil)
24
23
  super(version)
25
24
 
26
25
  # Path Solution
27
- @solution = {assistant_sid: assistant_sid}
26
+ @solution = {business_sid: business_sid}
28
27
  end
29
28
 
30
29
  ##
31
30
  # Provide a user friendly representation
32
31
  def to_s
33
- '#<Twilio.Autopilot.V1.ExportAssistantList>'
32
+ '#<Twilio.Preview.TrustedComms.BrandList>'
34
33
  end
35
34
  end
36
35
 
37
36
  ##
38
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.
39
- class ExportAssistantPage < Page
38
+ class BrandPage < Page
40
39
  ##
41
- # Initialize the ExportAssistantPage
40
+ # Initialize the BrandPage
42
41
  # @param [Version] version Version that contains the resource
43
42
  # @param [Response] response Response from the API
44
43
  # @param [Hash] solution Path solution for the resource
45
- # @return [ExportAssistantPage] ExportAssistantPage
44
+ # @return [BrandPage] BrandPage
46
45
  def initialize(version, response, solution)
47
46
  super(version, response)
48
47
 
@@ -51,40 +50,43 @@ module Twilio
51
50
  end
52
51
 
53
52
  ##
54
- # Build an instance of ExportAssistantInstance
53
+ # Build an instance of BrandInstance
55
54
  # @param [Hash] payload Payload response from the API
56
- # @return [ExportAssistantInstance] ExportAssistantInstance
55
+ # @return [BrandInstance] BrandInstance
57
56
  def get_instance(payload)
58
- ExportAssistantInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
57
+ BrandInstance.new(@version, payload, business_sid: @solution[:business_sid], )
59
58
  end
60
59
 
61
60
  ##
62
61
  # Provide a user friendly representation
63
62
  def to_s
64
- '<Twilio.Autopilot.V1.ExportAssistantPage>'
63
+ '<Twilio.Preview.TrustedComms.BrandPage>'
65
64
  end
66
65
  end
67
66
 
68
67
  ##
69
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.
70
- class ExportAssistantContext < InstanceContext
69
+ class BrandContext < InstanceContext
71
70
  ##
72
- # Initialize the ExportAssistantContext
71
+ # Initialize the BrandContext
73
72
  # @param [Version] version Version that contains the resource
74
- # @param [String] assistant_sid The SID of the
75
- # [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) to export.
76
- # @return [ExportAssistantContext] ExportAssistantContext
77
- def initialize(version, assistant_sid)
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)
78
77
  super(version)
79
78
 
80
79
  # Path Solution
81
- @solution = {assistant_sid: assistant_sid, }
82
- @uri = "/Assistants/#{@solution[:assistant_sid]}/Export"
80
+ @solution = {business_sid: business_sid, sid: sid, }
81
+ @uri = "/Businesses/#{@solution[:business_sid]}/Brands/#{@solution[:sid]}"
82
+
83
+ # Dependents
84
+ @branded_channels = nil
83
85
  end
84
86
 
85
87
  ##
86
- # Fetch a ExportAssistantInstance
87
- # @return [ExportAssistantInstance] Fetched ExportAssistantInstance
88
+ # Fetch a BrandInstance
89
+ # @return [BrandInstance] Fetched BrandInstance
88
90
  def fetch
89
91
  params = Twilio::Values.of({})
90
92
 
@@ -94,125 +96,140 @@ module Twilio
94
96
  params,
95
97
  )
96
98
 
97
- ExportAssistantInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
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
98
122
  end
99
123
 
100
124
  ##
101
125
  # Provide a user friendly representation
102
126
  def to_s
103
127
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
104
- "#<Twilio.Autopilot.V1.ExportAssistantContext #{context}>"
128
+ "#<Twilio.Preview.TrustedComms.BrandContext #{context}>"
105
129
  end
106
130
 
107
131
  ##
108
132
  # Provide a detailed, user friendly representation
109
133
  def inspect
110
134
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
111
- "#<Twilio.Autopilot.V1.ExportAssistantContext #{context}>"
135
+ "#<Twilio.Preview.TrustedComms.BrandContext #{context}>"
112
136
  end
113
137
  end
114
138
 
115
139
  ##
116
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.
117
- class ExportAssistantInstance < InstanceResource
141
+ class BrandInstance < InstanceResource
118
142
  ##
119
- # Initialize the ExportAssistantInstance
143
+ # Initialize the BrandInstance
120
144
  # @param [Version] version Version that contains the resource
121
145
  # @param [Hash] payload payload that contains response from Twilio
122
- # @param [String] assistant_sid The SID of the
123
- # [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) to export.
124
- # @return [ExportAssistantInstance] ExportAssistantInstance
125
- def initialize(version, payload, assistant_sid: nil)
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)
126
150
  super(version)
127
151
 
128
152
  # Marshaled Properties
129
153
  @properties = {
130
154
  'account_sid' => payload['account_sid'],
131
- 'assistant_sid' => payload['assistant_sid'],
132
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
133
- 'status' => payload['status'],
134
- 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
155
+ 'business_sid' => payload['business_sid'],
156
+ 'sid' => payload['sid'],
157
+ 'links' => payload['links'],
135
158
  'url' => payload['url'],
136
- 'schema' => payload['schema'],
137
159
  }
138
160
 
139
161
  # Context
140
162
  @instance_context = nil
141
- @params = {'assistant_sid' => assistant_sid, }
163
+ @params = {'business_sid' => business_sid, 'sid' => sid || @properties['sid'], }
142
164
  end
143
165
 
144
166
  ##
145
167
  # Generate an instance context for the instance, the context is capable of
146
168
  # performing various actions. All instance actions are proxied to the context
147
- # @return [ExportAssistantContext] ExportAssistantContext for this ExportAssistantInstance
169
+ # @return [BrandContext] BrandContext for this BrandInstance
148
170
  def context
149
171
  unless @instance_context
150
- @instance_context = ExportAssistantContext.new(@version, @params['assistant_sid'], )
172
+ @instance_context = BrandContext.new(@version, @params['business_sid'], @params['sid'], )
151
173
  end
152
174
  @instance_context
153
175
  end
154
176
 
155
177
  ##
156
- # @return [String] The SID of the Account that created the resource
178
+ # @return [String] Account Sid.
157
179
  def account_sid
158
180
  @properties['account_sid']
159
181
  end
160
182
 
161
183
  ##
162
- # @return [String] The SID of the Assistant to export.
163
- def assistant_sid
164
- @properties['assistant_sid']
165
- end
166
-
167
- ##
168
- # @return [Time] The RFC 2822 date and time in GMT when the resource was created
169
- def date_created
170
- @properties['date_created']
184
+ # @return [String] Business Sid.
185
+ def business_sid
186
+ @properties['business_sid']
171
187
  end
172
188
 
173
189
  ##
174
- # @return [export_assistant.Status] The status of the export
175
- def status
176
- @properties['status']
190
+ # @return [String] Brand Sid.
191
+ def sid
192
+ @properties['sid']
177
193
  end
178
194
 
179
195
  ##
180
- # @return [String] More information about why the export failed, if `status` is `failed`
181
- def error_code
182
- @properties['error_code']
196
+ # @return [String] Nested resource URLs.
197
+ def links
198
+ @properties['links']
183
199
  end
184
200
 
185
201
  ##
186
- # @return [String] The absolute URL of the Export resource.
202
+ # @return [String] The URL of this resource.
187
203
  def url
188
204
  @properties['url']
189
205
  end
190
206
 
191
207
  ##
192
- # @return [Hash] The JSON string that describes the requested Assistant.
193
- def schema
194
- @properties['schema']
208
+ # Fetch a BrandInstance
209
+ # @return [BrandInstance] Fetched BrandInstance
210
+ def fetch
211
+ context.fetch
195
212
  end
196
213
 
197
214
  ##
198
- # Fetch a ExportAssistantInstance
199
- # @return [ExportAssistantInstance] Fetched ExportAssistantInstance
200
- def fetch
201
- context.fetch
215
+ # Access the branded_channels
216
+ # @return [branded_channels] branded_channels
217
+ def branded_channels
218
+ context.branded_channels
202
219
  end
203
220
 
204
221
  ##
205
222
  # Provide a user friendly representation
206
223
  def to_s
207
224
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
208
- "<Twilio.Autopilot.V1.ExportAssistantInstance #{values}>"
225
+ "<Twilio.Preview.TrustedComms.BrandInstance #{values}>"
209
226
  end
210
227
 
211
228
  ##
212
229
  # Provide a detailed, user friendly representation
213
230
  def inspect
214
231
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
215
- "<Twilio.Autopilot.V1.ExportAssistantInstance #{values}>"
232
+ "<Twilio.Preview.TrustedComms.BrandInstance #{values}>"
216
233
  end
217
234
  end
218
235
  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