twilio-ruby 5.52.0 → 5.67.3

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.
Files changed (163) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/pr-lint.yml +15 -0
  3. data/.github/workflows/test-and-deploy.yml +129 -0
  4. data/.gitignore +5 -1
  5. data/.rubocop.yml +1 -1
  6. data/.rubocop_todo.yml +91 -28
  7. data/CHANGES.md +563 -0
  8. data/Gemfile +1 -0
  9. data/Makefile +8 -11
  10. data/README.md +13 -6
  11. data/examples/examples.rb +1 -1
  12. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  13. data/lib/twilio-ruby/http/http_client.rb +20 -4
  14. data/lib/twilio-ruby/http.rb +5 -0
  15. data/lib/twilio-ruby/jwt/access_token.rb +13 -0
  16. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +23 -23
  17. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -8
  19. data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +674 -0
  20. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
  21. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +68 -14
  22. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +12 -8
  23. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  24. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -4
  25. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -4
  26. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -4
  27. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +17 -10
  28. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +18 -5
  29. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +34 -7
  30. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
  31. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
  32. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +0 -8
  33. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +0 -6
  34. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +0 -8
  35. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -8
  36. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -8
  37. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +10 -4
  38. data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
  39. data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
  40. data/lib/twilio-ruby/rest/chat.rb +16 -0
  41. data/lib/twilio-ruby/rest/client.rb +21 -12
  42. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +454 -0
  43. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
  44. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +7 -0
  45. data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
  46. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +18 -2
  47. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
  48. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
  49. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
  50. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +7 -0
  51. data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
  52. data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
  53. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
  54. data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
  55. data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
  56. data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
  57. data/lib/twilio-ruby/rest/conversations/v1.rb +24 -0
  58. data/lib/twilio-ruby/rest/conversations.rb +15 -0
  59. data/lib/twilio-ruby/rest/events/v1/event_type.rb +12 -5
  60. data/lib/twilio-ruby/rest/events/v1/sink.rb +41 -5
  61. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +28 -0
  62. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +55 -34
  63. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
  64. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
  65. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +384 -0
  66. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
  67. data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
  68. data/lib/twilio-ruby/rest/flex_api.rb +9 -0
  69. data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +258 -0
  70. data/lib/twilio-ruby/rest/{fax → frontline_api}/v1.rb +11 -11
  71. data/lib/twilio-ruby/rest/{fax.rb → frontline_api.rb} +11 -11
  72. data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
  73. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +434 -0
  74. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
  75. data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
  76. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  77. data/lib/twilio-ruby/rest/insights/v1.rb +46 -0
  78. data/lib/twilio-ruby/rest/insights.rb +28 -0
  79. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +268 -0
  80. data/lib/twilio-ruby/rest/lookups/v2.rb +45 -0
  81. data/lib/twilio-ruby/rest/lookups.rb +7 -0
  82. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +397 -0
  83. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +406 -0
  84. data/lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb +221 -0
  85. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +403 -0
  86. data/lib/twilio-ruby/rest/media/v1.rb +76 -0
  87. data/lib/twilio-ruby/rest/media.rb +65 -0
  88. data/lib/twilio-ruby/rest/{fax/v1/fax/fax_media.rb → messaging/v1/brand_registration/brand_vetting.rb} +134 -95
  89. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +127 -2
  90. data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +7 -0
  91. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +187 -20
  92. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
  93. data/lib/twilio-ruby/rest/messaging/v1/service.rb +37 -5
  94. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +268 -0
  95. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +188 -0
  96. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +128 -26
  97. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
  98. data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
  99. data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
  100. data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
  101. data/lib/twilio-ruby/rest/pricing.rb +19 -0
  102. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +1 -1
  103. data/lib/twilio-ruby/rest/serverless/v1/service.rb +7 -0
  104. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -1
  105. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -1
  106. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  107. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -55
  108. data/lib/twilio-ruby/rest/supersim/v1/{command.rb → ip_command.rb} +132 -84
  109. data/lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb +231 -0
  110. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +30 -1
  111. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
  112. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +23 -9
  113. data/lib/twilio-ruby/rest/supersim/v1.rb +23 -7
  114. data/lib/twilio-ruby/rest/supersim.rb +15 -6
  115. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
  116. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +7 -3
  117. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
  118. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +7 -3
  119. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +23 -11
  120. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
  121. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
  122. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +38 -22
  123. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -3
  124. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +155 -10
  125. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +12 -9
  126. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +74 -22
  127. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +34 -15
  128. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +66 -31
  129. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +7 -3
  130. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +25 -7
  131. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
  132. data/lib/twilio-ruby/rest/verify/v2/service.rb +40 -11
  133. data/lib/twilio-ruby/rest/verify/v2/template.rb +206 -0
  134. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
  135. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +234 -0
  136. data/lib/twilio-ruby/rest/verify/v2.rb +14 -0
  137. data/lib/twilio-ruby/rest/verify.rb +14 -2
  138. data/lib/twilio-ruby/rest/video/v1/composition.rb +21 -8
  139. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +0 -8
  140. data/lib/twilio-ruby/rest/video/v1/recording.rb +21 -0
  141. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
  142. data/lib/twilio-ruby/rest/video/v1/room.rb +62 -5
  143. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  144. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  145. data/lib/twilio-ruby/rest/voice.rb +8 -0
  146. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  147. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +16 -26
  148. data/lib/twilio-ruby/rest.rb +13 -0
  149. data/lib/twilio-ruby/twiml/voice_response.rb +727 -87
  150. data/lib/twilio-ruby/version.rb +1 -1
  151. data/lib/twilio-ruby.rb +6 -16
  152. data/sonar-project.properties +13 -0
  153. data/twilio-ruby.gemspec +1 -2
  154. metadata +59 -32
  155. data/.travis.yml +0 -45
  156. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -536
  157. /data/lib/twilio-ruby/framework/{domain.rb → rest/domain.rb} +0 -0
  158. /data/lib/twilio-ruby/framework/{error.rb → rest/error.rb} +0 -0
  159. /data/lib/twilio-ruby/framework/{helper.rb → rest/helper.rb} +0 -0
  160. /data/lib/twilio-ruby/framework/{obsolete_client.rb → rest/obsolete_client.rb} +0 -0
  161. /data/lib/twilio-ruby/framework/{page.rb → rest/page.rb} +0 -0
  162. /data/lib/twilio-ruby/framework/{resource.rb → rest/resource.rb} +0 -0
  163. /data/lib/twilio-ruby/framework/{version.rb → rest/version.rb} +0 -0
@@ -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] callback_url The URL we should call using the `callback_method`
31
+ # when the status of the eSIM Profile changes. At this stage of the eSIM Profile
32
+ # pilot, the a request to the URL will only be called when the ESimProfile
33
+ # resource changes from `reserving` to `available`.
34
+ # @param [String] callback_method The HTTP method we should use to call
35
+ # `callback_url`. Can be: `GET` or `POST` and the default is POST.
36
+ # @param [String] eid Identifier of the eUICC that will claim the eSIM Profile.
37
+ # @return [EsimProfileInstance] Created EsimProfileInstance
38
+ def create(callback_url: :unset, callback_method: :unset, eid: :unset)
39
+ data = Twilio::Values.of({
40
+ 'CallbackUrl' => callback_url,
41
+ 'CallbackMethod' => callback_method,
42
+ 'Eid' => eid,
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
@@ -39,16 +39,13 @@ module Twilio
39
39
  # in Megabytes that each Sim resource assigned to the Fleet resource can consume
40
40
  # during a billing period (normally one month). Value must be between 1MB (1) and
41
41
  # 2TB (2,000,000). Defaults to 1GB (1,000).
42
- # @param [Boolean] commands_enabled Defines whether SIMs in the Fleet are capable
43
- # of sending and receiving machine-to-machine SMS via Commands. Defaults to
44
- # `true`.
45
- # @param [String] commands_url The URL that will receive a webhook when a Super
46
- # SIM in the Fleet is used to send an SMS from your device to the Commands number.
47
- # Your server should respond with an HTTP status code in the 200 range; any
48
- # response body will be ignored.
49
- # @param [String] commands_method A string representing the HTTP method to use
50
- # when making a request to `commands_url`. Can be one of `POST` or `GET`. Defaults
51
- # to `POST`.
42
+ # @param [String] ip_commands_url The URL that will receive a webhook when a Super
43
+ # SIM in the Fleet is used to send an IP Command from your device to a special IP
44
+ # address. Your server should respond with an HTTP status code in the 200 range;
45
+ # any response body will be ignored.
46
+ # @param [String] ip_commands_method A string representing the HTTP method to use
47
+ # when making a request to `ip_commands_url`. Can be one of `POST` or `GET`.
48
+ # Defaults to `POST`.
52
49
  # @param [Boolean] sms_commands_enabled Defines whether SIMs in the Fleet are
53
50
  # capable of sending and receiving machine-to-machine SMS via Commands. Defaults
54
51
  # to `true`.
@@ -60,15 +57,14 @@ module Twilio
60
57
  # when making a request to `sms_commands_url`. Can be one of `POST` or `GET`.
61
58
  # Defaults to `POST`.
62
59
  # @return [FleetInstance] Created FleetInstance
63
- def create(network_access_profile: nil, unique_name: :unset, data_enabled: :unset, data_limit: :unset, commands_enabled: :unset, commands_url: :unset, commands_method: :unset, sms_commands_enabled: :unset, sms_commands_url: :unset, sms_commands_method: :unset)
60
+ def create(network_access_profile: nil, unique_name: :unset, data_enabled: :unset, data_limit: :unset, ip_commands_url: :unset, ip_commands_method: :unset, sms_commands_enabled: :unset, sms_commands_url: :unset, sms_commands_method: :unset)
64
61
  data = Twilio::Values.of({
65
62
  'NetworkAccessProfile' => network_access_profile,
66
63
  'UniqueName' => unique_name,
67
64
  'DataEnabled' => data_enabled,
68
65
  'DataLimit' => data_limit,
69
- 'CommandsEnabled' => commands_enabled,
70
- 'CommandsUrl' => commands_url,
71
- 'CommandsMethod' => commands_method,
66
+ 'IpCommandsUrl' => ip_commands_url,
67
+ 'IpCommandsMethod' => ip_commands_method,
72
68
  'SmsCommandsEnabled' => sms_commands_enabled,
73
69
  'SmsCommandsUrl' => sms_commands_url,
74
70
  'SmsCommandsMethod' => sms_commands_method,
@@ -244,13 +240,13 @@ module Twilio
244
240
  # @param [String] network_access_profile The SID or unique name of the Network
245
241
  # Access Profile that will control which cellular networks the Fleet's SIMs can
246
242
  # connect to.
247
- # @param [String] commands_url The URL that will receive a webhook when a Super
248
- # SIM in the Fleet is used to send an SMS from your device to the Commands number.
249
- # Your server should respond with an HTTP status code in the 200 range; any
250
- # response body will be ignored.
251
- # @param [String] commands_method A string representing the HTTP method to use
252
- # when making a request to `commands_url`. Can be one of `POST` or `GET`. Defaults
253
- # to `POST`.
243
+ # @param [String] ip_commands_url The URL that will receive a webhook when a Super
244
+ # SIM in the Fleet is used to send an IP Command from your device to a special IP
245
+ # address. Your server should respond with an HTTP status code in the 200 range;
246
+ # any response body will be ignored.
247
+ # @param [String] ip_commands_method A string representing the HTTP method to use
248
+ # when making a request to `ip_commands_url`. Can be one of `POST` or `GET`.
249
+ # Defaults to `POST`.
254
250
  # @param [String] sms_commands_url The URL that will receive a webhook when a
255
251
  # Super SIM in the Fleet is used to send an SMS from your device to the SMS
256
252
  # Commands number. Your server should respond with an HTTP status code in the 200
@@ -259,12 +255,12 @@ module Twilio
259
255
  # when making a request to `sms_commands_url`. Can be one of `POST` or `GET`.
260
256
  # Defaults to `POST`.
261
257
  # @return [FleetInstance] Updated FleetInstance
262
- def update(unique_name: :unset, network_access_profile: :unset, commands_url: :unset, commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset)
258
+ def update(unique_name: :unset, network_access_profile: :unset, ip_commands_url: :unset, ip_commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset)
263
259
  data = Twilio::Values.of({
264
260
  'UniqueName' => unique_name,
265
261
  'NetworkAccessProfile' => network_access_profile,
266
- 'CommandsUrl' => commands_url,
267
- 'CommandsMethod' => commands_method,
262
+ 'IpCommandsUrl' => ip_commands_url,
263
+ 'IpCommandsMethod' => ip_commands_method,
268
264
  'SmsCommandsUrl' => sms_commands_url,
269
265
  'SmsCommandsMethod' => sms_commands_method,
270
266
  })
@@ -312,13 +308,12 @@ module Twilio
312
308
  'data_enabled' => payload['data_enabled'],
313
309
  'data_limit' => payload['data_limit'].to_i,
314
310
  'data_metering' => payload['data_metering'],
315
- 'commands_enabled' => payload['commands_enabled'],
316
- 'commands_url' => payload['commands_url'],
317
- 'commands_method' => payload['commands_method'],
318
311
  'sms_commands_enabled' => payload['sms_commands_enabled'],
319
312
  'sms_commands_url' => payload['sms_commands_url'],
320
313
  'sms_commands_method' => payload['sms_commands_method'],
321
314
  'network_access_profile_sid' => payload['network_access_profile_sid'],
315
+ 'ip_commands_url' => payload['ip_commands_url'],
316
+ 'ip_commands_method' => payload['ip_commands_method'],
322
317
  }
323
318
 
324
319
  # Context
@@ -391,24 +386,6 @@ module Twilio
391
386
  @properties['data_metering']
392
387
  end
393
388
 
394
- ##
395
- # @return [Boolean] Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands
396
- def commands_enabled
397
- @properties['commands_enabled']
398
- end
399
-
400
- ##
401
- # @return [String] The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the Commands number
402
- def commands_url
403
- @properties['commands_url']
404
- end
405
-
406
- ##
407
- # @return [String] A string representing the HTTP method to use when making a request to `commands_url`
408
- def commands_method
409
- @properties['commands_method']
410
- end
411
-
412
389
  ##
413
390
  # @return [Boolean] Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands
414
391
  def sms_commands_enabled
@@ -433,6 +410,18 @@ module Twilio
433
410
  @properties['network_access_profile_sid']
434
411
  end
435
412
 
413
+ ##
414
+ # @return [String] The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device
415
+ def ip_commands_url
416
+ @properties['ip_commands_url']
417
+ end
418
+
419
+ ##
420
+ # @return [String] A string representing the HTTP method to use when making a request to `ip_commands_url`
421
+ def ip_commands_method
422
+ @properties['ip_commands_method']
423
+ end
424
+
436
425
  ##
437
426
  # Fetch the FleetInstance
438
427
  # @return [FleetInstance] Fetched FleetInstance
@@ -448,13 +437,13 @@ module Twilio
448
437
  # @param [String] network_access_profile The SID or unique name of the Network
449
438
  # Access Profile that will control which cellular networks the Fleet's SIMs can
450
439
  # connect to.
451
- # @param [String] commands_url The URL that will receive a webhook when a Super
452
- # SIM in the Fleet is used to send an SMS from your device to the Commands number.
453
- # Your server should respond with an HTTP status code in the 200 range; any
454
- # response body will be ignored.
455
- # @param [String] commands_method A string representing the HTTP method to use
456
- # when making a request to `commands_url`. Can be one of `POST` or `GET`. Defaults
457
- # to `POST`.
440
+ # @param [String] ip_commands_url The URL that will receive a webhook when a Super
441
+ # SIM in the Fleet is used to send an IP Command from your device to a special IP
442
+ # address. Your server should respond with an HTTP status code in the 200 range;
443
+ # any response body will be ignored.
444
+ # @param [String] ip_commands_method A string representing the HTTP method to use
445
+ # when making a request to `ip_commands_url`. Can be one of `POST` or `GET`.
446
+ # Defaults to `POST`.
458
447
  # @param [String] sms_commands_url The URL that will receive a webhook when a
459
448
  # Super SIM in the Fleet is used to send an SMS from your device to the SMS
460
449
  # Commands number. Your server should respond with an HTTP status code in the 200
@@ -463,12 +452,12 @@ module Twilio
463
452
  # when making a request to `sms_commands_url`. Can be one of `POST` or `GET`.
464
453
  # Defaults to `POST`.
465
454
  # @return [FleetInstance] Updated FleetInstance
466
- def update(unique_name: :unset, network_access_profile: :unset, commands_url: :unset, commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset)
455
+ def update(unique_name: :unset, network_access_profile: :unset, ip_commands_url: :unset, ip_commands_method: :unset, sms_commands_url: :unset, sms_commands_method: :unset)
467
456
  context.update(
468
457
  unique_name: unique_name,
469
458
  network_access_profile: network_access_profile,
470
- commands_url: commands_url,
471
- commands_method: commands_method,
459
+ ip_commands_url: ip_commands_url,
460
+ ip_commands_method: ip_commands_method,
472
461
  sms_commands_url: sms_commands_url,
473
462
  sms_commands_method: sms_commands_method,
474
463
  )