Class: Io::Flow::V0::Models::BridgeManifest

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Represents closeout of a group of labels that have been transferred to the carrier for shipping

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ BridgeManifest

Returns a new instance of BridgeManifest.



32448
32449
32450
32451
32452
32453
32454
32455
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32448

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :service, :pdf, :data], 'BridgeManifest')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
  @pdf = HttpClient::Preconditions.assert_class('pdf', opts.delete(:pdf), String)
  @data = HttpClient::Preconditions.assert_class('data', opts.delete(:data), String)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



32446
32447
32448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32446

def data
  @data
end

#idObject (readonly)

Returns the value of attribute id.



32446
32447
32448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32446

def id
  @id
end

#pdfObject (readonly)

Returns the value of attribute pdf.



32446
32447
32448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32446

def pdf
  @pdf
end

#serviceObject (readonly)

Returns the value of attribute service.



32446
32447
32448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32446

def service
  @service
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32461
32462
32463
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32461

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

#to_hashObject



32465
32466
32467
32468
32469
32470
32471
32472
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32465

def to_hash
  {
    :id => id,
    :service => service.to_hash,
    :pdf => pdf,
    :data => data
  }
end

#to_jsonObject



32457
32458
32459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32457

def to_json
  JSON.dump(to_hash)
end