Class: NewStoreApi::ByoCrmConfigResponse

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

Overview

BYO CRM configuration settings

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(api_token = nil, enabled = false, url = nil) ⇒ ByoCrmConfigResponse

Returns a new instance of ByoCrmConfigResponse.



46
47
48
49
50
# File 'lib/new_store_api/models/byo_crm_config_response.rb', line 46

def initialize(api_token = nil, enabled = false, url = nil)
  @api_token = api_token
  @enabled = enabled
  @url = url
end

Instance Attribute Details

#api_tokenString

API token for the CRM provider

Returns:

  • (String)


14
15
16
# File 'lib/new_store_api/models/byo_crm_config_response.rb', line 14

def api_token
  @api_token
end

#enabledTrueClass | FalseClass

Whether BYO CRM is enabled for the tenant

Returns:

  • (TrueClass | FalseClass)


18
19
20
# File 'lib/new_store_api/models/byo_crm_config_response.rb', line 18

def enabled
  @enabled
end

#urlString

URL of the CRM provider

Returns:

  • (String)


22
23
24
# File 'lib/new_store_api/models/byo_crm_config_response.rb', line 22

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  api_token = hash.key?('api_token') ? hash['api_token'] : nil
  enabled = hash['enabled'] ||= false
  url = hash.key?('url') ? hash['url'] : nil

  # Create object from extracted values.
  ByoCrmConfigResponse.new(api_token,
                           enabled,
                           url)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/new_store_api/models/byo_crm_config_response.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['api_token'] = 'api_token'
  @_hash['enabled'] = 'enabled'
  @_hash['url'] = 'url'
  @_hash
end

.nullablesObject

An array for nullable fields



39
40
41
42
43
44
# File 'lib/new_store_api/models/byo_crm_config_response.rb', line 39

def self.nullables
  %w[
    api_token
    url
  ]
end

.optionalsObject

An array for optional fields



34
35
36
# File 'lib/new_store_api/models/byo_crm_config_response.rb', line 34

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



74
75
76
77
78
# File 'lib/new_store_api/models/byo_crm_config_response.rb', line 74

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

#to_sObject

Provides a human-readable string representation of the object.



68
69
70
71
# File 'lib/new_store_api/models/byo_crm_config_response.rb', line 68

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