Class: Io::Flow::V0::Models::TaxReport
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TaxReport
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#email_recipients ⇒ Object
readonly
Returns the value of attribute email_recipients.
-
#schedule ⇒ Object
readonly
Returns the value of attribute schedule.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TaxReport
constructor
A new instance of TaxReport.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ TaxReport
Returns a new instance of TaxReport.
70324 70325 70326 70327 70328 70329 70330 70331 |
# 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 |
Instance Attribute Details
#email_recipients ⇒ Object (readonly)
Returns the value of attribute email_recipients.
70322 70323 70324 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70322 def email_recipients @email_recipients end |
#schedule ⇒ Object (readonly)
Returns the value of attribute schedule.
70322 70323 70324 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70322 def schedule @schedule end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
70322 70323 70324 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70322 def timezone @timezone end |
#types ⇒ Object (readonly)
Returns the value of attribute types.
70322 70323 70324 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70322 def types @types end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
70337 70338 70339 |
# 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 ⇒ Object
70341 70342 70343 70344 70345 70346 70347 70348 |
# 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 ⇒ Object
70333 70334 70335 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70333 def to_json JSON.dump(to_hash) end |