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.



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

#htmlObject (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

#pdfObject (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_dataObject (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

#pngObject (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

#requiredObject (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

#zplObject (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_urlObject (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_hashObject



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_jsonObject



66503
66504
66505
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66503

def to_json
  JSON.dump(to_hash)
end