twilio-ruby 5.34.0 → 5.38.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.
- checksums.yaml +4 -4
- data/CHANGES.md +126 -0
- data/README.md +24 -3
- data/lib/twilio-ruby.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +87 -87
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +14 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +47 -9
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +71 -71
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +29 -29
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +12 -12
- data/lib/twilio-ruby/rest/autopilot.rb +6 -0
- data/lib/twilio-ruby/rest/autopilot/v1.rb +7 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -16
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +12 -3
- data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +198 -0
- data/lib/twilio-ruby/rest/client.rb +35 -15
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +28 -3
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +27 -4
- data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +2 -1
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +7 -0
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +6 -3
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +8 -8
- data/lib/twilio-ruby/rest/notify/v1/service.rb +20 -1
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +26 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +324 -0
- data/lib/twilio-ruby/rest/preview.rb +6 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +7 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/brands_information.rb +193 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +26 -0
- data/lib/twilio-ruby/rest/{autopilot/v1/assistant/export_assistant.rb → preview/trusted_comms/business/brand.rb} +88 -71
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +266 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +194 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +7 -0
- data/lib/twilio-ruby/rest/supersim.rb +18 -0
- data/lib/twilio-ruby/rest/supersim/v1.rb +30 -0
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +63 -16
- data/lib/twilio-ruby/rest/supersim/v1/network.rb +315 -0
- data/lib/twilio-ruby/rest/{authy/v1/service.rb → supersim/v1/network_access_profile.rb} +95 -121
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +352 -0
- data/lib/twilio-ruby/rest/verify.rb +9 -0
- data/lib/twilio-ruby/rest/verify/v2.rb +16 -0
- data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/form.rb +8 -8
- data/lib/twilio-ruby/rest/verify/v2/service.rb +74 -3
- data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity.rb +32 -8
- data/lib/twilio-ruby/rest/verify/v2/service/entity/access_token.rb +141 -0
- data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity/factor.rb +8 -8
- data/lib/twilio-ruby/rest/{authy/v1 → verify/v2}/service/entity/factor/challenge.rb +8 -8
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +425 -0
- data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +8 -4
- data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +8 -4
- data/lib/twilio-ruby/rest/voice.rb +36 -0
- data/lib/twilio-ruby/rest/voice/v1.rb +64 -0
- data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +513 -0
- data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +379 -0
- data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +458 -0
- data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +366 -0
- data/lib/twilio-ruby/rest/voice/v1/source_ip_mapping.rb +346 -0
- data/lib/twilio-ruby/util/configuration.rb +9 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call_spec.rb +5 -5
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +177 -0
- data/spec/integration/api/v2010/account/conference_spec.rb +42 -14
- data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +8 -14
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +12 -4
- data/spec/integration/api/v2010/account/token_spec.rb +23 -11
- data/spec/integration/api/v2010/account/validation_request_spec.rb +1 -1
- data/spec/integration/autopilot/v1/assistant/query_spec.rb +4 -4
- data/spec/integration/autopilot/v1/assistant_spec.rb +4 -8
- data/spec/integration/autopilot/v1/restore_assistant_spec.rb +53 -0
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +7 -0
- data/spec/integration/conversations/v1/conversation_spec.rb +16 -0
- data/spec/integration/flex_api/v1/configuration_spec.rb +3 -0
- data/spec/integration/numbers/v2/regulatory_compliance/bundle/evaluation_spec.rb +623 -0
- data/spec/integration/numbers/v2/regulatory_compliance/bundle_spec.rb +4 -0
- data/spec/integration/preview/trusted_comms/brands_information_spec.rb +44 -0
- data/spec/integration/preview/trusted_comms/business/brand/branded_channel/channel_spec.rb +54 -0
- data/spec/integration/preview/trusted_comms/business/brand/branded_channel_spec.rb +52 -0
- data/spec/integration/preview/trusted_comms/business/brand_spec.rb +49 -0
- data/spec/integration/preview/trusted_comms/business_spec.rb +1 -0
- data/spec/integration/serverless/v1/service/environment/log_spec.rb +1 -0
- data/spec/integration/supersim/v1/fleet_spec.rb +16 -7
- data/spec/integration/supersim/v1/network_access_profile/network_access_profile_network_spec.rb +179 -0
- data/spec/integration/supersim/v1/network_access_profile_spec.rb +223 -0
- data/spec/integration/supersim/v1/network_spec.rb +139 -0
- data/spec/integration/supersim/v1/sim_spec.rb +78 -6
- data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +13 -13
- data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +23 -23
- data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
- data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +17 -17
- data/spec/integration/trunking/v1/trunk_spec.rb +33 -33
- data/spec/integration/{authy/v1 → verify/v2}/form_spec.rb +4 -4
- data/spec/integration/verify/v2/service/entity/access_token_spec.rb +46 -0
- data/spec/integration/{authy/v1 → verify/v2}/service/entity/factor/challenge_spec.rb +73 -73
- data/spec/integration/{authy/v1 → verify/v2}/service/entity/factor_spec.rb +54 -54
- data/spec/integration/verify/v2/service/entity_spec.rb +204 -0
- data/spec/integration/verify/v2/service/webhook_spec.rb +262 -0
- data/spec/integration/verify/v2/service_spec.rb +32 -4
- data/spec/integration/voice/v1/byoc_trunk_spec.rb +250 -0
- data/spec/integration/voice/v1/connection_policy/connection_policy_target_spec.rb +246 -0
- data/spec/integration/voice/v1/connection_policy_spec.rb +226 -0
- data/spec/integration/voice/v1/ip_record_spec.rb +223 -0
- data/spec/integration/voice/v1/source_ip_mapping_spec.rb +219 -0
- data/spec/rest/client_spec.rb +168 -58
- data/spec/util/configuration_spec.rb +12 -0
- data/twilio-ruby.gemspec +1 -1
- metadata +63 -23
- data/lib/twilio-ruby/rest/authy.rb +0 -55
- data/lib/twilio-ruby/rest/authy/v1.rb +0 -59
- data/spec/integration/authy/v1/service/entity_spec.rb +0 -201
- data/spec/integration/authy/v1/service_spec.rb +0 -231
- 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
|
12
|
-
class
|
13
|
-
class
|
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
|
16
|
+
class BrandList < ListResource
|
17
17
|
##
|
18
|
-
# Initialize the
|
18
|
+
# Initialize the BrandList
|
19
19
|
# @param [Version] version Version that contains the resource
|
20
|
-
# @param [String]
|
21
|
-
#
|
22
|
-
|
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 = {
|
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.
|
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
|
38
|
+
class BrandPage < Page
|
40
39
|
##
|
41
|
-
# Initialize the
|
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 [
|
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
|
53
|
+
# Build an instance of BrandInstance
|
55
54
|
# @param [Hash] payload Payload response from the API
|
56
|
-
# @return [
|
55
|
+
# @return [BrandInstance] BrandInstance
|
57
56
|
def get_instance(payload)
|
58
|
-
|
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.
|
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
|
69
|
+
class BrandContext < InstanceContext
|
71
70
|
##
|
72
|
-
# Initialize the
|
71
|
+
# Initialize the BrandContext
|
73
72
|
# @param [Version] version Version that contains the resource
|
74
|
-
# @param [String]
|
75
|
-
#
|
76
|
-
# @return [
|
77
|
-
def initialize(version,
|
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 = {
|
82
|
-
@uri = "/
|
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
|
87
|
-
# @return [
|
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
|
-
|
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.
|
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.
|
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
|
141
|
+
class BrandInstance < InstanceResource
|
118
142
|
##
|
119
|
-
# Initialize the
|
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]
|
123
|
-
#
|
124
|
-
# @return [
|
125
|
-
def initialize(version, payload,
|
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
|
-
'
|
132
|
-
'
|
133
|
-
'
|
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 = {'
|
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 [
|
169
|
+
# @return [BrandContext] BrandContext for this BrandInstance
|
148
170
|
def context
|
149
171
|
unless @instance_context
|
150
|
-
@instance_context =
|
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]
|
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]
|
163
|
-
def
|
164
|
-
@properties['
|
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 [
|
175
|
-
def
|
176
|
-
@properties['
|
190
|
+
# @return [String] Brand Sid.
|
191
|
+
def sid
|
192
|
+
@properties['sid']
|
177
193
|
end
|
178
194
|
|
179
195
|
##
|
180
|
-
# @return [String]
|
181
|
-
def
|
182
|
-
@properties['
|
196
|
+
# @return [String] Nested resource URLs.
|
197
|
+
def links
|
198
|
+
@properties['links']
|
183
199
|
end
|
184
200
|
|
185
201
|
##
|
186
|
-
# @return [String] The
|
202
|
+
# @return [String] The URL of this resource.
|
187
203
|
def url
|
188
204
|
@properties['url']
|
189
205
|
end
|
190
206
|
|
191
207
|
##
|
192
|
-
#
|
193
|
-
|
194
|
-
|
208
|
+
# Fetch a BrandInstance
|
209
|
+
# @return [BrandInstance] Fetched BrandInstance
|
210
|
+
def fetch
|
211
|
+
context.fetch
|
195
212
|
end
|
196
213
|
|
197
214
|
##
|
198
|
-
#
|
199
|
-
# @return [
|
200
|
-
def
|
201
|
-
context.
|
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.
|
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.
|
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
|