Class: ApiReference::AccountingSyncConfiguration
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::AccountingSyncConfiguration
- Defined in:
- lib/api_reference/models/accounting_sync_configuration.rb
Overview
AccountingSyncConfiguration Model.
Instance Attribute Summary collapse
-
#accounting_providers ⇒ Array[AccountingProvider]
TODO: Write general description for this method.
-
#excluded ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(excluded:, accounting_providers:, additional_properties: nil) ⇒ AccountingSyncConfiguration
constructor
A new instance of AccountingSyncConfiguration.
-
#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(excluded:, accounting_providers:, additional_properties: nil) ⇒ AccountingSyncConfiguration
Returns a new instance of AccountingSyncConfiguration.
38 39 40 41 42 43 44 45 |
# File 'lib/api_reference/models/accounting_sync_configuration.rb', line 38 def initialize(excluded:, accounting_providers:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @excluded = excluded @accounting_providers = accounting_providers @additional_properties = additional_properties end |
Instance Attribute Details
#accounting_providers ⇒ Array[AccountingProvider]
TODO: Write general description for this method
18 19 20 |
# File 'lib/api_reference/models/accounting_sync_configuration.rb', line 18 def accounting_providers @accounting_providers end |
#excluded ⇒ TrueClass | FalseClass
TODO: Write general description for this method
14 15 16 |
# File 'lib/api_reference/models/accounting_sync_configuration.rb', line 14 def excluded @excluded end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/api_reference/models/accounting_sync_configuration.rb', line 48 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. excluded = hash.key?('excluded') ? hash['excluded'] : nil # Parameter is an array, so we need to iterate through it accounting_providers = nil unless hash['accounting_providers'].nil? accounting_providers = [] hash['accounting_providers'].each do |structure| accounting_providers << (AccountingProvider.from_hash(structure) if structure) end end accounting_providers = nil unless hash.key?('accounting_providers') # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. AccountingSyncConfiguration.new(excluded: excluded, accounting_providers: accounting_providers, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/api_reference/models/accounting_sync_configuration.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['excluded'] = 'excluded' @_hash['accounting_providers'] = 'accounting_providers' @_hash end |
.nullables ⇒ Object
An array for nullable fields
34 35 36 |
# File 'lib/api_reference/models/accounting_sync_configuration.rb', line 34 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 |
# File 'lib/api_reference/models/accounting_sync_configuration.rb', line 29 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/api_reference/models/accounting_sync_configuration.rb', line 79 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.excluded, ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value.accounting_providers, ->(val) { AccountingProvider.validate(val) }, is_model_hash: true, is_inner_model_hash: true) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['excluded'], ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value['accounting_providers'], ->(val) { AccountingProvider.validate(val) }, is_model_hash: true, is_inner_model_hash: true) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
111 112 113 114 115 |
# File 'lib/api_reference/models/accounting_sync_configuration.rb', line 111 def inspect class_name = self.class.name.split('::').last "<#{class_name} excluded: #{@excluded.inspect}, accounting_providers:"\ " #{@accounting_providers.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
104 105 106 107 108 |
# File 'lib/api_reference/models/accounting_sync_configuration.rb', line 104 def to_s class_name = self.class.name.split('::').last "<#{class_name} excluded: #{@excluded}, accounting_providers: #{@accounting_providers},"\ " additional_properties: #{@additional_properties}>" end |