Class: NewStoreApi::CapacityBasedRoutingSettings

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

Overview

CapacityBasedRoutingSettings Model.

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(value = nil, updated_at = SKIP) ⇒ CapacityBasedRoutingSettings

Returns a new instance of CapacityBasedRoutingSettings.



44
45
46
47
# File 'lib/new_store_api/models/capacity_based_routing_settings.rb', line 44

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

Instance Attribute Details

#updated_atDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


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

def updated_at
  @updated_at
end

#valueTrueClass | FalseClass

Tenant-based release toggle for the feature of capacity-based routing.

Returns:

  • (TrueClass | FalseClass)


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

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/new_store_api/models/capacity_based_routing_settings.rb', line 50

def self.from_hash(hash)
  return nil unless hash

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

  # Create object from extracted values.
  CapacityBasedRoutingSettings.new(value,
                                   updated_at)
end

.namesObject

A mapping from model property names to API property names.



22
23
24
25
26
27
# File 'lib/new_store_api/models/capacity_based_routing_settings.rb', line 22

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

.nullablesObject

An array for nullable fields



37
38
39
40
41
42
# File 'lib/new_store_api/models/capacity_based_routing_settings.rb', line 37

def self.nullables
  %w[
    updated_at
    value
  ]
end

.optionalsObject

An array for optional fields



30
31
32
33
34
# File 'lib/new_store_api/models/capacity_based_routing_settings.rb', line 30

def self.optionals
  %w[
    updated_at
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



77
78
79
80
# File 'lib/new_store_api/models/capacity_based_routing_settings.rb', line 77

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

#to_custom_updated_atObject



66
67
68
# File 'lib/new_store_api/models/capacity_based_routing_settings.rb', line 66

def to_custom_updated_at
  DateTimeHelper.to_rfc3339(updated_at)
end

#to_sObject

Provides a human-readable string representation of the object.



71
72
73
74
# File 'lib/new_store_api/models/capacity_based_routing_settings.rb', line 71

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