Class: NewStoreApi::ConfigurationRequest

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

Overview

Configurations request for updating 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 = SKIP, first_and_last_name_enabled = SKIP, nom_consumer_profiles_merge = SKIP) ⇒ ConfigurationRequest

Returns a new instance of ConfigurationRequest.



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/new_store_api/models/configuration_request.rb', line 48

def initialize(byo_crm = SKIP, first_and_last_name_enabled = SKIP,
               nom_consumer_profiles_merge = SKIP)
  @byo_crm = byo_crm unless byo_crm == SKIP
  unless first_and_last_name_enabled == SKIP
    @first_and_last_name_enabled =
      first_and_last_name_enabled
  end
  unless nom_consumer_profiles_merge == SKIP
    @nom_consumer_profiles_merge =
      nom_consumer_profiles_merge
  end
end

Instance Attribute Details

#byo_crmByoCrmConfigRequest

BYO CRM configuration settings

Returns:



15
16
17
# File 'lib/new_store_api/models/configuration_request.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_request.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_request.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.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  byo_crm = ByoCrmConfigRequest.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'] : SKIP
  nom_consumer_profiles_merge =
    hash.key?('nom_consumer_profiles_merge') ? hash['nom_consumer_profiles_merge'] : SKIP

  # Create object from extracted values.
  ConfigurationRequest.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_request.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



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    byo_crm
    first_and_last_name_enabled
    nom_consumer_profiles_merge
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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.



79
80
81
82
83
84
# File 'lib/new_store_api/models/configuration_request.rb', line 79

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