Class: NewStoreApi::OrderInjectionConfigurationResponse

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

Overview

Update configuration response

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(updated_at = SKIP, updated_by = SKIP, value = SKIP, version = SKIP) ⇒ OrderInjectionConfigurationResponse

Returns a new instance of OrderInjectionConfigurationResponse.



54
55
56
57
58
59
60
# File 'lib/new_store_api/models/order_injection_configuration_response.rb', line 54

def initialize(updated_at = SKIP, updated_by = SKIP, value = SKIP,
               version = SKIP)
  @updated_at = updated_at unless updated_at == SKIP
  @updated_by = updated_by unless updated_by == SKIP
  @value = value unless value == SKIP
  @version = version unless version == SKIP
end

Instance Attribute Details

#updated_atDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


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

def updated_at
  @updated_at
end

#updated_byString

Internal User ID

Returns:

  • (String)


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

def updated_by
  @updated_by
end

#valueOrderInjectionTenantConfiguration

Tenant configuration object.



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

def value
  @value
end

#versionString

Current Configuration version

Returns:

  • (String)


27
28
29
# File 'lib/new_store_api/models/order_injection_configuration_response.rb', line 27

def version
  @version
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/new_store_api/models/order_injection_configuration_response.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  updated_at = if hash.key?('updated_at')
                 (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
               else
                 SKIP
               end
  updated_by = hash.key?('updated_by') ? hash['updated_by'] : SKIP
  value = OrderInjectionTenantConfiguration.from_hash(hash['value']) if hash['value']
  version = hash.key?('version') ? hash['version'] : SKIP

  # Create object from extracted values.
  OrderInjectionConfigurationResponse.new(updated_at,
                                          updated_by,
                                          value,
                                          version)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['updated_at'] = 'updated_at'
  @_hash['updated_by'] = 'updated_by'
  @_hash['value'] = 'value'
  @_hash['version'] = 'version'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/new_store_api/models/order_injection_configuration_response.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    updated_at
    updated_by
    value
    version
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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

#to_custom_updated_atObject



83
84
85
# File 'lib/new_store_api/models/order_injection_configuration_response.rb', line 83

def to_custom_updated_at
  DateTimeHelper.to_rfc3339(updated_at)
end

#to_sObject

Provides a human-readable string representation of the object.



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

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