Class: NewStoreApi::ConfigurationResponse

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

Overview

Configurations response containing BYO CRM settings and customer feature toggles.

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(byo_crm = nil, first_and_last_name_enabled = nil, nom_consumer_profiles_merge = nil) ⇒ ConfigurationResponse

Returns a new instance of ConfigurationResponse.



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

def initialize(byo_crm = nil, first_and_last_name_enabled = nil,
               nom_consumer_profiles_merge = nil)
  @byo_crm = byo_crm
  @first_and_last_name_enabled = first_and_last_name_enabled
  @nom_consumer_profiles_merge = nom_consumer_profiles_merge
end

Instance Attribute Details

#byo_crmByoCrmConfigResponse

BYO CRM configuration settings



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

def byo_crm
  @byo_crm
end

#first_and_last_name_enabledTrueClass | FalseClass

Whether first and last name fields are enabled for the tenant.

Returns:

  • (TrueClass | FalseClass)


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

def first_and_last_name_enabled
  @first_and_last_name_enabled
end

#nom_consumer_profiles_mergeTrueClass | FalseClass

Whether consumer profile merge is enabled for the tenant.

Returns:

  • (TrueClass | FalseClass)


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

def nom_consumer_profiles_merge
  @nom_consumer_profiles_merge
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  byo_crm = ByoCrmConfigResponse.from_hash(hash['byo_crm']) if hash['byo_crm']
  first_and_last_name_enabled =
    hash.key?('first_and_last_name_enabled') ? hash['first_and_last_name_enabled'] : nil
  nom_consumer_profiles_merge =
    hash.key?('nom_consumer_profiles_merge') ? hash['nom_consumer_profiles_merge'] : nil

  # Create object from extracted values.
  ConfigurationResponse.new(byo_crm,
                            first_and_last_name_enabled,
                            nom_consumer_profiles_merge)
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/configuration_response.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['byo_crm'] = 'byo_crm'
  @_hash['first_and_last_name_enabled'] = 'first_and_last_name_enabled'
  @_hash['nom_consumer_profiles_merge'] = 'nom_consumer_profiles_merge'
  @_hash
end

.nullablesObject

An array for nullable fields



40
41
42
# File 'lib/new_store_api/models/configuration_response.rb', line 40

def self.nullables
  []
end

.optionalsObject

An array for optional fields



35
36
37
# File 'lib/new_store_api/models/configuration_response.rb', line 35

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



77
78
79
80
81
82
# File 'lib/new_store_api/models/configuration_response.rb', line 77

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

#to_sObject

Provides a human-readable string representation of the object.



69
70
71
72
73
74
# File 'lib/new_store_api/models/configuration_response.rb', line 69

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