Class: Io::Flow::V0::Models::ShippingLabelDocument
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShippingLabelDocument
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Output data or downloadable links for shipping label documents such as labels or commercial invoices
Instance Attribute Summary collapse
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#pdf ⇒ Object
readonly
Returns the value of attribute pdf.
-
#png ⇒ Object
readonly
Returns the value of attribute png.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#zpl ⇒ Object
readonly
Returns the value of attribute zpl.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShippingLabelDocument
constructor
A new instance of ShippingLabelDocument.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShippingLabelDocument
Returns a new instance of ShippingLabelDocument.
48508 48509 48510 48511 48512 48513 48514 48515 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48508 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @zpl = (x = opts.delete(:zpl); x.nil? ? nil : HttpClient::Preconditions.assert_class('zpl', x, String)) @pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String)) @png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String)) @html = (x = opts.delete(:html); x.nil? ? nil : HttpClient::Preconditions.assert_class('html', x, String)) @required = HttpClient::Preconditions.assert_boolean('required', (x = opts.delete(:required); x.nil? ? true : x)) end |
Instance Attribute Details
#html ⇒ Object (readonly)
Returns the value of attribute html.
48506 48507 48508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48506 def html @html end |
#pdf ⇒ Object (readonly)
Returns the value of attribute pdf.
48506 48507 48508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48506 def pdf @pdf end |
#png ⇒ Object (readonly)
Returns the value of attribute png.
48506 48507 48508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48506 def png @png end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
48506 48507 48508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48506 def required @required end |
#zpl ⇒ Object (readonly)
Returns the value of attribute zpl.
48506 48507 48508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48506 def zpl @zpl end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
48521 48522 48523 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48521 def copy(incoming={}) ShippingLabelDocument.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
48525 48526 48527 48528 48529 48530 48531 48532 48533 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48525 def to_hash { :zpl => zpl, :pdf => pdf, :png => png, :html => html, :required => required } end |
#to_json ⇒ Object
48517 48518 48519 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48517 def to_json JSON.dump(to_hash) end |