lib/twilio-ruby/rest/fax/v1/fax.rb in twilio-ruby-5.6.0 vs lib/twilio-ruby/rest/fax/v1/fax.rb in twilio-ruby-5.6.1
- old
+ new
@@ -91,11 +91,11 @@
# This operation lazily loads records as efficiently as possible until the limit
# is reached.
def each
limits = @version.read_limits
- page = self.page(page_size: limits[:page_size])
+ page = self.page(page_size: limits[:page_size], )
@version.stream(page,
limit: limits[:limit],
page_limit: limits[:page_limit]).each {|x| yield x}
end
@@ -166,30 +166,33 @@
# sending to a SIP address.
# @param [String] sip_auth_password The password to use for authentication when
# sending to a SIP address.
# @param [Boolean] store_media Whether or not to store a copy of the sent media on
# Twilio's servers for later retrieval (defaults to `true`)
+ # @param [String] ttl How many minutes from when a fax was initiated should Twilio
+ # attempt to send a fax.
# @return [FaxInstance] Newly created FaxInstance
- 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)
+ 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)
data = Twilio::Values.of({
'To' => to,
'MediaUrl' => media_url,
'Quality' => quality,
'StatusCallback' => status_callback,
'From' => from,
'SipAuthUsername' => sip_auth_username,
'SipAuthPassword' => sip_auth_password,
'StoreMedia' => store_media,
+ 'Ttl' => ttl,
})
payload = @version.create(
'POST',
@uri,
data: data
)
- FaxInstance.new(@version, payload)
+ FaxInstance.new(@version, payload, )
end
##
# Provide a user friendly representation
def to_s
@@ -216,11 +219,11 @@
##
# Build an instance of FaxInstance
# @param [Hash] payload Payload response from the API
# @return [FaxInstance] FaxInstance
def get_instance(payload)
- FaxInstance.new(@version, payload)
+ FaxInstance.new(@version, payload, )
end
##
# Provide a user friendly representation
def to_s
@@ -238,11 +241,11 @@
# @return [FaxContext] FaxContext
def initialize(version, sid)
super(version)
# Path Solution
- @solution = {sid: sid}
+ @solution = {sid: sid, }
@uri = "/Faxes/#{@solution[:sid]}"
# Dependents
@media = nil
end
@@ -257,29 +260,29 @@
'GET',
@uri,
params,
)
- FaxInstance.new(@version, payload, sid: @solution[:sid])
+ FaxInstance.new(@version, payload, sid: @solution[:sid], )
end
##
# Update the FaxInstance
# @param [fax.UpdateStatus] status The updated status of this fax. The only valid
# option is `canceled`. This may fail if the status has already started
# transmission.
# @return [FaxInstance] Updated FaxInstance
def update(status: :unset)
- data = Twilio::Values.of({'Status' => status})
+ data = Twilio::Values.of({'Status' => status, })
payload = @version.update(
'POST',
@uri,
data: data,
)
- FaxInstance.new(@version, payload, sid: @solution[:sid])
+ FaxInstance.new(@version, payload, sid: @solution[:sid], )
end
##
# Deletes the FaxInstance
# @return [Boolean] true if delete succeeds, true otherwise
@@ -293,15 +296,15 @@
# @return [FaxMediaContext] if sid was passed.
def media(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return FaxMediaContext.new(@version, @solution[:sid], sid)
+ return FaxMediaContext.new(@version, @solution[:sid], sid, )
end
unless @media
- @media = FaxMediaList.new(@version, fax_sid: @solution[:sid])
+ @media = FaxMediaList.new(@version, fax_sid: @solution[:sid], )
end
@media
end
@@ -347,20 +350,20 @@
'url' => payload['url'],
}
# Context
@instance_context = nil
- @params = {'sid' => sid || @properties['sid']}
+ @params = {'sid' => sid || @properties['sid'], }
end
##
# Generate an instance context for the instance, the context is capable of
# performing various actions. All instance actions are proxied to the context
# @return [FaxContext] FaxContext for this FaxInstance
def context
unless @instance_context
- @instance_context = FaxContext.new(@version, @params['sid'])
+ @instance_context = FaxContext.new(@version, @params['sid'], )
end
@instance_context
end
##
@@ -483,10 +486,10 @@
# @param [fax.UpdateStatus] status The updated status of this fax. The only valid
# option is `canceled`. This may fail if the status has already started
# transmission.
# @return [FaxInstance] Updated FaxInstance
def update(status: :unset)
- context.update(status: status)
+ context.update(status: status, )
end
##
# Deletes the FaxInstance
# @return [Boolean] true if delete succeeds, true otherwise
\ No newline at end of file