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.



37598
37599
37600
37601
37602
37603
37604
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37598

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.



37596
37597
37598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37596

def html
  @html
end

#pdfObject (readonly)

Returns the value of attribute pdf.



37596
37597
37598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37596

def pdf
  @pdf
end

#pngObject (readonly)

Returns the value of attribute png.



37596
37597
37598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37596

def png
  @png
end

#zplObject (readonly)

Returns the value of attribute zpl.



37596
37597
37598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37596

def zpl
  @zpl
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37610
37611
37612
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37610

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

#to_hashObject



37614
37615
37616
37617
37618
37619
37620
37621
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37614

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

#to_jsonObject



37606
37607
37608
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37606

def to_json
  JSON.dump(to_hash)
end