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.



61620
61621
61622
61623
61624
61625
61626
61627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61620

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.



61618
61619
61620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61618

def html
  @html
end

#pdfObject (readonly)

Returns the value of attribute pdf.



61618
61619
61620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61618

def pdf
  @pdf
end

#pngObject (readonly)

Returns the value of attribute png.



61618
61619
61620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61618

def png
  @png
end

#requiredObject (readonly)

Returns the value of attribute required.



61618
61619
61620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61618

def required
  @required
end

#zplObject (readonly)

Returns the value of attribute zpl.



61618
61619
61620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61618

def zpl
  @zpl
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



61633
61634
61635
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61633

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

#to_hashObject



61637
61638
61639
61640
61641
61642
61643
61644
61645
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61637

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

#to_jsonObject



61629
61630
61631
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61629

def to_json
  JSON.dump(to_hash)
end