Class: NewStoreApi::VertexFlexibleFieldConfigCreateDto

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

Overview

VertexFlexibleFieldConfigCreateDto Model.

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(extended_attribute_name = nil, target_field_id = nil, target_field_type = nil) ⇒ VertexFlexibleFieldConfigCreateDto

Returns a new instance of VertexFlexibleFieldConfigCreateDto.



55
56
57
58
59
60
# File 'lib/new_store_api/models/vertex_flexible_field_config_create_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_nameString

The name of the extended attribute.

Returns:

  • (String)


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

def extended_attribute_name
  @extended_attribute_name
end

#target_field_idInteger

Vertex flexible field identifier.

  • If target_field_type is set to flexible_code_field, maximum length is 25.
  • If target_field_type is set to flexible_numeric_field, maximum length is 10.
  • If target_field_type is set to flexible_date_field, maximum length is 5.

Returns:

  • (Integer)


24
25
26
# File 'lib/new_store_api/models/vertex_flexible_field_config_create_dto.rb', line 24

def target_field_id
  @target_field_id
end

#target_field_typeVertexTargetFieldEnum

Vertex flexible field identifier.

  • If target_field_type is set to flexible_code_field, maximum length is 25.
  • If target_field_type is set to flexible_numeric_field, maximum length is 10.
  • If target_field_type is set to flexible_date_field, maximum length is 5.


34
35
36
# File 'lib/new_store_api/models/vertex_flexible_field_config_create_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_create_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.
  VertexFlexibleFieldConfigCreateDto.new(extended_attribute_name,
                                         target_field_id,
                                         target_field_type)
end

.namesObject

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_create_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

.nullablesObject

An array for nullable fields



51
52
53
# File 'lib/new_store_api/models/vertex_flexible_field_config_create_dto.rb', line 51

def self.nullables
  []
end

.optionalsObject

An array for optional fields



46
47
48
# File 'lib/new_store_api/models/vertex_flexible_field_config_create_dto.rb', line 46

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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_sObject

Provides a human-readable string representation of the object.



81
82
83
84
85
# File 'lib/new_store_api/models/vertex_flexible_field_config_create_dto.rb', line 81

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