Class: Io::Flow::V0::Models::ShippingLabelDocument

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ShippingLabelDocument

Returns a new instance of ShippingLabelDocument.



44758
44759
44760
44761
44762
44763
44764
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44758

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))
end

Instance Attribute Details

#htmlObject (readonly)

Returns the value of attribute html.



44756
44757
44758
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44756

def html
  @html
end

#pdfObject (readonly)

Returns the value of attribute pdf.



44756
44757
44758
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44756

def pdf
  @pdf
end

#pngObject (readonly)

Returns the value of attribute png.



44756
44757
44758
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44756

def png
  @png
end

#zplObject (readonly)

Returns the value of attribute zpl.



44756
44757
44758
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44756

def zpl
  @zpl
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



44770
44771
44772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44770

def copy(incoming={})
  ShippingLabelDocument.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



44774
44775
44776
44777
44778
44779
44780
44781
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44774

def to_hash
  {
    :zpl => zpl,
    :pdf => pdf,
    :png => png,
    :html => html
  }
end

#to_jsonObject



44766
44767
44768
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44766

def to_json
  JSON.dump(to_hash)
end