twilio-ruby 5.67.1 → 5.67.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +6 -0
- data/Makefile +3 -2
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/client.rb +0 -7
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +9 -9
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +23 -16
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +1 -1
- data/lib/twilio-ruby/rest/flex_api.rb +1 -1
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +7 -0
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +2 -6
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +0 -314
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -459
- data/lib/twilio-ruby/rest/fax/v1.rb +0 -45
- data/lib/twilio-ruby/rest/fax.rb +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35111efb3cd1c98d7e45570f3e4f0290d9b7c0dc
|
4
|
+
data.tar.gz: c4a245a46eb0f17fee275083b9762782049cad42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c72bd52e4a6529b2cce7ce38e13a20377ddf4f4f97f449cdaee564b256f7eb9da052f64d62fa3b711e566571ac26cfa1be7e063d76453964c47258950d279b4
|
7
|
+
data.tar.gz: d1774e844540e03939d8a2849c9f2971fc71607dd881d69046d90a12c80e91a328206dddd35099a922aec2282c328c127e92a0156a00306f085582faf1f15ac1
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2022-06-01] Version 5.67.2
|
5
|
+
---------------------------
|
6
|
+
**Library - Chore**
|
7
|
+
- [PR #608](https://github.com/twilio/twilio-ruby/pull/608): use Docker 'rc' tag for release candidate images. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
8
|
+
|
9
|
+
|
4
10
|
[2022-05-18] Version 5.67.1
|
5
11
|
---------------------------
|
6
12
|
**Api**
|
data/Makefile
CHANGED
@@ -17,13 +17,14 @@ authors:
|
|
17
17
|
git log --raw | grep "^Author: " | cut -d ' ' -f2- | cut -d '<' -f1 | sed 's/^/- /' | sort | uniq >> AUTHORS.md
|
18
18
|
|
19
19
|
API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5)
|
20
|
+
CURRENT_TAG=$(shell [[ "${GITHUB_TAG}" == *"-rc"* ]] && echo "rc" || echo "latest")
|
20
21
|
docker-build:
|
21
22
|
docker build -t twilio/twilio-ruby .
|
22
23
|
docker tag twilio/twilio-ruby twilio/twilio-ruby:${GITHUB_TAG}
|
23
24
|
docker tag twilio/twilio-ruby twilio/twilio-ruby:apidefs-${API_DEFINITIONS_SHA}
|
24
|
-
docker tag twilio/twilio-ruby twilio/twilio-ruby
|
25
|
+
docker tag twilio/twilio-ruby twilio/twilio-ruby:${CURRENT_TAG}
|
25
26
|
|
26
27
|
docker-push:
|
27
28
|
docker push twilio/twilio-ruby:${GITHUB_TAG}
|
28
29
|
docker push twilio/twilio-ruby:apidefs-${API_DEFINITIONS_SHA}
|
29
|
-
docker push twilio/twilio-ruby
|
30
|
+
docker push twilio/twilio-ruby:${CURRENT_TAG}
|
data/README.md
CHANGED
@@ -34,13 +34,13 @@ This library supports the following Ruby implementations:
|
|
34
34
|
To install using [Bundler][bundler] grab the latest stable version:
|
35
35
|
|
36
36
|
```ruby
|
37
|
-
gem 'twilio-ruby', '~> 5.67.
|
37
|
+
gem 'twilio-ruby', '~> 5.67.2'
|
38
38
|
```
|
39
39
|
|
40
40
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
41
41
|
|
42
42
|
```bash
|
43
|
-
gem install twilio-ruby -v 5.67.
|
43
|
+
gem install twilio-ruby -v 5.67.2
|
44
44
|
```
|
45
45
|
|
46
46
|
To build and install the development branch yourself from the latest source:
|
@@ -36,7 +36,6 @@ module Twilio
|
|
36
36
|
@chat = nil
|
37
37
|
@conversations = nil
|
38
38
|
@events = nil
|
39
|
-
@fax = nil
|
40
39
|
@flex_api = nil
|
41
40
|
@frontline_api = nil
|
42
41
|
@insights = nil
|
@@ -198,12 +197,6 @@ module Twilio
|
|
198
197
|
@events ||= Events.new self
|
199
198
|
end
|
200
199
|
|
201
|
-
##
|
202
|
-
# Access the Fax Twilio Domain
|
203
|
-
def fax
|
204
|
-
@fax ||= Fax.new self
|
205
|
-
end
|
206
|
-
|
207
200
|
##
|
208
201
|
# Access the FlexApi Twilio Domain
|
209
202
|
def flex_api
|
data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb
CHANGED
@@ -16,8 +16,8 @@ module Twilio
|
|
16
16
|
##
|
17
17
|
# Initialize the InteractionChannelInviteList
|
18
18
|
# @param [Version] version Version that contains the resource
|
19
|
-
# @param [String] interaction_sid The
|
20
|
-
# @param [String] channel_sid The
|
19
|
+
# @param [String] interaction_sid The Interaction SID for this Channel.
|
20
|
+
# @param [String] channel_sid The Channel SID for this Invite.
|
21
21
|
# @return [InteractionChannelInviteList] InteractionChannelInviteList
|
22
22
|
def initialize(version, interaction_sid: nil, channel_sid: nil)
|
23
23
|
super(version)
|
@@ -29,7 +29,7 @@ module Twilio
|
|
29
29
|
|
30
30
|
##
|
31
31
|
# Create the InteractionChannelInviteInstance
|
32
|
-
# @param [Hash] routing The routing
|
32
|
+
# @param [Hash] routing The Interaction's routing logic.
|
33
33
|
# @return [InteractionChannelInviteInstance] Created InteractionChannelInviteInstance
|
34
34
|
def create(routing: nil)
|
35
35
|
data = Twilio::Values.of({'Routing' => Twilio.serialize_object(routing), })
|
@@ -170,8 +170,8 @@ module Twilio
|
|
170
170
|
# Initialize the InteractionChannelInviteInstance
|
171
171
|
# @param [Version] version Version that contains the resource
|
172
172
|
# @param [Hash] payload payload that contains response from Twilio
|
173
|
-
# @param [String] interaction_sid The
|
174
|
-
# @param [String] channel_sid The
|
173
|
+
# @param [String] interaction_sid The Interaction SID for this Channel.
|
174
|
+
# @param [String] channel_sid The Channel SID for this Invite.
|
175
175
|
# @return [InteractionChannelInviteInstance] InteractionChannelInviteInstance
|
176
176
|
def initialize(version, payload, interaction_sid: nil, channel_sid: nil)
|
177
177
|
super(version)
|
@@ -187,25 +187,25 @@ module Twilio
|
|
187
187
|
end
|
188
188
|
|
189
189
|
##
|
190
|
-
# @return [String] The
|
190
|
+
# @return [String] The unique string that identifies the resource
|
191
191
|
def sid
|
192
192
|
@properties['sid']
|
193
193
|
end
|
194
194
|
|
195
195
|
##
|
196
|
-
# @return [String] The
|
196
|
+
# @return [String] The Interaction SID for this Channel
|
197
197
|
def interaction_sid
|
198
198
|
@properties['interaction_sid']
|
199
199
|
end
|
200
200
|
|
201
201
|
##
|
202
|
-
# @return [String] The
|
202
|
+
# @return [String] The Channel SID for this Invite
|
203
203
|
def channel_sid
|
204
204
|
@properties['channel_sid']
|
205
205
|
end
|
206
206
|
|
207
207
|
##
|
208
|
-
# @return [Hash]
|
208
|
+
# @return [Hash] A JSON object representing the routing rules for the Interaction Channel
|
209
209
|
def routing
|
210
210
|
@properties['routing']
|
211
211
|
end
|
@@ -15,7 +15,8 @@ module Twilio
|
|
15
15
|
##
|
16
16
|
# Initialize the InteractionChannelList
|
17
17
|
# @param [Version] version Version that contains the resource
|
18
|
-
# @param [String] interaction_sid The
|
18
|
+
# @param [String] interaction_sid The unique string created by Twilio to identify
|
19
|
+
# an Interaction resource, prefixed with KD.
|
19
20
|
# @return [InteractionChannelList] InteractionChannelList
|
20
21
|
def initialize(version, interaction_sid: nil)
|
21
22
|
super(version)
|
@@ -145,8 +146,10 @@ module Twilio
|
|
145
146
|
##
|
146
147
|
# Initialize the InteractionChannelContext
|
147
148
|
# @param [Version] version Version that contains the resource
|
148
|
-
# @param [String] interaction_sid The
|
149
|
-
#
|
149
|
+
# @param [String] interaction_sid The unique string created by Twilio to identify
|
150
|
+
# an Interaction resource, prefixed with KD.
|
151
|
+
# @param [String] sid The unique string created by Twilio to identify an
|
152
|
+
# Interaction Channel resource, prefixed with UO.
|
150
153
|
# @return [InteractionChannelContext] InteractionChannelContext
|
151
154
|
def initialize(version, interaction_sid, sid)
|
152
155
|
super(version)
|
@@ -176,11 +179,12 @@ module Twilio
|
|
176
179
|
|
177
180
|
##
|
178
181
|
# Update the InteractionChannelInstance
|
179
|
-
# @param [interaction_channel.Status] status
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
182
|
+
# @param [interaction_channel.Status] status Required. Indicates the Interaction
|
183
|
+
# channel's status. When a channel is set to `closed`, all tasks are put in the
|
184
|
+
# `wrapping` state by default unless the Routing status is set to `closed` in
|
185
|
+
# which case the tasks will be `completed`. Value: `closed`.
|
186
|
+
# @param [Hash] routing Optional. The state of associated tasks. If not specified,
|
187
|
+
# all tasks will be set to `wrapping`.
|
184
188
|
# @return [InteractionChannelInstance] Updated InteractionChannelInstance
|
185
189
|
def update(status: nil, routing: :unset)
|
186
190
|
data = Twilio::Values.of({'Status' => status, 'Routing' => Twilio.serialize_object(routing), })
|
@@ -258,8 +262,10 @@ module Twilio
|
|
258
262
|
# Initialize the InteractionChannelInstance
|
259
263
|
# @param [Version] version Version that contains the resource
|
260
264
|
# @param [Hash] payload payload that contains response from Twilio
|
261
|
-
# @param [String] interaction_sid The
|
262
|
-
#
|
265
|
+
# @param [String] interaction_sid The unique string created by Twilio to identify
|
266
|
+
# an Interaction resource, prefixed with KD.
|
267
|
+
# @param [String] sid The unique string created by Twilio to identify an
|
268
|
+
# Interaction Channel resource, prefixed with UO.
|
263
269
|
# @return [InteractionChannelInstance] InteractionChannelInstance
|
264
270
|
def initialize(version, payload, interaction_sid: nil, sid: nil)
|
265
271
|
super(version)
|
@@ -300,7 +306,7 @@ module Twilio
|
|
300
306
|
end
|
301
307
|
|
302
308
|
##
|
303
|
-
# @return [String] The
|
309
|
+
# @return [String] The unique string that identifies the resource
|
304
310
|
def interaction_sid
|
305
311
|
@properties['interaction_sid']
|
306
312
|
end
|
@@ -332,11 +338,12 @@ module Twilio
|
|
332
338
|
|
333
339
|
##
|
334
340
|
# Update the InteractionChannelInstance
|
335
|
-
# @param [interaction_channel.Status] status
|
336
|
-
#
|
337
|
-
#
|
338
|
-
#
|
339
|
-
#
|
341
|
+
# @param [interaction_channel.Status] status Required. Indicates the Interaction
|
342
|
+
# channel's status. When a channel is set to `closed`, all tasks are put in the
|
343
|
+
# `wrapping` state by default unless the Routing status is set to `closed` in
|
344
|
+
# which case the tasks will be `completed`. Value: `closed`.
|
345
|
+
# @param [Hash] routing Optional. The state of associated tasks. If not specified,
|
346
|
+
# all tasks will be set to `wrapping`.
|
340
347
|
# @return [InteractionChannelInstance] Updated InteractionChannelInstance
|
341
348
|
def update(status: nil, routing: :unset)
|
342
349
|
context.update(status: status, routing: routing, )
|
@@ -54,7 +54,7 @@ module Twilio
|
|
54
54
|
|
55
55
|
##
|
56
56
|
# @param [String] sid The unique string created by Twilio to identify an
|
57
|
-
# Interaction resource.
|
57
|
+
# Interaction resource, prefixed with KD.
|
58
58
|
# @return [Twilio::REST::Flex_api::V1::InteractionInstance] if sid was passed.
|
59
59
|
# @return [Twilio::REST::Flex_api::V1::InteractionList]
|
60
60
|
def interaction(sid=:unset)
|
@@ -227,6 +227,7 @@ module Twilio
|
|
227
227
|
'send_code_attempts' => payload['send_code_attempts'],
|
228
228
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
229
229
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
230
|
+
'sna' => payload['sna'],
|
230
231
|
'url' => payload['url'],
|
231
232
|
}
|
232
233
|
|
@@ -324,6 +325,12 @@ module Twilio
|
|
324
325
|
@properties['date_updated']
|
325
326
|
end
|
326
327
|
|
328
|
+
##
|
329
|
+
# @return [Hash] The set of fields used for a silent network auth (`sna`) verification
|
330
|
+
def sna
|
331
|
+
@properties['sna']
|
332
|
+
end
|
333
|
+
|
327
334
|
##
|
328
335
|
# @return [String] The absolute URL of the Verification resource
|
329
336
|
def url
|
data/lib/twilio-ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.67.
|
4
|
+
version: 5.67.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twilio API Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -418,10 +418,6 @@ files:
|
|
418
418
|
- lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb
|
419
419
|
- lib/twilio-ruby/rest/events/v1/subscription.rb
|
420
420
|
- lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb
|
421
|
-
- lib/twilio-ruby/rest/fax.rb
|
422
|
-
- lib/twilio-ruby/rest/fax/v1.rb
|
423
|
-
- lib/twilio-ruby/rest/fax/v1/fax.rb
|
424
|
-
- lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb
|
425
421
|
- lib/twilio-ruby/rest/flex_api.rb
|
426
422
|
- lib/twilio-ruby/rest/flex_api/v1.rb
|
427
423
|
- lib/twilio-ruby/rest/flex_api/v1/channel.rb
|
@@ -1,314 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# This code was generated by
|
3
|
-
# \ / _ _ _| _ _
|
4
|
-
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
-
# / /
|
6
|
-
#
|
7
|
-
# frozen_string_literal: true
|
8
|
-
|
9
|
-
module Twilio
|
10
|
-
module REST
|
11
|
-
class Fax < Domain
|
12
|
-
class V1 < Version
|
13
|
-
class FaxContext < InstanceContext
|
14
|
-
##
|
15
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
16
|
-
class FaxMediaList < ListResource
|
17
|
-
##
|
18
|
-
# Initialize the FaxMediaList
|
19
|
-
# @param [Version] version Version that contains the resource
|
20
|
-
# @param [String] fax_sid The SID of the fax the FaxMedia resource is associated
|
21
|
-
# with.
|
22
|
-
# @return [FaxMediaList] FaxMediaList
|
23
|
-
def initialize(version, fax_sid: nil)
|
24
|
-
super(version)
|
25
|
-
|
26
|
-
# Path Solution
|
27
|
-
@solution = {fax_sid: fax_sid}
|
28
|
-
@uri = "/Faxes/#{@solution[:fax_sid]}/Media"
|
29
|
-
end
|
30
|
-
|
31
|
-
##
|
32
|
-
# Lists FaxMediaInstance records from the API as a list.
|
33
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
34
|
-
# memory before returning.
|
35
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
36
|
-
# guarantees to never return more than limit. Default is no limit
|
37
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
38
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
39
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
40
|
-
# efficient page size, i.e. min(limit, 1000)
|
41
|
-
# @return [Array] Array of up to limit results
|
42
|
-
def list(limit: nil, page_size: nil)
|
43
|
-
self.stream(limit: limit, page_size: page_size).entries
|
44
|
-
end
|
45
|
-
|
46
|
-
##
|
47
|
-
# Streams FaxMediaInstance records from the API as an Enumerable.
|
48
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
49
|
-
# is reached.
|
50
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
51
|
-
# guarantees to never return more than limit. Default is no limit.
|
52
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
53
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
54
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
55
|
-
# efficient page size, i.e. min(limit, 1000)
|
56
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
57
|
-
def stream(limit: nil, page_size: nil)
|
58
|
-
limits = @version.read_limits(limit, page_size)
|
59
|
-
|
60
|
-
page = self.page(page_size: limits[:page_size], )
|
61
|
-
|
62
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
63
|
-
end
|
64
|
-
|
65
|
-
##
|
66
|
-
# When passed a block, yields FaxMediaInstance records from the API.
|
67
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
68
|
-
# is reached.
|
69
|
-
def each
|
70
|
-
limits = @version.read_limits
|
71
|
-
|
72
|
-
page = self.page(page_size: limits[:page_size], )
|
73
|
-
|
74
|
-
@version.stream(page,
|
75
|
-
limit: limits[:limit],
|
76
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
77
|
-
end
|
78
|
-
|
79
|
-
##
|
80
|
-
# Retrieve a single page of FaxMediaInstance records from the API.
|
81
|
-
# Request is executed immediately.
|
82
|
-
# @param [String] page_token PageToken provided by the API
|
83
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
84
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
85
|
-
# @return [Page] Page of FaxMediaInstance
|
86
|
-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
87
|
-
params = Twilio::Values.of({
|
88
|
-
'PageToken' => page_token,
|
89
|
-
'Page' => page_number,
|
90
|
-
'PageSize' => page_size,
|
91
|
-
})
|
92
|
-
|
93
|
-
response = @version.page('GET', @uri, params: params)
|
94
|
-
|
95
|
-
FaxMediaPage.new(@version, response, @solution)
|
96
|
-
end
|
97
|
-
|
98
|
-
##
|
99
|
-
# Retrieve a single page of FaxMediaInstance records from the API.
|
100
|
-
# Request is executed immediately.
|
101
|
-
# @param [String] target_url API-generated URL for the requested results page
|
102
|
-
# @return [Page] Page of FaxMediaInstance
|
103
|
-
def get_page(target_url)
|
104
|
-
response = @version.domain.request(
|
105
|
-
'GET',
|
106
|
-
target_url
|
107
|
-
)
|
108
|
-
FaxMediaPage.new(@version, response, @solution)
|
109
|
-
end
|
110
|
-
|
111
|
-
##
|
112
|
-
# Provide a user friendly representation
|
113
|
-
def to_s
|
114
|
-
'#<Twilio.Fax.V1.FaxMediaList>'
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
##
|
119
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
120
|
-
class FaxMediaPage < Page
|
121
|
-
##
|
122
|
-
# Initialize the FaxMediaPage
|
123
|
-
# @param [Version] version Version that contains the resource
|
124
|
-
# @param [Response] response Response from the API
|
125
|
-
# @param [Hash] solution Path solution for the resource
|
126
|
-
# @return [FaxMediaPage] FaxMediaPage
|
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 FaxMediaInstance
|
136
|
-
# @param [Hash] payload Payload response from the API
|
137
|
-
# @return [FaxMediaInstance] FaxMediaInstance
|
138
|
-
def get_instance(payload)
|
139
|
-
FaxMediaInstance.new(@version, payload, fax_sid: @solution[:fax_sid], )
|
140
|
-
end
|
141
|
-
|
142
|
-
##
|
143
|
-
# Provide a user friendly representation
|
144
|
-
def to_s
|
145
|
-
'<Twilio.Fax.V1.FaxMediaPage>'
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
##
|
150
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
151
|
-
class FaxMediaContext < InstanceContext
|
152
|
-
##
|
153
|
-
# Initialize the FaxMediaContext
|
154
|
-
# @param [Version] version Version that contains the resource
|
155
|
-
# @param [String] fax_sid The SID of the fax with the FaxMedia resource to fetch.
|
156
|
-
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
157
|
-
# FaxMedia resource to fetch.
|
158
|
-
# @return [FaxMediaContext] FaxMediaContext
|
159
|
-
def initialize(version, fax_sid, sid)
|
160
|
-
super(version)
|
161
|
-
|
162
|
-
# Path Solution
|
163
|
-
@solution = {fax_sid: fax_sid, sid: sid, }
|
164
|
-
@uri = "/Faxes/#{@solution[:fax_sid]}/Media/#{@solution[:sid]}"
|
165
|
-
end
|
166
|
-
|
167
|
-
##
|
168
|
-
# Fetch the FaxMediaInstance
|
169
|
-
# @return [FaxMediaInstance] Fetched FaxMediaInstance
|
170
|
-
def fetch
|
171
|
-
payload = @version.fetch('GET', @uri)
|
172
|
-
|
173
|
-
FaxMediaInstance.new(@version, payload, fax_sid: @solution[:fax_sid], sid: @solution[:sid], )
|
174
|
-
end
|
175
|
-
|
176
|
-
##
|
177
|
-
# Delete the FaxMediaInstance
|
178
|
-
# @return [Boolean] true if delete succeeds, false otherwise
|
179
|
-
def delete
|
180
|
-
@version.delete('DELETE', @uri)
|
181
|
-
end
|
182
|
-
|
183
|
-
##
|
184
|
-
# Provide a user friendly representation
|
185
|
-
def to_s
|
186
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
187
|
-
"#<Twilio.Fax.V1.FaxMediaContext #{context}>"
|
188
|
-
end
|
189
|
-
|
190
|
-
##
|
191
|
-
# Provide a detailed, user friendly representation
|
192
|
-
def inspect
|
193
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
194
|
-
"#<Twilio.Fax.V1.FaxMediaContext #{context}>"
|
195
|
-
end
|
196
|
-
end
|
197
|
-
|
198
|
-
##
|
199
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
200
|
-
class FaxMediaInstance < InstanceResource
|
201
|
-
##
|
202
|
-
# Initialize the FaxMediaInstance
|
203
|
-
# @param [Version] version Version that contains the resource
|
204
|
-
# @param [Hash] payload payload that contains response from Twilio
|
205
|
-
# @param [String] fax_sid The SID of the fax the FaxMedia resource is associated
|
206
|
-
# with.
|
207
|
-
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
208
|
-
# FaxMedia resource to fetch.
|
209
|
-
# @return [FaxMediaInstance] FaxMediaInstance
|
210
|
-
def initialize(version, payload, fax_sid: nil, sid: nil)
|
211
|
-
super(version)
|
212
|
-
|
213
|
-
# Marshaled Properties
|
214
|
-
@properties = {
|
215
|
-
'sid' => payload['sid'],
|
216
|
-
'account_sid' => payload['account_sid'],
|
217
|
-
'fax_sid' => payload['fax_sid'],
|
218
|
-
'content_type' => payload['content_type'],
|
219
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
220
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
221
|
-
'url' => payload['url'],
|
222
|
-
}
|
223
|
-
|
224
|
-
# Context
|
225
|
-
@instance_context = nil
|
226
|
-
@params = {'fax_sid' => fax_sid, 'sid' => sid || @properties['sid'], }
|
227
|
-
end
|
228
|
-
|
229
|
-
##
|
230
|
-
# Generate an instance context for the instance, the context is capable of
|
231
|
-
# performing various actions. All instance actions are proxied to the context
|
232
|
-
# @return [FaxMediaContext] FaxMediaContext for this FaxMediaInstance
|
233
|
-
def context
|
234
|
-
unless @instance_context
|
235
|
-
@instance_context = FaxMediaContext.new(@version, @params['fax_sid'], @params['sid'], )
|
236
|
-
end
|
237
|
-
@instance_context
|
238
|
-
end
|
239
|
-
|
240
|
-
##
|
241
|
-
# @return [String] The unique string that identifies the resource
|
242
|
-
def sid
|
243
|
-
@properties['sid']
|
244
|
-
end
|
245
|
-
|
246
|
-
##
|
247
|
-
# @return [String] The SID of the Account that created the resource
|
248
|
-
def account_sid
|
249
|
-
@properties['account_sid']
|
250
|
-
end
|
251
|
-
|
252
|
-
##
|
253
|
-
# @return [String] The SID of the fax the FaxMedia resource is associated with
|
254
|
-
def fax_sid
|
255
|
-
@properties['fax_sid']
|
256
|
-
end
|
257
|
-
|
258
|
-
##
|
259
|
-
# @return [String] The content type of the stored fax media
|
260
|
-
def content_type
|
261
|
-
@properties['content_type']
|
262
|
-
end
|
263
|
-
|
264
|
-
##
|
265
|
-
# @return [Time] The ISO 8601 date and time in GMT when the resource was created
|
266
|
-
def date_created
|
267
|
-
@properties['date_created']
|
268
|
-
end
|
269
|
-
|
270
|
-
##
|
271
|
-
# @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
|
272
|
-
def date_updated
|
273
|
-
@properties['date_updated']
|
274
|
-
end
|
275
|
-
|
276
|
-
##
|
277
|
-
# @return [String] The absolute URL of the FaxMedia resource
|
278
|
-
def url
|
279
|
-
@properties['url']
|
280
|
-
end
|
281
|
-
|
282
|
-
##
|
283
|
-
# Fetch the FaxMediaInstance
|
284
|
-
# @return [FaxMediaInstance] Fetched FaxMediaInstance
|
285
|
-
def fetch
|
286
|
-
context.fetch
|
287
|
-
end
|
288
|
-
|
289
|
-
##
|
290
|
-
# Delete the FaxMediaInstance
|
291
|
-
# @return [Boolean] true if delete succeeds, false otherwise
|
292
|
-
def delete
|
293
|
-
context.delete
|
294
|
-
end
|
295
|
-
|
296
|
-
##
|
297
|
-
# Provide a user friendly representation
|
298
|
-
def to_s
|
299
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
300
|
-
"<Twilio.Fax.V1.FaxMediaInstance #{values}>"
|
301
|
-
end
|
302
|
-
|
303
|
-
##
|
304
|
-
# Provide a detailed, user friendly representation
|
305
|
-
def inspect
|
306
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
307
|
-
"<Twilio.Fax.V1.FaxMediaInstance #{values}>"
|
308
|
-
end
|
309
|
-
end
|
310
|
-
end
|
311
|
-
end
|
312
|
-
end
|
313
|
-
end
|
314
|
-
end
|
@@ -1,459 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# This code was generated by
|
3
|
-
# \ / _ _ _| _ _
|
4
|
-
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
-
# / /
|
6
|
-
#
|
7
|
-
# frozen_string_literal: true
|
8
|
-
|
9
|
-
module Twilio
|
10
|
-
module REST
|
11
|
-
class Fax < Domain
|
12
|
-
class V1 < Version
|
13
|
-
##
|
14
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
15
|
-
class FaxList < ListResource
|
16
|
-
##
|
17
|
-
# Initialize the FaxList
|
18
|
-
# @param [Version] version Version that contains the resource
|
19
|
-
# @return [FaxList] FaxList
|
20
|
-
def initialize(version)
|
21
|
-
super(version)
|
22
|
-
|
23
|
-
# Path Solution
|
24
|
-
@solution = {}
|
25
|
-
@uri = "/Faxes"
|
26
|
-
end
|
27
|
-
|
28
|
-
##
|
29
|
-
# Lists FaxInstance records from the API as a list.
|
30
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
31
|
-
# memory before returning.
|
32
|
-
# @param [String] from Retrieve only those faxes sent from this phone number,
|
33
|
-
# specified in {E.164}[https://www.twilio.com/docs/glossary/what-e164] format.
|
34
|
-
# @param [String] to Retrieve only those faxes sent to this phone number,
|
35
|
-
# specified in {E.164}[https://www.twilio.com/docs/glossary/what-e164] format.
|
36
|
-
# @param [Time] date_created_on_or_before Retrieve only those faxes with a
|
37
|
-
# `date_created` that is before or equal to this value, specified in {ISO
|
38
|
-
# 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
|
39
|
-
# @param [Time] date_created_after Retrieve only those faxes with a `date_created`
|
40
|
-
# that is later than this value, specified in {ISO
|
41
|
-
# 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
|
42
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
43
|
-
# guarantees to never return more than limit. Default is no limit
|
44
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
45
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
46
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
47
|
-
# efficient page size, i.e. min(limit, 1000)
|
48
|
-
# @return [Array] Array of up to limit results
|
49
|
-
def list(from: :unset, to: :unset, date_created_on_or_before: :unset, date_created_after: :unset, limit: nil, page_size: nil)
|
50
|
-
self.stream(
|
51
|
-
from: from,
|
52
|
-
to: to,
|
53
|
-
date_created_on_or_before: date_created_on_or_before,
|
54
|
-
date_created_after: date_created_after,
|
55
|
-
limit: limit,
|
56
|
-
page_size: page_size
|
57
|
-
).entries
|
58
|
-
end
|
59
|
-
|
60
|
-
##
|
61
|
-
# Streams FaxInstance records from the API as an Enumerable.
|
62
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
63
|
-
# is reached.
|
64
|
-
# @param [String] from Retrieve only those faxes sent from this phone number,
|
65
|
-
# specified in {E.164}[https://www.twilio.com/docs/glossary/what-e164] format.
|
66
|
-
# @param [String] to Retrieve only those faxes sent to this phone number,
|
67
|
-
# specified in {E.164}[https://www.twilio.com/docs/glossary/what-e164] format.
|
68
|
-
# @param [Time] date_created_on_or_before Retrieve only those faxes with a
|
69
|
-
# `date_created` that is before or equal to this value, specified in {ISO
|
70
|
-
# 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
|
71
|
-
# @param [Time] date_created_after Retrieve only those faxes with a `date_created`
|
72
|
-
# that is later than this value, specified in {ISO
|
73
|
-
# 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
|
74
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
75
|
-
# guarantees to never return more than limit. Default is no limit.
|
76
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
77
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
78
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
79
|
-
# efficient page size, i.e. min(limit, 1000)
|
80
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
81
|
-
def stream(from: :unset, to: :unset, date_created_on_or_before: :unset, date_created_after: :unset, limit: nil, page_size: nil)
|
82
|
-
limits = @version.read_limits(limit, page_size)
|
83
|
-
|
84
|
-
page = self.page(
|
85
|
-
from: from,
|
86
|
-
to: to,
|
87
|
-
date_created_on_or_before: date_created_on_or_before,
|
88
|
-
date_created_after: date_created_after,
|
89
|
-
page_size: limits[:page_size],
|
90
|
-
)
|
91
|
-
|
92
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
93
|
-
end
|
94
|
-
|
95
|
-
##
|
96
|
-
# When passed a block, yields FaxInstance records from the API.
|
97
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
98
|
-
# is reached.
|
99
|
-
def each
|
100
|
-
limits = @version.read_limits
|
101
|
-
|
102
|
-
page = self.page(page_size: limits[:page_size], )
|
103
|
-
|
104
|
-
@version.stream(page,
|
105
|
-
limit: limits[:limit],
|
106
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
107
|
-
end
|
108
|
-
|
109
|
-
##
|
110
|
-
# Retrieve a single page of FaxInstance records from the API.
|
111
|
-
# Request is executed immediately.
|
112
|
-
# @param [String] from Retrieve only those faxes sent from this phone number,
|
113
|
-
# specified in {E.164}[https://www.twilio.com/docs/glossary/what-e164] format.
|
114
|
-
# @param [String] to Retrieve only those faxes sent to this phone number,
|
115
|
-
# specified in {E.164}[https://www.twilio.com/docs/glossary/what-e164] format.
|
116
|
-
# @param [Time] date_created_on_or_before Retrieve only those faxes with a
|
117
|
-
# `date_created` that is before or equal to this value, specified in {ISO
|
118
|
-
# 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
|
119
|
-
# @param [Time] date_created_after Retrieve only those faxes with a `date_created`
|
120
|
-
# that is later than this value, specified in {ISO
|
121
|
-
# 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
|
122
|
-
# @param [String] page_token PageToken provided by the API
|
123
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
124
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
125
|
-
# @return [Page] Page of FaxInstance
|
126
|
-
def page(from: :unset, to: :unset, date_created_on_or_before: :unset, date_created_after: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
127
|
-
params = Twilio::Values.of({
|
128
|
-
'From' => from,
|
129
|
-
'To' => to,
|
130
|
-
'DateCreatedOnOrBefore' => Twilio.serialize_iso8601_datetime(date_created_on_or_before),
|
131
|
-
'DateCreatedAfter' => Twilio.serialize_iso8601_datetime(date_created_after),
|
132
|
-
'PageToken' => page_token,
|
133
|
-
'Page' => page_number,
|
134
|
-
'PageSize' => page_size,
|
135
|
-
})
|
136
|
-
|
137
|
-
response = @version.page('GET', @uri, params: params)
|
138
|
-
|
139
|
-
FaxPage.new(@version, response, @solution)
|
140
|
-
end
|
141
|
-
|
142
|
-
##
|
143
|
-
# Retrieve a single page of FaxInstance records from the API.
|
144
|
-
# Request is executed immediately.
|
145
|
-
# @param [String] target_url API-generated URL for the requested results page
|
146
|
-
# @return [Page] Page of FaxInstance
|
147
|
-
def get_page(target_url)
|
148
|
-
response = @version.domain.request(
|
149
|
-
'GET',
|
150
|
-
target_url
|
151
|
-
)
|
152
|
-
FaxPage.new(@version, response, @solution)
|
153
|
-
end
|
154
|
-
|
155
|
-
##
|
156
|
-
# Provide a user friendly representation
|
157
|
-
def to_s
|
158
|
-
'#<Twilio.Fax.V1.FaxList>'
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
##
|
163
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
164
|
-
class FaxPage < Page
|
165
|
-
##
|
166
|
-
# Initialize the FaxPage
|
167
|
-
# @param [Version] version Version that contains the resource
|
168
|
-
# @param [Response] response Response from the API
|
169
|
-
# @param [Hash] solution Path solution for the resource
|
170
|
-
# @return [FaxPage] FaxPage
|
171
|
-
def initialize(version, response, solution)
|
172
|
-
super(version, response)
|
173
|
-
|
174
|
-
# Path Solution
|
175
|
-
@solution = solution
|
176
|
-
end
|
177
|
-
|
178
|
-
##
|
179
|
-
# Build an instance of FaxInstance
|
180
|
-
# @param [Hash] payload Payload response from the API
|
181
|
-
# @return [FaxInstance] FaxInstance
|
182
|
-
def get_instance(payload)
|
183
|
-
FaxInstance.new(@version, payload, )
|
184
|
-
end
|
185
|
-
|
186
|
-
##
|
187
|
-
# Provide a user friendly representation
|
188
|
-
def to_s
|
189
|
-
'<Twilio.Fax.V1.FaxPage>'
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
##
|
194
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
195
|
-
class FaxContext < InstanceContext
|
196
|
-
##
|
197
|
-
# Initialize the FaxContext
|
198
|
-
# @param [Version] version Version that contains the resource
|
199
|
-
# @param [String] sid The Twilio-provided string that uniquely identifies the Fax
|
200
|
-
# resource to fetch.
|
201
|
-
# @return [FaxContext] FaxContext
|
202
|
-
def initialize(version, sid)
|
203
|
-
super(version)
|
204
|
-
|
205
|
-
# Path Solution
|
206
|
-
@solution = {sid: sid, }
|
207
|
-
@uri = "/Faxes/#{@solution[:sid]}"
|
208
|
-
|
209
|
-
# Dependents
|
210
|
-
@media = nil
|
211
|
-
end
|
212
|
-
|
213
|
-
##
|
214
|
-
# Fetch the FaxInstance
|
215
|
-
# @return [FaxInstance] Fetched FaxInstance
|
216
|
-
def fetch
|
217
|
-
payload = @version.fetch('GET', @uri)
|
218
|
-
|
219
|
-
FaxInstance.new(@version, payload, sid: @solution[:sid], )
|
220
|
-
end
|
221
|
-
|
222
|
-
##
|
223
|
-
# Delete the FaxInstance
|
224
|
-
# @return [Boolean] true if delete succeeds, false otherwise
|
225
|
-
def delete
|
226
|
-
@version.delete('DELETE', @uri)
|
227
|
-
end
|
228
|
-
|
229
|
-
##
|
230
|
-
# Access the media
|
231
|
-
# @return [FaxMediaList]
|
232
|
-
# @return [FaxMediaContext] if sid was passed.
|
233
|
-
def media(sid=:unset)
|
234
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
235
|
-
|
236
|
-
if sid != :unset
|
237
|
-
return FaxMediaContext.new(@version, @solution[:sid], sid, )
|
238
|
-
end
|
239
|
-
|
240
|
-
unless @media
|
241
|
-
@media = FaxMediaList.new(@version, fax_sid: @solution[:sid], )
|
242
|
-
end
|
243
|
-
|
244
|
-
@media
|
245
|
-
end
|
246
|
-
|
247
|
-
##
|
248
|
-
# Provide a user friendly representation
|
249
|
-
def to_s
|
250
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
251
|
-
"#<Twilio.Fax.V1.FaxContext #{context}>"
|
252
|
-
end
|
253
|
-
|
254
|
-
##
|
255
|
-
# Provide a detailed, user friendly representation
|
256
|
-
def inspect
|
257
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
258
|
-
"#<Twilio.Fax.V1.FaxContext #{context}>"
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
##
|
263
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
264
|
-
class FaxInstance < InstanceResource
|
265
|
-
##
|
266
|
-
# Initialize the FaxInstance
|
267
|
-
# @param [Version] version Version that contains the resource
|
268
|
-
# @param [Hash] payload payload that contains response from Twilio
|
269
|
-
# @param [String] sid The Twilio-provided string that uniquely identifies the Fax
|
270
|
-
# resource to fetch.
|
271
|
-
# @return [FaxInstance] FaxInstance
|
272
|
-
def initialize(version, payload, sid: nil)
|
273
|
-
super(version)
|
274
|
-
|
275
|
-
# Marshaled Properties
|
276
|
-
@properties = {
|
277
|
-
'sid' => payload['sid'],
|
278
|
-
'account_sid' => payload['account_sid'],
|
279
|
-
'from' => payload['from'],
|
280
|
-
'to' => payload['to'],
|
281
|
-
'quality' => payload['quality'],
|
282
|
-
'media_sid' => payload['media_sid'],
|
283
|
-
'media_url' => payload['media_url'],
|
284
|
-
'num_pages' => payload['num_pages'] == nil ? payload['num_pages'] : payload['num_pages'].to_i,
|
285
|
-
'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
|
286
|
-
'status' => payload['status'],
|
287
|
-
'direction' => payload['direction'],
|
288
|
-
'api_version' => payload['api_version'],
|
289
|
-
'price' => payload['price'].to_f,
|
290
|
-
'price_unit' => payload['price_unit'],
|
291
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
292
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
293
|
-
'links' => payload['links'],
|
294
|
-
'url' => payload['url'],
|
295
|
-
}
|
296
|
-
|
297
|
-
# Context
|
298
|
-
@instance_context = nil
|
299
|
-
@params = {'sid' => sid || @properties['sid'], }
|
300
|
-
end
|
301
|
-
|
302
|
-
##
|
303
|
-
# Generate an instance context for the instance, the context is capable of
|
304
|
-
# performing various actions. All instance actions are proxied to the context
|
305
|
-
# @return [FaxContext] FaxContext for this FaxInstance
|
306
|
-
def context
|
307
|
-
unless @instance_context
|
308
|
-
@instance_context = FaxContext.new(@version, @params['sid'], )
|
309
|
-
end
|
310
|
-
@instance_context
|
311
|
-
end
|
312
|
-
|
313
|
-
##
|
314
|
-
# @return [String] The unique string that identifies the resource
|
315
|
-
def sid
|
316
|
-
@properties['sid']
|
317
|
-
end
|
318
|
-
|
319
|
-
##
|
320
|
-
# @return [String] The SID of the Account that created the resource
|
321
|
-
def account_sid
|
322
|
-
@properties['account_sid']
|
323
|
-
end
|
324
|
-
|
325
|
-
##
|
326
|
-
# @return [String] The number the fax was sent from
|
327
|
-
def from
|
328
|
-
@properties['from']
|
329
|
-
end
|
330
|
-
|
331
|
-
##
|
332
|
-
# @return [String] The phone number that received the fax
|
333
|
-
def to
|
334
|
-
@properties['to']
|
335
|
-
end
|
336
|
-
|
337
|
-
##
|
338
|
-
# @return [fax.Quality] The quality of the fax
|
339
|
-
def quality
|
340
|
-
@properties['quality']
|
341
|
-
end
|
342
|
-
|
343
|
-
##
|
344
|
-
# @return [String] The SID of the FaxMedia resource that is associated with the Fax
|
345
|
-
def media_sid
|
346
|
-
@properties['media_sid']
|
347
|
-
end
|
348
|
-
|
349
|
-
##
|
350
|
-
# @return [String] The Twilio-hosted URL that can be used to download fax media
|
351
|
-
def media_url
|
352
|
-
@properties['media_url']
|
353
|
-
end
|
354
|
-
|
355
|
-
##
|
356
|
-
# @return [String] The number of pages contained in the fax document
|
357
|
-
def num_pages
|
358
|
-
@properties['num_pages']
|
359
|
-
end
|
360
|
-
|
361
|
-
##
|
362
|
-
# @return [String] The time it took to transmit the fax
|
363
|
-
def duration
|
364
|
-
@properties['duration']
|
365
|
-
end
|
366
|
-
|
367
|
-
##
|
368
|
-
# @return [fax.Status] The status of the fax
|
369
|
-
def status
|
370
|
-
@properties['status']
|
371
|
-
end
|
372
|
-
|
373
|
-
##
|
374
|
-
# @return [fax.Direction] The direction of the fax
|
375
|
-
def direction
|
376
|
-
@properties['direction']
|
377
|
-
end
|
378
|
-
|
379
|
-
##
|
380
|
-
# @return [String] The API version used to transmit the fax
|
381
|
-
def api_version
|
382
|
-
@properties['api_version']
|
383
|
-
end
|
384
|
-
|
385
|
-
##
|
386
|
-
# @return [String] The fax transmission price
|
387
|
-
def price
|
388
|
-
@properties['price']
|
389
|
-
end
|
390
|
-
|
391
|
-
##
|
392
|
-
# @return [String] The ISO 4217 currency used for billing
|
393
|
-
def price_unit
|
394
|
-
@properties['price_unit']
|
395
|
-
end
|
396
|
-
|
397
|
-
##
|
398
|
-
# @return [Time] The ISO 8601 formatted date and time in GMT when the resource was created
|
399
|
-
def date_created
|
400
|
-
@properties['date_created']
|
401
|
-
end
|
402
|
-
|
403
|
-
##
|
404
|
-
# @return [Time] The ISO 8601 formatted date and time in GMT when the resource was last updated
|
405
|
-
def date_updated
|
406
|
-
@properties['date_updated']
|
407
|
-
end
|
408
|
-
|
409
|
-
##
|
410
|
-
# @return [String] The URLs of the fax's related resources
|
411
|
-
def links
|
412
|
-
@properties['links']
|
413
|
-
end
|
414
|
-
|
415
|
-
##
|
416
|
-
# @return [String] The absolute URL of the fax resource
|
417
|
-
def url
|
418
|
-
@properties['url']
|
419
|
-
end
|
420
|
-
|
421
|
-
##
|
422
|
-
# Fetch the FaxInstance
|
423
|
-
# @return [FaxInstance] Fetched FaxInstance
|
424
|
-
def fetch
|
425
|
-
context.fetch
|
426
|
-
end
|
427
|
-
|
428
|
-
##
|
429
|
-
# Delete the FaxInstance
|
430
|
-
# @return [Boolean] true if delete succeeds, false otherwise
|
431
|
-
def delete
|
432
|
-
context.delete
|
433
|
-
end
|
434
|
-
|
435
|
-
##
|
436
|
-
# Access the media
|
437
|
-
# @return [media] media
|
438
|
-
def media
|
439
|
-
context.media
|
440
|
-
end
|
441
|
-
|
442
|
-
##
|
443
|
-
# Provide a user friendly representation
|
444
|
-
def to_s
|
445
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
446
|
-
"<Twilio.Fax.V1.FaxInstance #{values}>"
|
447
|
-
end
|
448
|
-
|
449
|
-
##
|
450
|
-
# Provide a detailed, user friendly representation
|
451
|
-
def inspect
|
452
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
453
|
-
"<Twilio.Fax.V1.FaxInstance #{values}>"
|
454
|
-
end
|
455
|
-
end
|
456
|
-
end
|
457
|
-
end
|
458
|
-
end
|
459
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# This code was generated by
|
3
|
-
# \ / _ _ _| _ _
|
4
|
-
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
-
# / /
|
6
|
-
#
|
7
|
-
# frozen_string_literal: true
|
8
|
-
|
9
|
-
module Twilio
|
10
|
-
module REST
|
11
|
-
class Fax
|
12
|
-
class V1 < Version
|
13
|
-
##
|
14
|
-
# Initialize the V1 version of Fax
|
15
|
-
def initialize(domain)
|
16
|
-
super
|
17
|
-
@version = 'v1'
|
18
|
-
@faxes = nil
|
19
|
-
end
|
20
|
-
|
21
|
-
##
|
22
|
-
# @param [String] sid The Twilio-provided string that uniquely identifies the Fax
|
23
|
-
# resource to fetch.
|
24
|
-
# @return [Twilio::REST::Fax::V1::FaxContext] if sid was passed.
|
25
|
-
# @return [Twilio::REST::Fax::V1::FaxList]
|
26
|
-
def faxes(sid=:unset)
|
27
|
-
if sid.nil?
|
28
|
-
raise ArgumentError, 'sid cannot be nil'
|
29
|
-
end
|
30
|
-
if sid == :unset
|
31
|
-
@faxes ||= FaxList.new self
|
32
|
-
else
|
33
|
-
FaxContext.new(self, sid)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
##
|
38
|
-
# Provide a user friendly representation
|
39
|
-
def to_s
|
40
|
-
'<Twilio::REST::Fax::V1>'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
data/lib/twilio-ruby/rest/fax.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# This code was generated by
|
3
|
-
# \ / _ _ _| _ _
|
4
|
-
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
-
# / /
|
6
|
-
#
|
7
|
-
# frozen_string_literal: true
|
8
|
-
|
9
|
-
module Twilio
|
10
|
-
module REST
|
11
|
-
class Fax < Domain
|
12
|
-
##
|
13
|
-
# Initialize the Fax Domain
|
14
|
-
def initialize(twilio)
|
15
|
-
super
|
16
|
-
|
17
|
-
@base_url = 'https://fax.twilio.com'
|
18
|
-
@host = 'fax.twilio.com'
|
19
|
-
@port = 443
|
20
|
-
|
21
|
-
# Versions
|
22
|
-
@v1 = nil
|
23
|
-
end
|
24
|
-
|
25
|
-
##
|
26
|
-
# Version v1 of fax
|
27
|
-
def v1
|
28
|
-
@v1 ||= V1.new self
|
29
|
-
end
|
30
|
-
|
31
|
-
##
|
32
|
-
# @param [String] sid The unique string that we created to identify the Fax
|
33
|
-
# resource.
|
34
|
-
# @return [Twilio::REST::Fax::V1::FaxInstance] if sid was passed.
|
35
|
-
# @return [Twilio::REST::Fax::V1::FaxList]
|
36
|
-
def faxes(sid=:unset)
|
37
|
-
self.v1.faxes(sid)
|
38
|
-
end
|
39
|
-
|
40
|
-
##
|
41
|
-
# Provide a user friendly representation
|
42
|
-
def to_s
|
43
|
-
'#<Twilio::REST::Fax>'
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|