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.
-
#pdf_data ⇒ Object
readonly
Returns the value of attribute pdf_data.
-
#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.
-
#zpl_url ⇒ Object
readonly
Returns the value of attribute zpl_url.
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.
66492 66493 66494 66495 66496 66497 66498 66499 66500 66501 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66492 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @zpl = (x = opts.delete(:zpl); x.nil? ? nil : HttpClient::Preconditions.assert_class('zpl', x, String)) @zpl_url = (x = opts.delete(:zpl_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('zpl_url', x, String)) @pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String)) @pdf_data = (x = opts.delete(:pdf_data); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf_data', 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.
66490 66491 66492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66490 def html @html end |
#pdf ⇒ Object (readonly)
Returns the value of attribute pdf.
66490 66491 66492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66490 def pdf @pdf end |
#pdf_data ⇒ Object (readonly)
Returns the value of attribute pdf_data.
66490 66491 66492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66490 def pdf_data @pdf_data end |
#png ⇒ Object (readonly)
Returns the value of attribute png.
66490 66491 66492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66490 def png @png end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
66490 66491 66492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66490 def required @required end |
#zpl ⇒ Object (readonly)
Returns the value of attribute zpl.
66490 66491 66492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66490 def zpl @zpl end |
#zpl_url ⇒ Object (readonly)
Returns the value of attribute zpl_url.
66490 66491 66492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66490 def zpl_url @zpl_url end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
66507 66508 66509 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66507 def copy(incoming={}) ShippingLabelDocument.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
66511 66512 66513 66514 66515 66516 66517 66518 66519 66520 66521 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66511 def to_hash { :zpl => zpl, :zpl_url => zpl_url, :pdf => pdf, :pdf_data => pdf_data, :png => png, :html => html, :required => required } end |
#to_json ⇒ Object
66503 66504 66505 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66503 def to_json JSON.dump(to_hash) end |