twilio-ruby 5.63.0 → 5.65.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/.github/workflows/test-and-deploy.yml +27 -3
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +84 -21
- data/CHANGES.md +79 -0
- data/Makefile +1 -4
- data/README.md +3 -2
- data/lib/rack/twilio_webhook_authentication.rb +25 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +26 -0
- data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +447 -0
- data/lib/twilio-ruby/rest/conversations/v1.rb +17 -0
- data/lib/twilio-ruby/rest/conversations.rb +9 -0
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -77
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +33 -18
- data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
- data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +16 -0
- data/lib/twilio-ruby/rest/insights.rb +8 -0
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +7 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +75 -18
- data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +71 -30
- data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +9 -9
- data/lib/twilio-ruby/rest/supersim/v1.rb +16 -0
- data/lib/twilio-ruby/rest/supersim.rb +9 -0
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +130 -8
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +7 -0
- data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +16 -6
- data/lib/twilio-ruby/rest/verify/v2/service.rb +8 -2
- data/lib/twilio-ruby/rest/verify/v2/template.rb +1 -1
- data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
- data/lib/twilio-ruby/rest/verify.rb +2 -2
- data/lib/twilio-ruby/rest/video/v1/room.rb +7 -4
- data/lib/twilio-ruby/version.rb +1 -1
- data/sonar-project.properties +1 -1
- data/twilio-ruby.gemspec +0 -1
- metadata +7 -16
@@ -64,15 +64,28 @@ module Twilio
|
|
64
64
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
65
65
|
# memory before returning.
|
66
66
|
# @param [bundle.Status] status The verification status of the Bundle resource.
|
67
|
+
# Please refer to {Bundle
|
68
|
+
# Statuses}[https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses]
|
69
|
+
# for more details.
|
67
70
|
# @param [String] friendly_name The string that you assigned to describe the
|
68
|
-
# resource.
|
69
|
-
# @param [String] regulation_sid The unique string of a
|
70
|
-
#
|
71
|
-
#
|
71
|
+
# resource. The column can contain 255 variable characters.
|
72
|
+
# @param [String] regulation_sid The unique string of a {Regulation
|
73
|
+
# resource}[https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations]
|
74
|
+
# that is associated to the Bundle resource.
|
75
|
+
# @param [String] iso_country The 2-digit {ISO country
|
72
76
|
# code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the Bundle's phone
|
73
77
|
# number country ownership request.
|
74
78
|
# @param [String] number_type The type of phone number of the Bundle's ownership
|
75
|
-
# request. Can be `local`, `mobile`, `national`, or `
|
79
|
+
# request. Can be `local`, `mobile`, `national`, or `tollfree`.
|
80
|
+
# @param [Boolean] has_valid_until_date Indicates that the Bundle is a valid
|
81
|
+
# Bundle until a specified expiration date.
|
82
|
+
# @param [bundle.SortBy] sort_by Can be `valid-until` or `date-updated`. Defaults
|
83
|
+
# to `date-created`.
|
84
|
+
# @param [bundle.SortDirection] sort_direction Default is `DESC`. Can be `ASC` or
|
85
|
+
# `DESC`.
|
86
|
+
# @param [Time] valid_until_date_before Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well.
|
87
|
+
# @param [Time] valid_until_date Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well.
|
88
|
+
# @param [Time] valid_until_date_after Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well.
|
76
89
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
77
90
|
# guarantees to never return more than limit. Default is no limit
|
78
91
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -80,13 +93,19 @@ module Twilio
|
|
80
93
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
81
94
|
# efficient page size, i.e. min(limit, 1000)
|
82
95
|
# @return [Array] Array of up to limit results
|
83
|
-
def list(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, limit: nil, page_size: nil)
|
96
|
+
def list(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date_before: :unset, valid_until_date: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
|
84
97
|
self.stream(
|
85
98
|
status: status,
|
86
99
|
friendly_name: friendly_name,
|
87
100
|
regulation_sid: regulation_sid,
|
88
101
|
iso_country: iso_country,
|
89
102
|
number_type: number_type,
|
103
|
+
has_valid_until_date: has_valid_until_date,
|
104
|
+
sort_by: sort_by,
|
105
|
+
sort_direction: sort_direction,
|
106
|
+
valid_until_date_before: valid_until_date_before,
|
107
|
+
valid_until_date: valid_until_date,
|
108
|
+
valid_until_date_after: valid_until_date_after,
|
90
109
|
limit: limit,
|
91
110
|
page_size: page_size
|
92
111
|
).entries
|
@@ -97,15 +116,28 @@ module Twilio
|
|
97
116
|
# This operation lazily loads records as efficiently as possible until the limit
|
98
117
|
# is reached.
|
99
118
|
# @param [bundle.Status] status The verification status of the Bundle resource.
|
119
|
+
# Please refer to {Bundle
|
120
|
+
# Statuses}[https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses]
|
121
|
+
# for more details.
|
100
122
|
# @param [String] friendly_name The string that you assigned to describe the
|
101
|
-
# resource.
|
102
|
-
# @param [String] regulation_sid The unique string of a
|
103
|
-
#
|
104
|
-
#
|
123
|
+
# resource. The column can contain 255 variable characters.
|
124
|
+
# @param [String] regulation_sid The unique string of a {Regulation
|
125
|
+
# resource}[https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations]
|
126
|
+
# that is associated to the Bundle resource.
|
127
|
+
# @param [String] iso_country The 2-digit {ISO country
|
105
128
|
# code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the Bundle's phone
|
106
129
|
# number country ownership request.
|
107
130
|
# @param [String] number_type The type of phone number of the Bundle's ownership
|
108
|
-
# request. Can be `local`, `mobile`, `national`, or `
|
131
|
+
# request. Can be `local`, `mobile`, `national`, or `tollfree`.
|
132
|
+
# @param [Boolean] has_valid_until_date Indicates that the Bundle is a valid
|
133
|
+
# Bundle until a specified expiration date.
|
134
|
+
# @param [bundle.SortBy] sort_by Can be `valid-until` or `date-updated`. Defaults
|
135
|
+
# to `date-created`.
|
136
|
+
# @param [bundle.SortDirection] sort_direction Default is `DESC`. Can be `ASC` or
|
137
|
+
# `DESC`.
|
138
|
+
# @param [Time] valid_until_date_before Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well.
|
139
|
+
# @param [Time] valid_until_date Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well.
|
140
|
+
# @param [Time] valid_until_date_after Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well.
|
109
141
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
110
142
|
# guarantees to never return more than limit. Default is no limit.
|
111
143
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -113,7 +145,7 @@ module Twilio
|
|
113
145
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
114
146
|
# efficient page size, i.e. min(limit, 1000)
|
115
147
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
116
|
-
def stream(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, limit: nil, page_size: nil)
|
148
|
+
def stream(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date_before: :unset, valid_until_date: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
|
117
149
|
limits = @version.read_limits(limit, page_size)
|
118
150
|
|
119
151
|
page = self.page(
|
@@ -122,6 +154,12 @@ module Twilio
|
|
122
154
|
regulation_sid: regulation_sid,
|
123
155
|
iso_country: iso_country,
|
124
156
|
number_type: number_type,
|
157
|
+
has_valid_until_date: has_valid_until_date,
|
158
|
+
sort_by: sort_by,
|
159
|
+
sort_direction: sort_direction,
|
160
|
+
valid_until_date_before: valid_until_date_before,
|
161
|
+
valid_until_date: valid_until_date,
|
162
|
+
valid_until_date_after: valid_until_date_after,
|
125
163
|
page_size: limits[:page_size],
|
126
164
|
)
|
127
165
|
|
@@ -146,26 +184,45 @@ module Twilio
|
|
146
184
|
# Retrieve a single page of BundleInstance records from the API.
|
147
185
|
# Request is executed immediately.
|
148
186
|
# @param [bundle.Status] status The verification status of the Bundle resource.
|
187
|
+
# Please refer to {Bundle
|
188
|
+
# Statuses}[https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses]
|
189
|
+
# for more details.
|
149
190
|
# @param [String] friendly_name The string that you assigned to describe the
|
150
|
-
# resource.
|
151
|
-
# @param [String] regulation_sid The unique string of a
|
152
|
-
#
|
153
|
-
#
|
191
|
+
# resource. The column can contain 255 variable characters.
|
192
|
+
# @param [String] regulation_sid The unique string of a {Regulation
|
193
|
+
# resource}[https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations]
|
194
|
+
# that is associated to the Bundle resource.
|
195
|
+
# @param [String] iso_country The 2-digit {ISO country
|
154
196
|
# code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the Bundle's phone
|
155
197
|
# number country ownership request.
|
156
198
|
# @param [String] number_type The type of phone number of the Bundle's ownership
|
157
|
-
# request. Can be `local`, `mobile`, `national`, or `
|
199
|
+
# request. Can be `local`, `mobile`, `national`, or `tollfree`.
|
200
|
+
# @param [Boolean] has_valid_until_date Indicates that the Bundle is a valid
|
201
|
+
# Bundle until a specified expiration date.
|
202
|
+
# @param [bundle.SortBy] sort_by Can be `valid-until` or `date-updated`. Defaults
|
203
|
+
# to `date-created`.
|
204
|
+
# @param [bundle.SortDirection] sort_direction Default is `DESC`. Can be `ASC` or
|
205
|
+
# `DESC`.
|
206
|
+
# @param [Time] valid_until_date_before Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well.
|
207
|
+
# @param [Time] valid_until_date Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well.
|
208
|
+
# @param [Time] valid_until_date_after Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well.
|
158
209
|
# @param [String] page_token PageToken provided by the API
|
159
210
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
160
211
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
161
212
|
# @return [Page] Page of BundleInstance
|
162
|
-
def page(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
213
|
+
def page(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date_before: :unset, valid_until_date: :unset, valid_until_date_after: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
163
214
|
params = Twilio::Values.of({
|
164
215
|
'Status' => status,
|
165
216
|
'FriendlyName' => friendly_name,
|
166
217
|
'RegulationSid' => regulation_sid,
|
167
218
|
'IsoCountry' => iso_country,
|
168
219
|
'NumberType' => number_type,
|
220
|
+
'HasValidUntilDate' => has_valid_until_date,
|
221
|
+
'SortBy' => sort_by,
|
222
|
+
'SortDirection' => sort_direction,
|
223
|
+
'ValidUntilDate<' => Twilio.serialize_iso8601_datetime(valid_until_date_before),
|
224
|
+
'ValidUntilDate' => Twilio.serialize_iso8601_datetime(valid_until_date),
|
225
|
+
'ValidUntilDate>' => Twilio.serialize_iso8601_datetime(valid_until_date_after),
|
169
226
|
'PageToken' => page_token,
|
170
227
|
'Page' => page_number,
|
171
228
|
'PageSize' => page_size,
|
@@ -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
|