Class: NewStoreApi::ByoCrmConfigRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::ByoCrmConfigRequest
- Defined in:
- lib/new_store_api/models/byo_crm_config_request.rb
Overview
BYO CRM configuration settings
Instance Attribute Summary collapse
-
#api_token ⇒ String
API token for the CRM provider, set to empty string
""to clear the value. -
#enabled ⇒ TrueClass | FalseClass
Whether BYO CRM is enabled for the tenant.
-
#url ⇒ String
URL of the CRM provider, set to empty string
""to clear the value.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(api_token = SKIP, enabled = false, url = SKIP) ⇒ ByoCrmConfigRequest
constructor
A new instance of ByoCrmConfigRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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 = SKIP, enabled = false, url = SKIP) ⇒ ByoCrmConfigRequest
Returns a new instance of ByoCrmConfigRequest.
51 52 53 54 55 |
# File 'lib/new_store_api/models/byo_crm_config_request.rb', line 51 def initialize(api_token = SKIP, enabled = false, url = SKIP) @api_token = api_token unless api_token == SKIP @enabled = enabled unless enabled == SKIP @url = url unless url == SKIP end |
Instance Attribute Details
#api_token ⇒ String
API token for the CRM provider, set to empty string "" to clear the
value
15 16 17 |
# File 'lib/new_store_api/models/byo_crm_config_request.rb', line 15 def api_token @api_token end |
#enabled ⇒ TrueClass | FalseClass
Whether BYO CRM is enabled for the tenant
19 20 21 |
# File 'lib/new_store_api/models/byo_crm_config_request.rb', line 19 def enabled @enabled end |
#url ⇒ String
URL of the CRM provider, set to empty string "" to clear the value
23 24 25 |
# File 'lib/new_store_api/models/byo_crm_config_request.rb', line 23 def url @url end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/new_store_api/models/byo_crm_config_request.rb', line 58 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. api_token = hash.key?('api_token') ? hash['api_token'] : SKIP enabled = hash['enabled'] ||= false url = hash.key?('url') ? hash['url'] : SKIP # Create object from extracted values. ByoCrmConfigRequest.new(api_token, enabled, url) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/new_store_api/models/byo_crm_config_request.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['api_token'] = 'api_token' @_hash['enabled'] = 'enabled' @_hash['url'] = 'url' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 47 48 49 |
# File 'lib/new_store_api/models/byo_crm_config_request.rb', line 44 def self.nullables %w[ api_token url ] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 41 |
# File 'lib/new_store_api/models/byo_crm_config_request.rb', line 35 def self.optionals %w[ api_token enabled url ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
79 80 81 82 83 |
# File 'lib/new_store_api/models/byo_crm_config_request.rb', line 79 def inspect class_name = self.class.name.split('::').last "<#{class_name} api_token: #{@api_token.inspect}, enabled: #{@enabled.inspect}, url:"\ " #{@url.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
73 74 75 76 |
# File 'lib/new_store_api/models/byo_crm_config_request.rb', line 73 def to_s class_name = self.class.name.split('::').last "<#{class_name} api_token: #{@api_token}, enabled: #{@enabled}, url: #{@url}>" end |