twilio-ruby 5.40.2 → 5.40.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +15 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/framework/version.rb +2 -1
  5. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +12 -3
  6. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +12 -3
  7. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +12 -3
  8. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +12 -3
  9. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +12 -3
  10. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +12 -3
  11. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +12 -3
  12. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +2 -1
  13. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -2
  14. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
  15. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +8 -1
  16. data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +3 -1
  17. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +2 -1
  18. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +8 -4
  19. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +11 -4
  20. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +13 -6
  21. data/lib/twilio-ruby/rest/conversations.rb +0 -16
  22. data/lib/twilio-ruby/rest/conversations/v1.rb +0 -24
  23. data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +17 -7
  24. data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +262 -0
  25. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +6 -6
  26. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +13 -10
  27. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +22 -16
  28. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +42 -36
  29. data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +14 -11
  30. data/lib/twilio-ruby/rest/conversations/v1/credential.rb +1 -1
  31. data/lib/twilio-ruby/rest/conversations/v1/role.rb +4 -2
  32. data/lib/twilio-ruby/rest/conversations/v1/service.rb +1 -1
  33. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +28 -25
  34. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +30 -18
  35. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +315 -0
  36. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +10 -10
  37. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +23 -20
  38. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +32 -26
  39. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +52 -46
  40. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +24 -21
  41. data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +13 -11
  42. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +23 -23
  43. data/lib/twilio-ruby/rest/conversations/v1/user.rb +14 -14
  44. data/lib/twilio-ruby/rest/events.rb +10 -1
  45. data/lib/twilio-ruby/rest/events/v1.rb +17 -1
  46. data/lib/twilio-ruby/rest/events/v1/event_type.rb +8 -8
  47. data/lib/twilio-ruby/rest/events/v1/schema.rb +226 -0
  48. data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +290 -0
  49. data/lib/twilio-ruby/rest/events/v1/subscription.rb +28 -8
  50. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +3 -109
  51. data/lib/twilio-ruby/rest/fax/v1/fax.rb +2 -1
  52. data/lib/twilio-ruby/rest/messaging/v1/service.rb +6 -3
  53. data/lib/twilio-ruby/rest/notify/v1/credential.rb +12 -6
  54. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +10 -2
  55. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +10 -5
  56. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +6 -3
  57. data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +1 -4
  58. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +3 -1
  59. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +6 -2
  60. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +1 -4
  61. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +6 -2
  62. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -26
  63. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +2 -1
  64. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +2 -1
  65. data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +201 -0
  66. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -1
  67. data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -3
  68. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +18 -9
  69. data/lib/twilio-ruby/rest/video/v1/room.rb +2 -1
  70. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +1 -4
  71. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +2 -1
  72. data/lib/twilio-ruby/version.rb +1 -1
  73. data/spec/framework/version_spec.rb +11 -0
  74. data/spec/integration/conversations/v1/{webhook_spec.rb → configuration/webhook_spec.rb} +12 -8
  75. data/spec/integration/conversations/v1/configuration_spec.rb +4 -2
  76. data/spec/integration/conversations/v1/{notification_spec.rb → service/configuration/notification_spec.rb} +12 -4
  77. data/spec/integration/events/v1/schema/schema_version_spec.rb +126 -0
  78. data/spec/integration/events/v1/schema_spec.rb +46 -0
  79. data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +0 -121
  80. data/spec/integration/events/v1/subscription_spec.rb +38 -0
  81. data/spec/integration/trunking/v1/trunk/recording_spec.rb +79 -0
  82. metadata +17 -8
  83. data/lib/twilio-ruby/rest/conversations/v1/notification.rb +0 -310
  84. data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +0 -262
@@ -0,0 +1,290 @@
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 Events < Domain
12
+ class V1 < Version
13
+ class SchemaContext < InstanceContext
14
+ ##
15
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
16
+ class VersionList < ListResource
17
+ ##
18
+ # Initialize the VersionList
19
+ # @param [Version] version Version that contains the resource
20
+ # @param [String] id The unique identifier of the schema. Each schema can have
21
+ # multiple versions, that share the same id.
22
+ # @return [VersionList] VersionList
23
+ def initialize(version, id: nil)
24
+ super(version)
25
+
26
+ # Path Solution
27
+ @solution = {id: id}
28
+ @uri = "/Schemas/#{@solution[:id]}/Versions"
29
+ end
30
+
31
+ ##
32
+ # Lists VersionInstance records from the API as a list.
33
+ # Unlike stream(), this operation is eager and will load `limit` records into
34
+ # memory before returning.
35
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
36
+ # guarantees to never return more than limit. Default is no limit
37
+ # @param [Integer] page_size Number of records to fetch per request, when
38
+ # not set will use the default value of 50 records. If no page_size is defined
39
+ # but a limit is defined, stream() will attempt to read the limit with the most
40
+ # efficient page size, i.e. min(limit, 1000)
41
+ # @return [Array] Array of up to limit results
42
+ def list(limit: nil, page_size: nil)
43
+ self.stream(limit: limit, page_size: page_size).entries
44
+ end
45
+
46
+ ##
47
+ # Streams VersionInstance records from the API as an Enumerable.
48
+ # This operation lazily loads records as efficiently as possible until the limit
49
+ # is reached.
50
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
51
+ # guarantees to never return more than limit. Default is no limit.
52
+ # @param [Integer] page_size Number of records to fetch per request, when
53
+ # not set will use the default value of 50 records. If no page_size is defined
54
+ # but a limit is defined, stream() will attempt to read the limit with the most
55
+ # efficient page size, i.e. min(limit, 1000)
56
+ # @return [Enumerable] Enumerable that will yield up to limit results
57
+ def stream(limit: nil, page_size: nil)
58
+ limits = @version.read_limits(limit, page_size)
59
+
60
+ page = self.page(page_size: limits[:page_size], )
61
+
62
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
63
+ end
64
+
65
+ ##
66
+ # When passed a block, yields VersionInstance records from the API.
67
+ # This operation lazily loads records as efficiently as possible until the limit
68
+ # is reached.
69
+ def each
70
+ limits = @version.read_limits
71
+
72
+ page = self.page(page_size: limits[:page_size], )
73
+
74
+ @version.stream(page,
75
+ limit: limits[:limit],
76
+ page_limit: limits[:page_limit]).each {|x| yield x}
77
+ end
78
+
79
+ ##
80
+ # Retrieve a single page of VersionInstance records from the API.
81
+ # Request is executed immediately.
82
+ # @param [String] page_token PageToken provided by the API
83
+ # @param [Integer] page_number Page Number, this value is simply for client state
84
+ # @param [Integer] page_size Number of records to return, defaults to 50
85
+ # @return [Page] Page of VersionInstance
86
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
87
+ params = Twilio::Values.of({
88
+ 'PageToken' => page_token,
89
+ 'Page' => page_number,
90
+ 'PageSize' => page_size,
91
+ })
92
+
93
+ response = @version.page('GET', @uri, params: params)
94
+
95
+ VersionPage.new(@version, response, @solution)
96
+ end
97
+
98
+ ##
99
+ # Retrieve a single page of VersionInstance records from the API.
100
+ # Request is executed immediately.
101
+ # @param [String] target_url API-generated URL for the requested results page
102
+ # @return [Page] Page of VersionInstance
103
+ def get_page(target_url)
104
+ response = @version.domain.request(
105
+ 'GET',
106
+ target_url
107
+ )
108
+ VersionPage.new(@version, response, @solution)
109
+ end
110
+
111
+ ##
112
+ # Provide a user friendly representation
113
+ def to_s
114
+ '#<Twilio.Events.V1.VersionList>'
115
+ end
116
+ end
117
+
118
+ ##
119
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
120
+ class VersionPage < Page
121
+ ##
122
+ # Initialize the VersionPage
123
+ # @param [Version] version Version that contains the resource
124
+ # @param [Response] response Response from the API
125
+ # @param [Hash] solution Path solution for the resource
126
+ # @return [VersionPage] VersionPage
127
+ def initialize(version, response, solution)
128
+ super(version, response)
129
+
130
+ # Path Solution
131
+ @solution = solution
132
+ end
133
+
134
+ ##
135
+ # Build an instance of VersionInstance
136
+ # @param [Hash] payload Payload response from the API
137
+ # @return [VersionInstance] VersionInstance
138
+ def get_instance(payload)
139
+ VersionInstance.new(@version, payload, id: @solution[:id], )
140
+ end
141
+
142
+ ##
143
+ # Provide a user friendly representation
144
+ def to_s
145
+ '<Twilio.Events.V1.VersionPage>'
146
+ end
147
+ end
148
+
149
+ ##
150
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
151
+ class VersionContext < InstanceContext
152
+ ##
153
+ # Initialize the VersionContext
154
+ # @param [Version] version Version that contains the resource
155
+ # @param [String] id The unique identifier of the schema. Each schema can have
156
+ # multiple versions, that share the same id.
157
+ # @param [String] schema_version The version of the schema
158
+ # @return [VersionContext] VersionContext
159
+ def initialize(version, id, schema_version)
160
+ super(version)
161
+
162
+ # Path Solution
163
+ @solution = {id: id, schema_version: schema_version, }
164
+ @uri = "/Schemas/#{@solution[:id]}/Versions/#{@solution[:schema_version]}"
165
+ end
166
+
167
+ ##
168
+ # Fetch the VersionInstance
169
+ # @return [VersionInstance] Fetched VersionInstance
170
+ def fetch
171
+ payload = @version.fetch('GET', @uri)
172
+
173
+ VersionInstance.new(
174
+ @version,
175
+ payload,
176
+ id: @solution[:id],
177
+ schema_version: @solution[:schema_version],
178
+ )
179
+ end
180
+
181
+ ##
182
+ # Provide a user friendly representation
183
+ def to_s
184
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
185
+ "#<Twilio.Events.V1.VersionContext #{context}>"
186
+ end
187
+
188
+ ##
189
+ # Provide a detailed, user friendly representation
190
+ def inspect
191
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
192
+ "#<Twilio.Events.V1.VersionContext #{context}>"
193
+ end
194
+ end
195
+
196
+ ##
197
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
198
+ class VersionInstance < InstanceResource
199
+ ##
200
+ # Initialize the VersionInstance
201
+ # @param [Version] version Version that contains the resource
202
+ # @param [Hash] payload payload that contains response from Twilio
203
+ # @param [String] id The unique identifier of the schema. Each schema can have
204
+ # multiple versions, that share the same id.
205
+ # @param [String] schema_version The version of the schema
206
+ # @return [VersionInstance] VersionInstance
207
+ def initialize(version, payload, id: nil, schema_version: nil)
208
+ super(version)
209
+
210
+ # Marshaled Properties
211
+ @properties = {
212
+ 'id' => payload['id'],
213
+ 'schema_version' => payload['schema_version'].to_i,
214
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
215
+ 'url' => payload['url'],
216
+ 'raw' => payload['raw'],
217
+ }
218
+
219
+ # Context
220
+ @instance_context = nil
221
+ @params = {'id' => id, 'schema_version' => schema_version || @properties['schema_version'], }
222
+ end
223
+
224
+ ##
225
+ # Generate an instance context for the instance, the context is capable of
226
+ # performing various actions. All instance actions are proxied to the context
227
+ # @return [VersionContext] VersionContext for this VersionInstance
228
+ def context
229
+ unless @instance_context
230
+ @instance_context = VersionContext.new(@version, @params['id'], @params['schema_version'], )
231
+ end
232
+ @instance_context
233
+ end
234
+
235
+ ##
236
+ # @return [String] The unique identifier of the schema.
237
+ def id
238
+ @properties['id']
239
+ end
240
+
241
+ ##
242
+ # @return [String] The version of this schema.
243
+ def schema_version
244
+ @properties['schema_version']
245
+ end
246
+
247
+ ##
248
+ # @return [Time] The date the schema version was created.
249
+ def date_created
250
+ @properties['date_created']
251
+ end
252
+
253
+ ##
254
+ # @return [String] The URL of this resource.
255
+ def url
256
+ @properties['url']
257
+ end
258
+
259
+ ##
260
+ # @return [String] The raw
261
+ def raw
262
+ @properties['raw']
263
+ end
264
+
265
+ ##
266
+ # Fetch the VersionInstance
267
+ # @return [VersionInstance] Fetched VersionInstance
268
+ def fetch
269
+ context.fetch
270
+ end
271
+
272
+ ##
273
+ # Provide a user friendly representation
274
+ def to_s
275
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
276
+ "<Twilio.Events.V1.VersionInstance #{values}>"
277
+ end
278
+
279
+ ##
280
+ # Provide a detailed, user friendly representation
281
+ def inspect
282
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
283
+ "<Twilio.Events.V1.VersionInstance #{values}>"
284
+ end
285
+ end
286
+ end
287
+ end
288
+ end
289
+ end
290
+ end
@@ -193,6 +193,21 @@ module Twilio
193
193
  SubscriptionInstance.new(@version, payload, sid: @solution[:sid], )
194
194
  end
195
195
 
196
+ ##
197
+ # Update the SubscriptionInstance
198
+ # @param [String] description A human readable description for the Subscription.
199
+ # @param [String] sink_sid The SID of the sink that events selected by this
200
+ # subscription should be sent to. Sink must be active for the subscription to be
201
+ # created.
202
+ # @return [SubscriptionInstance] Updated SubscriptionInstance
203
+ def update(description: :unset, sink_sid: :unset)
204
+ data = Twilio::Values.of({'Description' => description, 'SinkSid' => sink_sid, })
205
+
206
+ payload = @version.update('POST', @uri, data: data)
207
+
208
+ SubscriptionInstance.new(@version, payload, sid: @solution[:sid], )
209
+ end
210
+
196
211
  ##
197
212
  # Delete the SubscriptionInstance
198
213
  # @return [Boolean] true if delete succeeds, false otherwise
@@ -203,14 +218,8 @@ module Twilio
203
218
  ##
204
219
  # Access the subscribed_events
205
220
  # @return [SubscribedEventList]
206
- # @return [SubscribedEventContext] if type was passed.
207
- def subscribed_events(type=:unset)
208
- raise ArgumentError, 'type cannot be nil' if type.nil?
209
-
210
- if type != :unset
211
- return SubscribedEventContext.new(@version, @solution[:sid], type, )
212
- end
213
-
221
+ # @return [SubscribedEventContext]
222
+ def subscribed_events
214
223
  unless @subscribed_events
215
224
  @subscribed_events = SubscribedEventList.new(@version, subscription_sid: @solution[:sid], )
216
225
  end
@@ -329,6 +338,17 @@ module Twilio
329
338
  context.fetch
330
339
  end
331
340
 
341
+ ##
342
+ # Update the SubscriptionInstance
343
+ # @param [String] description A human readable description for the Subscription.
344
+ # @param [String] sink_sid The SID of the sink that events selected by this
345
+ # subscription should be sent to. Sink must be active for the subscription to be
346
+ # created.
347
+ # @return [SubscriptionInstance] Updated SubscriptionInstance
348
+ def update(description: :unset, sink_sid: :unset)
349
+ context.update(description: description, sink_sid: sink_sid, )
350
+ end
351
+
332
352
  ##
333
353
  # Delete the SubscriptionInstance
334
354
  # @return [Boolean] true if delete succeeds, false otherwise
@@ -107,19 +107,6 @@ module Twilio
107
107
  SubscribedEventPage.new(@version, response, @solution)
108
108
  end
109
109
 
110
- ##
111
- # Create the SubscribedEventInstance
112
- # @param [String] type Type of event being subscribed to.
113
- # @param [String] version The schema version that the subscription should use.
114
- # @return [SubscribedEventInstance] Created SubscribedEventInstance
115
- def create(type: nil, version: :unset)
116
- data = Twilio::Values.of({'Type' => type, 'Version' => version, })
117
-
118
- payload = @version.create('POST', @uri, data: data)
119
-
120
- SubscribedEventInstance.new(@version, payload, subscription_sid: @solution[:subscription_sid], )
121
- end
122
-
123
110
  ##
124
111
  # Provide a user friendly representation
125
112
  def to_s
@@ -158,62 +145,6 @@ module Twilio
158
145
  end
159
146
  end
160
147
 
161
- ##
162
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
163
- class SubscribedEventContext < InstanceContext
164
- ##
165
- # Initialize the SubscribedEventContext
166
- # @param [Version] version Version that contains the resource
167
- # @param [String] subscription_sid The unique SID identifier of the Subscription.
168
- # @param [String] type Type of event being subscribed to.
169
- # @return [SubscribedEventContext] SubscribedEventContext
170
- def initialize(version, subscription_sid, type)
171
- super(version)
172
-
173
- # Path Solution
174
- @solution = {subscription_sid: subscription_sid, type: type, }
175
- @uri = "/Subscriptions/#{@solution[:subscription_sid]}/SubscribedEvents/#{@solution[:type]}"
176
- end
177
-
178
- ##
179
- # Update the SubscribedEventInstance
180
- # @param [String] version The schema version that the subscription should use.
181
- # @return [SubscribedEventInstance] Updated SubscribedEventInstance
182
- def update(version: nil)
183
- data = Twilio::Values.of({'Version' => version, })
184
-
185
- payload = @version.update('POST', @uri, data: data)
186
-
187
- SubscribedEventInstance.new(
188
- @version,
189
- payload,
190
- subscription_sid: @solution[:subscription_sid],
191
- type: @solution[:type],
192
- )
193
- end
194
-
195
- ##
196
- # Delete the SubscribedEventInstance
197
- # @return [Boolean] true if delete succeeds, false otherwise
198
- def delete
199
- @version.delete('DELETE', @uri)
200
- end
201
-
202
- ##
203
- # Provide a user friendly representation
204
- def to_s
205
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
206
- "#<Twilio.Events.V1.SubscribedEventContext #{context}>"
207
- end
208
-
209
- ##
210
- # Provide a detailed, user friendly representation
211
- def inspect
212
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
213
- "#<Twilio.Events.V1.SubscribedEventContext #{context}>"
214
- end
215
- end
216
-
217
148
  ##
218
149
  # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
219
150
  class SubscribedEventInstance < InstanceResource
@@ -222,9 +153,8 @@ module Twilio
222
153
  # @param [Version] version Version that contains the resource
223
154
  # @param [Hash] payload payload that contains response from Twilio
224
155
  # @param [String] subscription_sid The unique SID identifier of the Subscription.
225
- # @param [String] type Type of event being subscribed to.
226
156
  # @return [SubscribedEventInstance] SubscribedEventInstance
227
- def initialize(version, payload, subscription_sid: nil, type: nil)
157
+ def initialize(version, payload, subscription_sid: nil)
228
158
  super(version)
229
159
 
230
160
  # Marshaled Properties
@@ -235,25 +165,6 @@ module Twilio
235
165
  'subscription_sid' => payload['subscription_sid'],
236
166
  'url' => payload['url'],
237
167
  }
238
-
239
- # Context
240
- @instance_context = nil
241
- @params = {'subscription_sid' => subscription_sid, 'type' => type || @properties['type'], }
242
- end
243
-
244
- ##
245
- # Generate an instance context for the instance, the context is capable of
246
- # performing various actions. All instance actions are proxied to the context
247
- # @return [SubscribedEventContext] SubscribedEventContext for this SubscribedEventInstance
248
- def context
249
- unless @instance_context
250
- @instance_context = SubscribedEventContext.new(
251
- @version,
252
- @params['subscription_sid'],
253
- @params['type'],
254
- )
255
- end
256
- @instance_context
257
168
  end
258
169
 
259
170
  ##
@@ -286,33 +197,16 @@ module Twilio
286
197
  @properties['url']
287
198
  end
288
199
 
289
- ##
290
- # Update the SubscribedEventInstance
291
- # @param [String] version The schema version that the subscription should use.
292
- # @return [SubscribedEventInstance] Updated SubscribedEventInstance
293
- def update(version: nil)
294
- context.update(version: version, )
295
- end
296
-
297
- ##
298
- # Delete the SubscribedEventInstance
299
- # @return [Boolean] true if delete succeeds, false otherwise
300
- def delete
301
- context.delete
302
- end
303
-
304
200
  ##
305
201
  # Provide a user friendly representation
306
202
  def to_s
307
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
308
- "<Twilio.Events.V1.SubscribedEventInstance #{values}>"
203
+ "<Twilio.Events.V1.SubscribedEventInstance>"
309
204
  end
310
205
 
311
206
  ##
312
207
  # Provide a detailed, user friendly representation
313
208
  def inspect
314
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
315
- "<Twilio.Events.V1.SubscribedEventInstance #{values}>"
209
+ "<Twilio.Events.V1.SubscribedEventInstance>"
316
210
  end
317
211
  end
318
212
  end