twilio-ruby 5.0.0.rc9 → 5.0.0.rc10
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/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +2 -9
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +13 -24
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +12 -23
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +6 -15
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +2 -9
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +2 -9
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +2 -9
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +9 -18
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +15 -23
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +8 -15
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +9 -18
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +9 -18
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +20 -28
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +15 -24
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +7 -16
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +10 -20
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +2 -10
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +2 -10
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +2 -10
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +12 -23
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +324 -0
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +4 -9
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +9 -18
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +23 -29
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +145 -0
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +145 -0
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +7 -16
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +12 -21
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +13 -23
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +13 -24
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +9 -18
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +8 -17
- data/lib/twilio-ruby/rest/api/v2010/account/sandbox.rb +8 -15
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +324 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +16 -27
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +14 -24
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -21
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -21
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +23 -31
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +16 -27
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +14 -24
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/sms/short_code.rb +10 -20
- data/lib/twilio-ruby/rest/api/v2010/account/sms/sms_message.rb +13 -23
- data/lib/twilio-ruby/rest/api/v2010/account/sms.rb +1 -7
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +2 -7
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +7 -16
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +12 -23
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +1 -6
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +2 -7
- data/lib/twilio-ruby/rest/api/v2010/account.rb +131 -38
- data/lib/twilio-ruby/rest/api/v2010.rb +17 -1
- data/lib/twilio-ruby/rest/api.rb +16 -0
- data/lib/twilio-ruby/rest/client.rb +16 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +13 -28
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +11 -21
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +62 -20
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +17 -28
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +12 -23
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +23 -25
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +13 -24
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +1 -1
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +5 -12
- data/lib/twilio-ruby/rest/lookups/v1.rb +1 -1
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +5 -14
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +4 -13
- data/lib/twilio-ruby/rest/monitor/v1.rb +1 -1
- data/lib/twilio-ruby/rest/notifications/v1/credential.rb +13 -28
- data/lib/twilio-ruby/rest/notifications/v1/service/binding.rb +8 -18
- data/lib/twilio-ruby/rest/notifications/v1/service/notification.rb +8 -8
- data/lib/twilio-ruby/rest/notifications/v1/service.rb +10 -21
- data/lib/twilio-ruby/rest/notifications/v1.rb +1 -1
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +4 -14
- data/lib/twilio-ruby/rest/preview/wireless/device/usage.rb +6 -13
- data/lib/twilio-ruby/rest/preview/wireless/device.rb +8 -19
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +4 -13
- data/lib/twilio-ruby/rest/preview/wireless.rb +1 -1
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +4 -13
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +0 -5
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +4 -13
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +0 -5
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +4 -13
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +4 -10
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +0 -6
- data/lib/twilio-ruby/rest/pricing/v1.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +13 -23
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +6 -15
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +13 -23
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +13 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +8 -15
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +1 -8
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +13 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +8 -15
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +6 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +13 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +8 -15
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +13 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +6 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +15 -26
- data/lib/twilio-ruby/rest/taskrouter/v1.rb +1 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +8 -18
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +8 -18
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +12 -23
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +8 -18
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +12 -23
- data/lib/twilio-ruby/rest/trunking/v1.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/key_spec.rb +178 -0
- data/spec/integration/api/v2010/account/message_spec.rb +2 -3
- data/spec/integration/api/v2010/account/new_key_spec.rb +45 -0
- data/spec/integration/api/v2010/account/new_signing_key_spec.rb +45 -0
- data/spec/integration/api/v2010/account/signing_key_spec.rb +178 -0
- data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +3 -7
- data/spec/integration/ip_messaging/v1/credential_spec.rb +5 -10
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +37 -0
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +3 -7
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +3 -6
- data/spec/integration/notifications/v1/credential_spec.rb +5 -10
- data/spec/integration/notifications/v1/service/notification_spec.rb +1 -0
- data/spec/integration/preview/wireless/device_spec.rb +4 -4
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +3 -6
- metadata +15 -3
|
@@ -12,7 +12,6 @@ module Twilio
|
|
|
12
12
|
##
|
|
13
13
|
# Initialize the CredentialList
|
|
14
14
|
# @param [Version] version Version that contains the resource
|
|
15
|
-
|
|
16
15
|
# @return [CredentialList] CredentialList
|
|
17
16
|
def initialize(version)
|
|
18
17
|
super(version)
|
|
@@ -32,7 +31,6 @@ module Twilio
|
|
|
32
31
|
# the default value of 50 records. If no page_size is defined
|
|
33
32
|
# but a limit is defined, stream() will attempt to read the
|
|
34
33
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
35
|
-
|
|
36
34
|
# @return [Array] Array of up to limit results
|
|
37
35
|
def list(limit: nil, page_size: nil)
|
|
38
36
|
self.stream(
|
|
@@ -51,7 +49,6 @@ module Twilio
|
|
|
51
49
|
# the default value of 50 records. If no page_size is defined
|
|
52
50
|
# but a limit is defined, stream() will attempt to read the
|
|
53
51
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
54
|
-
|
|
55
52
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
56
53
|
def stream(limit: nil, page_size: nil)
|
|
57
54
|
limits = @version.read_limits(limit, page_size)
|
|
@@ -91,7 +88,6 @@ module Twilio
|
|
|
91
88
|
# @param [String] page_token PageToken provided by the API
|
|
92
89
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
93
90
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
94
|
-
|
|
95
91
|
# @return [Page] Page of CredentialInstance
|
|
96
92
|
def page(page_token: nil, page_number: nil, page_size: nil)
|
|
97
93
|
params = {
|
|
@@ -110,18 +106,17 @@ module Twilio
|
|
|
110
106
|
##
|
|
111
107
|
# Retrieve a single page of CredentialInstance records from the API.
|
|
112
108
|
# Request is executed immediately.
|
|
113
|
-
# @param [String] friendly_name The friendly_name
|
|
114
109
|
# @param [credential.PushService] type The type
|
|
110
|
+
# @param [String] friendly_name The friendly_name
|
|
115
111
|
# @param [String] certificate The certificate
|
|
116
112
|
# @param [String] private_key The private_key
|
|
117
113
|
# @param [Boolean] sandbox The sandbox
|
|
118
114
|
# @param [String] api_key The api_key
|
|
119
|
-
|
|
120
115
|
# @return [CredentialInstance] Newly created CredentialInstance
|
|
121
|
-
def create(
|
|
116
|
+
def create(type: nil, friendly_name: nil, certificate: nil, private_key: nil, sandbox: nil, api_key: nil)
|
|
122
117
|
data = {
|
|
123
|
-
'FriendlyName' => friendly_name,
|
|
124
118
|
'Type' => type,
|
|
119
|
+
'FriendlyName' => friendly_name,
|
|
125
120
|
'Certificate' => certificate,
|
|
126
121
|
'PrivateKey' => private_key,
|
|
127
122
|
'Sandbox' => sandbox,
|
|
@@ -153,7 +148,6 @@ module Twilio
|
|
|
153
148
|
# @param [Version] version Version that contains the resource
|
|
154
149
|
# @param [Response] response Response from the API
|
|
155
150
|
# @param [Hash] solution Path solution for the resource
|
|
156
|
-
|
|
157
151
|
# @return [CredentialPage] CredentialPage
|
|
158
152
|
def initialize(version, response, solution)
|
|
159
153
|
super(version, response)
|
|
@@ -165,7 +159,6 @@ module Twilio
|
|
|
165
159
|
##
|
|
166
160
|
# Build an instance of CredentialInstance
|
|
167
161
|
# @param [Hash] payload Payload response from the API
|
|
168
|
-
|
|
169
162
|
# @return [CredentialInstance] CredentialInstance
|
|
170
163
|
def get_instance(payload)
|
|
171
164
|
return CredentialInstance.new(
|
|
@@ -186,7 +179,6 @@ module Twilio
|
|
|
186
179
|
# Initialize the CredentialContext
|
|
187
180
|
# @param [Version] version Version that contains the resource
|
|
188
181
|
# @param [String] sid The sid
|
|
189
|
-
|
|
190
182
|
# @return [CredentialContext] CredentialContext
|
|
191
183
|
def initialize(version, sid)
|
|
192
184
|
super(version)
|
|
@@ -213,24 +205,21 @@ module Twilio
|
|
|
213
205
|
return CredentialInstance.new(
|
|
214
206
|
@version,
|
|
215
207
|
payload,
|
|
216
|
-
sid: @solution[
|
|
208
|
+
sid: @solution[:sid],
|
|
217
209
|
)
|
|
218
210
|
end
|
|
219
211
|
|
|
220
212
|
##
|
|
221
213
|
# Update the CredentialInstance
|
|
222
214
|
# @param [String] friendly_name The friendly_name
|
|
223
|
-
# @param [credential.PushService] type The type
|
|
224
215
|
# @param [String] certificate The certificate
|
|
225
216
|
# @param [String] private_key The private_key
|
|
226
217
|
# @param [Boolean] sandbox The sandbox
|
|
227
218
|
# @param [String] api_key The api_key
|
|
228
|
-
|
|
229
219
|
# @return [CredentialInstance] Updated CredentialInstance
|
|
230
|
-
def update(friendly_name: nil,
|
|
220
|
+
def update(friendly_name: nil, certificate: nil, private_key: nil, sandbox: nil, api_key: nil)
|
|
231
221
|
data = {
|
|
232
222
|
'FriendlyName' => friendly_name,
|
|
233
|
-
'Type' => type,
|
|
234
223
|
'Certificate' => certificate,
|
|
235
224
|
'PrivateKey' => private_key,
|
|
236
225
|
'Sandbox' => sandbox,
|
|
@@ -246,7 +235,7 @@ module Twilio
|
|
|
246
235
|
return CredentialInstance.new(
|
|
247
236
|
@version,
|
|
248
237
|
payload,
|
|
249
|
-
sid: @solution[
|
|
238
|
+
sid: @solution[:sid],
|
|
250
239
|
)
|
|
251
240
|
end
|
|
252
241
|
|
|
@@ -271,7 +260,6 @@ module Twilio
|
|
|
271
260
|
# @param [Version] version Version that contains the resource
|
|
272
261
|
# @param [Hash] payload payload that contains response from Twilio
|
|
273
262
|
# @param [String] sid The sid
|
|
274
|
-
|
|
275
263
|
# @return [CredentialInstance] CredentialInstance
|
|
276
264
|
def initialize(version, payload, sid: nil)
|
|
277
265
|
super(version)
|
|
@@ -299,7 +287,6 @@ module Twilio
|
|
|
299
287
|
# Generate an instance context for the instance, the context is capable of
|
|
300
288
|
# performing various actions. All instance actions are proxied to the context
|
|
301
289
|
# @param [Version] version Version that contains the resource
|
|
302
|
-
|
|
303
290
|
# @return [CredentialContext] CredentialContext for this CredentialInstance
|
|
304
291
|
def context
|
|
305
292
|
unless @instance_context
|
|
@@ -347,22 +334,20 @@ module Twilio
|
|
|
347
334
|
# Fetch a CredentialInstance
|
|
348
335
|
# @return [CredentialInstance] Fetched CredentialInstance
|
|
349
336
|
def fetch
|
|
350
|
-
|
|
337
|
+
context.fetch
|
|
351
338
|
end
|
|
352
339
|
|
|
353
340
|
##
|
|
354
341
|
# Update the CredentialInstance
|
|
355
342
|
# @param [String] friendly_name The friendly_name
|
|
356
|
-
# @param [credential.PushService] type The type
|
|
357
343
|
# @param [String] certificate The certificate
|
|
358
344
|
# @param [String] private_key The private_key
|
|
359
345
|
# @param [Boolean] sandbox The sandbox
|
|
360
346
|
# @param [String] api_key The api_key
|
|
361
|
-
|
|
362
347
|
# @return [CredentialInstance] Updated CredentialInstance
|
|
363
|
-
def update(friendly_name: nil,
|
|
364
|
-
|
|
365
|
-
|
|
348
|
+
def update(friendly_name: nil, certificate: nil, private_key: nil, sandbox: nil, api_key: nil)
|
|
349
|
+
context.update(
|
|
350
|
+
friendly_name: friendly_name,
|
|
366
351
|
certificate: certificate,
|
|
367
352
|
private_key: private_key,
|
|
368
353
|
sandbox: sandbox,
|
|
@@ -374,14 +359,14 @@ module Twilio
|
|
|
374
359
|
# Deletes the CredentialInstance
|
|
375
360
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
376
361
|
def delete
|
|
377
|
-
|
|
362
|
+
context.delete
|
|
378
363
|
end
|
|
379
364
|
|
|
380
365
|
##
|
|
381
366
|
# Provide a user friendly representation
|
|
382
367
|
def to_s
|
|
383
|
-
|
|
384
|
-
"<Twilio.Notifications.V1.CredentialInstance #{
|
|
368
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
369
|
+
"<Twilio.Notifications.V1.CredentialInstance #{values}>"
|
|
385
370
|
end
|
|
386
371
|
end
|
|
387
372
|
end
|
|
@@ -14,7 +14,6 @@ module Twilio
|
|
|
14
14
|
# Initialize the BindingList
|
|
15
15
|
# @param [Version] version Version that contains the resource
|
|
16
16
|
# @param [String] service_sid The service_sid
|
|
17
|
-
|
|
18
17
|
# @return [BindingList] BindingList
|
|
19
18
|
def initialize(version, service_sid: nil)
|
|
20
19
|
super(version)
|
|
@@ -35,7 +34,6 @@ module Twilio
|
|
|
35
34
|
# @param [String] address The address
|
|
36
35
|
# @param [String] tag The tag
|
|
37
36
|
# @param [String] notification_protocol_version The notification_protocol_version
|
|
38
|
-
|
|
39
37
|
# @return [BindingInstance] Newly created BindingInstance
|
|
40
38
|
def create(endpoint: nil, identity: nil, binding_type: nil, address: nil, tag: nil, notification_protocol_version: nil)
|
|
41
39
|
data = {
|
|
@@ -56,7 +54,7 @@ module Twilio
|
|
|
56
54
|
return BindingInstance.new(
|
|
57
55
|
@version,
|
|
58
56
|
payload,
|
|
59
|
-
service_sid: @solution[
|
|
57
|
+
service_sid: @solution[:service_sid],
|
|
60
58
|
)
|
|
61
59
|
end
|
|
62
60
|
|
|
@@ -78,7 +76,6 @@ module Twilio
|
|
|
78
76
|
# the default value of 50 records. If no page_size is defined
|
|
79
77
|
# but a limit is defined, stream() will attempt to read the
|
|
80
78
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
81
|
-
|
|
82
79
|
# @return [Array] Array of up to limit results
|
|
83
80
|
def list(start_date_before: nil, start_date: nil, start_date_after: nil, end_date_before: nil, end_date: nil, end_date_after: nil, identity: nil, tag: nil, limit: nil, page_size: nil)
|
|
84
81
|
self.stream(
|
|
@@ -113,7 +110,6 @@ module Twilio
|
|
|
113
110
|
# the default value of 50 records. If no page_size is defined
|
|
114
111
|
# but a limit is defined, stream() will attempt to read the
|
|
115
112
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
116
|
-
|
|
117
113
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
118
114
|
def stream(start_date_before: nil, start_date: nil, start_date_after: nil, end_date_before: nil, end_date: nil, end_date_after: nil, identity: nil, tag: nil, limit: nil, page_size: nil)
|
|
119
115
|
limits = @version.read_limits(limit, page_size)
|
|
@@ -177,7 +173,6 @@ module Twilio
|
|
|
177
173
|
# @param [String] page_token PageToken provided by the API
|
|
178
174
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
179
175
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
180
|
-
|
|
181
176
|
# @return [Page] Page of BindingInstance
|
|
182
177
|
def page(start_date_before: nil, start_date: nil, start_date_after: nil, end_date_before: nil, end_date: nil, end_date_after: nil, identity: nil, tag: nil, page_token: nil, page_number: nil, page_size: nil)
|
|
183
178
|
params = {
|
|
@@ -215,7 +210,6 @@ module Twilio
|
|
|
215
210
|
# @param [Response] response Response from the API
|
|
216
211
|
# @param [Hash] solution Path solution for the resource
|
|
217
212
|
# @param [String] service_sid The service_sid
|
|
218
|
-
|
|
219
213
|
# @return [BindingPage] BindingPage
|
|
220
214
|
def initialize(version, response, solution)
|
|
221
215
|
super(version, response)
|
|
@@ -227,13 +221,12 @@ module Twilio
|
|
|
227
221
|
##
|
|
228
222
|
# Build an instance of BindingInstance
|
|
229
223
|
# @param [Hash] payload Payload response from the API
|
|
230
|
-
|
|
231
224
|
# @return [BindingInstance] BindingInstance
|
|
232
225
|
def get_instance(payload)
|
|
233
226
|
return BindingInstance.new(
|
|
234
227
|
@version,
|
|
235
228
|
payload,
|
|
236
|
-
service_sid: @solution[
|
|
229
|
+
service_sid: @solution[:service_sid],
|
|
237
230
|
)
|
|
238
231
|
end
|
|
239
232
|
|
|
@@ -250,7 +243,6 @@ module Twilio
|
|
|
250
243
|
# @param [Version] version Version that contains the resource
|
|
251
244
|
# @param [String] service_sid The service_sid
|
|
252
245
|
# @param [String] sid The sid
|
|
253
|
-
|
|
254
246
|
# @return [BindingContext] BindingContext
|
|
255
247
|
def initialize(version, service_sid, sid)
|
|
256
248
|
super(version)
|
|
@@ -278,8 +270,8 @@ module Twilio
|
|
|
278
270
|
return BindingInstance.new(
|
|
279
271
|
@version,
|
|
280
272
|
payload,
|
|
281
|
-
service_sid: @solution[
|
|
282
|
-
sid: @solution[
|
|
273
|
+
service_sid: @solution[:service_sid],
|
|
274
|
+
sid: @solution[:sid],
|
|
283
275
|
)
|
|
284
276
|
end
|
|
285
277
|
|
|
@@ -305,7 +297,6 @@ module Twilio
|
|
|
305
297
|
# @param [Hash] payload payload that contains response from Twilio
|
|
306
298
|
# @param [String] service_sid The service_sid
|
|
307
299
|
# @param [String] sid The sid
|
|
308
|
-
|
|
309
300
|
# @return [BindingInstance] BindingInstance
|
|
310
301
|
def initialize(version, payload, service_sid: nil, sid: nil)
|
|
311
302
|
super(version)
|
|
@@ -338,7 +329,6 @@ module Twilio
|
|
|
338
329
|
# Generate an instance context for the instance, the context is capable of
|
|
339
330
|
# performing various actions. All instance actions are proxied to the context
|
|
340
331
|
# @param [Version] version Version that contains the resource
|
|
341
|
-
|
|
342
332
|
# @return [BindingContext] BindingContext for this BindingInstance
|
|
343
333
|
def context
|
|
344
334
|
unless @instance_context
|
|
@@ -403,21 +393,21 @@ module Twilio
|
|
|
403
393
|
# Fetch a BindingInstance
|
|
404
394
|
# @return [BindingInstance] Fetched BindingInstance
|
|
405
395
|
def fetch
|
|
406
|
-
|
|
396
|
+
context.fetch
|
|
407
397
|
end
|
|
408
398
|
|
|
409
399
|
##
|
|
410
400
|
# Deletes the BindingInstance
|
|
411
401
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
412
402
|
def delete
|
|
413
|
-
|
|
403
|
+
context.delete
|
|
414
404
|
end
|
|
415
405
|
|
|
416
406
|
##
|
|
417
407
|
# Provide a user friendly representation
|
|
418
408
|
def to_s
|
|
419
|
-
|
|
420
|
-
"<Twilio.Notifications.V1.BindingInstance #{
|
|
409
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
410
|
+
"<Twilio.Notifications.V1.BindingInstance #{values}>"
|
|
421
411
|
end
|
|
422
412
|
end
|
|
423
413
|
end
|
|
@@ -14,7 +14,6 @@ module Twilio
|
|
|
14
14
|
# Initialize the NotificationList
|
|
15
15
|
# @param [Version] version Version that contains the resource
|
|
16
16
|
# @param [String] service_sid The service_sid
|
|
17
|
-
|
|
18
17
|
# @return [NotificationList] NotificationList
|
|
19
18
|
def initialize(version, service_sid: nil)
|
|
20
19
|
super(version)
|
|
@@ -41,8 +40,7 @@ module Twilio
|
|
|
41
40
|
# @param [String] apn The apn
|
|
42
41
|
# @param [String] gcm The gcm
|
|
43
42
|
# @param [String] sms The sms
|
|
44
|
-
# @param [
|
|
45
|
-
|
|
43
|
+
# @param [Hash] facebook_messenger The facebook_messenger
|
|
46
44
|
# @return [NotificationInstance] Newly created NotificationInstance
|
|
47
45
|
def create(identity: nil, tag: nil, body: nil, priority: nil, ttl: nil, title: nil, sound: nil, action: nil, data: nil, apn: nil, gcm: nil, sms: nil, facebook_messenger: nil)
|
|
48
46
|
data = {
|
|
@@ -70,7 +68,7 @@ module Twilio
|
|
|
70
68
|
return NotificationInstance.new(
|
|
71
69
|
@version,
|
|
72
70
|
payload,
|
|
73
|
-
service_sid: @solution[
|
|
71
|
+
service_sid: @solution[:service_sid],
|
|
74
72
|
)
|
|
75
73
|
end
|
|
76
74
|
|
|
@@ -88,7 +86,6 @@ module Twilio
|
|
|
88
86
|
# @param [Response] response Response from the API
|
|
89
87
|
# @param [Hash] solution Path solution for the resource
|
|
90
88
|
# @param [String] service_sid The service_sid
|
|
91
|
-
|
|
92
89
|
# @return [NotificationPage] NotificationPage
|
|
93
90
|
def initialize(version, response, solution)
|
|
94
91
|
super(version, response)
|
|
@@ -100,13 +97,12 @@ module Twilio
|
|
|
100
97
|
##
|
|
101
98
|
# Build an instance of NotificationInstance
|
|
102
99
|
# @param [Hash] payload Payload response from the API
|
|
103
|
-
|
|
104
100
|
# @return [NotificationInstance] NotificationInstance
|
|
105
101
|
def get_instance(payload)
|
|
106
102
|
return NotificationInstance.new(
|
|
107
103
|
@version,
|
|
108
104
|
payload,
|
|
109
|
-
service_sid: @solution[
|
|
105
|
+
service_sid: @solution[:service_sid],
|
|
110
106
|
)
|
|
111
107
|
end
|
|
112
108
|
|
|
@@ -123,7 +119,6 @@ module Twilio
|
|
|
123
119
|
# @param [Version] version Version that contains the resource
|
|
124
120
|
# @param [Hash] payload payload that contains response from Twilio
|
|
125
121
|
# @param [String] service_sid The service_sid
|
|
126
|
-
|
|
127
122
|
# @return [NotificationInstance] NotificationInstance
|
|
128
123
|
def initialize(version, payload, service_sid: nil)
|
|
129
124
|
super(version)
|
|
@@ -145,6 +140,7 @@ module Twilio
|
|
|
145
140
|
'data' => payload['data'],
|
|
146
141
|
'apn' => payload['apn'],
|
|
147
142
|
'gcm' => payload['gcm'],
|
|
143
|
+
'sms' => payload['sms'],
|
|
148
144
|
'facebook_messenger' => payload['facebook_messenger'],
|
|
149
145
|
}
|
|
150
146
|
end
|
|
@@ -209,6 +205,10 @@ module Twilio
|
|
|
209
205
|
@properties['gcm']
|
|
210
206
|
end
|
|
211
207
|
|
|
208
|
+
def sms
|
|
209
|
+
@properties['sms']
|
|
210
|
+
end
|
|
211
|
+
|
|
212
212
|
def facebook_messenger
|
|
213
213
|
@properties['facebook_messenger']
|
|
214
214
|
end
|
|
@@ -12,7 +12,6 @@ module Twilio
|
|
|
12
12
|
##
|
|
13
13
|
# Initialize the ServiceList
|
|
14
14
|
# @param [Version] version Version that contains the resource
|
|
15
|
-
|
|
16
15
|
# @return [ServiceList] ServiceList
|
|
17
16
|
def initialize(version)
|
|
18
17
|
super(version)
|
|
@@ -34,7 +33,6 @@ module Twilio
|
|
|
34
33
|
# default_apn_notification_protocol_version
|
|
35
34
|
# @param [String] default_gcm_notification_protocol_version The
|
|
36
35
|
# default_gcm_notification_protocol_version
|
|
37
|
-
|
|
38
36
|
# @return [ServiceInstance] Newly created ServiceInstance
|
|
39
37
|
def create(friendly_name: nil, apn_credential_sid: nil, gcm_credential_sid: nil, messaging_service_sid: nil, facebook_messenger_page_id: nil, default_apn_notification_protocol_version: nil, default_gcm_notification_protocol_version: nil)
|
|
40
38
|
data = {
|
|
@@ -70,7 +68,6 @@ module Twilio
|
|
|
70
68
|
# the default value of 50 records. If no page_size is defined
|
|
71
69
|
# but a limit is defined, stream() will attempt to read the
|
|
72
70
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
73
|
-
|
|
74
71
|
# @return [Array] Array of up to limit results
|
|
75
72
|
def list(friendly_name: nil, limit: nil, page_size: nil)
|
|
76
73
|
self.stream(
|
|
@@ -91,7 +88,6 @@ module Twilio
|
|
|
91
88
|
# the default value of 50 records. If no page_size is defined
|
|
92
89
|
# but a limit is defined, stream() will attempt to read the
|
|
93
90
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
94
|
-
|
|
95
91
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
96
92
|
def stream(friendly_name: nil, limit: nil, page_size: nil)
|
|
97
93
|
limits = @version.read_limits(limit, page_size)
|
|
@@ -134,7 +130,6 @@ module Twilio
|
|
|
134
130
|
# @param [String] page_token PageToken provided by the API
|
|
135
131
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
136
132
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
137
|
-
|
|
138
133
|
# @return [Page] Page of ServiceInstance
|
|
139
134
|
def page(friendly_name: nil, page_token: nil, page_number: nil, page_size: nil)
|
|
140
135
|
params = {
|
|
@@ -164,7 +159,6 @@ module Twilio
|
|
|
164
159
|
# @param [Version] version Version that contains the resource
|
|
165
160
|
# @param [Response] response Response from the API
|
|
166
161
|
# @param [Hash] solution Path solution for the resource
|
|
167
|
-
|
|
168
162
|
# @return [ServicePage] ServicePage
|
|
169
163
|
def initialize(version, response, solution)
|
|
170
164
|
super(version, response)
|
|
@@ -176,7 +170,6 @@ module Twilio
|
|
|
176
170
|
##
|
|
177
171
|
# Build an instance of ServiceInstance
|
|
178
172
|
# @param [Hash] payload Payload response from the API
|
|
179
|
-
|
|
180
173
|
# @return [ServiceInstance] ServiceInstance
|
|
181
174
|
def get_instance(payload)
|
|
182
175
|
return ServiceInstance.new(
|
|
@@ -197,7 +190,6 @@ module Twilio
|
|
|
197
190
|
# Initialize the ServiceContext
|
|
198
191
|
# @param [Version] version Version that contains the resource
|
|
199
192
|
# @param [String] sid The sid
|
|
200
|
-
|
|
201
193
|
# @return [ServiceContext] ServiceContext
|
|
202
194
|
def initialize(version, sid)
|
|
203
195
|
super(version)
|
|
@@ -235,7 +227,7 @@ module Twilio
|
|
|
235
227
|
return ServiceInstance.new(
|
|
236
228
|
@version,
|
|
237
229
|
payload,
|
|
238
|
-
sid: @solution[
|
|
230
|
+
sid: @solution[:sid],
|
|
239
231
|
)
|
|
240
232
|
end
|
|
241
233
|
|
|
@@ -250,7 +242,6 @@ module Twilio
|
|
|
250
242
|
# default_apn_notification_protocol_version
|
|
251
243
|
# @param [String] default_gcm_notification_protocol_version The
|
|
252
244
|
# default_gcm_notification_protocol_version
|
|
253
|
-
|
|
254
245
|
# @return [ServiceInstance] Updated ServiceInstance
|
|
255
246
|
def update(friendly_name: nil, apn_credential_sid: nil, gcm_credential_sid: nil, messaging_service_sid: nil, facebook_messenger_page_id: nil, default_apn_notification_protocol_version: nil, default_gcm_notification_protocol_version: nil)
|
|
256
247
|
data = {
|
|
@@ -272,7 +263,7 @@ module Twilio
|
|
|
272
263
|
return ServiceInstance.new(
|
|
273
264
|
@version,
|
|
274
265
|
payload,
|
|
275
|
-
sid: @solution[
|
|
266
|
+
sid: @solution[:sid],
|
|
276
267
|
)
|
|
277
268
|
end
|
|
278
269
|
|
|
@@ -326,7 +317,6 @@ module Twilio
|
|
|
326
317
|
# @param [Version] version Version that contains the resource
|
|
327
318
|
# @param [Hash] payload payload that contains response from Twilio
|
|
328
319
|
# @param [String] sid The sid
|
|
329
|
-
|
|
330
320
|
# @return [ServiceInstance] ServiceInstance
|
|
331
321
|
def initialize(version, payload, sid: nil)
|
|
332
322
|
super(version)
|
|
@@ -359,7 +349,6 @@ module Twilio
|
|
|
359
349
|
# Generate an instance context for the instance, the context is capable of
|
|
360
350
|
# performing various actions. All instance actions are proxied to the context
|
|
361
351
|
# @param [Version] version Version that contains the resource
|
|
362
|
-
|
|
363
352
|
# @return [ServiceContext] ServiceContext for this ServiceInstance
|
|
364
353
|
def context
|
|
365
354
|
unless @instance_context
|
|
@@ -427,14 +416,14 @@ module Twilio
|
|
|
427
416
|
# Deletes the ServiceInstance
|
|
428
417
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
429
418
|
def delete
|
|
430
|
-
|
|
419
|
+
context.delete
|
|
431
420
|
end
|
|
432
421
|
|
|
433
422
|
##
|
|
434
423
|
# Fetch a ServiceInstance
|
|
435
424
|
# @return [ServiceInstance] Fetched ServiceInstance
|
|
436
425
|
def fetch
|
|
437
|
-
|
|
426
|
+
context.fetch
|
|
438
427
|
end
|
|
439
428
|
|
|
440
429
|
##
|
|
@@ -448,10 +437,10 @@ module Twilio
|
|
|
448
437
|
# default_apn_notification_protocol_version
|
|
449
438
|
# @param [String] default_gcm_notification_protocol_version The
|
|
450
439
|
# default_gcm_notification_protocol_version
|
|
451
|
-
|
|
452
440
|
# @return [ServiceInstance] Updated ServiceInstance
|
|
453
441
|
def update(friendly_name: nil, apn_credential_sid: nil, gcm_credential_sid: nil, messaging_service_sid: nil, facebook_messenger_page_id: nil, default_apn_notification_protocol_version: nil, default_gcm_notification_protocol_version: nil)
|
|
454
|
-
|
|
442
|
+
context.update(
|
|
443
|
+
friendly_name: friendly_name,
|
|
455
444
|
apn_credential_sid: apn_credential_sid,
|
|
456
445
|
gcm_credential_sid: gcm_credential_sid,
|
|
457
446
|
messaging_service_sid: messaging_service_sid,
|
|
@@ -465,21 +454,21 @@ module Twilio
|
|
|
465
454
|
# Access the bindings
|
|
466
455
|
# @return [bindings] bindings
|
|
467
456
|
def bindings
|
|
468
|
-
|
|
457
|
+
context.bindings
|
|
469
458
|
end
|
|
470
459
|
|
|
471
460
|
##
|
|
472
461
|
# Access the notifications
|
|
473
462
|
# @return [notifications] notifications
|
|
474
463
|
def notifications
|
|
475
|
-
|
|
464
|
+
context.notifications
|
|
476
465
|
end
|
|
477
466
|
|
|
478
467
|
##
|
|
479
468
|
# Provide a user friendly representation
|
|
480
469
|
def to_s
|
|
481
|
-
|
|
482
|
-
"<Twilio.Notifications.V1.ServiceInstance #{
|
|
470
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
471
|
+
"<Twilio.Notifications.V1.ServiceInstance #{values}>"
|
|
483
472
|
end
|
|
484
473
|
end
|
|
485
474
|
end
|