twilio-ruby 5.61.1 → 5.63.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test-and-deploy.yml +124 -0
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +84 -21
- data/CHANGES.md +96 -0
- data/Makefile +3 -6
- data/README.md +4 -4
- data/lib/rack/twilio_webhook_authentication.rb +25 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +19 -5
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +33 -18
- data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +483 -0
- data/lib/twilio-ruby/rest/insights/v1/conference.rb +484 -0
- data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +23 -0
- data/lib/twilio-ruby/rest/insights.rb +14 -0
- data/lib/twilio-ruby/rest/media/v1/media_processor.rb +14 -1
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +23 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +80 -0
- data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
- data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +416 -0
- data/lib/twilio-ruby/rest/supersim/v1.rb +32 -0
- data/lib/twilio-ruby/rest/supersim.rb +18 -0
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +138 -10
- data/lib/twilio-ruby/rest/verify/v2/service.rb +8 -2
- data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -0
- data/lib/twilio-ruby/rest/video/v1/recording.rb +7 -0
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
- data/lib/twilio-ruby/rest/video/v1/room.rb +34 -1
- data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
- data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
- data/lib/twilio-ruby/rest/voice.rb +8 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +4 -4
- data/lib/twilio-ruby/version.rb +1 -1
- data/sonar-project.properties +1 -1
- data/twilio-ruby.gemspec +0 -1
- metadata +10 -18
- data/.github/workflows/deploy.yml +0 -65
- data/.github/workflows/test.yml +0 -51
@@ -15,11 +15,19 @@ module Twilio
|
|
15
15
|
def initialize(domain)
|
16
16
|
super
|
17
17
|
@version = 'v1'
|
18
|
+
@settings = nil
|
18
19
|
@calls = nil
|
19
20
|
@call_summaries = nil
|
21
|
+
@conferences = nil
|
20
22
|
@rooms = nil
|
21
23
|
end
|
22
24
|
|
25
|
+
##
|
26
|
+
# @return [Twilio::REST::Insights::V1::SettingContext]
|
27
|
+
def settings
|
28
|
+
@settings ||= SettingContext.new self
|
29
|
+
end
|
30
|
+
|
23
31
|
##
|
24
32
|
# @param [String] sid The sid
|
25
33
|
# @return [Twilio::REST::Insights::V1::CallContext] if sid was passed.
|
@@ -41,6 +49,21 @@ module Twilio
|
|
41
49
|
@call_summaries ||= CallSummariesList.new self
|
42
50
|
end
|
43
51
|
|
52
|
+
##
|
53
|
+
# @param [String] conference_sid The conference_sid
|
54
|
+
# @return [Twilio::REST::Insights::V1::ConferenceContext] if conference_sid was passed.
|
55
|
+
# @return [Twilio::REST::Insights::V1::ConferenceList]
|
56
|
+
def conferences(conference_sid=:unset)
|
57
|
+
if conference_sid.nil?
|
58
|
+
raise ArgumentError, 'conference_sid cannot be nil'
|
59
|
+
end
|
60
|
+
if conference_sid == :unset
|
61
|
+
@conferences ||= ConferenceList.new self
|
62
|
+
else
|
63
|
+
ConferenceContext.new(self, conference_sid)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
44
67
|
##
|
45
68
|
# @param [String] room_sid The SID of the Room resource.
|
46
69
|
# @return [Twilio::REST::Insights::V1::RoomContext] if room_sid was passed.
|
@@ -28,6 +28,12 @@ module Twilio
|
|
28
28
|
@v1 ||= V1.new self
|
29
29
|
end
|
30
30
|
|
31
|
+
##
|
32
|
+
# @return [Twilio::REST::Insights::V1::SettingInstance]
|
33
|
+
def settings
|
34
|
+
self.v1.settings()
|
35
|
+
end
|
36
|
+
|
31
37
|
##
|
32
38
|
# @param [String] sid The sid
|
33
39
|
# @return [Twilio::REST::Insights::V1::CallInstance] if sid was passed.
|
@@ -42,6 +48,14 @@ module Twilio
|
|
42
48
|
self.v1.call_summaries()
|
43
49
|
end
|
44
50
|
|
51
|
+
##
|
52
|
+
# @param [String] conference_sid The conference_sid
|
53
|
+
# @return [Twilio::REST::Insights::V1::ConferenceInstance] if conference_sid was passed.
|
54
|
+
# @return [Twilio::REST::Insights::V1::ConferenceList]
|
55
|
+
def conferences(conference_sid=:unset)
|
56
|
+
self.v1.conferences(conference_sid)
|
57
|
+
end
|
58
|
+
|
45
59
|
##
|
46
60
|
# @param [String] room_sid Unique identifier for the room.
|
47
61
|
# @return [Twilio::REST::Insights::V1::RoomInstance] if room_sid was passed.
|
@@ -42,14 +42,20 @@ module Twilio
|
|
42
42
|
# Callbacks}[/docs/live/status-callbacks] for details.
|
43
43
|
# @param [String] status_callback_method The HTTP method Twilio should use to call
|
44
44
|
# the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
|
45
|
+
# @param [String] max_duration The maximum time, in seconds, that the
|
46
|
+
# MediaProcessor can run before automatically ends. The default value is 300
|
47
|
+
# seconds, and the maximum value is 90000 seconds. Once this maximum duration is
|
48
|
+
# reached, Twilio will end the MediaProcessor, regardless of whether media is
|
49
|
+
# still streaming.
|
45
50
|
# @return [MediaProcessorInstance] Created MediaProcessorInstance
|
46
|
-
def create(extension: nil, extension_context: nil, extension_environment: :unset, status_callback: :unset, status_callback_method: :unset)
|
51
|
+
def create(extension: nil, extension_context: nil, extension_environment: :unset, status_callback: :unset, status_callback_method: :unset, max_duration: :unset)
|
47
52
|
data = Twilio::Values.of({
|
48
53
|
'Extension' => extension,
|
49
54
|
'ExtensionContext' => extension_context,
|
50
55
|
'ExtensionEnvironment' => Twilio.serialize_object(extension_environment),
|
51
56
|
'StatusCallback' => status_callback,
|
52
57
|
'StatusCallbackMethod' => status_callback_method,
|
58
|
+
'MaxDuration' => max_duration,
|
53
59
|
})
|
54
60
|
|
55
61
|
payload = @version.create('POST', @uri, data: data)
|
@@ -264,6 +270,7 @@ module Twilio
|
|
264
270
|
'ended_reason' => payload['ended_reason'],
|
265
271
|
'status_callback' => payload['status_callback'],
|
266
272
|
'status_callback_method' => payload['status_callback_method'],
|
273
|
+
'max_duration' => payload['max_duration'].to_i,
|
267
274
|
}
|
268
275
|
|
269
276
|
# Context
|
@@ -348,6 +355,12 @@ module Twilio
|
|
348
355
|
@properties['status_callback_method']
|
349
356
|
end
|
350
357
|
|
358
|
+
##
|
359
|
+
# @return [String] Maximum MediaProcessor duration in minutes
|
360
|
+
def max_duration
|
361
|
+
@properties['max_duration']
|
362
|
+
end
|
363
|
+
|
351
364
|
##
|
352
365
|
# Fetch the MediaProcessorInstance
|
353
366
|
# @return [MediaProcessorInstance] Fetched MediaProcessorInstance
|
@@ -198,6 +198,15 @@ module Twilio
|
|
198
198
|
BrandRegistrationInstance.new(@version, payload, sid: @solution[:sid], )
|
199
199
|
end
|
200
200
|
|
201
|
+
##
|
202
|
+
# Update the BrandRegistrationInstance
|
203
|
+
# @return [BrandRegistrationInstance] Updated BrandRegistrationInstance
|
204
|
+
def update
|
205
|
+
payload = @version.update('POST', @uri)
|
206
|
+
|
207
|
+
BrandRegistrationInstance.new(@version, payload, sid: @solution[:sid], )
|
208
|
+
end
|
209
|
+
|
201
210
|
##
|
202
211
|
# Access the brand_vettings
|
203
212
|
# @return [BrandVettingList]
|
@@ -260,6 +269,7 @@ module Twilio
|
|
260
269
|
'brand_feedback' => payload['brand_feedback'],
|
261
270
|
'identity_status' => payload['identity_status'],
|
262
271
|
'russell_3000' => payload['russell_3000'],
|
272
|
+
'government_entity' => payload['government_entity'],
|
263
273
|
'tax_exempt_status' => payload['tax_exempt_status'],
|
264
274
|
'skip_automatic_sec_vet' => payload['skip_automatic_sec_vet'],
|
265
275
|
'mock' => payload['mock'],
|
@@ -372,6 +382,12 @@ module Twilio
|
|
372
382
|
@properties['russell_3000']
|
373
383
|
end
|
374
384
|
|
385
|
+
##
|
386
|
+
# @return [Boolean] Government Entity
|
387
|
+
def government_entity
|
388
|
+
@properties['government_entity']
|
389
|
+
end
|
390
|
+
|
375
391
|
##
|
376
392
|
# @return [String] Tax Exempt Status
|
377
393
|
def tax_exempt_status
|
@@ -403,6 +419,13 @@ module Twilio
|
|
403
419
|
context.fetch
|
404
420
|
end
|
405
421
|
|
422
|
+
##
|
423
|
+
# Update the BrandRegistrationInstance
|
424
|
+
# @return [BrandRegistrationInstance] Updated BrandRegistrationInstance
|
425
|
+
def update
|
426
|
+
context.update
|
427
|
+
end
|
428
|
+
|
406
429
|
##
|
407
430
|
# Access the brand_vettings
|
408
431
|
# @return [brand_vettings] brand_vettings
|
@@ -42,6 +42,86 @@ module Twilio
|
|
42
42
|
BundleCopyInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], )
|
43
43
|
end
|
44
44
|
|
45
|
+
##
|
46
|
+
# Lists BundleCopyInstance records from the API as a list.
|
47
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
48
|
+
# memory before returning.
|
49
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
50
|
+
# guarantees to never return more than limit. Default is no limit
|
51
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
52
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
53
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
54
|
+
# efficient page size, i.e. min(limit, 1000)
|
55
|
+
# @return [Array] Array of up to limit results
|
56
|
+
def list(limit: nil, page_size: nil)
|
57
|
+
self.stream(limit: limit, page_size: page_size).entries
|
58
|
+
end
|
59
|
+
|
60
|
+
##
|
61
|
+
# Streams BundleCopyInstance records from the API as an Enumerable.
|
62
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
63
|
+
# is reached.
|
64
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
65
|
+
# guarantees to never return more than limit. Default is no limit.
|
66
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
67
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
68
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
69
|
+
# efficient page size, i.e. min(limit, 1000)
|
70
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
71
|
+
def stream(limit: nil, page_size: nil)
|
72
|
+
limits = @version.read_limits(limit, page_size)
|
73
|
+
|
74
|
+
page = self.page(page_size: limits[:page_size], )
|
75
|
+
|
76
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
77
|
+
end
|
78
|
+
|
79
|
+
##
|
80
|
+
# When passed a block, yields BundleCopyInstance records from the API.
|
81
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
82
|
+
# is reached.
|
83
|
+
def each
|
84
|
+
limits = @version.read_limits
|
85
|
+
|
86
|
+
page = self.page(page_size: limits[:page_size], )
|
87
|
+
|
88
|
+
@version.stream(page,
|
89
|
+
limit: limits[:limit],
|
90
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Retrieve a single page of BundleCopyInstance records from the API.
|
95
|
+
# Request is executed immediately.
|
96
|
+
# @param [String] page_token PageToken provided by the API
|
97
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
98
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
99
|
+
# @return [Page] Page of BundleCopyInstance
|
100
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
101
|
+
params = Twilio::Values.of({
|
102
|
+
'PageToken' => page_token,
|
103
|
+
'Page' => page_number,
|
104
|
+
'PageSize' => page_size,
|
105
|
+
})
|
106
|
+
|
107
|
+
response = @version.page('GET', @uri, params: params)
|
108
|
+
|
109
|
+
BundleCopyPage.new(@version, response, @solution)
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# Retrieve a single page of BundleCopyInstance records from the API.
|
114
|
+
# Request is executed immediately.
|
115
|
+
# @param [String] target_url API-generated URL for the requested results page
|
116
|
+
# @return [Page] Page of BundleCopyInstance
|
117
|
+
def get_page(target_url)
|
118
|
+
response = @version.domain.request(
|
119
|
+
'GET',
|
120
|
+
target_url
|
121
|
+
)
|
122
|
+
BundleCopyPage.new(@version, response, @solution)
|
123
|
+
end
|
124
|
+
|
45
125
|
##
|
46
126
|
# Provide a user friendly representation
|
47
127
|
def to_s
|
@@ -0,0 +1,372 @@
|
|
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 beta products that are subject to change. Use them with caution.
|
15
|
+
class EsimProfileList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the EsimProfileList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [EsimProfileList] EsimProfileList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/ESimProfiles"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Create the EsimProfileInstance
|
30
|
+
# @param [String] eid Identifier of the eUICC that will claim the eSIM Profile.
|
31
|
+
# @param [String] callback_url The URL we should call using the `callback_method`
|
32
|
+
# when the status of the eSIM Profile changes. At this stage of the eSIM Profile
|
33
|
+
# pilot, the a request to the URL will only be called when the ESimProfile
|
34
|
+
# resource changes from `reserving` to `available`.
|
35
|
+
# @param [String] callback_method The HTTP method we should use to call
|
36
|
+
# `callback_url`. Can be: `GET` or `POST` and the default is POST.
|
37
|
+
# @return [EsimProfileInstance] Created EsimProfileInstance
|
38
|
+
def create(eid: nil, callback_url: :unset, callback_method: :unset)
|
39
|
+
data = Twilio::Values.of({
|
40
|
+
'Eid' => eid,
|
41
|
+
'CallbackUrl' => callback_url,
|
42
|
+
'CallbackMethod' => callback_method,
|
43
|
+
})
|
44
|
+
|
45
|
+
payload = @version.create('POST', @uri, data: data)
|
46
|
+
|
47
|
+
EsimProfileInstance.new(@version, payload, )
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Lists EsimProfileInstance records from the API as a list.
|
52
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
53
|
+
# memory before returning.
|
54
|
+
# @param [String] eid List the eSIM Profiles that have been associated with an
|
55
|
+
# EId.
|
56
|
+
# @param [String] sim_sid Find the eSIM Profile resource related to a
|
57
|
+
# {Sim}[https://www.twilio.com/docs/wireless/api/sim-resource] resource by
|
58
|
+
# providing the SIM SID. Will always return an array with either 1 or 0 records.
|
59
|
+
# @param [esim_profile.Status] status List the eSIM Profiles that are in a given
|
60
|
+
# status.
|
61
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
62
|
+
# guarantees to never return more than limit. Default is no limit
|
63
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
64
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
65
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
66
|
+
# efficient page size, i.e. min(limit, 1000)
|
67
|
+
# @return [Array] Array of up to limit results
|
68
|
+
def list(eid: :unset, sim_sid: :unset, status: :unset, limit: nil, page_size: nil)
|
69
|
+
self.stream(eid: eid, sim_sid: sim_sid, status: status, limit: limit, page_size: page_size).entries
|
70
|
+
end
|
71
|
+
|
72
|
+
##
|
73
|
+
# Streams EsimProfileInstance records from the API as an Enumerable.
|
74
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
75
|
+
# is reached.
|
76
|
+
# @param [String] eid List the eSIM Profiles that have been associated with an
|
77
|
+
# EId.
|
78
|
+
# @param [String] sim_sid Find the eSIM Profile resource related to a
|
79
|
+
# {Sim}[https://www.twilio.com/docs/wireless/api/sim-resource] resource by
|
80
|
+
# providing the SIM SID. Will always return an array with either 1 or 0 records.
|
81
|
+
# @param [esim_profile.Status] status List the eSIM Profiles that are in a given
|
82
|
+
# status.
|
83
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
84
|
+
# guarantees to never return more than limit. Default is no limit.
|
85
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
86
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
87
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
88
|
+
# efficient page size, i.e. min(limit, 1000)
|
89
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
90
|
+
def stream(eid: :unset, sim_sid: :unset, status: :unset, limit: nil, page_size: nil)
|
91
|
+
limits = @version.read_limits(limit, page_size)
|
92
|
+
|
93
|
+
page = self.page(eid: eid, sim_sid: sim_sid, status: status, page_size: limits[:page_size], )
|
94
|
+
|
95
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# When passed a block, yields EsimProfileInstance records from the API.
|
100
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
101
|
+
# is reached.
|
102
|
+
def each
|
103
|
+
limits = @version.read_limits
|
104
|
+
|
105
|
+
page = self.page(page_size: limits[:page_size], )
|
106
|
+
|
107
|
+
@version.stream(page,
|
108
|
+
limit: limits[:limit],
|
109
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# Retrieve a single page of EsimProfileInstance records from the API.
|
114
|
+
# Request is executed immediately.
|
115
|
+
# @param [String] eid List the eSIM Profiles that have been associated with an
|
116
|
+
# EId.
|
117
|
+
# @param [String] sim_sid Find the eSIM Profile resource related to a
|
118
|
+
# {Sim}[https://www.twilio.com/docs/wireless/api/sim-resource] resource by
|
119
|
+
# providing the SIM SID. Will always return an array with either 1 or 0 records.
|
120
|
+
# @param [esim_profile.Status] status List the eSIM Profiles that are in a given
|
121
|
+
# status.
|
122
|
+
# @param [String] page_token PageToken provided by the API
|
123
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
124
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
125
|
+
# @return [Page] Page of EsimProfileInstance
|
126
|
+
def page(eid: :unset, sim_sid: :unset, status: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
127
|
+
params = Twilio::Values.of({
|
128
|
+
'Eid' => eid,
|
129
|
+
'SimSid' => sim_sid,
|
130
|
+
'Status' => status,
|
131
|
+
'PageToken' => page_token,
|
132
|
+
'Page' => page_number,
|
133
|
+
'PageSize' => page_size,
|
134
|
+
})
|
135
|
+
|
136
|
+
response = @version.page('GET', @uri, params: params)
|
137
|
+
|
138
|
+
EsimProfilePage.new(@version, response, @solution)
|
139
|
+
end
|
140
|
+
|
141
|
+
##
|
142
|
+
# Retrieve a single page of EsimProfileInstance records from the API.
|
143
|
+
# Request is executed immediately.
|
144
|
+
# @param [String] target_url API-generated URL for the requested results page
|
145
|
+
# @return [Page] Page of EsimProfileInstance
|
146
|
+
def get_page(target_url)
|
147
|
+
response = @version.domain.request(
|
148
|
+
'GET',
|
149
|
+
target_url
|
150
|
+
)
|
151
|
+
EsimProfilePage.new(@version, response, @solution)
|
152
|
+
end
|
153
|
+
|
154
|
+
##
|
155
|
+
# Provide a user friendly representation
|
156
|
+
def to_s
|
157
|
+
'#<Twilio.Supersim.V1.EsimProfileList>'
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
##
|
162
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
163
|
+
class EsimProfilePage < Page
|
164
|
+
##
|
165
|
+
# Initialize the EsimProfilePage
|
166
|
+
# @param [Version] version Version that contains the resource
|
167
|
+
# @param [Response] response Response from the API
|
168
|
+
# @param [Hash] solution Path solution for the resource
|
169
|
+
# @return [EsimProfilePage] EsimProfilePage
|
170
|
+
def initialize(version, response, solution)
|
171
|
+
super(version, response)
|
172
|
+
|
173
|
+
# Path Solution
|
174
|
+
@solution = solution
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# Build an instance of EsimProfileInstance
|
179
|
+
# @param [Hash] payload Payload response from the API
|
180
|
+
# @return [EsimProfileInstance] EsimProfileInstance
|
181
|
+
def get_instance(payload)
|
182
|
+
EsimProfileInstance.new(@version, payload, )
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# Provide a user friendly representation
|
187
|
+
def to_s
|
188
|
+
'<Twilio.Supersim.V1.EsimProfilePage>'
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
##
|
193
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
194
|
+
class EsimProfileContext < InstanceContext
|
195
|
+
##
|
196
|
+
# Initialize the EsimProfileContext
|
197
|
+
# @param [Version] version Version that contains the resource
|
198
|
+
# @param [String] sid The SID of the eSIM Profile resource to fetch.
|
199
|
+
# @return [EsimProfileContext] EsimProfileContext
|
200
|
+
def initialize(version, sid)
|
201
|
+
super(version)
|
202
|
+
|
203
|
+
# Path Solution
|
204
|
+
@solution = {sid: sid, }
|
205
|
+
@uri = "/ESimProfiles/#{@solution[:sid]}"
|
206
|
+
end
|
207
|
+
|
208
|
+
##
|
209
|
+
# Fetch the EsimProfileInstance
|
210
|
+
# @return [EsimProfileInstance] Fetched EsimProfileInstance
|
211
|
+
def fetch
|
212
|
+
payload = @version.fetch('GET', @uri)
|
213
|
+
|
214
|
+
EsimProfileInstance.new(@version, payload, sid: @solution[:sid], )
|
215
|
+
end
|
216
|
+
|
217
|
+
##
|
218
|
+
# Provide a user friendly representation
|
219
|
+
def to_s
|
220
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
221
|
+
"#<Twilio.Supersim.V1.EsimProfileContext #{context}>"
|
222
|
+
end
|
223
|
+
|
224
|
+
##
|
225
|
+
# Provide a detailed, user friendly representation
|
226
|
+
def inspect
|
227
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
228
|
+
"#<Twilio.Supersim.V1.EsimProfileContext #{context}>"
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
##
|
233
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
234
|
+
class EsimProfileInstance < InstanceResource
|
235
|
+
##
|
236
|
+
# Initialize the EsimProfileInstance
|
237
|
+
# @param [Version] version Version that contains the resource
|
238
|
+
# @param [Hash] payload payload that contains response from Twilio
|
239
|
+
# @param [String] sid The SID of the eSIM Profile resource to fetch.
|
240
|
+
# @return [EsimProfileInstance] EsimProfileInstance
|
241
|
+
def initialize(version, payload, sid: nil)
|
242
|
+
super(version)
|
243
|
+
|
244
|
+
# Marshaled Properties
|
245
|
+
@properties = {
|
246
|
+
'sid' => payload['sid'],
|
247
|
+
'account_sid' => payload['account_sid'],
|
248
|
+
'iccid' => payload['iccid'],
|
249
|
+
'sim_sid' => payload['sim_sid'],
|
250
|
+
'status' => payload['status'],
|
251
|
+
'eid' => payload['eid'],
|
252
|
+
'smdp_plus_address' => payload['smdp_plus_address'],
|
253
|
+
'error_code' => payload['error_code'],
|
254
|
+
'error_message' => payload['error_message'],
|
255
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
256
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
257
|
+
'url' => payload['url'],
|
258
|
+
}
|
259
|
+
|
260
|
+
# Context
|
261
|
+
@instance_context = nil
|
262
|
+
@params = {'sid' => sid || @properties['sid'], }
|
263
|
+
end
|
264
|
+
|
265
|
+
##
|
266
|
+
# Generate an instance context for the instance, the context is capable of
|
267
|
+
# performing various actions. All instance actions are proxied to the context
|
268
|
+
# @return [EsimProfileContext] EsimProfileContext for this EsimProfileInstance
|
269
|
+
def context
|
270
|
+
unless @instance_context
|
271
|
+
@instance_context = EsimProfileContext.new(@version, @params['sid'], )
|
272
|
+
end
|
273
|
+
@instance_context
|
274
|
+
end
|
275
|
+
|
276
|
+
##
|
277
|
+
# @return [String] The unique string that identifies the resource
|
278
|
+
def sid
|
279
|
+
@properties['sid']
|
280
|
+
end
|
281
|
+
|
282
|
+
##
|
283
|
+
# @return [String] The SID of the Account to which the eSIM Profile resource belongs
|
284
|
+
def account_sid
|
285
|
+
@properties['account_sid']
|
286
|
+
end
|
287
|
+
|
288
|
+
##
|
289
|
+
# @return [String] The ICCID associated with the Sim resource
|
290
|
+
def iccid
|
291
|
+
@properties['iccid']
|
292
|
+
end
|
293
|
+
|
294
|
+
##
|
295
|
+
# @return [String] The SID of the Sim resource that this eSIM Profile controls
|
296
|
+
def sim_sid
|
297
|
+
@properties['sim_sid']
|
298
|
+
end
|
299
|
+
|
300
|
+
##
|
301
|
+
# @return [esim_profile.Status] The status of the eSIM Profile
|
302
|
+
def status
|
303
|
+
@properties['status']
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# @return [String] Identifier of the eUICC that can claim the eSIM Profile
|
308
|
+
def eid
|
309
|
+
@properties['eid']
|
310
|
+
end
|
311
|
+
|
312
|
+
##
|
313
|
+
# @return [String] Address of the SM-DP+ server from which the Profile will be downloaded
|
314
|
+
def smdp_plus_address
|
315
|
+
@properties['smdp_plus_address']
|
316
|
+
end
|
317
|
+
|
318
|
+
##
|
319
|
+
# @return [String] Code indicating the failure if the download of the SIM Profile failed and the eSIM Profile is in `failed` state
|
320
|
+
def error_code
|
321
|
+
@properties['error_code']
|
322
|
+
end
|
323
|
+
|
324
|
+
##
|
325
|
+
# @return [String] Error message describing the failure if the download of the SIM Profile failed and the eSIM Profile is in `failed` state
|
326
|
+
def error_message
|
327
|
+
@properties['error_message']
|
328
|
+
end
|
329
|
+
|
330
|
+
##
|
331
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was created
|
332
|
+
def date_created
|
333
|
+
@properties['date_created']
|
334
|
+
end
|
335
|
+
|
336
|
+
##
|
337
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
|
338
|
+
def date_updated
|
339
|
+
@properties['date_updated']
|
340
|
+
end
|
341
|
+
|
342
|
+
##
|
343
|
+
# @return [String] The absolute URL of the eSIM Profile resource
|
344
|
+
def url
|
345
|
+
@properties['url']
|
346
|
+
end
|
347
|
+
|
348
|
+
##
|
349
|
+
# Fetch the EsimProfileInstance
|
350
|
+
# @return [EsimProfileInstance] Fetched EsimProfileInstance
|
351
|
+
def fetch
|
352
|
+
context.fetch
|
353
|
+
end
|
354
|
+
|
355
|
+
##
|
356
|
+
# Provide a user friendly representation
|
357
|
+
def to_s
|
358
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
359
|
+
"<Twilio.Supersim.V1.EsimProfileInstance #{values}>"
|
360
|
+
end
|
361
|
+
|
362
|
+
##
|
363
|
+
# Provide a detailed, user friendly representation
|
364
|
+
def inspect
|
365
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
366
|
+
"<Twilio.Supersim.V1.EsimProfileInstance #{values}>"
|
367
|
+
end
|
368
|
+
end
|
369
|
+
end
|
370
|
+
end
|
371
|
+
end
|
372
|
+
end
|