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.



50706
50707
50708
50709
50710
50711
50712
50713
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50706

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

#htmlObject (readonly)

Returns the value of attribute html.



50704
50705
50706
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50704

def html
  @html
end

#pdfObject (readonly)

Returns the value of attribute pdf.



50704
50705
50706
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50704

def pdf
  @pdf
end

#pngObject (readonly)

Returns the value of attribute png.



50704
50705
50706
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50704

def png
  @png
end

#requiredObject (readonly)

Returns the value of attribute required.



50704
50705
50706
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50704

def required
  @required
end

#zplObject (readonly)

Returns the value of attribute zpl.



50704
50705
50706
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50704

def zpl
  @zpl
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50719
50720
50721
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50719

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

#to_hashObject



50723
50724
50725
50726
50727
50728
50729
50730
50731
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50723

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

#to_jsonObject



50715
50716
50717
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50715

def to_json
  JSON.dump(to_hash)
end