twilio-ruby 5.52.0 → 5.67.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/pr-lint.yml +15 -0
- data/.github/workflows/test-and-deploy.yml +129 -0
- data/.gitignore +5 -1
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +91 -28
- data/CHANGES.md +563 -0
- data/Gemfile +1 -0
- data/Makefile +8 -11
- data/README.md +13 -6
- data/examples/examples.rb +1 -1
- data/lib/rack/twilio_webhook_authentication.rb +25 -1
- data/lib/twilio-ruby/http/http_client.rb +20 -4
- data/lib/twilio-ruby/http.rb +5 -0
- data/lib/twilio-ruby/jwt/access_token.rb +13 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +23 -23
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -8
- data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +674 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +68 -14
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +12 -8
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +17 -10
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +18 -5
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +34 -7
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +0 -6
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -8
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +10 -4
- data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
- data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
- data/lib/twilio-ruby/rest/chat.rb +16 -0
- data/lib/twilio-ruby/rest/client.rb +21 -12
- data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +454 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +7 -0
- data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +18 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +7 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
- data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
- data/lib/twilio-ruby/rest/conversations/v1.rb +24 -0
- data/lib/twilio-ruby/rest/conversations.rb +15 -0
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +12 -5
- data/lib/twilio-ruby/rest/events/v1/sink.rb +41 -5
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +28 -0
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +55 -34
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +384 -0
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
- data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
- data/lib/twilio-ruby/rest/flex_api.rb +9 -0
- data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +258 -0
- data/lib/twilio-ruby/rest/{fax → frontline_api}/v1.rb +11 -11
- data/lib/twilio-ruby/rest/{fax.rb → frontline_api.rb} +11 -11
- data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +434 -0
- data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
- data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
- data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +46 -0
- data/lib/twilio-ruby/rest/insights.rb +28 -0
- data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +268 -0
- data/lib/twilio-ruby/rest/lookups/v2.rb +45 -0
- data/lib/twilio-ruby/rest/lookups.rb +7 -0
- data/lib/twilio-ruby/rest/media/v1/media_processor.rb +397 -0
- data/lib/twilio-ruby/rest/media/v1/media_recording.rb +406 -0
- data/lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb +221 -0
- data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +403 -0
- data/lib/twilio-ruby/rest/media/v1.rb +76 -0
- data/lib/twilio-ruby/rest/media.rb +65 -0
- data/lib/twilio-ruby/rest/{fax/v1/fax/fax_media.rb → messaging/v1/brand_registration/brand_vetting.rb} +134 -95
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +127 -2
- data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +7 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +187 -20
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +37 -5
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +268 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +188 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +128 -26
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
- data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
- data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
- data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
- data/lib/twilio-ruby/rest/pricing.rb +19 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +1 -1
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +7 -0
- data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -1
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -55
- data/lib/twilio-ruby/rest/supersim/v1/{command.rb → ip_command.rb} +132 -84
- data/lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb +231 -0
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +30 -1
- data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +23 -9
- data/lib/twilio-ruby/rest/supersim/v1.rb +23 -7
- data/lib/twilio-ruby/rest/supersim.rb +15 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +7 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +7 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +23 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +38 -22
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -3
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +155 -10
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +12 -9
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +74 -22
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +34 -15
- data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +66 -31
- data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +7 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +25 -7
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
- data/lib/twilio-ruby/rest/verify/v2/service.rb +40 -11
- data/lib/twilio-ruby/rest/verify/v2/template.rb +206 -0
- data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
- data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +234 -0
- data/lib/twilio-ruby/rest/verify/v2.rb +14 -0
- data/lib/twilio-ruby/rest/verify.rb +14 -2
- data/lib/twilio-ruby/rest/video/v1/composition.rb +21 -8
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +0 -8
- data/lib/twilio-ruby/rest/video/v1/recording.rb +21 -0
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
- data/lib/twilio-ruby/rest/video/v1/room.rb +62 -5
- data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
- data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
- data/lib/twilio-ruby/rest/voice.rb +8 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +16 -26
- data/lib/twilio-ruby/rest.rb +13 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +727 -87
- data/lib/twilio-ruby/version.rb +1 -1
- data/lib/twilio-ruby.rb +6 -16
- data/sonar-project.properties +13 -0
- data/twilio-ruby.gemspec +1 -2
- metadata +59 -32
- data/.travis.yml +0 -45
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -536
- /data/lib/twilio-ruby/framework/{domain.rb → rest/domain.rb} +0 -0
- /data/lib/twilio-ruby/framework/{error.rb → rest/error.rb} +0 -0
- /data/lib/twilio-ruby/framework/{helper.rb → rest/helper.rb} +0 -0
- /data/lib/twilio-ruby/framework/{obsolete_client.rb → rest/obsolete_client.rb} +0 -0
- /data/lib/twilio-ruby/framework/{page.rb → rest/page.rb} +0 -0
- /data/lib/twilio-ruby/framework/{resource.rb → rest/resource.rb} +0 -0
- /data/lib/twilio-ruby/framework/{version.rb → rest/version.rb} +0 -0
@@ -1,536 +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
|
-
# Create the FaxInstance
|
157
|
-
# @param [String] to The phone number to receive the fax in
|
158
|
-
# {E.164}[https://www.twilio.com/docs/glossary/what-e164] format or the
|
159
|
-
# recipient's SIP URI.
|
160
|
-
# @param [String] media_url The URL of the PDF that contains the fax. See our
|
161
|
-
# {security}[https://www.twilio.com/docs/usage/security] page for information on
|
162
|
-
# how to ensure the request for your media comes from Twilio.
|
163
|
-
# @param [fax.Quality] quality The {Fax Quality
|
164
|
-
# value}[https://www.twilio.com/docs/fax/api/fax-resource#fax-quality-values] that
|
165
|
-
# describes the fax quality. Can be: `standard`, `fine`, or `superfine` and
|
166
|
-
# defaults to `fine`.
|
167
|
-
# @param [String] status_callback The URL we should call using the `POST` method
|
168
|
-
# to send {status
|
169
|
-
# information}[https://www.twilio.com/docs/fax/api/fax-resource#fax-status-callback]
|
170
|
-
# to your application when the status of the fax changes.
|
171
|
-
# @param [String] from The number the fax was sent from. Can be the phone number
|
172
|
-
# in {E.164}[https://www.twilio.com/docs/glossary/what-e164] format or the SIP
|
173
|
-
# `from` value. The caller ID displayed to the recipient uses this value. If this
|
174
|
-
# is a phone number, it must be a Twilio number or a verified outgoing caller id
|
175
|
-
# from your account. If `to` is a SIP address, this can be any alphanumeric string
|
176
|
-
# (and also the characters `+`, `_`, `.`, and `-`), which will be used in the
|
177
|
-
# `from` header of the SIP request.
|
178
|
-
# @param [String] sip_auth_username The username to use with the
|
179
|
-
# `sip_auth_password` to authenticate faxes sent to a SIP address.
|
180
|
-
# @param [String] sip_auth_password The password to use with `sip_auth_username`
|
181
|
-
# to authenticate faxes sent to a SIP address.
|
182
|
-
# @param [Boolean] store_media Whether to store a copy of the sent media on our
|
183
|
-
# servers for later retrieval. Can be: `true` or `false` and the default is
|
184
|
-
# `true`.
|
185
|
-
# @param [String] ttl How long in minutes from when the fax is initiated that we
|
186
|
-
# should try to send the fax.
|
187
|
-
# @return [FaxInstance] Created FaxInstance
|
188
|
-
def create(to: nil, media_url: nil, quality: :unset, status_callback: :unset, from: :unset, sip_auth_username: :unset, sip_auth_password: :unset, store_media: :unset, ttl: :unset)
|
189
|
-
data = Twilio::Values.of({
|
190
|
-
'To' => to,
|
191
|
-
'MediaUrl' => media_url,
|
192
|
-
'Quality' => quality,
|
193
|
-
'StatusCallback' => status_callback,
|
194
|
-
'From' => from,
|
195
|
-
'SipAuthUsername' => sip_auth_username,
|
196
|
-
'SipAuthPassword' => sip_auth_password,
|
197
|
-
'StoreMedia' => store_media,
|
198
|
-
'Ttl' => ttl,
|
199
|
-
})
|
200
|
-
|
201
|
-
payload = @version.create('POST', @uri, data: data)
|
202
|
-
|
203
|
-
FaxInstance.new(@version, payload, )
|
204
|
-
end
|
205
|
-
|
206
|
-
##
|
207
|
-
# Provide a user friendly representation
|
208
|
-
def to_s
|
209
|
-
'#<Twilio.Fax.V1.FaxList>'
|
210
|
-
end
|
211
|
-
end
|
212
|
-
|
213
|
-
##
|
214
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
215
|
-
class FaxPage < Page
|
216
|
-
##
|
217
|
-
# Initialize the FaxPage
|
218
|
-
# @param [Version] version Version that contains the resource
|
219
|
-
# @param [Response] response Response from the API
|
220
|
-
# @param [Hash] solution Path solution for the resource
|
221
|
-
# @return [FaxPage] FaxPage
|
222
|
-
def initialize(version, response, solution)
|
223
|
-
super(version, response)
|
224
|
-
|
225
|
-
# Path Solution
|
226
|
-
@solution = solution
|
227
|
-
end
|
228
|
-
|
229
|
-
##
|
230
|
-
# Build an instance of FaxInstance
|
231
|
-
# @param [Hash] payload Payload response from the API
|
232
|
-
# @return [FaxInstance] FaxInstance
|
233
|
-
def get_instance(payload)
|
234
|
-
FaxInstance.new(@version, payload, )
|
235
|
-
end
|
236
|
-
|
237
|
-
##
|
238
|
-
# Provide a user friendly representation
|
239
|
-
def to_s
|
240
|
-
'<Twilio.Fax.V1.FaxPage>'
|
241
|
-
end
|
242
|
-
end
|
243
|
-
|
244
|
-
##
|
245
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
246
|
-
class FaxContext < InstanceContext
|
247
|
-
##
|
248
|
-
# Initialize the FaxContext
|
249
|
-
# @param [Version] version Version that contains the resource
|
250
|
-
# @param [String] sid The Twilio-provided string that uniquely identifies the Fax
|
251
|
-
# resource to fetch.
|
252
|
-
# @return [FaxContext] FaxContext
|
253
|
-
def initialize(version, sid)
|
254
|
-
super(version)
|
255
|
-
|
256
|
-
# Path Solution
|
257
|
-
@solution = {sid: sid, }
|
258
|
-
@uri = "/Faxes/#{@solution[:sid]}"
|
259
|
-
|
260
|
-
# Dependents
|
261
|
-
@media = nil
|
262
|
-
end
|
263
|
-
|
264
|
-
##
|
265
|
-
# Fetch the FaxInstance
|
266
|
-
# @return [FaxInstance] Fetched FaxInstance
|
267
|
-
def fetch
|
268
|
-
payload = @version.fetch('GET', @uri)
|
269
|
-
|
270
|
-
FaxInstance.new(@version, payload, sid: @solution[:sid], )
|
271
|
-
end
|
272
|
-
|
273
|
-
##
|
274
|
-
# Update the FaxInstance
|
275
|
-
# @param [fax.UpdateStatus] status The new
|
276
|
-
# {status}[https://www.twilio.com/docs/fax/api/fax-resource#fax-status-values] of
|
277
|
-
# the resource. Can be only `canceled`. This may fail if transmission has already
|
278
|
-
# started.
|
279
|
-
# @return [FaxInstance] Updated FaxInstance
|
280
|
-
def update(status: :unset)
|
281
|
-
data = Twilio::Values.of({'Status' => status, })
|
282
|
-
|
283
|
-
payload = @version.update('POST', @uri, data: data)
|
284
|
-
|
285
|
-
FaxInstance.new(@version, payload, sid: @solution[:sid], )
|
286
|
-
end
|
287
|
-
|
288
|
-
##
|
289
|
-
# Delete the FaxInstance
|
290
|
-
# @return [Boolean] true if delete succeeds, false otherwise
|
291
|
-
def delete
|
292
|
-
@version.delete('DELETE', @uri)
|
293
|
-
end
|
294
|
-
|
295
|
-
##
|
296
|
-
# Access the media
|
297
|
-
# @return [FaxMediaList]
|
298
|
-
# @return [FaxMediaContext] if sid was passed.
|
299
|
-
def media(sid=:unset)
|
300
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
301
|
-
|
302
|
-
if sid != :unset
|
303
|
-
return FaxMediaContext.new(@version, @solution[:sid], sid, )
|
304
|
-
end
|
305
|
-
|
306
|
-
unless @media
|
307
|
-
@media = FaxMediaList.new(@version, fax_sid: @solution[:sid], )
|
308
|
-
end
|
309
|
-
|
310
|
-
@media
|
311
|
-
end
|
312
|
-
|
313
|
-
##
|
314
|
-
# Provide a user friendly representation
|
315
|
-
def to_s
|
316
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
317
|
-
"#<Twilio.Fax.V1.FaxContext #{context}>"
|
318
|
-
end
|
319
|
-
|
320
|
-
##
|
321
|
-
# Provide a detailed, user friendly representation
|
322
|
-
def inspect
|
323
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
324
|
-
"#<Twilio.Fax.V1.FaxContext #{context}>"
|
325
|
-
end
|
326
|
-
end
|
327
|
-
|
328
|
-
##
|
329
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
330
|
-
class FaxInstance < InstanceResource
|
331
|
-
##
|
332
|
-
# Initialize the FaxInstance
|
333
|
-
# @param [Version] version Version that contains the resource
|
334
|
-
# @param [Hash] payload payload that contains response from Twilio
|
335
|
-
# @param [String] sid The Twilio-provided string that uniquely identifies the Fax
|
336
|
-
# resource to fetch.
|
337
|
-
# @return [FaxInstance] FaxInstance
|
338
|
-
def initialize(version, payload, sid: nil)
|
339
|
-
super(version)
|
340
|
-
|
341
|
-
# Marshaled Properties
|
342
|
-
@properties = {
|
343
|
-
'sid' => payload['sid'],
|
344
|
-
'account_sid' => payload['account_sid'],
|
345
|
-
'from' => payload['from'],
|
346
|
-
'to' => payload['to'],
|
347
|
-
'quality' => payload['quality'],
|
348
|
-
'media_sid' => payload['media_sid'],
|
349
|
-
'media_url' => payload['media_url'],
|
350
|
-
'num_pages' => payload['num_pages'] == nil ? payload['num_pages'] : payload['num_pages'].to_i,
|
351
|
-
'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
|
352
|
-
'status' => payload['status'],
|
353
|
-
'direction' => payload['direction'],
|
354
|
-
'api_version' => payload['api_version'],
|
355
|
-
'price' => payload['price'].to_f,
|
356
|
-
'price_unit' => payload['price_unit'],
|
357
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
358
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
359
|
-
'links' => payload['links'],
|
360
|
-
'url' => payload['url'],
|
361
|
-
}
|
362
|
-
|
363
|
-
# Context
|
364
|
-
@instance_context = nil
|
365
|
-
@params = {'sid' => sid || @properties['sid'], }
|
366
|
-
end
|
367
|
-
|
368
|
-
##
|
369
|
-
# Generate an instance context for the instance, the context is capable of
|
370
|
-
# performing various actions. All instance actions are proxied to the context
|
371
|
-
# @return [FaxContext] FaxContext for this FaxInstance
|
372
|
-
def context
|
373
|
-
unless @instance_context
|
374
|
-
@instance_context = FaxContext.new(@version, @params['sid'], )
|
375
|
-
end
|
376
|
-
@instance_context
|
377
|
-
end
|
378
|
-
|
379
|
-
##
|
380
|
-
# @return [String] The unique string that identifies the resource
|
381
|
-
def sid
|
382
|
-
@properties['sid']
|
383
|
-
end
|
384
|
-
|
385
|
-
##
|
386
|
-
# @return [String] The SID of the Account that created the resource
|
387
|
-
def account_sid
|
388
|
-
@properties['account_sid']
|
389
|
-
end
|
390
|
-
|
391
|
-
##
|
392
|
-
# @return [String] The number the fax was sent from
|
393
|
-
def from
|
394
|
-
@properties['from']
|
395
|
-
end
|
396
|
-
|
397
|
-
##
|
398
|
-
# @return [String] The phone number that received the fax
|
399
|
-
def to
|
400
|
-
@properties['to']
|
401
|
-
end
|
402
|
-
|
403
|
-
##
|
404
|
-
# @return [fax.Quality] The quality of the fax
|
405
|
-
def quality
|
406
|
-
@properties['quality']
|
407
|
-
end
|
408
|
-
|
409
|
-
##
|
410
|
-
# @return [String] The SID of the FaxMedia resource that is associated with the Fax
|
411
|
-
def media_sid
|
412
|
-
@properties['media_sid']
|
413
|
-
end
|
414
|
-
|
415
|
-
##
|
416
|
-
# @return [String] The Twilio-hosted URL that can be used to download fax media
|
417
|
-
def media_url
|
418
|
-
@properties['media_url']
|
419
|
-
end
|
420
|
-
|
421
|
-
##
|
422
|
-
# @return [String] The number of pages contained in the fax document
|
423
|
-
def num_pages
|
424
|
-
@properties['num_pages']
|
425
|
-
end
|
426
|
-
|
427
|
-
##
|
428
|
-
# @return [String] The time it took to transmit the fax
|
429
|
-
def duration
|
430
|
-
@properties['duration']
|
431
|
-
end
|
432
|
-
|
433
|
-
##
|
434
|
-
# @return [fax.Status] The status of the fax
|
435
|
-
def status
|
436
|
-
@properties['status']
|
437
|
-
end
|
438
|
-
|
439
|
-
##
|
440
|
-
# @return [fax.Direction] The direction of the fax
|
441
|
-
def direction
|
442
|
-
@properties['direction']
|
443
|
-
end
|
444
|
-
|
445
|
-
##
|
446
|
-
# @return [String] The API version used to transmit the fax
|
447
|
-
def api_version
|
448
|
-
@properties['api_version']
|
449
|
-
end
|
450
|
-
|
451
|
-
##
|
452
|
-
# @return [String] The fax transmission price
|
453
|
-
def price
|
454
|
-
@properties['price']
|
455
|
-
end
|
456
|
-
|
457
|
-
##
|
458
|
-
# @return [String] The ISO 4217 currency used for billing
|
459
|
-
def price_unit
|
460
|
-
@properties['price_unit']
|
461
|
-
end
|
462
|
-
|
463
|
-
##
|
464
|
-
# @return [Time] The ISO 8601 formatted date and time in GMT when the resource was created
|
465
|
-
def date_created
|
466
|
-
@properties['date_created']
|
467
|
-
end
|
468
|
-
|
469
|
-
##
|
470
|
-
# @return [Time] The ISO 8601 formatted date and time in GMT when the resource was last updated
|
471
|
-
def date_updated
|
472
|
-
@properties['date_updated']
|
473
|
-
end
|
474
|
-
|
475
|
-
##
|
476
|
-
# @return [String] The URLs of the fax's related resources
|
477
|
-
def links
|
478
|
-
@properties['links']
|
479
|
-
end
|
480
|
-
|
481
|
-
##
|
482
|
-
# @return [String] The absolute URL of the fax resource
|
483
|
-
def url
|
484
|
-
@properties['url']
|
485
|
-
end
|
486
|
-
|
487
|
-
##
|
488
|
-
# Fetch the FaxInstance
|
489
|
-
# @return [FaxInstance] Fetched FaxInstance
|
490
|
-
def fetch
|
491
|
-
context.fetch
|
492
|
-
end
|
493
|
-
|
494
|
-
##
|
495
|
-
# Update the FaxInstance
|
496
|
-
# @param [fax.UpdateStatus] status The new
|
497
|
-
# {status}[https://www.twilio.com/docs/fax/api/fax-resource#fax-status-values] of
|
498
|
-
# the resource. Can be only `canceled`. This may fail if transmission has already
|
499
|
-
# started.
|
500
|
-
# @return [FaxInstance] Updated FaxInstance
|
501
|
-
def update(status: :unset)
|
502
|
-
context.update(status: status, )
|
503
|
-
end
|
504
|
-
|
505
|
-
##
|
506
|
-
# Delete the FaxInstance
|
507
|
-
# @return [Boolean] true if delete succeeds, false otherwise
|
508
|
-
def delete
|
509
|
-
context.delete
|
510
|
-
end
|
511
|
-
|
512
|
-
##
|
513
|
-
# Access the media
|
514
|
-
# @return [media] media
|
515
|
-
def media
|
516
|
-
context.media
|
517
|
-
end
|
518
|
-
|
519
|
-
##
|
520
|
-
# Provide a user friendly representation
|
521
|
-
def to_s
|
522
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
523
|
-
"<Twilio.Fax.V1.FaxInstance #{values}>"
|
524
|
-
end
|
525
|
-
|
526
|
-
##
|
527
|
-
# Provide a detailed, user friendly representation
|
528
|
-
def inspect
|
529
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
530
|
-
"<Twilio.Fax.V1.FaxInstance #{values}>"
|
531
|
-
end
|
532
|
-
end
|
533
|
-
end
|
534
|
-
end
|
535
|
-
end
|
536
|
-
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|