twilio-ruby 5.0.0.rc9 → 5.0.0.rc10
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -16,7 +16,6 @@ module Twilio
|
|
16
16
|
# @param [Version] version Version that contains the resource
|
17
17
|
# @param [String] account_sid The account_sid
|
18
18
|
# @param [String] message_sid The message_sid
|
19
|
-
|
20
19
|
# @return [FeedbackList] FeedbackList
|
21
20
|
def initialize(version, account_sid: nil, message_sid: nil)
|
22
21
|
super(version)
|
@@ -33,7 +32,6 @@ module Twilio
|
|
33
32
|
# Retrieve a single page of FeedbackInstance records from the API.
|
34
33
|
# Request is executed immediately.
|
35
34
|
# @param [feedback.Outcome] outcome The outcome
|
36
|
-
|
37
35
|
# @return [FeedbackInstance] Newly created FeedbackInstance
|
38
36
|
def create(outcome: nil)
|
39
37
|
data = {
|
@@ -49,8 +47,8 @@ module Twilio
|
|
49
47
|
return FeedbackInstance.new(
|
50
48
|
@version,
|
51
49
|
payload,
|
52
|
-
account_sid: @solution[
|
53
|
-
message_sid: @solution[
|
50
|
+
account_sid: @solution[:account_sid],
|
51
|
+
message_sid: @solution[:message_sid],
|
54
52
|
)
|
55
53
|
end
|
56
54
|
|
@@ -69,7 +67,6 @@ module Twilio
|
|
69
67
|
# @param [Hash] solution Path solution for the resource
|
70
68
|
# @param [String] account_sid The account_sid
|
71
69
|
# @param [String] message_sid The message_sid
|
72
|
-
|
73
70
|
# @return [FeedbackPage] FeedbackPage
|
74
71
|
def initialize(version, response, solution)
|
75
72
|
super(version, response)
|
@@ -81,14 +78,13 @@ module Twilio
|
|
81
78
|
##
|
82
79
|
# Build an instance of FeedbackInstance
|
83
80
|
# @param [Hash] payload Payload response from the API
|
84
|
-
|
85
81
|
# @return [FeedbackInstance] FeedbackInstance
|
86
82
|
def get_instance(payload)
|
87
83
|
return FeedbackInstance.new(
|
88
84
|
@version,
|
89
85
|
payload,
|
90
|
-
account_sid: @solution[
|
91
|
-
message_sid: @solution[
|
86
|
+
account_sid: @solution[:account_sid],
|
87
|
+
message_sid: @solution[:message_sid],
|
92
88
|
)
|
93
89
|
end
|
94
90
|
|
@@ -106,7 +102,6 @@ module Twilio
|
|
106
102
|
# @param [Hash] payload payload that contains response from Twilio
|
107
103
|
# @param [String] account_sid The account_sid
|
108
104
|
# @param [String] message_sid The message_sid
|
109
|
-
|
110
105
|
# @return [FeedbackInstance] FeedbackInstance
|
111
106
|
def initialize(version, payload, account_sid: nil, message_sid: nil)
|
112
107
|
super(version)
|
@@ -18,7 +18,6 @@ module Twilio
|
|
18
18
|
# media.
|
19
19
|
# @param [String] message_sid A 34 character string that uniquely identifies this
|
20
20
|
# resource.
|
21
|
-
|
22
21
|
# @return [MediaList] MediaList
|
23
22
|
def initialize(version, account_sid: nil, message_sid: nil)
|
24
23
|
super(version)
|
@@ -44,7 +43,6 @@ module Twilio
|
|
44
43
|
# the default value of 50 records. If no page_size is defined
|
45
44
|
# but a limit is defined, stream() will attempt to read the
|
46
45
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
47
|
-
|
48
46
|
# @return [Array] Array of up to limit results
|
49
47
|
def list(date_created_before: nil, date_created: nil, date_created_after: nil, limit: nil, page_size: nil)
|
50
48
|
self.stream(
|
@@ -69,7 +67,6 @@ module Twilio
|
|
69
67
|
# the default value of 50 records. If no page_size is defined
|
70
68
|
# but a limit is defined, stream() will attempt to read the
|
71
69
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
72
|
-
|
73
70
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
74
71
|
def stream(date_created_before: nil, date_created: nil, date_created_after: nil, limit: nil, page_size: nil)
|
75
72
|
limits = @version.read_limits(limit, page_size)
|
@@ -118,7 +115,6 @@ module Twilio
|
|
118
115
|
# @param [String] page_token PageToken provided by the API
|
119
116
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
120
117
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
121
|
-
|
122
118
|
# @return [Page] Page of MediaInstance
|
123
119
|
def page(date_created_before: nil, date_created: nil, date_created_after: nil, page_token: nil, page_number: nil, page_size: nil)
|
124
120
|
params = {
|
@@ -154,7 +150,6 @@ module Twilio
|
|
154
150
|
# media.
|
155
151
|
# @param [String] message_sid A 34 character string that uniquely identifies this
|
156
152
|
# resource.
|
157
|
-
|
158
153
|
# @return [MediaPage] MediaPage
|
159
154
|
def initialize(version, response, solution)
|
160
155
|
super(version, response)
|
@@ -166,14 +161,13 @@ module Twilio
|
|
166
161
|
##
|
167
162
|
# Build an instance of MediaInstance
|
168
163
|
# @param [Hash] payload Payload response from the API
|
169
|
-
|
170
164
|
# @return [MediaInstance] MediaInstance
|
171
165
|
def get_instance(payload)
|
172
166
|
return MediaInstance.new(
|
173
167
|
@version,
|
174
168
|
payload,
|
175
|
-
account_sid: @solution[
|
176
|
-
message_sid: @solution[
|
169
|
+
account_sid: @solution[:account_sid],
|
170
|
+
message_sid: @solution[:message_sid],
|
177
171
|
)
|
178
172
|
end
|
179
173
|
|
@@ -191,7 +185,6 @@ module Twilio
|
|
191
185
|
# @param [String] account_sid The account_sid
|
192
186
|
# @param [String] message_sid The message_sid
|
193
187
|
# @param [String] sid The media Sid that uniquely identifies this resource
|
194
|
-
|
195
188
|
# @return [MediaContext] MediaContext
|
196
189
|
def initialize(version, account_sid, message_sid, sid)
|
197
190
|
super(version)
|
@@ -227,9 +220,9 @@ module Twilio
|
|
227
220
|
return MediaInstance.new(
|
228
221
|
@version,
|
229
222
|
payload,
|
230
|
-
account_sid: @solution[
|
231
|
-
message_sid: @solution[
|
232
|
-
sid: @solution[
|
223
|
+
account_sid: @solution[:account_sid],
|
224
|
+
message_sid: @solution[:message_sid],
|
225
|
+
sid: @solution[:sid],
|
233
226
|
)
|
234
227
|
end
|
235
228
|
|
@@ -251,7 +244,6 @@ module Twilio
|
|
251
244
|
# @param [String] message_sid A 34 character string that uniquely identifies this
|
252
245
|
# resource.
|
253
246
|
# @param [String] sid The media Sid that uniquely identifies this resource
|
254
|
-
|
255
247
|
# @return [MediaInstance] MediaInstance
|
256
248
|
def initialize(version, payload, account_sid: nil, message_sid: nil, sid: nil)
|
257
249
|
super(version)
|
@@ -280,7 +272,6 @@ module Twilio
|
|
280
272
|
# Generate an instance context for the instance, the context is capable of
|
281
273
|
# performing various actions. All instance actions are proxied to the context
|
282
274
|
# @param [Version] version Version that contains the resource
|
283
|
-
|
284
275
|
# @return [MediaContext] MediaContext for this MediaInstance
|
285
276
|
def context
|
286
277
|
unless @instance_context
|
@@ -326,21 +317,21 @@ module Twilio
|
|
326
317
|
# Deletes the MediaInstance
|
327
318
|
# @return [Boolean] true if delete succeeds, true otherwise
|
328
319
|
def delete
|
329
|
-
|
320
|
+
context.delete
|
330
321
|
end
|
331
322
|
|
332
323
|
##
|
333
324
|
# Fetch a MediaInstance
|
334
325
|
# @return [MediaInstance] Fetched MediaInstance
|
335
326
|
def fetch
|
336
|
-
|
327
|
+
context.fetch
|
337
328
|
end
|
338
329
|
|
339
330
|
##
|
340
331
|
# Provide a user friendly representation
|
341
332
|
def to_s
|
342
|
-
|
343
|
-
"<Twilio.Api.V2010.MediaInstance #{
|
333
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
334
|
+
"<Twilio.Api.V2010.MediaInstance #{values}>"
|
344
335
|
end
|
345
336
|
end
|
346
337
|
end
|
@@ -14,7 +14,6 @@ module Twilio
|
|
14
14
|
# Initialize the MessageList
|
15
15
|
# @param [Version] version Version that contains the resource
|
16
16
|
# @param [String] account_sid The unique id of the Account that sent this message.
|
17
|
-
|
18
17
|
# @return [MessageList] MessageList
|
19
18
|
def initialize(version, account_sid: nil)
|
20
19
|
super(version)
|
@@ -31,26 +30,29 @@ module Twilio
|
|
31
30
|
# Request is executed immediately.
|
32
31
|
# @param [String] to The destination phone number. Format with a '+' and country
|
33
32
|
# code
|
34
|
-
# @param [String] from A Twilio phone number or alphanumeric sender ID enabled for
|
35
|
-
# the type of message you wish to send.
|
36
33
|
# @param [String] status_callback The URL that Twilio will POST to each time your
|
37
34
|
# message status changes
|
38
35
|
# @param [String] application_sid Twilio the POST MessageSid as well as
|
39
36
|
# MessageStatus to the URL in the MessageStatusCallback property of this
|
40
37
|
# Application
|
38
|
+
# @param [String] max_price The max_price
|
41
39
|
# @param [Boolean] provide_feedback The provide_feedback
|
42
40
|
# @param [String] body The body
|
43
41
|
# @param [String] media_url The media_url
|
44
|
-
|
42
|
+
# @param [String] from A Twilio phone number or alphanumeric sender ID enabled for
|
43
|
+
# the type of message you wish to send.
|
44
|
+
# @param [String] messaging_service_sid The messaging_service_sid
|
45
45
|
# @return [MessageInstance] Newly created MessageInstance
|
46
|
-
def create(to: nil,
|
46
|
+
def create(to: nil, status_callback: nil, application_sid: nil, max_price: nil, provide_feedback: nil, body: nil, media_url: nil, from: nil, messaging_service_sid: nil)
|
47
47
|
data = {
|
48
48
|
'To' => to,
|
49
|
-
'From' => from,
|
50
49
|
'Body' => body,
|
51
50
|
'MediaUrl' => media_url,
|
51
|
+
'From' => from,
|
52
|
+
'MessagingServiceSid' => messaging_service_sid,
|
52
53
|
'StatusCallback' => status_callback,
|
53
54
|
'ApplicationSid' => application_sid,
|
55
|
+
'MaxPrice' => max_price,
|
54
56
|
'ProvideFeedback' => provide_feedback,
|
55
57
|
}
|
56
58
|
|
@@ -63,7 +65,7 @@ module Twilio
|
|
63
65
|
return MessageInstance.new(
|
64
66
|
@version,
|
65
67
|
payload,
|
66
|
-
account_sid: @solution[
|
68
|
+
account_sid: @solution[:account_sid],
|
67
69
|
)
|
68
70
|
end
|
69
71
|
|
@@ -82,7 +84,6 @@ module Twilio
|
|
82
84
|
# the default value of 50 records. If no page_size is defined
|
83
85
|
# but a limit is defined, stream() will attempt to read the
|
84
86
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
85
|
-
|
86
87
|
# @return [Array] Array of up to limit results
|
87
88
|
def list(to: nil, from: nil, date_sent_before: nil, date_sent: nil, date_sent_after: nil, limit: nil, page_size: nil)
|
88
89
|
self.stream(
|
@@ -111,7 +112,6 @@ module Twilio
|
|
111
112
|
# the default value of 50 records. If no page_size is defined
|
112
113
|
# but a limit is defined, stream() will attempt to read the
|
113
114
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
114
|
-
|
115
115
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
116
116
|
def stream(to: nil, from: nil, date_sent_before: nil, date_sent: nil, date_sent_after: nil, limit: nil, page_size: nil)
|
117
117
|
limits = @version.read_limits(limit, page_size)
|
@@ -166,7 +166,6 @@ module Twilio
|
|
166
166
|
# @param [String] page_token PageToken provided by the API
|
167
167
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
168
168
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
169
|
-
|
170
169
|
# @return [Page] Page of MessageInstance
|
171
170
|
def page(to: nil, from: nil, date_sent_before: nil, date_sent: nil, date_sent_after: nil, page_token: nil, page_number: nil, page_size: nil)
|
172
171
|
params = {
|
@@ -201,7 +200,6 @@ module Twilio
|
|
201
200
|
# @param [Response] response Response from the API
|
202
201
|
# @param [Hash] solution Path solution for the resource
|
203
202
|
# @param [String] account_sid The unique id of the Account that sent this message.
|
204
|
-
|
205
203
|
# @return [MessagePage] MessagePage
|
206
204
|
def initialize(version, response, solution)
|
207
205
|
super(version, response)
|
@@ -213,13 +211,12 @@ module Twilio
|
|
213
211
|
##
|
214
212
|
# Build an instance of MessageInstance
|
215
213
|
# @param [Hash] payload Payload response from the API
|
216
|
-
|
217
214
|
# @return [MessageInstance] MessageInstance
|
218
215
|
def get_instance(payload)
|
219
216
|
return MessageInstance.new(
|
220
217
|
@version,
|
221
218
|
payload,
|
222
|
-
account_sid: @solution[
|
219
|
+
account_sid: @solution[:account_sid],
|
223
220
|
)
|
224
221
|
end
|
225
222
|
|
@@ -236,7 +233,6 @@ module Twilio
|
|
236
233
|
# @param [Version] version Version that contains the resource
|
237
234
|
# @param [String] account_sid The account_sid
|
238
235
|
# @param [String] sid The message Sid that uniquely identifies this resource
|
239
|
-
|
240
236
|
# @return [MessageContext] MessageContext
|
241
237
|
def initialize(version, account_sid, sid)
|
242
238
|
super(version)
|
@@ -275,15 +271,14 @@ module Twilio
|
|
275
271
|
return MessageInstance.new(
|
276
272
|
@version,
|
277
273
|
payload,
|
278
|
-
account_sid: @solution[
|
279
|
-
sid: @solution[
|
274
|
+
account_sid: @solution[:account_sid],
|
275
|
+
sid: @solution[:sid],
|
280
276
|
)
|
281
277
|
end
|
282
278
|
|
283
279
|
##
|
284
280
|
# Update the MessageInstance
|
285
281
|
# @param [String] body The body
|
286
|
-
|
287
282
|
# @return [MessageInstance] Updated MessageInstance
|
288
283
|
def update(body: nil)
|
289
284
|
data = {
|
@@ -299,8 +294,8 @@ module Twilio
|
|
299
294
|
return MessageInstance.new(
|
300
295
|
@version,
|
301
296
|
payload,
|
302
|
-
account_sid: @solution[
|
303
|
-
sid: @solution[
|
297
|
+
account_sid: @solution[:account_sid],
|
298
|
+
sid: @solution[:sid],
|
304
299
|
)
|
305
300
|
end
|
306
301
|
|
@@ -358,7 +353,6 @@ module Twilio
|
|
358
353
|
# @param [Hash] payload payload that contains response from Twilio
|
359
354
|
# @param [String] account_sid The unique id of the Account that sent this message.
|
360
355
|
# @param [String] sid The message Sid that uniquely identifies this resource
|
361
|
-
|
362
356
|
# @return [MessageInstance] MessageInstance
|
363
357
|
def initialize(version, payload, account_sid: nil, sid: nil)
|
364
358
|
super(version)
|
@@ -398,7 +392,6 @@ module Twilio
|
|
398
392
|
# Generate an instance context for the instance, the context is capable of
|
399
393
|
# performing various actions. All instance actions are proxied to the context
|
400
394
|
# @param [Version] version Version that contains the resource
|
401
|
-
|
402
395
|
# @return [MessageContext] MessageContext for this MessageInstance
|
403
396
|
def context
|
404
397
|
unless @instance_context
|
@@ -491,44 +484,45 @@ module Twilio
|
|
491
484
|
# Deletes the MessageInstance
|
492
485
|
# @return [Boolean] true if delete succeeds, true otherwise
|
493
486
|
def delete
|
494
|
-
|
487
|
+
context.delete
|
495
488
|
end
|
496
489
|
|
497
490
|
##
|
498
491
|
# Fetch a MessageInstance
|
499
492
|
# @return [MessageInstance] Fetched MessageInstance
|
500
493
|
def fetch
|
501
|
-
|
494
|
+
context.fetch
|
502
495
|
end
|
503
496
|
|
504
497
|
##
|
505
498
|
# Update the MessageInstance
|
506
499
|
# @param [String] body The body
|
507
|
-
|
508
500
|
# @return [MessageInstance] Updated MessageInstance
|
509
501
|
def update(body: nil)
|
510
|
-
|
502
|
+
context.update(
|
503
|
+
body: body,
|
504
|
+
)
|
511
505
|
end
|
512
506
|
|
513
507
|
##
|
514
508
|
# Access the media
|
515
509
|
# @return [media] media
|
516
510
|
def media
|
517
|
-
|
511
|
+
context.media
|
518
512
|
end
|
519
513
|
|
520
514
|
##
|
521
515
|
# Access the feedback
|
522
516
|
# @return [feedback] feedback
|
523
517
|
def feedback
|
524
|
-
|
518
|
+
context.feedback
|
525
519
|
end
|
526
520
|
|
527
521
|
##
|
528
522
|
# Provide a user friendly representation
|
529
523
|
def to_s
|
530
|
-
|
531
|
-
"<Twilio.Api.V2010.MessageInstance #{
|
524
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
525
|
+
"<Twilio.Api.V2010.MessageInstance #{values}>"
|
532
526
|
end
|
533
527
|
end
|
534
528
|
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Api < Domain
|
10
|
+
class V2010 < Version
|
11
|
+
class AccountContext < InstanceContext
|
12
|
+
class NewKeyList < ListResource
|
13
|
+
##
|
14
|
+
# Initialize the NewKeyList
|
15
|
+
# @param [Version] version Version that contains the resource
|
16
|
+
# @param [String] account_sid A 34 character string that uniquely identifies this
|
17
|
+
# resource.
|
18
|
+
# @return [NewKeyList] NewKeyList
|
19
|
+
def initialize(version, account_sid: nil)
|
20
|
+
super(version)
|
21
|
+
|
22
|
+
# Path Solution
|
23
|
+
@solution = {
|
24
|
+
account_sid: account_sid
|
25
|
+
}
|
26
|
+
@uri = "/Accounts/#{@solution[:account_sid]}/Keys.json"
|
27
|
+
end
|
28
|
+
|
29
|
+
##
|
30
|
+
# Retrieve a single page of NewKeyInstance records from the API.
|
31
|
+
# Request is executed immediately.
|
32
|
+
# @param [String] friendly_name The friendly_name
|
33
|
+
# @return [NewKeyInstance] Newly created NewKeyInstance
|
34
|
+
def create(friendly_name: nil)
|
35
|
+
data = {
|
36
|
+
'FriendlyName' => friendly_name,
|
37
|
+
}
|
38
|
+
|
39
|
+
payload = @version.create(
|
40
|
+
'POST',
|
41
|
+
@uri,
|
42
|
+
data: data
|
43
|
+
)
|
44
|
+
|
45
|
+
return NewKeyInstance.new(
|
46
|
+
@version,
|
47
|
+
payload,
|
48
|
+
account_sid: @solution[:account_sid],
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
##
|
53
|
+
# Provide a user friendly representation
|
54
|
+
def to_s
|
55
|
+
'#<Twilio.Api.V2010.NewKeyList>'
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class NewKeyPage < Page
|
60
|
+
##
|
61
|
+
# Initialize the NewKeyPage
|
62
|
+
# @param [Version] version Version that contains the resource
|
63
|
+
# @param [Response] response Response from the API
|
64
|
+
# @param [Hash] solution Path solution for the resource
|
65
|
+
# @param [String] account_sid A 34 character string that uniquely identifies this
|
66
|
+
# resource.
|
67
|
+
# @return [NewKeyPage] NewKeyPage
|
68
|
+
def initialize(version, response, solution)
|
69
|
+
super(version, response)
|
70
|
+
|
71
|
+
# Path Solution
|
72
|
+
@solution = solution
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Build an instance of NewKeyInstance
|
77
|
+
# @param [Hash] payload Payload response from the API
|
78
|
+
# @return [NewKeyInstance] NewKeyInstance
|
79
|
+
def get_instance(payload)
|
80
|
+
return NewKeyInstance.new(
|
81
|
+
@version,
|
82
|
+
payload,
|
83
|
+
account_sid: @solution[:account_sid],
|
84
|
+
)
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
# Provide a user friendly representation
|
89
|
+
def to_s
|
90
|
+
'<Twilio.Api.V2010.NewKeyPage>'
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
class NewKeyInstance < InstanceResource
|
95
|
+
##
|
96
|
+
# Initialize the NewKeyInstance
|
97
|
+
# @param [Version] version Version that contains the resource
|
98
|
+
# @param [Hash] payload payload that contains response from Twilio
|
99
|
+
# @param [String] account_sid A 34 character string that uniquely identifies this
|
100
|
+
# resource.
|
101
|
+
# @return [NewKeyInstance] NewKeyInstance
|
102
|
+
def initialize(version, payload, account_sid: nil)
|
103
|
+
super(version)
|
104
|
+
|
105
|
+
# Marshaled Properties
|
106
|
+
@properties = {
|
107
|
+
'sid' => payload['sid'],
|
108
|
+
'friendly_name' => payload['friendly_name'],
|
109
|
+
'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
|
110
|
+
'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
|
111
|
+
'secret' => payload['secret'],
|
112
|
+
}
|
113
|
+
end
|
114
|
+
|
115
|
+
def sid
|
116
|
+
@properties['sid']
|
117
|
+
end
|
118
|
+
|
119
|
+
def friendly_name
|
120
|
+
@properties['friendly_name']
|
121
|
+
end
|
122
|
+
|
123
|
+
def date_created
|
124
|
+
@properties['date_created']
|
125
|
+
end
|
126
|
+
|
127
|
+
def date_updated
|
128
|
+
@properties['date_updated']
|
129
|
+
end
|
130
|
+
|
131
|
+
def secret
|
132
|
+
@properties['secret']
|
133
|
+
end
|
134
|
+
|
135
|
+
##
|
136
|
+
# Provide a user friendly representation
|
137
|
+
def to_s
|
138
|
+
"<Twilio.Api.V2010.NewKeyInstance>"
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|