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
@@ -0,0 +1,324 @@
|
|
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 SigningKeyList < ListResource
|
13
|
+
##
|
14
|
+
# Initialize the SigningKeyList
|
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 [SigningKeyList] SigningKeyList
|
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]}/SigningKeys.json"
|
27
|
+
end
|
28
|
+
|
29
|
+
##
|
30
|
+
# Lists SigningKeyInstance records from the API as a list.
|
31
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
32
|
+
# memory before returning.
|
33
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
34
|
+
# guarantees to never return more than limit. Default is no limit
|
35
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
36
|
+
# the default value of 50 records. If no page_size is defined
|
37
|
+
# but a limit is defined, stream() will attempt to read the
|
38
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
39
|
+
# @return [Array] Array of up to limit results
|
40
|
+
def list(limit: nil, page_size: nil)
|
41
|
+
self.stream(
|
42
|
+
limit: limit,
|
43
|
+
page_size: page_size
|
44
|
+
).entries
|
45
|
+
end
|
46
|
+
|
47
|
+
##
|
48
|
+
# Streams SigningKeyInstance records from the API as an Enumerable.
|
49
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
50
|
+
# is reached.
|
51
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
52
|
+
# guarantees to never return more than limit. Default is no limit
|
53
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
54
|
+
# the default value of 50 records. If no page_size is defined
|
55
|
+
# but a limit is defined, stream() will attempt to read the
|
56
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
57
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
58
|
+
def stream(limit: nil, page_size: nil)
|
59
|
+
limits = @version.read_limits(limit, page_size)
|
60
|
+
|
61
|
+
page = self.page(
|
62
|
+
page_size: limits['page_size'],
|
63
|
+
)
|
64
|
+
|
65
|
+
@version.stream(page, limit: limits['limit'], page_limit: limits['page_limit'])
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# When passed a block, yields SigningKeyInstance records from the API.
|
70
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
71
|
+
# is reached.
|
72
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
73
|
+
# guarantees to never return more than limit. Default is no limit
|
74
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
75
|
+
# the default value of 50 records. If no page_size is defined
|
76
|
+
# but a limit is defined, stream() will attempt to read the
|
77
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
78
|
+
def each
|
79
|
+
limits = @version.read_limits
|
80
|
+
|
81
|
+
page = self.page(
|
82
|
+
page_size: limits['page_size'],
|
83
|
+
)
|
84
|
+
|
85
|
+
@version.stream(page,
|
86
|
+
limit: limits['limit'],
|
87
|
+
page_limit: limits['page_limit']).each {|x| yield x}
|
88
|
+
end
|
89
|
+
|
90
|
+
##
|
91
|
+
# Retrieve a single page of SigningKeyInstance records from the API.
|
92
|
+
# Request is executed immediately.
|
93
|
+
# @param [String] page_token PageToken provided by the API
|
94
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
95
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
96
|
+
# @return [Page] Page of SigningKeyInstance
|
97
|
+
def page(page_token: nil, page_number: nil, page_size: nil)
|
98
|
+
params = {
|
99
|
+
'PageToken' => page_token,
|
100
|
+
'Page' => page_number,
|
101
|
+
'PageSize' => page_size,
|
102
|
+
}
|
103
|
+
response = @version.page(
|
104
|
+
'GET',
|
105
|
+
@uri,
|
106
|
+
params
|
107
|
+
)
|
108
|
+
return SigningKeyPage.new(@version, response, @solution)
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# Provide a user friendly representation
|
113
|
+
def to_s
|
114
|
+
'#<Twilio.Api.V2010.SigningKeyList>'
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
class SigningKeyPage < Page
|
119
|
+
##
|
120
|
+
# Initialize the SigningKeyPage
|
121
|
+
# @param [Version] version Version that contains the resource
|
122
|
+
# @param [Response] response Response from the API
|
123
|
+
# @param [Hash] solution Path solution for the resource
|
124
|
+
# @param [String] account_sid A 34 character string that uniquely identifies this
|
125
|
+
# resource.
|
126
|
+
# @return [SigningKeyPage] SigningKeyPage
|
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 SigningKeyInstance
|
136
|
+
# @param [Hash] payload Payload response from the API
|
137
|
+
# @return [SigningKeyInstance] SigningKeyInstance
|
138
|
+
def get_instance(payload)
|
139
|
+
return SigningKeyInstance.new(
|
140
|
+
@version,
|
141
|
+
payload,
|
142
|
+
account_sid: @solution[:account_sid],
|
143
|
+
)
|
144
|
+
end
|
145
|
+
|
146
|
+
##
|
147
|
+
# Provide a user friendly representation
|
148
|
+
def to_s
|
149
|
+
'<Twilio.Api.V2010.SigningKeyPage>'
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
class SigningKeyContext < InstanceContext
|
154
|
+
##
|
155
|
+
# Initialize the SigningKeyContext
|
156
|
+
# @param [Version] version Version that contains the resource
|
157
|
+
# @param [String] account_sid The account_sid
|
158
|
+
# @param [String] sid The sid
|
159
|
+
# @return [SigningKeyContext] SigningKeyContext
|
160
|
+
def initialize(version, account_sid, sid)
|
161
|
+
super(version)
|
162
|
+
|
163
|
+
# Path Solution
|
164
|
+
@solution = {
|
165
|
+
account_sid: account_sid,
|
166
|
+
sid: sid,
|
167
|
+
}
|
168
|
+
@uri = "/Accounts/#{@solution[:account_sid]}/SigningKeys/#{@solution[:sid]}.json"
|
169
|
+
end
|
170
|
+
|
171
|
+
##
|
172
|
+
# Fetch a SigningKeyInstance
|
173
|
+
# @return [SigningKeyInstance] Fetched SigningKeyInstance
|
174
|
+
def fetch
|
175
|
+
params = {}
|
176
|
+
|
177
|
+
payload = @version.fetch(
|
178
|
+
'GET',
|
179
|
+
@uri,
|
180
|
+
params,
|
181
|
+
)
|
182
|
+
|
183
|
+
return SigningKeyInstance.new(
|
184
|
+
@version,
|
185
|
+
payload,
|
186
|
+
account_sid: @solution[:account_sid],
|
187
|
+
sid: @solution[:sid],
|
188
|
+
)
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# Update the SigningKeyInstance
|
193
|
+
# @param [String] friendly_name The friendly_name
|
194
|
+
# @return [SigningKeyInstance] Updated SigningKeyInstance
|
195
|
+
def update(friendly_name: nil)
|
196
|
+
data = {
|
197
|
+
'FriendlyName' => friendly_name,
|
198
|
+
}
|
199
|
+
|
200
|
+
payload = @version.update(
|
201
|
+
'POST',
|
202
|
+
@uri,
|
203
|
+
data: data,
|
204
|
+
)
|
205
|
+
|
206
|
+
return SigningKeyInstance.new(
|
207
|
+
@version,
|
208
|
+
payload,
|
209
|
+
account_sid: @solution[:account_sid],
|
210
|
+
sid: @solution[:sid],
|
211
|
+
)
|
212
|
+
end
|
213
|
+
|
214
|
+
##
|
215
|
+
# Deletes the SigningKeyInstance
|
216
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
217
|
+
def delete
|
218
|
+
return @version.delete('delete', @uri)
|
219
|
+
end
|
220
|
+
|
221
|
+
##
|
222
|
+
# Provide a user friendly representation
|
223
|
+
def to_s
|
224
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
225
|
+
"#<Twilio.Api.V2010.SigningKeyContext #{context}>"
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
class SigningKeyInstance < InstanceResource
|
230
|
+
##
|
231
|
+
# Initialize the SigningKeyInstance
|
232
|
+
# @param [Version] version Version that contains the resource
|
233
|
+
# @param [Hash] payload payload that contains response from Twilio
|
234
|
+
# @param [String] account_sid A 34 character string that uniquely identifies this
|
235
|
+
# resource.
|
236
|
+
# @param [String] sid The sid
|
237
|
+
# @return [SigningKeyInstance] SigningKeyInstance
|
238
|
+
def initialize(version, payload, account_sid: nil, sid: nil)
|
239
|
+
super(version)
|
240
|
+
|
241
|
+
# Marshaled Properties
|
242
|
+
@properties = {
|
243
|
+
'sid' => payload['sid'],
|
244
|
+
'friendly_name' => payload['friendly_name'],
|
245
|
+
'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
|
246
|
+
'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
|
247
|
+
}
|
248
|
+
|
249
|
+
# Context
|
250
|
+
@instance_context = nil
|
251
|
+
@params = {
|
252
|
+
'account_sid' => account_sid,
|
253
|
+
'sid' => sid || @properties['sid'],
|
254
|
+
}
|
255
|
+
end
|
256
|
+
|
257
|
+
##
|
258
|
+
# Generate an instance context for the instance, the context is capable of
|
259
|
+
# performing various actions. All instance actions are proxied to the context
|
260
|
+
# @param [Version] version Version that contains the resource
|
261
|
+
# @return [SigningKeyContext] SigningKeyContext for this SigningKeyInstance
|
262
|
+
def context
|
263
|
+
unless @instance_context
|
264
|
+
@instance_context = SigningKeyContext.new(
|
265
|
+
@version,
|
266
|
+
@params['account_sid'],
|
267
|
+
@params['sid'],
|
268
|
+
)
|
269
|
+
end
|
270
|
+
@instance_context
|
271
|
+
end
|
272
|
+
|
273
|
+
def sid
|
274
|
+
@properties['sid']
|
275
|
+
end
|
276
|
+
|
277
|
+
def friendly_name
|
278
|
+
@properties['friendly_name']
|
279
|
+
end
|
280
|
+
|
281
|
+
def date_created
|
282
|
+
@properties['date_created']
|
283
|
+
end
|
284
|
+
|
285
|
+
def date_updated
|
286
|
+
@properties['date_updated']
|
287
|
+
end
|
288
|
+
|
289
|
+
##
|
290
|
+
# Fetch a SigningKeyInstance
|
291
|
+
# @return [SigningKeyInstance] Fetched SigningKeyInstance
|
292
|
+
def fetch
|
293
|
+
context.fetch
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# Update the SigningKeyInstance
|
298
|
+
# @param [String] friendly_name The friendly_name
|
299
|
+
# @return [SigningKeyInstance] Updated SigningKeyInstance
|
300
|
+
def update(friendly_name: nil)
|
301
|
+
context.update(
|
302
|
+
friendly_name: friendly_name,
|
303
|
+
)
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# Deletes the SigningKeyInstance
|
308
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
309
|
+
def delete
|
310
|
+
context.delete
|
311
|
+
end
|
312
|
+
|
313
|
+
##
|
314
|
+
# Provide a user friendly representation
|
315
|
+
def to_s
|
316
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
317
|
+
"<Twilio.Api.V2010.SigningKeyInstance #{values}>"
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
@@ -17,7 +17,6 @@ module Twilio
|
|
17
17
|
# @param [Version] version Version that contains the resource
|
18
18
|
# @param [String] account_sid The account_sid
|
19
19
|
# @param [String] credential_list_sid The credential_list_sid
|
20
|
-
|
21
20
|
# @return [CredentialList] CredentialList
|
22
21
|
def initialize(version, account_sid: nil, credential_list_sid: nil)
|
23
22
|
super(version)
|
@@ -40,7 +39,6 @@ module Twilio
|
|
40
39
|
# the default value of 50 records. If no page_size is defined
|
41
40
|
# but a limit is defined, stream() will attempt to read the
|
42
41
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
43
|
-
|
44
42
|
# @return [Array] Array of up to limit results
|
45
43
|
def list(limit: nil, page_size: nil)
|
46
44
|
self.stream(
|
@@ -59,7 +57,6 @@ module Twilio
|
|
59
57
|
# the default value of 50 records. If no page_size is defined
|
60
58
|
# but a limit is defined, stream() will attempt to read the
|
61
59
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
62
|
-
|
63
60
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
64
61
|
def stream(limit: nil, page_size: nil)
|
65
62
|
limits = @version.read_limits(limit, page_size)
|
@@ -99,7 +96,6 @@ module Twilio
|
|
99
96
|
# @param [String] page_token PageToken provided by the API
|
100
97
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
101
98
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
102
|
-
|
103
99
|
# @return [Page] Page of CredentialInstance
|
104
100
|
def page(page_token: nil, page_number: nil, page_size: nil)
|
105
101
|
params = {
|
@@ -120,7 +116,6 @@ module Twilio
|
|
120
116
|
# Request is executed immediately.
|
121
117
|
# @param [String] username The username
|
122
118
|
# @param [String] password The password
|
123
|
-
|
124
119
|
# @return [CredentialInstance] Newly created CredentialInstance
|
125
120
|
def create(username: nil, password: nil)
|
126
121
|
data = {
|
@@ -137,8 +132,8 @@ module Twilio
|
|
137
132
|
return CredentialInstance.new(
|
138
133
|
@version,
|
139
134
|
payload,
|
140
|
-
account_sid: @solution[
|
141
|
-
credential_list_sid: @solution[
|
135
|
+
account_sid: @solution[:account_sid],
|
136
|
+
credential_list_sid: @solution[:credential_list_sid],
|
142
137
|
)
|
143
138
|
end
|
144
139
|
|
@@ -157,7 +152,6 @@ module Twilio
|
|
157
152
|
# @param [Hash] solution Path solution for the resource
|
158
153
|
# @param [String] account_sid The account_sid
|
159
154
|
# @param [String] credential_list_sid The credential_list_sid
|
160
|
-
|
161
155
|
# @return [CredentialPage] CredentialPage
|
162
156
|
def initialize(version, response, solution)
|
163
157
|
super(version, response)
|
@@ -169,14 +163,13 @@ module Twilio
|
|
169
163
|
##
|
170
164
|
# Build an instance of CredentialInstance
|
171
165
|
# @param [Hash] payload Payload response from the API
|
172
|
-
|
173
166
|
# @return [CredentialInstance] CredentialInstance
|
174
167
|
def get_instance(payload)
|
175
168
|
return CredentialInstance.new(
|
176
169
|
@version,
|
177
170
|
payload,
|
178
|
-
account_sid: @solution[
|
179
|
-
credential_list_sid: @solution[
|
171
|
+
account_sid: @solution[:account_sid],
|
172
|
+
credential_list_sid: @solution[:credential_list_sid],
|
180
173
|
)
|
181
174
|
end
|
182
175
|
|
@@ -194,7 +187,6 @@ module Twilio
|
|
194
187
|
# @param [String] account_sid The account_sid
|
195
188
|
# @param [String] credential_list_sid The credential_list_sid
|
196
189
|
# @param [String] sid The sid
|
197
|
-
|
198
190
|
# @return [CredentialContext] CredentialContext
|
199
191
|
def initialize(version, account_sid, credential_list_sid, sid)
|
200
192
|
super(version)
|
@@ -223,9 +215,9 @@ module Twilio
|
|
223
215
|
return CredentialInstance.new(
|
224
216
|
@version,
|
225
217
|
payload,
|
226
|
-
account_sid: @solution[
|
227
|
-
credential_list_sid: @solution[
|
228
|
-
sid: @solution[
|
218
|
+
account_sid: @solution[:account_sid],
|
219
|
+
credential_list_sid: @solution[:credential_list_sid],
|
220
|
+
sid: @solution[:sid],
|
229
221
|
)
|
230
222
|
end
|
231
223
|
|
@@ -233,7 +225,6 @@ module Twilio
|
|
233
225
|
# Update the CredentialInstance
|
234
226
|
# @param [String] username The username
|
235
227
|
# @param [String] password The password
|
236
|
-
|
237
228
|
# @return [CredentialInstance] Updated CredentialInstance
|
238
229
|
def update(username: nil, password: nil)
|
239
230
|
data = {
|
@@ -250,9 +241,9 @@ module Twilio
|
|
250
241
|
return CredentialInstance.new(
|
251
242
|
@version,
|
252
243
|
payload,
|
253
|
-
account_sid: @solution[
|
254
|
-
credential_list_sid: @solution[
|
255
|
-
sid: @solution[
|
244
|
+
account_sid: @solution[:account_sid],
|
245
|
+
credential_list_sid: @solution[:credential_list_sid],
|
246
|
+
sid: @solution[:sid],
|
256
247
|
)
|
257
248
|
end
|
258
249
|
|
@@ -279,7 +270,6 @@ module Twilio
|
|
279
270
|
# @param [String] account_sid The account_sid
|
280
271
|
# @param [String] credential_list_sid The credential_list_sid
|
281
272
|
# @param [String] sid The sid
|
282
|
-
|
283
273
|
# @return [CredentialInstance] CredentialInstance
|
284
274
|
def initialize(version, payload, account_sid: nil, credential_list_sid: nil, sid: nil)
|
285
275
|
super(version)
|
@@ -308,7 +298,6 @@ module Twilio
|
|
308
298
|
# Generate an instance context for the instance, the context is capable of
|
309
299
|
# performing various actions. All instance actions are proxied to the context
|
310
300
|
# @param [Version] version Version that contains the resource
|
311
|
-
|
312
301
|
# @return [CredentialContext] CredentialContext for this CredentialInstance
|
313
302
|
def context
|
314
303
|
unless @instance_context
|
@@ -354,17 +343,17 @@ module Twilio
|
|
354
343
|
# Fetch a CredentialInstance
|
355
344
|
# @return [CredentialInstance] Fetched CredentialInstance
|
356
345
|
def fetch
|
357
|
-
|
346
|
+
context.fetch
|
358
347
|
end
|
359
348
|
|
360
349
|
##
|
361
350
|
# Update the CredentialInstance
|
362
351
|
# @param [String] username The username
|
363
352
|
# @param [String] password The password
|
364
|
-
|
365
353
|
# @return [CredentialInstance] Updated CredentialInstance
|
366
354
|
def update(username: nil, password: nil)
|
367
|
-
|
355
|
+
context.update(
|
356
|
+
username: username,
|
368
357
|
password: password,
|
369
358
|
)
|
370
359
|
end
|
@@ -373,14 +362,14 @@ module Twilio
|
|
373
362
|
# Deletes the CredentialInstance
|
374
363
|
# @return [Boolean] true if delete succeeds, true otherwise
|
375
364
|
def delete
|
376
|
-
|
365
|
+
context.delete
|
377
366
|
end
|
378
367
|
|
379
368
|
##
|
380
369
|
# Provide a user friendly representation
|
381
370
|
def to_s
|
382
|
-
|
383
|
-
"<Twilio.Api.V2010.CredentialInstance #{
|
371
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
372
|
+
"<Twilio.Api.V2010.CredentialInstance #{values}>"
|
384
373
|
end
|
385
374
|
end
|
386
375
|
end
|