Class: Raas::ResendOrderResponseModel

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/raas/models/resend_order_response_model.rb

Overview

Represents the response returned from a resend order request

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(created_at = nil, id = nil) ⇒ ResendOrderResponseModel

Returns a new instance of ResendOrderResponseModel.



24
25
26
27
28
# File 'lib/raas/models/resend_order_response_model.rb', line 24

def initialize(created_at = nil,
               id = nil)
  @created_at = created_at
  @id = id
end

Instance Attribute Details

#created_atDateTime

When the resend request was created

Returns:

  • (DateTime)


10
11
12
# File 'lib/raas/models/resend_order_response_model.rb', line 10

def created_at
  @created_at
end

#idInteger

The order resend id

Returns:

  • (Integer)


14
15
16
# File 'lib/raas/models/resend_order_response_model.rb', line 14

def id
  @id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/raas/models/resend_order_response_model.rb', line 31

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  created_at = APIHelper.rfc3339(hash['createdAt']) if hash['createdAt']
  id = hash['id']

  # Create object from extracted values.
  ResendOrderResponseModel.new(created_at,
                               id)
end

.namesObject

A mapping from model property names to API property names.



17
18
19
20
21
22
# File 'lib/raas/models/resend_order_response_model.rb', line 17

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['created_at'] = 'createdAt'
  @_hash['id'] = 'id'
  @_hash
end