Class: NewStoreApi::RoutingInsightsFulfillmentRequests

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

Overview

Any fulfillment request identifiers for this LO uuid

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(dispatched_at = SKIP, fulfillment_node_id = SKIP, fulfillment_request_id = SKIP) ⇒ RoutingInsightsFulfillmentRequests

Returns a new instance of RoutingInsightsFulfillmentRequests.



52
53
54
55
56
57
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 52

def initialize(dispatched_at = SKIP, fulfillment_node_id = SKIP,
               fulfillment_request_id = SKIP)
  @dispatched_at = dispatched_at unless dispatched_at == SKIP
  @fulfillment_node_id = fulfillment_node_id unless fulfillment_node_id == SKIP
  @fulfillment_request_id = fulfillment_request_id unless fulfillment_request_id == SKIP
end

Instance Attribute Details

#dispatched_atDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


15
16
17
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 15

def dispatched_at
  @dispatched_at
end

#fulfillment_node_idString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 19

def fulfillment_node_id
  @fulfillment_node_id
end

#fulfillment_request_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


23
24
25
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 23

def fulfillment_request_id
  @fulfillment_request_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 60

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  dispatched_at = if hash.key?('dispatched_at')
                    (DateTimeHelper.from_rfc3339(hash['dispatched_at']) if hash['dispatched_at'])
                  else
                    SKIP
                  end
  fulfillment_node_id =
    hash.key?('fulfillment_node_id') ? hash['fulfillment_node_id'] : SKIP
  fulfillment_request_id =
    hash.key?('fulfillment_request_id') ? hash['fulfillment_request_id'] : SKIP

  # Create object from extracted values.
  RoutingInsightsFulfillmentRequests.new(dispatched_at,
                                         fulfillment_node_id,
                                         fulfillment_request_id)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['dispatched_at'] = 'dispatched_at'
  @_hash['fulfillment_node_id'] = 'fulfillment_node_id'
  @_hash['fulfillment_request_id'] = 'fulfillment_request_id'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
47
48
49
50
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 44

def self.nullables
  %w[
    dispatched_at
    fulfillment_node_id
    fulfillment_request_id
  ]
end

.optionalsObject

An array for optional fields



35
36
37
38
39
40
41
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 35

def self.optionals
  %w[
    dispatched_at
    fulfillment_node_id
    fulfillment_request_id
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



86
87
88
89
90
91
92
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 86

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



102
103
104
105
106
107
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 102

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

#to_custom_dispatched_atObject



80
81
82
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 80

def to_custom_dispatched_at
  DateTimeHelper.to_rfc3339(dispatched_at)
end

#to_sObject

Provides a human-readable string representation of the object.



95
96
97
98
99
# File 'lib/new_store_api/models/routing_insights_fulfillment_requests.rb', line 95

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