Class: NewStoreApi::ResponseBookedPackageTransaction

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/response_booked_package_transaction.rb

Overview

A Transaction here means that you will ship a single package, with using one of the following combination: outbound/outbound+return/return You can see the "booked package" as a shipment. Then there can be an outbound shipment, and a return shipment.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(outbound_package = SKIP, return_package = SKIP) ⇒ ResponseBookedPackageTransaction

Returns a new instance of ResponseBookedPackageTransaction.



47
48
49
50
# File 'lib/new_store_api/models/response_booked_package_transaction.rb', line 47

def initialize(outbound_package = SKIP, return_package = SKIP)
  @outbound_package = outbound_package unless outbound_package == SKIP
  @return_package = return_package unless return_package == SKIP
end

Instance Attribute Details

#outbound_packageResponseBookedPackage

TODO: Write general description for this method



17
18
19
# File 'lib/new_store_api/models/response_booked_package_transaction.rb', line 17

def outbound_package
  @outbound_package
end

#return_packageResponseBookedPackage

TODO: Write general description for this method



21
22
23
# File 'lib/new_store_api/models/response_booked_package_transaction.rb', line 21

def return_package
  @return_package
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/new_store_api/models/response_booked_package_transaction.rb', line 53

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  outbound_package = ResponseBookedPackage.from_hash(hash['outbound_package']) if
    hash['outbound_package']
  return_package = ResponseBookedPackage.from_hash(hash['return_package']) if
    hash['return_package']

  # Create object from extracted values.
  ResponseBookedPackageTransaction.new(outbound_package,
                                       return_package)
end

.namesObject

A mapping from model property names to API property names.



24
25
26
27
28
29
# File 'lib/new_store_api/models/response_booked_package_transaction.rb', line 24

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['outbound_package'] = 'outbound_package'
  @_hash['return_package'] = 'return_package'
  @_hash
end

.nullablesObject

An array for nullable fields



40
41
42
43
44
45
# File 'lib/new_store_api/models/response_booked_package_transaction.rb', line 40

def self.nullables
  %w[
    outbound_package
    return_package
  ]
end

.optionalsObject

An array for optional fields



32
33
34
35
36
37
# File 'lib/new_store_api/models/response_booked_package_transaction.rb', line 32

def self.optionals
  %w[
    outbound_package
    return_package
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



75
76
77
78
79
# File 'lib/new_store_api/models/response_booked_package_transaction.rb', line 75

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} outbound_package: #{@outbound_package.inspect}, return_package:"\
  " #{@return_package.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



68
69
70
71
72
# File 'lib/new_store_api/models/response_booked_package_transaction.rb', line 68

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} outbound_package: #{@outbound_package}, return_package:"\
  " #{@return_package}>"
end