twilio-ruby 5.34.0 → 5.34.1
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 +32 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +38 -3
- 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/restore_assistant.rb +198 -0
- 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/supersim.rb +8 -0
- data/lib/twilio-ruby/rest/supersim/v1.rb +15 -0
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -10
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +337 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +22 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -3
- 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/version.rb +1 -1
- 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/autopilot/v1/restore_assistant_spec.rb +53 -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/supersim/v1/fleet_spec.rb +8 -4
- data/spec/integration/supersim/v1/network_access_profile_spec.rb +208 -0
- data/spec/integration/verify/v2/service_spec.rb +4 -0
- 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/twilio-ruby.gemspec +1 -1
- metadata +28 -3
@@ -46,6 +46,14 @@ module Twilio
|
|
46
46
|
self.v1.fleets(sid)
|
47
47
|
end
|
48
48
|
|
49
|
+
##
|
50
|
+
# @param [String] sid The sid
|
51
|
+
# @return [Twilio::REST::Supersim::V1::NetworkAccessProfileInstance] if sid was passed.
|
52
|
+
# @return [Twilio::REST::Supersim::V1::NetworkAccessProfileList]
|
53
|
+
def network_access_profiles(sid=:unset)
|
54
|
+
self.v1.network_access_profiles(sid)
|
55
|
+
end
|
56
|
+
|
49
57
|
##
|
50
58
|
# @param [String] sid The unique string that identifies the Sim resource.
|
51
59
|
# @return [Twilio::REST::Supersim::V1::SimInstance] if sid was passed.
|
@@ -17,6 +17,7 @@ module Twilio
|
|
17
17
|
@version = 'v1'
|
18
18
|
@commands = nil
|
19
19
|
@fleets = nil
|
20
|
+
@network_access_profiles = nil
|
20
21
|
@sims = nil
|
21
22
|
@usage_records = nil
|
22
23
|
end
|
@@ -49,6 +50,20 @@ module Twilio
|
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
53
|
+
##
|
54
|
+
# @param [String] sid The sid
|
55
|
+
# @return [Twilio::REST::Supersim::V1::NetworkAccessProfileContext] if sid was passed.
|
56
|
+
# @return [Twilio::REST::Supersim::V1::NetworkAccessProfileList]
|
57
|
+
def network_access_profiles(sid=:unset)
|
58
|
+
if sid.nil?
|
59
|
+
raise ArgumentError, 'sid cannot be nil'
|
60
|
+
elsif sid == :unset
|
61
|
+
@network_access_profiles ||= NetworkAccessProfileList.new self
|
62
|
+
else
|
63
|
+
NetworkAccessProfileContext.new(self, sid)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
52
67
|
##
|
53
68
|
# @param [String] sid The SID of the Sim resource to fetch.
|
54
69
|
# @return [Twilio::REST::Supersim::V1::SimContext] if sid was passed.
|
@@ -41,14 +41,18 @@ module Twilio
|
|
41
41
|
# @param [String] commands_method A string representing the HTTP method to use
|
42
42
|
# when making a request to `commands_url`. Can be one of POST or GET. Defaults to
|
43
43
|
# POST.
|
44
|
+
# @param [String] network_access_profile The SID or unique name of the Network
|
45
|
+
# Access Profile that will control which cellular network operators the Fleet's
|
46
|
+
# SIMs can connect to
|
44
47
|
# @return [FleetInstance] Newly created FleetInstance
|
45
|
-
def create(unique_name: :unset, data_enabled: :unset, commands_enabled: :unset, commands_url: :unset, commands_method: :unset)
|
48
|
+
def create(unique_name: :unset, data_enabled: :unset, commands_enabled: :unset, commands_url: :unset, commands_method: :unset, network_access_profile: :unset)
|
46
49
|
data = Twilio::Values.of({
|
47
50
|
'UniqueName' => unique_name,
|
48
51
|
'DataEnabled' => data_enabled,
|
49
52
|
'CommandsEnabled' => commands_enabled,
|
50
53
|
'CommandsUrl' => commands_url,
|
51
54
|
'CommandsMethod' => commands_method,
|
55
|
+
'NetworkAccessProfile' => network_access_profile,
|
52
56
|
})
|
53
57
|
|
54
58
|
payload = @version.create(
|
@@ -64,6 +68,9 @@ module Twilio
|
|
64
68
|
# Lists FleetInstance records from the API as a list.
|
65
69
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
66
70
|
# memory before returning.
|
71
|
+
# @param [String] network_access_profile The SID or unique name of the Network
|
72
|
+
# Access Profile that controls which cellular network operators the Fleet's SIMs
|
73
|
+
# can connect to
|
67
74
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
68
75
|
# guarantees to never return more than limit. Default is no limit
|
69
76
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -71,14 +78,21 @@ module Twilio
|
|
71
78
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
72
79
|
# efficient page size, i.e. min(limit, 1000)
|
73
80
|
# @return [Array] Array of up to limit results
|
74
|
-
def list(limit: nil, page_size: nil)
|
75
|
-
self.stream(
|
81
|
+
def list(network_access_profile: :unset, limit: nil, page_size: nil)
|
82
|
+
self.stream(
|
83
|
+
network_access_profile: network_access_profile,
|
84
|
+
limit: limit,
|
85
|
+
page_size: page_size
|
86
|
+
).entries
|
76
87
|
end
|
77
88
|
|
78
89
|
##
|
79
90
|
# Streams FleetInstance records from the API as an Enumerable.
|
80
91
|
# This operation lazily loads records as efficiently as possible until the limit
|
81
92
|
# is reached.
|
93
|
+
# @param [String] network_access_profile The SID or unique name of the Network
|
94
|
+
# Access Profile that controls which cellular network operators the Fleet's SIMs
|
95
|
+
# can connect to
|
82
96
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
83
97
|
# guarantees to never return more than limit. Default is no limit.
|
84
98
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -86,10 +100,10 @@ module Twilio
|
|
86
100
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
87
101
|
# efficient page size, i.e. min(limit, 1000)
|
88
102
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
89
|
-
def stream(limit: nil, page_size: nil)
|
103
|
+
def stream(network_access_profile: :unset, limit: nil, page_size: nil)
|
90
104
|
limits = @version.read_limits(limit, page_size)
|
91
105
|
|
92
|
-
page = self.page(page_size: limits[:page_size], )
|
106
|
+
page = self.page(network_access_profile: network_access_profile, page_size: limits[:page_size], )
|
93
107
|
|
94
108
|
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
95
109
|
end
|
@@ -111,12 +125,16 @@ module Twilio
|
|
111
125
|
##
|
112
126
|
# Retrieve a single page of FleetInstance records from the API.
|
113
127
|
# Request is executed immediately.
|
128
|
+
# @param [String] network_access_profile The SID or unique name of the Network
|
129
|
+
# Access Profile that controls which cellular network operators the Fleet's SIMs
|
130
|
+
# can connect to
|
114
131
|
# @param [String] page_token PageToken provided by the API
|
115
132
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
116
133
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
117
134
|
# @return [Page] Page of FleetInstance
|
118
|
-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
135
|
+
def page(network_access_profile: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
119
136
|
params = Twilio::Values.of({
|
137
|
+
'NetworkAccessProfile' => network_access_profile,
|
120
138
|
'PageToken' => page_token,
|
121
139
|
'Page' => page_number,
|
122
140
|
'PageSize' => page_size,
|
@@ -216,9 +234,15 @@ module Twilio
|
|
216
234
|
# @param [String] unique_name An application-defined string that uniquely
|
217
235
|
# identifies the resource. It can be used in place of the resource's `sid` in the
|
218
236
|
# URL to address the resource.
|
237
|
+
# @param [String] network_access_profile The SID or unique name of the Network
|
238
|
+
# Access Profile that will control which cellular network operators the Fleet's
|
239
|
+
# SIMs can connect to
|
219
240
|
# @return [FleetInstance] Updated FleetInstance
|
220
|
-
def update(unique_name: :unset)
|
221
|
-
data = Twilio::Values.of({
|
241
|
+
def update(unique_name: :unset, network_access_profile: :unset)
|
242
|
+
data = Twilio::Values.of({
|
243
|
+
'UniqueName' => unique_name,
|
244
|
+
'NetworkAccessProfile' => network_access_profile,
|
245
|
+
})
|
222
246
|
|
223
247
|
payload = @version.update(
|
224
248
|
'POST',
|
@@ -269,6 +293,7 @@ module Twilio
|
|
269
293
|
'commands_enabled' => payload['commands_enabled'],
|
270
294
|
'commands_url' => payload['commands_url'],
|
271
295
|
'commands_method' => payload['commands_method'],
|
296
|
+
'network_access_profile_sid' => payload['network_access_profile_sid'],
|
272
297
|
}
|
273
298
|
|
274
299
|
# Context
|
@@ -353,6 +378,12 @@ module Twilio
|
|
353
378
|
@properties['commands_method']
|
354
379
|
end
|
355
380
|
|
381
|
+
##
|
382
|
+
# @return [String] The SID of the Network Access Profile of the Fleet
|
383
|
+
def network_access_profile_sid
|
384
|
+
@properties['network_access_profile_sid']
|
385
|
+
end
|
386
|
+
|
356
387
|
##
|
357
388
|
# Fetch a FleetInstance
|
358
389
|
# @return [FleetInstance] Fetched FleetInstance
|
@@ -365,9 +396,12 @@ module Twilio
|
|
365
396
|
# @param [String] unique_name An application-defined string that uniquely
|
366
397
|
# identifies the resource. It can be used in place of the resource's `sid` in the
|
367
398
|
# URL to address the resource.
|
399
|
+
# @param [String] network_access_profile The SID or unique name of the Network
|
400
|
+
# Access Profile that will control which cellular network operators the Fleet's
|
401
|
+
# SIMs can connect to
|
368
402
|
# @return [FleetInstance] Updated FleetInstance
|
369
|
-
def update(unique_name: :unset)
|
370
|
-
context.update(unique_name: unique_name, )
|
403
|
+
def update(unique_name: :unset, network_access_profile: :unset)
|
404
|
+
context.update(unique_name: unique_name, network_access_profile: network_access_profile, )
|
371
405
|
end
|
372
406
|
|
373
407
|
##
|
@@ -0,0 +1,337 @@
|
|
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 NetworkAccessProfileList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the NetworkAccessProfileList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [NetworkAccessProfileList] NetworkAccessProfileList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/NetworkAccessProfiles"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Retrieve a single page of NetworkAccessProfileInstance records from the API.
|
30
|
+
# Request is executed immediately.
|
31
|
+
# @param [String] unique_name The unique_name
|
32
|
+
# @param [String] networks The networks
|
33
|
+
# @return [NetworkAccessProfileInstance] Newly created NetworkAccessProfileInstance
|
34
|
+
def create(unique_name: :unset, networks: :unset)
|
35
|
+
data = Twilio::Values.of({
|
36
|
+
'UniqueName' => unique_name,
|
37
|
+
'Networks' => Twilio.serialize_list(networks) { |e| e },
|
38
|
+
})
|
39
|
+
|
40
|
+
payload = @version.create(
|
41
|
+
'POST',
|
42
|
+
@uri,
|
43
|
+
data: data
|
44
|
+
)
|
45
|
+
|
46
|
+
NetworkAccessProfileInstance.new(@version, payload, )
|
47
|
+
end
|
48
|
+
|
49
|
+
##
|
50
|
+
# Lists NetworkAccessProfileInstance records from the API as a list.
|
51
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
52
|
+
# memory before returning.
|
53
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
54
|
+
# guarantees to never return more than limit. Default is no limit
|
55
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
56
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
57
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
58
|
+
# efficient page size, i.e. min(limit, 1000)
|
59
|
+
# @return [Array] Array of up to limit results
|
60
|
+
def list(limit: nil, page_size: nil)
|
61
|
+
self.stream(limit: limit, page_size: page_size).entries
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# Streams NetworkAccessProfileInstance records from the API as an Enumerable.
|
66
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
67
|
+
# is reached.
|
68
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
69
|
+
# guarantees to never return more than limit. Default is no limit.
|
70
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
71
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
72
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
73
|
+
# efficient page size, i.e. min(limit, 1000)
|
74
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
75
|
+
def stream(limit: nil, page_size: nil)
|
76
|
+
limits = @version.read_limits(limit, page_size)
|
77
|
+
|
78
|
+
page = self.page(page_size: limits[:page_size], )
|
79
|
+
|
80
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# When passed a block, yields NetworkAccessProfileInstance records from the API.
|
85
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
86
|
+
# is reached.
|
87
|
+
def each
|
88
|
+
limits = @version.read_limits
|
89
|
+
|
90
|
+
page = self.page(page_size: limits[:page_size], )
|
91
|
+
|
92
|
+
@version.stream(page,
|
93
|
+
limit: limits[:limit],
|
94
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
95
|
+
end
|
96
|
+
|
97
|
+
##
|
98
|
+
# Retrieve a single page of NetworkAccessProfileInstance records from the API.
|
99
|
+
# Request is executed immediately.
|
100
|
+
# @param [String] page_token PageToken provided by the API
|
101
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
102
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
103
|
+
# @return [Page] Page of NetworkAccessProfileInstance
|
104
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
105
|
+
params = Twilio::Values.of({
|
106
|
+
'PageToken' => page_token,
|
107
|
+
'Page' => page_number,
|
108
|
+
'PageSize' => page_size,
|
109
|
+
})
|
110
|
+
response = @version.page(
|
111
|
+
'GET',
|
112
|
+
@uri,
|
113
|
+
params
|
114
|
+
)
|
115
|
+
NetworkAccessProfilePage.new(@version, response, @solution)
|
116
|
+
end
|
117
|
+
|
118
|
+
##
|
119
|
+
# Retrieve a single page of NetworkAccessProfileInstance records from the API.
|
120
|
+
# Request is executed immediately.
|
121
|
+
# @param [String] target_url API-generated URL for the requested results page
|
122
|
+
# @return [Page] Page of NetworkAccessProfileInstance
|
123
|
+
def get_page(target_url)
|
124
|
+
response = @version.domain.request(
|
125
|
+
'GET',
|
126
|
+
target_url
|
127
|
+
)
|
128
|
+
NetworkAccessProfilePage.new(@version, response, @solution)
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# Provide a user friendly representation
|
133
|
+
def to_s
|
134
|
+
'#<Twilio.Supersim.V1.NetworkAccessProfileList>'
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
##
|
139
|
+
# 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.
|
140
|
+
class NetworkAccessProfilePage < Page
|
141
|
+
##
|
142
|
+
# Initialize the NetworkAccessProfilePage
|
143
|
+
# @param [Version] version Version that contains the resource
|
144
|
+
# @param [Response] response Response from the API
|
145
|
+
# @param [Hash] solution Path solution for the resource
|
146
|
+
# @return [NetworkAccessProfilePage] NetworkAccessProfilePage
|
147
|
+
def initialize(version, response, solution)
|
148
|
+
super(version, response)
|
149
|
+
|
150
|
+
# Path Solution
|
151
|
+
@solution = solution
|
152
|
+
end
|
153
|
+
|
154
|
+
##
|
155
|
+
# Build an instance of NetworkAccessProfileInstance
|
156
|
+
# @param [Hash] payload Payload response from the API
|
157
|
+
# @return [NetworkAccessProfileInstance] NetworkAccessProfileInstance
|
158
|
+
def get_instance(payload)
|
159
|
+
NetworkAccessProfileInstance.new(@version, payload, )
|
160
|
+
end
|
161
|
+
|
162
|
+
##
|
163
|
+
# Provide a user friendly representation
|
164
|
+
def to_s
|
165
|
+
'<Twilio.Supersim.V1.NetworkAccessProfilePage>'
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
##
|
170
|
+
# 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.
|
171
|
+
class NetworkAccessProfileContext < InstanceContext
|
172
|
+
##
|
173
|
+
# Initialize the NetworkAccessProfileContext
|
174
|
+
# @param [Version] version Version that contains the resource
|
175
|
+
# @param [String] sid The sid
|
176
|
+
# @return [NetworkAccessProfileContext] NetworkAccessProfileContext
|
177
|
+
def initialize(version, sid)
|
178
|
+
super(version)
|
179
|
+
|
180
|
+
# Path Solution
|
181
|
+
@solution = {sid: sid, }
|
182
|
+
@uri = "/NetworkAccessProfiles/#{@solution[:sid]}"
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# Fetch a NetworkAccessProfileInstance
|
187
|
+
# @return [NetworkAccessProfileInstance] Fetched NetworkAccessProfileInstance
|
188
|
+
def fetch
|
189
|
+
params = Twilio::Values.of({})
|
190
|
+
|
191
|
+
payload = @version.fetch(
|
192
|
+
'GET',
|
193
|
+
@uri,
|
194
|
+
params,
|
195
|
+
)
|
196
|
+
|
197
|
+
NetworkAccessProfileInstance.new(@version, payload, sid: @solution[:sid], )
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# Update the NetworkAccessProfileInstance
|
202
|
+
# @param [String] unique_name The unique_name
|
203
|
+
# @return [NetworkAccessProfileInstance] Updated NetworkAccessProfileInstance
|
204
|
+
def update(unique_name: :unset)
|
205
|
+
data = Twilio::Values.of({'UniqueName' => unique_name, })
|
206
|
+
|
207
|
+
payload = @version.update(
|
208
|
+
'POST',
|
209
|
+
@uri,
|
210
|
+
data: data,
|
211
|
+
)
|
212
|
+
|
213
|
+
NetworkAccessProfileInstance.new(@version, payload, sid: @solution[:sid], )
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# Provide a user friendly representation
|
218
|
+
def to_s
|
219
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
220
|
+
"#<Twilio.Supersim.V1.NetworkAccessProfileContext #{context}>"
|
221
|
+
end
|
222
|
+
|
223
|
+
##
|
224
|
+
# Provide a detailed, user friendly representation
|
225
|
+
def inspect
|
226
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
227
|
+
"#<Twilio.Supersim.V1.NetworkAccessProfileContext #{context}>"
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
##
|
232
|
+
# 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.
|
233
|
+
class NetworkAccessProfileInstance < InstanceResource
|
234
|
+
##
|
235
|
+
# Initialize the NetworkAccessProfileInstance
|
236
|
+
# @param [Version] version Version that contains the resource
|
237
|
+
# @param [Hash] payload payload that contains response from Twilio
|
238
|
+
# @param [String] sid The sid
|
239
|
+
# @return [NetworkAccessProfileInstance] NetworkAccessProfileInstance
|
240
|
+
def initialize(version, payload, sid: nil)
|
241
|
+
super(version)
|
242
|
+
|
243
|
+
# Marshaled Properties
|
244
|
+
@properties = {
|
245
|
+
'sid' => payload['sid'],
|
246
|
+
'unique_name' => payload['unique_name'],
|
247
|
+
'account_sid' => payload['account_sid'],
|
248
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
249
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
250
|
+
'url' => payload['url'],
|
251
|
+
}
|
252
|
+
|
253
|
+
# Context
|
254
|
+
@instance_context = nil
|
255
|
+
@params = {'sid' => sid || @properties['sid'], }
|
256
|
+
end
|
257
|
+
|
258
|
+
##
|
259
|
+
# Generate an instance context for the instance, the context is capable of
|
260
|
+
# performing various actions. All instance actions are proxied to the context
|
261
|
+
# @return [NetworkAccessProfileContext] NetworkAccessProfileContext for this NetworkAccessProfileInstance
|
262
|
+
def context
|
263
|
+
unless @instance_context
|
264
|
+
@instance_context = NetworkAccessProfileContext.new(@version, @params['sid'], )
|
265
|
+
end
|
266
|
+
@instance_context
|
267
|
+
end
|
268
|
+
|
269
|
+
##
|
270
|
+
# @return [String] The sid
|
271
|
+
def sid
|
272
|
+
@properties['sid']
|
273
|
+
end
|
274
|
+
|
275
|
+
##
|
276
|
+
# @return [String] The unique_name
|
277
|
+
def unique_name
|
278
|
+
@properties['unique_name']
|
279
|
+
end
|
280
|
+
|
281
|
+
##
|
282
|
+
# @return [String] The account_sid
|
283
|
+
def account_sid
|
284
|
+
@properties['account_sid']
|
285
|
+
end
|
286
|
+
|
287
|
+
##
|
288
|
+
# @return [Time] The date_created
|
289
|
+
def date_created
|
290
|
+
@properties['date_created']
|
291
|
+
end
|
292
|
+
|
293
|
+
##
|
294
|
+
# @return [Time] The date_updated
|
295
|
+
def date_updated
|
296
|
+
@properties['date_updated']
|
297
|
+
end
|
298
|
+
|
299
|
+
##
|
300
|
+
# @return [String] The url
|
301
|
+
def url
|
302
|
+
@properties['url']
|
303
|
+
end
|
304
|
+
|
305
|
+
##
|
306
|
+
# Fetch a NetworkAccessProfileInstance
|
307
|
+
# @return [NetworkAccessProfileInstance] Fetched NetworkAccessProfileInstance
|
308
|
+
def fetch
|
309
|
+
context.fetch
|
310
|
+
end
|
311
|
+
|
312
|
+
##
|
313
|
+
# Update the NetworkAccessProfileInstance
|
314
|
+
# @param [String] unique_name The unique_name
|
315
|
+
# @return [NetworkAccessProfileInstance] Updated NetworkAccessProfileInstance
|
316
|
+
def update(unique_name: :unset)
|
317
|
+
context.update(unique_name: unique_name, )
|
318
|
+
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# Provide a user friendly representation
|
322
|
+
def to_s
|
323
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
324
|
+
"<Twilio.Supersim.V1.NetworkAccessProfileInstance #{values}>"
|
325
|
+
end
|
326
|
+
|
327
|
+
##
|
328
|
+
# Provide a detailed, user friendly representation
|
329
|
+
def inspect
|
330
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
331
|
+
"<Twilio.Supersim.V1.NetworkAccessProfileInstance #{values}>"
|
332
|
+
end
|
333
|
+
end
|
334
|
+
end
|
335
|
+
end
|
336
|
+
end
|
337
|
+
end
|