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
@@ -0,0 +1,315 @@
|
|
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 Supersim < Domain
|
12
|
+
class V1 < 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 NetworkList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the NetworkList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [NetworkList] NetworkList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/Networks"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Lists NetworkInstance records from the API as a list.
|
30
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
31
|
+
# memory before returning.
|
32
|
+
# @param [String] iso_country The [ISO country
|
33
|
+
# code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources
|
34
|
+
# to read.
|
35
|
+
# @param [String] mcc The 'mobile country code' of a country. Network resources
|
36
|
+
# with this `mcc` in their `identifiers` will be read.
|
37
|
+
# @param [String] mnc The 'mobile network code' of a mobile operator network.
|
38
|
+
# Network resources with this `mnc` in their `identifiers` will be read.
|
39
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
40
|
+
# guarantees to never return more than limit. Default is no limit
|
41
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
42
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
43
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
44
|
+
# efficient page size, i.e. min(limit, 1000)
|
45
|
+
# @return [Array] Array of up to limit results
|
46
|
+
def list(iso_country: :unset, mcc: :unset, mnc: :unset, limit: nil, page_size: nil)
|
47
|
+
self.stream(
|
48
|
+
iso_country: iso_country,
|
49
|
+
mcc: mcc,
|
50
|
+
mnc: mnc,
|
51
|
+
limit: limit,
|
52
|
+
page_size: page_size
|
53
|
+
).entries
|
54
|
+
end
|
55
|
+
|
56
|
+
##
|
57
|
+
# Streams NetworkInstance records from the API as an Enumerable.
|
58
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
59
|
+
# is reached.
|
60
|
+
# @param [String] iso_country The [ISO country
|
61
|
+
# code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources
|
62
|
+
# to read.
|
63
|
+
# @param [String] mcc The 'mobile country code' of a country. Network resources
|
64
|
+
# with this `mcc` in their `identifiers` will be read.
|
65
|
+
# @param [String] mnc The 'mobile network code' of a mobile operator network.
|
66
|
+
# Network resources with this `mnc` in their `identifiers` will be read.
|
67
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
68
|
+
# guarantees to never return more than limit. Default is no limit.
|
69
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
70
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
71
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
72
|
+
# efficient page size, i.e. min(limit, 1000)
|
73
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
74
|
+
def stream(iso_country: :unset, mcc: :unset, mnc: :unset, limit: nil, page_size: nil)
|
75
|
+
limits = @version.read_limits(limit, page_size)
|
76
|
+
|
77
|
+
page = self.page(iso_country: iso_country, mcc: mcc, mnc: mnc, page_size: limits[:page_size], )
|
78
|
+
|
79
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# When passed a block, yields NetworkInstance records from the API.
|
84
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
85
|
+
# is reached.
|
86
|
+
def each
|
87
|
+
limits = @version.read_limits
|
88
|
+
|
89
|
+
page = self.page(page_size: limits[:page_size], )
|
90
|
+
|
91
|
+
@version.stream(page,
|
92
|
+
limit: limits[:limit],
|
93
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
94
|
+
end
|
95
|
+
|
96
|
+
##
|
97
|
+
# Retrieve a single page of NetworkInstance records from the API.
|
98
|
+
# Request is executed immediately.
|
99
|
+
# @param [String] iso_country The [ISO country
|
100
|
+
# code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources
|
101
|
+
# to read.
|
102
|
+
# @param [String] mcc The 'mobile country code' of a country. Network resources
|
103
|
+
# with this `mcc` in their `identifiers` will be read.
|
104
|
+
# @param [String] mnc The 'mobile network code' of a mobile operator network.
|
105
|
+
# Network resources with this `mnc` in their `identifiers` will be read.
|
106
|
+
# @param [String] page_token PageToken provided by the API
|
107
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
108
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
109
|
+
# @return [Page] Page of NetworkInstance
|
110
|
+
def page(iso_country: :unset, mcc: :unset, mnc: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
111
|
+
params = Twilio::Values.of({
|
112
|
+
'IsoCountry' => iso_country,
|
113
|
+
'Mcc' => mcc,
|
114
|
+
'Mnc' => mnc,
|
115
|
+
'PageToken' => page_token,
|
116
|
+
'Page' => page_number,
|
117
|
+
'PageSize' => page_size,
|
118
|
+
})
|
119
|
+
response = @version.page(
|
120
|
+
'GET',
|
121
|
+
@uri,
|
122
|
+
params
|
123
|
+
)
|
124
|
+
NetworkPage.new(@version, response, @solution)
|
125
|
+
end
|
126
|
+
|
127
|
+
##
|
128
|
+
# Retrieve a single page of NetworkInstance records from the API.
|
129
|
+
# Request is executed immediately.
|
130
|
+
# @param [String] target_url API-generated URL for the requested results page
|
131
|
+
# @return [Page] Page of NetworkInstance
|
132
|
+
def get_page(target_url)
|
133
|
+
response = @version.domain.request(
|
134
|
+
'GET',
|
135
|
+
target_url
|
136
|
+
)
|
137
|
+
NetworkPage.new(@version, response, @solution)
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Provide a user friendly representation
|
142
|
+
def to_s
|
143
|
+
'#<Twilio.Supersim.V1.NetworkList>'
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
##
|
148
|
+
# 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.
|
149
|
+
class NetworkPage < Page
|
150
|
+
##
|
151
|
+
# Initialize the NetworkPage
|
152
|
+
# @param [Version] version Version that contains the resource
|
153
|
+
# @param [Response] response Response from the API
|
154
|
+
# @param [Hash] solution Path solution for the resource
|
155
|
+
# @return [NetworkPage] NetworkPage
|
156
|
+
def initialize(version, response, solution)
|
157
|
+
super(version, response)
|
158
|
+
|
159
|
+
# Path Solution
|
160
|
+
@solution = solution
|
161
|
+
end
|
162
|
+
|
163
|
+
##
|
164
|
+
# Build an instance of NetworkInstance
|
165
|
+
# @param [Hash] payload Payload response from the API
|
166
|
+
# @return [NetworkInstance] NetworkInstance
|
167
|
+
def get_instance(payload)
|
168
|
+
NetworkInstance.new(@version, payload, )
|
169
|
+
end
|
170
|
+
|
171
|
+
##
|
172
|
+
# Provide a user friendly representation
|
173
|
+
def to_s
|
174
|
+
'<Twilio.Supersim.V1.NetworkPage>'
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
##
|
179
|
+
# 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.
|
180
|
+
class NetworkContext < InstanceContext
|
181
|
+
##
|
182
|
+
# Initialize the NetworkContext
|
183
|
+
# @param [Version] version Version that contains the resource
|
184
|
+
# @param [String] sid The SID of the Network resource to fetch.
|
185
|
+
# @return [NetworkContext] NetworkContext
|
186
|
+
def initialize(version, sid)
|
187
|
+
super(version)
|
188
|
+
|
189
|
+
# Path Solution
|
190
|
+
@solution = {sid: sid, }
|
191
|
+
@uri = "/Networks/#{@solution[:sid]}"
|
192
|
+
end
|
193
|
+
|
194
|
+
##
|
195
|
+
# Fetch a NetworkInstance
|
196
|
+
# @return [NetworkInstance] Fetched NetworkInstance
|
197
|
+
def fetch
|
198
|
+
params = Twilio::Values.of({})
|
199
|
+
|
200
|
+
payload = @version.fetch(
|
201
|
+
'GET',
|
202
|
+
@uri,
|
203
|
+
params,
|
204
|
+
)
|
205
|
+
|
206
|
+
NetworkInstance.new(@version, payload, sid: @solution[:sid], )
|
207
|
+
end
|
208
|
+
|
209
|
+
##
|
210
|
+
# Provide a user friendly representation
|
211
|
+
def to_s
|
212
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
213
|
+
"#<Twilio.Supersim.V1.NetworkContext #{context}>"
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# Provide a detailed, user friendly representation
|
218
|
+
def inspect
|
219
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
220
|
+
"#<Twilio.Supersim.V1.NetworkContext #{context}>"
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
##
|
225
|
+
# 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.
|
226
|
+
class NetworkInstance < InstanceResource
|
227
|
+
##
|
228
|
+
# Initialize the NetworkInstance
|
229
|
+
# @param [Version] version Version that contains the resource
|
230
|
+
# @param [Hash] payload payload that contains response from Twilio
|
231
|
+
# @param [String] sid The SID of the Network resource to fetch.
|
232
|
+
# @return [NetworkInstance] NetworkInstance
|
233
|
+
def initialize(version, payload, sid: nil)
|
234
|
+
super(version)
|
235
|
+
|
236
|
+
# Marshaled Properties
|
237
|
+
@properties = {
|
238
|
+
'sid' => payload['sid'],
|
239
|
+
'friendly_name' => payload['friendly_name'],
|
240
|
+
'url' => payload['url'],
|
241
|
+
'iso_country' => payload['iso_country'],
|
242
|
+
'identifiers' => payload['identifiers'],
|
243
|
+
}
|
244
|
+
|
245
|
+
# Context
|
246
|
+
@instance_context = nil
|
247
|
+
@params = {'sid' => sid || @properties['sid'], }
|
248
|
+
end
|
249
|
+
|
250
|
+
##
|
251
|
+
# Generate an instance context for the instance, the context is capable of
|
252
|
+
# performing various actions. All instance actions are proxied to the context
|
253
|
+
# @return [NetworkContext] NetworkContext for this NetworkInstance
|
254
|
+
def context
|
255
|
+
unless @instance_context
|
256
|
+
@instance_context = NetworkContext.new(@version, @params['sid'], )
|
257
|
+
end
|
258
|
+
@instance_context
|
259
|
+
end
|
260
|
+
|
261
|
+
##
|
262
|
+
# @return [String] The unique string that identifies the resource
|
263
|
+
def sid
|
264
|
+
@properties['sid']
|
265
|
+
end
|
266
|
+
|
267
|
+
##
|
268
|
+
# @return [String] A human readable identifier of this resource
|
269
|
+
def friendly_name
|
270
|
+
@properties['friendly_name']
|
271
|
+
end
|
272
|
+
|
273
|
+
##
|
274
|
+
# @return [String] The absolute URL of the Network resource
|
275
|
+
def url
|
276
|
+
@properties['url']
|
277
|
+
end
|
278
|
+
|
279
|
+
##
|
280
|
+
# @return [String] The ISO country code of the Network resource
|
281
|
+
def iso_country
|
282
|
+
@properties['iso_country']
|
283
|
+
end
|
284
|
+
|
285
|
+
##
|
286
|
+
# @return [Hash] The MCC/MNCs included in the Network resource
|
287
|
+
def identifiers
|
288
|
+
@properties['identifiers']
|
289
|
+
end
|
290
|
+
|
291
|
+
##
|
292
|
+
# Fetch a NetworkInstance
|
293
|
+
# @return [NetworkInstance] Fetched NetworkInstance
|
294
|
+
def fetch
|
295
|
+
context.fetch
|
296
|
+
end
|
297
|
+
|
298
|
+
##
|
299
|
+
# Provide a user friendly representation
|
300
|
+
def to_s
|
301
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
302
|
+
"<Twilio.Supersim.V1.NetworkInstance #{values}>"
|
303
|
+
end
|
304
|
+
|
305
|
+
##
|
306
|
+
# Provide a detailed, user friendly representation
|
307
|
+
def inspect
|
308
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
309
|
+
"<Twilio.Supersim.V1.NetworkInstance #{values}>"
|
310
|
+
end
|
311
|
+
end
|
312
|
+
end
|
313
|
+
end
|
314
|
+
end
|
315
|
+
end
|
@@ -8,35 +8,37 @@
|
|
8
8
|
|
9
9
|
module Twilio
|
10
10
|
module REST
|
11
|
-
class
|
11
|
+
class Supersim < Domain
|
12
12
|
class V1 < Version
|
13
13
|
##
|
14
14
|
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
15
|
-
class
|
15
|
+
class NetworkAccessProfileList < ListResource
|
16
16
|
##
|
17
|
-
# Initialize the
|
17
|
+
# Initialize the NetworkAccessProfileList
|
18
18
|
# @param [Version] version Version that contains the resource
|
19
|
-
# @return [
|
19
|
+
# @return [NetworkAccessProfileList] NetworkAccessProfileList
|
20
20
|
def initialize(version)
|
21
21
|
super(version)
|
22
22
|
|
23
23
|
# Path Solution
|
24
24
|
@solution = {}
|
25
|
-
@uri = "/
|
25
|
+
@uri = "/NetworkAccessProfiles"
|
26
26
|
end
|
27
27
|
|
28
28
|
##
|
29
|
-
# Retrieve a single page of
|
29
|
+
# Retrieve a single page of NetworkAccessProfileInstance records from the API.
|
30
30
|
# Request is executed immediately.
|
31
|
-
# @param [String]
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
# @param [String] unique_name An application-defined string that uniquely
|
32
|
+
# identifies the resource. It can be used in place of the resource's `sid` in the
|
33
|
+
# URL to address the resource.
|
34
|
+
# @param [String] networks List of Network SIDs that this Network Access Profile
|
35
|
+
# will allow connections to.
|
36
|
+
# @return [NetworkAccessProfileInstance] Newly created NetworkAccessProfileInstance
|
37
|
+
def create(unique_name: :unset, networks: :unset)
|
38
|
+
data = Twilio::Values.of({
|
39
|
+
'UniqueName' => unique_name,
|
40
|
+
'Networks' => Twilio.serialize_list(networks) { |e| e },
|
41
|
+
})
|
40
42
|
|
41
43
|
payload = @version.create(
|
42
44
|
'POST',
|
@@ -44,11 +46,11 @@ module Twilio
|
|
44
46
|
data: data
|
45
47
|
)
|
46
48
|
|
47
|
-
|
49
|
+
NetworkAccessProfileInstance.new(@version, payload, )
|
48
50
|
end
|
49
51
|
|
50
52
|
##
|
51
|
-
# Lists
|
53
|
+
# Lists NetworkAccessProfileInstance records from the API as a list.
|
52
54
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
53
55
|
# memory before returning.
|
54
56
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
@@ -63,7 +65,7 @@ module Twilio
|
|
63
65
|
end
|
64
66
|
|
65
67
|
##
|
66
|
-
# Streams
|
68
|
+
# Streams NetworkAccessProfileInstance records from the API as an Enumerable.
|
67
69
|
# This operation lazily loads records as efficiently as possible until the limit
|
68
70
|
# is reached.
|
69
71
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
@@ -82,7 +84,7 @@ module Twilio
|
|
82
84
|
end
|
83
85
|
|
84
86
|
##
|
85
|
-
# When passed a block, yields
|
87
|
+
# When passed a block, yields NetworkAccessProfileInstance records from the API.
|
86
88
|
# This operation lazily loads records as efficiently as possible until the limit
|
87
89
|
# is reached.
|
88
90
|
def each
|
@@ -96,12 +98,12 @@ module Twilio
|
|
96
98
|
end
|
97
99
|
|
98
100
|
##
|
99
|
-
# Retrieve a single page of
|
101
|
+
# Retrieve a single page of NetworkAccessProfileInstance records from the API.
|
100
102
|
# Request is executed immediately.
|
101
103
|
# @param [String] page_token PageToken provided by the API
|
102
104
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
103
105
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
104
|
-
# @return [Page] Page of
|
106
|
+
# @return [Page] Page of NetworkAccessProfileInstance
|
105
107
|
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
106
108
|
params = Twilio::Values.of({
|
107
109
|
'PageToken' => page_token,
|
@@ -113,38 +115,38 @@ module Twilio
|
|
113
115
|
@uri,
|
114
116
|
params
|
115
117
|
)
|
116
|
-
|
118
|
+
NetworkAccessProfilePage.new(@version, response, @solution)
|
117
119
|
end
|
118
120
|
|
119
121
|
##
|
120
|
-
# Retrieve a single page of
|
122
|
+
# Retrieve a single page of NetworkAccessProfileInstance records from the API.
|
121
123
|
# Request is executed immediately.
|
122
124
|
# @param [String] target_url API-generated URL for the requested results page
|
123
|
-
# @return [Page] Page of
|
125
|
+
# @return [Page] Page of NetworkAccessProfileInstance
|
124
126
|
def get_page(target_url)
|
125
127
|
response = @version.domain.request(
|
126
128
|
'GET',
|
127
129
|
target_url
|
128
130
|
)
|
129
|
-
|
131
|
+
NetworkAccessProfilePage.new(@version, response, @solution)
|
130
132
|
end
|
131
133
|
|
132
134
|
##
|
133
135
|
# Provide a user friendly representation
|
134
136
|
def to_s
|
135
|
-
'#<Twilio.
|
137
|
+
'#<Twilio.Supersim.V1.NetworkAccessProfileList>'
|
136
138
|
end
|
137
139
|
end
|
138
140
|
|
139
141
|
##
|
140
142
|
# 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
|
143
|
+
class NetworkAccessProfilePage < Page
|
142
144
|
##
|
143
|
-
# Initialize the
|
145
|
+
# Initialize the NetworkAccessProfilePage
|
144
146
|
# @param [Version] version Version that contains the resource
|
145
147
|
# @param [Response] response Response from the API
|
146
148
|
# @param [Hash] solution Path solution for the resource
|
147
|
-
# @return [
|
149
|
+
# @return [NetworkAccessProfilePage] NetworkAccessProfilePage
|
148
150
|
def initialize(version, response, solution)
|
149
151
|
super(version, response)
|
150
152
|
|
@@ -153,49 +155,42 @@ module Twilio
|
|
153
155
|
end
|
154
156
|
|
155
157
|
##
|
156
|
-
# Build an instance of
|
158
|
+
# Build an instance of NetworkAccessProfileInstance
|
157
159
|
# @param [Hash] payload Payload response from the API
|
158
|
-
# @return [
|
160
|
+
# @return [NetworkAccessProfileInstance] NetworkAccessProfileInstance
|
159
161
|
def get_instance(payload)
|
160
|
-
|
162
|
+
NetworkAccessProfileInstance.new(@version, payload, )
|
161
163
|
end
|
162
164
|
|
163
165
|
##
|
164
166
|
# Provide a user friendly representation
|
165
167
|
def to_s
|
166
|
-
'<Twilio.
|
168
|
+
'<Twilio.Supersim.V1.NetworkAccessProfilePage>'
|
167
169
|
end
|
168
170
|
end
|
169
171
|
|
170
172
|
##
|
171
173
|
# 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.
|
172
|
-
class
|
174
|
+
class NetworkAccessProfileContext < InstanceContext
|
173
175
|
##
|
174
|
-
# Initialize the
|
176
|
+
# Initialize the NetworkAccessProfileContext
|
175
177
|
# @param [Version] version Version that contains the resource
|
176
|
-
# @param [String] sid
|
177
|
-
# @return [
|
178
|
+
# @param [String] sid The SID of the Network Access Profile resource to fetch.
|
179
|
+
# @return [NetworkAccessProfileContext] NetworkAccessProfileContext
|
178
180
|
def initialize(version, sid)
|
179
181
|
super(version)
|
180
182
|
|
181
183
|
# Path Solution
|
182
184
|
@solution = {sid: sid, }
|
183
|
-
@uri = "/
|
185
|
+
@uri = "/NetworkAccessProfiles/#{@solution[:sid]}"
|
184
186
|
|
185
187
|
# Dependents
|
186
|
-
@
|
187
|
-
end
|
188
|
-
|
189
|
-
##
|
190
|
-
# Deletes the ServiceInstance
|
191
|
-
# @return [Boolean] true if delete succeeds, false otherwise
|
192
|
-
def delete
|
193
|
-
@version.delete('delete', @uri)
|
188
|
+
@networks = nil
|
194
189
|
end
|
195
190
|
|
196
191
|
##
|
197
|
-
# Fetch a
|
198
|
-
# @return [
|
192
|
+
# Fetch a NetworkAccessProfileInstance
|
193
|
+
# @return [NetworkAccessProfileInstance] Fetched NetworkAccessProfileInstance
|
199
194
|
def fetch
|
200
195
|
params = Twilio::Values.of({})
|
201
196
|
|
@@ -205,20 +200,15 @@ module Twilio
|
|
205
200
|
params,
|
206
201
|
)
|
207
202
|
|
208
|
-
|
203
|
+
NetworkAccessProfileInstance.new(@version, payload, sid: @solution[:sid], )
|
209
204
|
end
|
210
205
|
|
211
206
|
##
|
212
|
-
# Update the
|
213
|
-
# @param [String]
|
214
|
-
#
|
215
|
-
|
216
|
-
|
217
|
-
# {"notify_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "include_date":
|
218
|
-
# true}
|
219
|
-
# @return [ServiceInstance] Updated ServiceInstance
|
220
|
-
def update(friendly_name: :unset, push: :unset)
|
221
|
-
data = Twilio::Values.of({'FriendlyName' => friendly_name, 'Push' => push, })
|
207
|
+
# Update the NetworkAccessProfileInstance
|
208
|
+
# @param [String] unique_name The new unique name of the Network Access Profile.
|
209
|
+
# @return [NetworkAccessProfileInstance] Updated NetworkAccessProfileInstance
|
210
|
+
def update(unique_name: :unset)
|
211
|
+
data = Twilio::Values.of({'UniqueName' => unique_name, })
|
222
212
|
|
223
213
|
payload = @version.update(
|
224
214
|
'POST',
|
@@ -226,64 +216,66 @@ module Twilio
|
|
226
216
|
data: data,
|
227
217
|
)
|
228
218
|
|
229
|
-
|
219
|
+
NetworkAccessProfileInstance.new(@version, payload, sid: @solution[:sid], )
|
230
220
|
end
|
231
221
|
|
232
222
|
##
|
233
|
-
# Access the
|
234
|
-
# @return [
|
235
|
-
# @return [
|
236
|
-
def
|
237
|
-
raise ArgumentError, '
|
238
|
-
|
239
|
-
if
|
240
|
-
return
|
223
|
+
# Access the networks
|
224
|
+
# @return [NetworkAccessProfileNetworkList]
|
225
|
+
# @return [NetworkAccessProfileNetworkContext] if sid was passed.
|
226
|
+
def networks(sid=:unset)
|
227
|
+
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
228
|
+
|
229
|
+
if sid != :unset
|
230
|
+
return NetworkAccessProfileNetworkContext.new(@version, @solution[:sid], sid, )
|
241
231
|
end
|
242
232
|
|
243
|
-
unless @
|
244
|
-
@
|
233
|
+
unless @networks
|
234
|
+
@networks = NetworkAccessProfileNetworkList.new(
|
235
|
+
@version,
|
236
|
+
network_access_profile_sid: @solution[:sid],
|
237
|
+
)
|
245
238
|
end
|
246
239
|
|
247
|
-
@
|
240
|
+
@networks
|
248
241
|
end
|
249
242
|
|
250
243
|
##
|
251
244
|
# Provide a user friendly representation
|
252
245
|
def to_s
|
253
246
|
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
254
|
-
"#<Twilio.
|
247
|
+
"#<Twilio.Supersim.V1.NetworkAccessProfileContext #{context}>"
|
255
248
|
end
|
256
249
|
|
257
250
|
##
|
258
251
|
# Provide a detailed, user friendly representation
|
259
252
|
def inspect
|
260
253
|
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
261
|
-
"#<Twilio.
|
254
|
+
"#<Twilio.Supersim.V1.NetworkAccessProfileContext #{context}>"
|
262
255
|
end
|
263
256
|
end
|
264
257
|
|
265
258
|
##
|
266
259
|
# 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.
|
267
|
-
class
|
260
|
+
class NetworkAccessProfileInstance < InstanceResource
|
268
261
|
##
|
269
|
-
# Initialize the
|
262
|
+
# Initialize the NetworkAccessProfileInstance
|
270
263
|
# @param [Version] version Version that contains the resource
|
271
264
|
# @param [Hash] payload payload that contains response from Twilio
|
272
|
-
# @param [String] sid
|
273
|
-
# @return [
|
265
|
+
# @param [String] sid The SID of the Network Access Profile resource to fetch.
|
266
|
+
# @return [NetworkAccessProfileInstance] NetworkAccessProfileInstance
|
274
267
|
def initialize(version, payload, sid: nil)
|
275
268
|
super(version)
|
276
269
|
|
277
270
|
# Marshaled Properties
|
278
271
|
@properties = {
|
279
272
|
'sid' => payload['sid'],
|
280
|
-
'
|
273
|
+
'unique_name' => payload['unique_name'],
|
281
274
|
'account_sid' => payload['account_sid'],
|
282
275
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
283
276
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
284
277
|
'url' => payload['url'],
|
285
278
|
'links' => payload['links'],
|
286
|
-
'configuration' => payload['configuration'],
|
287
279
|
}
|
288
280
|
|
289
281
|
# Context
|
@@ -294,108 +286,90 @@ module Twilio
|
|
294
286
|
##
|
295
287
|
# Generate an instance context for the instance, the context is capable of
|
296
288
|
# performing various actions. All instance actions are proxied to the context
|
297
|
-
# @return [
|
289
|
+
# @return [NetworkAccessProfileContext] NetworkAccessProfileContext for this NetworkAccessProfileInstance
|
298
290
|
def context
|
299
291
|
unless @instance_context
|
300
|
-
@instance_context =
|
292
|
+
@instance_context = NetworkAccessProfileContext.new(@version, @params['sid'], )
|
301
293
|
end
|
302
294
|
@instance_context
|
303
295
|
end
|
304
296
|
|
305
297
|
##
|
306
|
-
# @return [String]
|
298
|
+
# @return [String] The unique string that identifies the resource
|
307
299
|
def sid
|
308
300
|
@properties['sid']
|
309
301
|
end
|
310
302
|
|
311
303
|
##
|
312
|
-
# @return [String]
|
313
|
-
def
|
314
|
-
@properties['
|
304
|
+
# @return [String] An application-defined string that uniquely identifies the resource
|
305
|
+
def unique_name
|
306
|
+
@properties['unique_name']
|
315
307
|
end
|
316
308
|
|
317
309
|
##
|
318
|
-
# @return [String] Account
|
310
|
+
# @return [String] The SID of the Account that the Network Access Profile belongs to
|
319
311
|
def account_sid
|
320
312
|
@properties['account_sid']
|
321
313
|
end
|
322
314
|
|
323
315
|
##
|
324
|
-
# @return [Time] The date
|
316
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was created
|
325
317
|
def date_created
|
326
318
|
@properties['date_created']
|
327
319
|
end
|
328
320
|
|
329
321
|
##
|
330
|
-
# @return [Time] The date
|
322
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
|
331
323
|
def date_updated
|
332
324
|
@properties['date_updated']
|
333
325
|
end
|
334
326
|
|
335
327
|
##
|
336
|
-
# @return [String] The URL of
|
328
|
+
# @return [String] The absolute URL of the resource
|
337
329
|
def url
|
338
330
|
@properties['url']
|
339
331
|
end
|
340
332
|
|
341
333
|
##
|
342
|
-
# @return [String]
|
334
|
+
# @return [String] The links
|
343
335
|
def links
|
344
336
|
@properties['links']
|
345
337
|
end
|
346
338
|
|
347
339
|
##
|
348
|
-
#
|
349
|
-
|
350
|
-
@properties['configuration']
|
351
|
-
end
|
352
|
-
|
353
|
-
##
|
354
|
-
# Deletes the ServiceInstance
|
355
|
-
# @return [Boolean] true if delete succeeds, false otherwise
|
356
|
-
def delete
|
357
|
-
context.delete
|
358
|
-
end
|
359
|
-
|
360
|
-
##
|
361
|
-
# Fetch a ServiceInstance
|
362
|
-
# @return [ServiceInstance] Fetched ServiceInstance
|
340
|
+
# Fetch a NetworkAccessProfileInstance
|
341
|
+
# @return [NetworkAccessProfileInstance] Fetched NetworkAccessProfileInstance
|
363
342
|
def fetch
|
364
343
|
context.fetch
|
365
344
|
end
|
366
345
|
|
367
346
|
##
|
368
|
-
# Update the
|
369
|
-
# @param [String]
|
370
|
-
#
|
371
|
-
|
372
|
-
|
373
|
-
# {"notify_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "include_date":
|
374
|
-
# true}
|
375
|
-
# @return [ServiceInstance] Updated ServiceInstance
|
376
|
-
def update(friendly_name: :unset, push: :unset)
|
377
|
-
context.update(friendly_name: friendly_name, push: push, )
|
347
|
+
# Update the NetworkAccessProfileInstance
|
348
|
+
# @param [String] unique_name The new unique name of the Network Access Profile.
|
349
|
+
# @return [NetworkAccessProfileInstance] Updated NetworkAccessProfileInstance
|
350
|
+
def update(unique_name: :unset)
|
351
|
+
context.update(unique_name: unique_name, )
|
378
352
|
end
|
379
353
|
|
380
354
|
##
|
381
|
-
# Access the
|
382
|
-
# @return [
|
383
|
-
def
|
384
|
-
context.
|
355
|
+
# Access the networks
|
356
|
+
# @return [networks] networks
|
357
|
+
def networks
|
358
|
+
context.networks
|
385
359
|
end
|
386
360
|
|
387
361
|
##
|
388
362
|
# Provide a user friendly representation
|
389
363
|
def to_s
|
390
364
|
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
391
|
-
"<Twilio.
|
365
|
+
"<Twilio.Supersim.V1.NetworkAccessProfileInstance #{values}>"
|
392
366
|
end
|
393
367
|
|
394
368
|
##
|
395
369
|
# Provide a detailed, user friendly representation
|
396
370
|
def inspect
|
397
371
|
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
398
|
-
"<Twilio.
|
372
|
+
"<Twilio.Supersim.V1.NetworkAccessProfileInstance #{values}>"
|
399
373
|
end
|
400
374
|
end
|
401
375
|
end
|