Class: NewStoreApi::VertexFlexibleFieldConfigDto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::VertexFlexibleFieldConfigDto
- Defined in:
- lib/new_store_api/models/vertex_flexible_field_config_dto.rb
Overview
VertexFlexibleFieldConfigDto Model.
Instance Attribute Summary collapse
-
#extended_attribute_name ⇒ String
The name of the extended attribute.
-
#target_field_id ⇒ Integer
Vertex flexible field identifier.
-
#target_field_type ⇒ VertexTargetFieldEnum
Vertex flexible field identifier.
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(extended_attribute_name = nil, target_field_id = nil, target_field_type = nil) ⇒ VertexFlexibleFieldConfigDto
constructor
A new instance of VertexFlexibleFieldConfigDto.
-
#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(extended_attribute_name = nil, target_field_id = nil, target_field_type = nil) ⇒ VertexFlexibleFieldConfigDto
Returns a new instance of VertexFlexibleFieldConfigDto.
55 56 57 58 59 60 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 55 def initialize(extended_attribute_name = nil, target_field_id = nil, target_field_type = nil) @extended_attribute_name = extended_attribute_name @target_field_id = target_field_id @target_field_type = target_field_type end |
Instance Attribute Details
#extended_attribute_name ⇒ String
The name of the extended attribute.
14 15 16 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 14 def extended_attribute_name @extended_attribute_name end |
#target_field_id ⇒ Integer
Vertex flexible field identifier.
- If
target_field_typeis set toflexible_code_field, maximum length is 25. - If
target_field_typeis set toflexible_numeric_field, maximum length is 10. - If
target_field_typeis set toflexible_date_field, maximum length is 5.
24 25 26 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 24 def target_field_id @target_field_id end |
#target_field_type ⇒ VertexTargetFieldEnum
Vertex flexible field identifier.
- If
target_field_typeis set toflexible_code_field, maximum length is 25. - If
target_field_typeis set toflexible_numeric_field, maximum length is 10. - If
target_field_typeis set toflexible_date_field, maximum length is 5.
34 35 36 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 34 def target_field_type @target_field_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. extended_attribute_name = hash.key?('extended_attribute_name') ? hash['extended_attribute_name'] : nil target_field_id = hash.key?('target_field_id') ? hash['target_field_id'] : nil target_field_type = hash.key?('target_field_type') ? hash['target_field_type'] : nil # Create object from extracted values. VertexFlexibleFieldConfigDto.new(extended_attribute_name, target_field_id, target_field_type) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['extended_attribute_name'] = 'extended_attribute_name' @_hash['target_field_id'] = 'target_field_id' @_hash['target_field_type'] = 'target_field_type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
51 52 53 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 51 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 46 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 82 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.extended_attribute_name, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.target_field_id, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.target_field_type, ->(val) { VertexTargetFieldEnum.validate(val) }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['extended_attribute_name'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['target_field_id'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['target_field_type'], ->(val) { VertexTargetFieldEnum.validate(val) }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} extended_attribute_name: #{@extended_attribute_name.inspect},"\ " target_field_id: #{@target_field_id.inspect}, target_field_type:"\ " #{@target_field_type.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
107 108 109 110 111 |
# File 'lib/new_store_api/models/vertex_flexible_field_config_dto.rb', line 107 def to_s class_name = self.class.name.split('::').last "<#{class_name} extended_attribute_name: #{@extended_attribute_name}, target_field_id:"\ " #{@target_field_id}, target_field_type: #{@target_field_type}>" end |