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
@@ -12,7 +12,6 @@ module Twilio
|
|
12
12
|
##
|
13
13
|
# Initialize the MessagingList
|
14
14
|
# @param [Version] version Version that contains the resource
|
15
|
-
|
16
15
|
# @return [MessagingList] MessagingList
|
17
16
|
def initialize(version)
|
18
17
|
super(version)
|
@@ -27,7 +26,6 @@ module Twilio
|
|
27
26
|
##
|
28
27
|
# Access the countries
|
29
28
|
# @param [String] iso_country The iso_country
|
30
|
-
|
31
29
|
# @return [CountryList] CountryList
|
32
30
|
def countries(iso_country=:unset)
|
33
31
|
if iso_country != :unset
|
@@ -55,7 +53,6 @@ module Twilio
|
|
55
53
|
# @param [Version] version Version that contains the resource
|
56
54
|
# @param [Response] response Response from the API
|
57
55
|
# @param [Hash] solution Path solution for the resource
|
58
|
-
|
59
56
|
# @return [MessagingPage] MessagingPage
|
60
57
|
def initialize(version, response, solution)
|
61
58
|
super(version, response)
|
@@ -67,7 +64,6 @@ module Twilio
|
|
67
64
|
##
|
68
65
|
# Build an instance of MessagingInstance
|
69
66
|
# @param [Hash] payload Payload response from the API
|
70
|
-
|
71
67
|
# @return [MessagingInstance] MessagingInstance
|
72
68
|
def get_instance(payload)
|
73
69
|
return MessagingInstance.new(
|
@@ -88,7 +84,6 @@ module Twilio
|
|
88
84
|
# Initialize the MessagingInstance
|
89
85
|
# @param [Version] version Version that contains the resource
|
90
86
|
# @param [Hash] payload payload that contains response from Twilio
|
91
|
-
|
92
87
|
# @return [MessagingInstance] MessagingInstance
|
93
88
|
def initialize(version, payload)
|
94
89
|
super(version)
|
@@ -13,7 +13,6 @@ module Twilio
|
|
13
13
|
##
|
14
14
|
# Initialize the CountryList
|
15
15
|
# @param [Version] version Version that contains the resource
|
16
|
-
|
17
16
|
# @return [CountryList] CountryList
|
18
17
|
def initialize(version)
|
19
18
|
super(version)
|
@@ -33,7 +32,6 @@ module Twilio
|
|
33
32
|
# the default value of 50 records. If no page_size is defined
|
34
33
|
# but a limit is defined, stream() will attempt to read the
|
35
34
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
36
|
-
|
37
35
|
# @return [Array] Array of up to limit results
|
38
36
|
def list(limit: nil, page_size: nil)
|
39
37
|
self.stream(
|
@@ -52,7 +50,6 @@ module Twilio
|
|
52
50
|
# the default value of 50 records. If no page_size is defined
|
53
51
|
# but a limit is defined, stream() will attempt to read the
|
54
52
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
55
|
-
|
56
53
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
57
54
|
def stream(limit: nil, page_size: nil)
|
58
55
|
limits = @version.read_limits(limit, page_size)
|
@@ -92,7 +89,6 @@ module Twilio
|
|
92
89
|
# @param [String] page_token PageToken provided by the API
|
93
90
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
94
91
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
95
|
-
|
96
92
|
# @return [Page] Page of CountryInstance
|
97
93
|
def page(page_token: nil, page_number: nil, page_size: nil)
|
98
94
|
params = {
|
@@ -121,7 +117,6 @@ module Twilio
|
|
121
117
|
# @param [Version] version Version that contains the resource
|
122
118
|
# @param [Response] response Response from the API
|
123
119
|
# @param [Hash] solution Path solution for the resource
|
124
|
-
|
125
120
|
# @return [CountryPage] CountryPage
|
126
121
|
def initialize(version, response, solution)
|
127
122
|
super(version, response)
|
@@ -133,7 +128,6 @@ module Twilio
|
|
133
128
|
##
|
134
129
|
# Build an instance of CountryInstance
|
135
130
|
# @param [Hash] payload Payload response from the API
|
136
|
-
|
137
131
|
# @return [CountryInstance] CountryInstance
|
138
132
|
def get_instance(payload)
|
139
133
|
return CountryInstance.new(
|
@@ -154,7 +148,6 @@ module Twilio
|
|
154
148
|
# Initialize the CountryContext
|
155
149
|
# @param [Version] version Version that contains the resource
|
156
150
|
# @param [String] iso_country The iso_country
|
157
|
-
|
158
151
|
# @return [CountryContext] CountryContext
|
159
152
|
def initialize(version, iso_country)
|
160
153
|
super(version)
|
@@ -181,7 +174,7 @@ module Twilio
|
|
181
174
|
return CountryInstance.new(
|
182
175
|
@version,
|
183
176
|
payload,
|
184
|
-
iso_country: @solution[
|
177
|
+
iso_country: @solution[:iso_country],
|
185
178
|
)
|
186
179
|
end
|
187
180
|
|
@@ -199,7 +192,6 @@ module Twilio
|
|
199
192
|
# @param [Version] version Version that contains the resource
|
200
193
|
# @param [Hash] payload payload that contains response from Twilio
|
201
194
|
# @param [String] iso_country The iso_country
|
202
|
-
|
203
195
|
# @return [CountryInstance] CountryInstance
|
204
196
|
def initialize(version, payload, iso_country: nil)
|
205
197
|
super(version)
|
@@ -225,7 +217,6 @@ module Twilio
|
|
225
217
|
# Generate an instance context for the instance, the context is capable of
|
226
218
|
# performing various actions. All instance actions are proxied to the context
|
227
219
|
# @param [Version] version Version that contains the resource
|
228
|
-
|
229
220
|
# @return [CountryContext] CountryContext for this CountryInstance
|
230
221
|
def context
|
231
222
|
unless @instance_context
|
@@ -265,14 +256,14 @@ module Twilio
|
|
265
256
|
# Fetch a CountryInstance
|
266
257
|
# @return [CountryInstance] Fetched CountryInstance
|
267
258
|
def fetch
|
268
|
-
|
259
|
+
context.fetch
|
269
260
|
end
|
270
261
|
|
271
262
|
##
|
272
263
|
# Provide a user friendly representation
|
273
264
|
def to_s
|
274
|
-
|
275
|
-
"<Twilio.Pricing.V1.CountryInstance #{
|
265
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
266
|
+
"<Twilio.Pricing.V1.CountryInstance #{values}>"
|
276
267
|
end
|
277
268
|
end
|
278
269
|
end
|
@@ -12,7 +12,6 @@ module Twilio
|
|
12
12
|
##
|
13
13
|
# Initialize the PhoneNumberList
|
14
14
|
# @param [Version] version Version that contains the resource
|
15
|
-
|
16
15
|
# @return [PhoneNumberList] PhoneNumberList
|
17
16
|
def initialize(version)
|
18
17
|
super(version)
|
@@ -27,7 +26,6 @@ module Twilio
|
|
27
26
|
##
|
28
27
|
# Access the countries
|
29
28
|
# @param [String] iso_country The iso_country
|
30
|
-
|
31
29
|
# @return [CountryList] CountryList
|
32
30
|
def countries(iso_country=:unset)
|
33
31
|
if iso_country != :unset
|
@@ -55,7 +53,6 @@ module Twilio
|
|
55
53
|
# @param [Version] version Version that contains the resource
|
56
54
|
# @param [Response] response Response from the API
|
57
55
|
# @param [Hash] solution Path solution for the resource
|
58
|
-
|
59
56
|
# @return [PhoneNumberPage] PhoneNumberPage
|
60
57
|
def initialize(version, response, solution)
|
61
58
|
super(version, response)
|
@@ -67,7 +64,6 @@ module Twilio
|
|
67
64
|
##
|
68
65
|
# Build an instance of PhoneNumberInstance
|
69
66
|
# @param [Hash] payload Payload response from the API
|
70
|
-
|
71
67
|
# @return [PhoneNumberInstance] PhoneNumberInstance
|
72
68
|
def get_instance(payload)
|
73
69
|
return PhoneNumberInstance.new(
|
@@ -88,7 +84,6 @@ module Twilio
|
|
88
84
|
# Initialize the PhoneNumberInstance
|
89
85
|
# @param [Version] version Version that contains the resource
|
90
86
|
# @param [Hash] payload payload that contains response from Twilio
|
91
|
-
|
92
87
|
# @return [PhoneNumberInstance] PhoneNumberInstance
|
93
88
|
def initialize(version, payload)
|
94
89
|
super(version)
|
@@ -13,7 +13,6 @@ module Twilio
|
|
13
13
|
##
|
14
14
|
# Initialize the CountryList
|
15
15
|
# @param [Version] version Version that contains the resource
|
16
|
-
|
17
16
|
# @return [CountryList] CountryList
|
18
17
|
def initialize(version)
|
19
18
|
super(version)
|
@@ -33,7 +32,6 @@ module Twilio
|
|
33
32
|
# the default value of 50 records. If no page_size is defined
|
34
33
|
# but a limit is defined, stream() will attempt to read the
|
35
34
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
36
|
-
|
37
35
|
# @return [Array] Array of up to limit results
|
38
36
|
def list(limit: nil, page_size: nil)
|
39
37
|
self.stream(
|
@@ -52,7 +50,6 @@ module Twilio
|
|
52
50
|
# the default value of 50 records. If no page_size is defined
|
53
51
|
# but a limit is defined, stream() will attempt to read the
|
54
52
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
55
|
-
|
56
53
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
57
54
|
def stream(limit: nil, page_size: nil)
|
58
55
|
limits = @version.read_limits(limit, page_size)
|
@@ -92,7 +89,6 @@ module Twilio
|
|
92
89
|
# @param [String] page_token PageToken provided by the API
|
93
90
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
94
91
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
95
|
-
|
96
92
|
# @return [Page] Page of CountryInstance
|
97
93
|
def page(page_token: nil, page_number: nil, page_size: nil)
|
98
94
|
params = {
|
@@ -121,7 +117,6 @@ module Twilio
|
|
121
117
|
# @param [Version] version Version that contains the resource
|
122
118
|
# @param [Response] response Response from the API
|
123
119
|
# @param [Hash] solution Path solution for the resource
|
124
|
-
|
125
120
|
# @return [CountryPage] CountryPage
|
126
121
|
def initialize(version, response, solution)
|
127
122
|
super(version, response)
|
@@ -133,7 +128,6 @@ module Twilio
|
|
133
128
|
##
|
134
129
|
# Build an instance of CountryInstance
|
135
130
|
# @param [Hash] payload Payload response from the API
|
136
|
-
|
137
131
|
# @return [CountryInstance] CountryInstance
|
138
132
|
def get_instance(payload)
|
139
133
|
return CountryInstance.new(
|
@@ -154,7 +148,6 @@ module Twilio
|
|
154
148
|
# Initialize the CountryContext
|
155
149
|
# @param [Version] version Version that contains the resource
|
156
150
|
# @param [String] iso_country The iso_country
|
157
|
-
|
158
151
|
# @return [CountryContext] CountryContext
|
159
152
|
def initialize(version, iso_country)
|
160
153
|
super(version)
|
@@ -181,7 +174,7 @@ module Twilio
|
|
181
174
|
return CountryInstance.new(
|
182
175
|
@version,
|
183
176
|
payload,
|
184
|
-
iso_country: @solution[
|
177
|
+
iso_country: @solution[:iso_country],
|
185
178
|
)
|
186
179
|
end
|
187
180
|
|
@@ -199,7 +192,6 @@ module Twilio
|
|
199
192
|
# @param [Version] version Version that contains the resource
|
200
193
|
# @param [Hash] payload payload that contains response from Twilio
|
201
194
|
# @param [String] iso_country The iso_country
|
202
|
-
|
203
195
|
# @return [CountryInstance] CountryInstance
|
204
196
|
def initialize(version, payload, iso_country: nil)
|
205
197
|
super(version)
|
@@ -225,7 +217,6 @@ module Twilio
|
|
225
217
|
# Generate an instance context for the instance, the context is capable of
|
226
218
|
# performing various actions. All instance actions are proxied to the context
|
227
219
|
# @param [Version] version Version that contains the resource
|
228
|
-
|
229
220
|
# @return [CountryContext] CountryContext for this CountryInstance
|
230
221
|
def context
|
231
222
|
unless @instance_context
|
@@ -265,14 +256,14 @@ module Twilio
|
|
265
256
|
# Fetch a CountryInstance
|
266
257
|
# @return [CountryInstance] Fetched CountryInstance
|
267
258
|
def fetch
|
268
|
-
|
259
|
+
context.fetch
|
269
260
|
end
|
270
261
|
|
271
262
|
##
|
272
263
|
# Provide a user friendly representation
|
273
264
|
def to_s
|
274
|
-
|
275
|
-
"<Twilio.Pricing.V1.CountryInstance #{
|
265
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
266
|
+
"<Twilio.Pricing.V1.CountryInstance #{values}>"
|
276
267
|
end
|
277
268
|
end
|
278
269
|
end
|
@@ -13,7 +13,6 @@ module Twilio
|
|
13
13
|
##
|
14
14
|
# Initialize the NumberList
|
15
15
|
# @param [Version] version Version that contains the resource
|
16
|
-
|
17
16
|
# @return [NumberList] NumberList
|
18
17
|
def initialize(version)
|
19
18
|
super(version)
|
@@ -35,7 +34,6 @@ module Twilio
|
|
35
34
|
# @param [Version] version Version that contains the resource
|
36
35
|
# @param [Response] response Response from the API
|
37
36
|
# @param [Hash] solution Path solution for the resource
|
38
|
-
|
39
37
|
# @return [NumberPage] NumberPage
|
40
38
|
def initialize(version, response, solution)
|
41
39
|
super(version, response)
|
@@ -47,7 +45,6 @@ module Twilio
|
|
47
45
|
##
|
48
46
|
# Build an instance of NumberInstance
|
49
47
|
# @param [Hash] payload Payload response from the API
|
50
|
-
|
51
48
|
# @return [NumberInstance] NumberInstance
|
52
49
|
def get_instance(payload)
|
53
50
|
return NumberInstance.new(
|
@@ -68,7 +65,6 @@ module Twilio
|
|
68
65
|
# Initialize the NumberContext
|
69
66
|
# @param [Version] version Version that contains the resource
|
70
67
|
# @param [String] number The number
|
71
|
-
|
72
68
|
# @return [NumberContext] NumberContext
|
73
69
|
def initialize(version, number)
|
74
70
|
super(version)
|
@@ -95,7 +91,7 @@ module Twilio
|
|
95
91
|
return NumberInstance.new(
|
96
92
|
@version,
|
97
93
|
payload,
|
98
|
-
number: @solution[
|
94
|
+
number: @solution[:number],
|
99
95
|
)
|
100
96
|
end
|
101
97
|
|
@@ -113,7 +109,6 @@ module Twilio
|
|
113
109
|
# @param [Version] version Version that contains the resource
|
114
110
|
# @param [Hash] payload payload that contains response from Twilio
|
115
111
|
# @param [String] number The number
|
116
|
-
|
117
112
|
# @return [NumberInstance] NumberInstance
|
118
113
|
def initialize(version, payload, number: nil)
|
119
114
|
super(version)
|
@@ -140,7 +135,6 @@ module Twilio
|
|
140
135
|
# Generate an instance context for the instance, the context is capable of
|
141
136
|
# performing various actions. All instance actions are proxied to the context
|
142
137
|
# @param [Version] version Version that contains the resource
|
143
|
-
|
144
138
|
# @return [NumberContext] NumberContext for this NumberInstance
|
145
139
|
def context
|
146
140
|
unless @instance_context
|
@@ -184,14 +178,14 @@ module Twilio
|
|
184
178
|
# Fetch a NumberInstance
|
185
179
|
# @return [NumberInstance] Fetched NumberInstance
|
186
180
|
def fetch
|
187
|
-
|
181
|
+
context.fetch
|
188
182
|
end
|
189
183
|
|
190
184
|
##
|
191
185
|
# Provide a user friendly representation
|
192
186
|
def to_s
|
193
|
-
|
194
|
-
"<Twilio.Pricing.V1.NumberInstance #{
|
187
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
188
|
+
"<Twilio.Pricing.V1.NumberInstance #{values}>"
|
195
189
|
end
|
196
190
|
end
|
197
191
|
end
|
@@ -12,7 +12,6 @@ module Twilio
|
|
12
12
|
##
|
13
13
|
# Initialize the VoiceList
|
14
14
|
# @param [Version] version Version that contains the resource
|
15
|
-
|
16
15
|
# @return [VoiceList] VoiceList
|
17
16
|
def initialize(version)
|
18
17
|
super(version)
|
@@ -28,7 +27,6 @@ module Twilio
|
|
28
27
|
##
|
29
28
|
# Access the numbers
|
30
29
|
# @param [String] number The number
|
31
|
-
|
32
30
|
# @return [NumberList] NumberList
|
33
31
|
def numbers(number=:unset)
|
34
32
|
if number != :unset
|
@@ -46,7 +44,6 @@ module Twilio
|
|
46
44
|
##
|
47
45
|
# Access the countries
|
48
46
|
# @param [String] iso_country The iso_country
|
49
|
-
|
50
47
|
# @return [CountryList] CountryList
|
51
48
|
def countries(iso_country=:unset)
|
52
49
|
if iso_country != :unset
|
@@ -74,7 +71,6 @@ module Twilio
|
|
74
71
|
# @param [Version] version Version that contains the resource
|
75
72
|
# @param [Response] response Response from the API
|
76
73
|
# @param [Hash] solution Path solution for the resource
|
77
|
-
|
78
74
|
# @return [VoicePage] VoicePage
|
79
75
|
def initialize(version, response, solution)
|
80
76
|
super(version, response)
|
@@ -86,7 +82,6 @@ module Twilio
|
|
86
82
|
##
|
87
83
|
# Build an instance of VoiceInstance
|
88
84
|
# @param [Hash] payload Payload response from the API
|
89
|
-
|
90
85
|
# @return [VoiceInstance] VoiceInstance
|
91
86
|
def get_instance(payload)
|
92
87
|
return VoiceInstance.new(
|
@@ -107,7 +102,6 @@ module Twilio
|
|
107
102
|
# Initialize the VoiceInstance
|
108
103
|
# @param [Version] version Version that contains the resource
|
109
104
|
# @param [Hash] payload payload that contains response from Twilio
|
110
|
-
|
111
105
|
# @return [VoiceInstance] VoiceInstance
|
112
106
|
def initialize(version, payload)
|
113
107
|
super(version)
|
@@ -14,7 +14,6 @@ module Twilio
|
|
14
14
|
# Initialize the ActivityList
|
15
15
|
# @param [Version] version Version that contains the resource
|
16
16
|
# @param [String] workspace_sid The workspace_sid
|
17
|
-
|
18
17
|
# @return [ActivityList] ActivityList
|
19
18
|
def initialize(version, workspace_sid: nil)
|
20
19
|
super(version)
|
@@ -38,7 +37,6 @@ module Twilio
|
|
38
37
|
# the default value of 50 records. If no page_size is defined
|
39
38
|
# but a limit is defined, stream() will attempt to read the
|
40
39
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
41
|
-
|
42
40
|
# @return [Array] Array of up to limit results
|
43
41
|
def list(friendly_name: nil, available: nil, limit: nil, page_size: nil)
|
44
42
|
self.stream(
|
@@ -61,7 +59,6 @@ module Twilio
|
|
61
59
|
# the default value of 50 records. If no page_size is defined
|
62
60
|
# but a limit is defined, stream() will attempt to read the
|
63
61
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
64
|
-
|
65
62
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
66
63
|
def stream(friendly_name: nil, available: nil, limit: nil, page_size: nil)
|
67
64
|
limits = @version.read_limits(limit, page_size)
|
@@ -107,7 +104,6 @@ module Twilio
|
|
107
104
|
# @param [String] page_token PageToken provided by the API
|
108
105
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
109
106
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
110
|
-
|
111
107
|
# @return [Page] Page of ActivityInstance
|
112
108
|
def page(friendly_name: nil, available: nil, page_token: nil, page_number: nil, page_size: nil)
|
113
109
|
params = {
|
@@ -130,7 +126,6 @@ module Twilio
|
|
130
126
|
# Request is executed immediately.
|
131
127
|
# @param [String] friendly_name The friendly_name
|
132
128
|
# @param [Boolean] available The available
|
133
|
-
|
134
129
|
# @return [ActivityInstance] Newly created ActivityInstance
|
135
130
|
def create(friendly_name: nil, available: nil)
|
136
131
|
data = {
|
@@ -147,7 +142,7 @@ module Twilio
|
|
147
142
|
return ActivityInstance.new(
|
148
143
|
@version,
|
149
144
|
payload,
|
150
|
-
workspace_sid: @solution[
|
145
|
+
workspace_sid: @solution[:workspace_sid],
|
151
146
|
)
|
152
147
|
end
|
153
148
|
|
@@ -165,7 +160,6 @@ module Twilio
|
|
165
160
|
# @param [Response] response Response from the API
|
166
161
|
# @param [Hash] solution Path solution for the resource
|
167
162
|
# @param [String] workspace_sid The workspace_sid
|
168
|
-
|
169
163
|
# @return [ActivityPage] ActivityPage
|
170
164
|
def initialize(version, response, solution)
|
171
165
|
super(version, response)
|
@@ -177,13 +171,12 @@ module Twilio
|
|
177
171
|
##
|
178
172
|
# Build an instance of ActivityInstance
|
179
173
|
# @param [Hash] payload Payload response from the API
|
180
|
-
|
181
174
|
# @return [ActivityInstance] ActivityInstance
|
182
175
|
def get_instance(payload)
|
183
176
|
return ActivityInstance.new(
|
184
177
|
@version,
|
185
178
|
payload,
|
186
|
-
workspace_sid: @solution[
|
179
|
+
workspace_sid: @solution[:workspace_sid],
|
187
180
|
)
|
188
181
|
end
|
189
182
|
|
@@ -200,7 +193,6 @@ module Twilio
|
|
200
193
|
# @param [Version] version Version that contains the resource
|
201
194
|
# @param [String] workspace_sid The workspace_sid
|
202
195
|
# @param [String] sid The sid
|
203
|
-
|
204
196
|
# @return [ActivityContext] ActivityContext
|
205
197
|
def initialize(version, workspace_sid, sid)
|
206
198
|
super(version)
|
@@ -228,15 +220,14 @@ module Twilio
|
|
228
220
|
return ActivityInstance.new(
|
229
221
|
@version,
|
230
222
|
payload,
|
231
|
-
workspace_sid: @solution[
|
232
|
-
sid: @solution[
|
223
|
+
workspace_sid: @solution[:workspace_sid],
|
224
|
+
sid: @solution[:sid],
|
233
225
|
)
|
234
226
|
end
|
235
227
|
|
236
228
|
##
|
237
229
|
# Update the ActivityInstance
|
238
230
|
# @param [String] friendly_name The friendly_name
|
239
|
-
|
240
231
|
# @return [ActivityInstance] Updated ActivityInstance
|
241
232
|
def update(friendly_name: nil)
|
242
233
|
data = {
|
@@ -252,8 +243,8 @@ module Twilio
|
|
252
243
|
return ActivityInstance.new(
|
253
244
|
@version,
|
254
245
|
payload,
|
255
|
-
workspace_sid: @solution[
|
256
|
-
sid: @solution[
|
246
|
+
workspace_sid: @solution[:workspace_sid],
|
247
|
+
sid: @solution[:sid],
|
257
248
|
)
|
258
249
|
end
|
259
250
|
|
@@ -279,7 +270,6 @@ module Twilio
|
|
279
270
|
# @param [Hash] payload payload that contains response from Twilio
|
280
271
|
# @param [String] workspace_sid The workspace_sid
|
281
272
|
# @param [String] sid The sid
|
282
|
-
|
283
273
|
# @return [ActivityInstance] ActivityInstance
|
284
274
|
def initialize(version, payload, workspace_sid: nil, sid: nil)
|
285
275
|
super(version)
|
@@ -307,7 +297,6 @@ module Twilio
|
|
307
297
|
# Generate an instance context for the instance, the context is capable of
|
308
298
|
# performing various actions. All instance actions are proxied to the context
|
309
299
|
# @param [Version] version Version that contains the resource
|
310
|
-
|
311
300
|
# @return [ActivityContext] ActivityContext for this ActivityInstance
|
312
301
|
def context
|
313
302
|
unless @instance_context
|
@@ -352,30 +341,31 @@ module Twilio
|
|
352
341
|
# Fetch a ActivityInstance
|
353
342
|
# @return [ActivityInstance] Fetched ActivityInstance
|
354
343
|
def fetch
|
355
|
-
|
344
|
+
context.fetch
|
356
345
|
end
|
357
346
|
|
358
347
|
##
|
359
348
|
# Update the ActivityInstance
|
360
349
|
# @param [String] friendly_name The friendly_name
|
361
|
-
|
362
350
|
# @return [ActivityInstance] Updated ActivityInstance
|
363
351
|
def update(friendly_name: nil)
|
364
|
-
|
352
|
+
context.update(
|
353
|
+
friendly_name: friendly_name,
|
354
|
+
)
|
365
355
|
end
|
366
356
|
|
367
357
|
##
|
368
358
|
# Deletes the ActivityInstance
|
369
359
|
# @return [Boolean] true if delete succeeds, true otherwise
|
370
360
|
def delete
|
371
|
-
|
361
|
+
context.delete
|
372
362
|
end
|
373
363
|
|
374
364
|
##
|
375
365
|
# Provide a user friendly representation
|
376
366
|
def to_s
|
377
|
-
|
378
|
-
"<Twilio.Taskrouter.V1.ActivityInstance #{
|
367
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
368
|
+
"<Twilio.Taskrouter.V1.ActivityInstance #{values}>"
|
379
369
|
end
|
380
370
|
end
|
381
371
|
end
|