class Io::Flow::V0::Models::TaxReport
Attributes
email_recipients[R]
schedule[R]
timezone[R]
types[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 70324 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:schedule, :timezone], 'TaxReport') @schedule = (x = opts.delete(:schedule); x.is_a?(::Io::Flow::V0::Models::RepeatSchedule) ? x : ::Io::Flow::V0::Models::RepeatSchedule.from_json(x)) @timezone = HttpClient::Preconditions.assert_class('timezone', opts.delete(:timezone), String) @types = HttpClient::Preconditions.assert_class('types', (x = opts.delete(:types); x.nil? ? ["consumer","b2b"] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::TaxReportType) ? x : ::Io::Flow::V0::Models::TaxReportType.apply(x)) } @email_recipients = (x = opts.delete(:email_recipients); x.nil? ? nil : HttpClient::Preconditions.assert_class('email_recipients', x, Array).map { |v| HttpClient::Preconditions.assert_class('email_recipients', v, String) }) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 70337 def copy(incoming={}) TaxReport.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 70341 def to_hash { :schedule => schedule.to_hash, :timezone => timezone, :types => types.map { |o| o.value }, :email_recipients => email_recipients.nil? ? nil : email_recipients } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 70333 def to_json JSON.dump(to_hash) end