Class: NewStoreApi::VertexFlexibleFieldConfigUpdateDto

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

Overview

VertexFlexibleFieldConfigUpdateDto 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 = SKIP, target_field_id = SKIP, target_field_type = SKIP) ⇒ VertexFlexibleFieldConfigUpdateDto

Returns a new instance of VertexFlexibleFieldConfigUpdateDto.



59
60
61
62
63
64
# File 'lib/new_store_api/models/vertex_flexible_field_config_update_dto.rb', line 59

def initialize(extended_attribute_name = SKIP, target_field_id = SKIP,
               target_field_type = SKIP)
  @extended_attribute_name = extended_attribute_name unless extended_attribute_name == SKIP
  @target_field_id = target_field_id unless target_field_id == SKIP
  @target_field_type = target_field_type unless target_field_type == SKIP
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_update_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_update_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_update_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.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/new_store_api/models/vertex_flexible_field_config_update_dto.rb', line 67

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'] : SKIP
  target_field_id =
    hash.key?('target_field_id') ? hash['target_field_id'] : SKIP
  target_field_type =
    hash.key?('target_field_type') ? hash['target_field_type'] : SKIP

  # Create object from extracted values.
  VertexFlexibleFieldConfigUpdateDto.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_update_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



55
56
57
# File 'lib/new_store_api/models/vertex_flexible_field_config_update_dto.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    extended_attribute_name
    target_field_id
    target_field_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



92
93
94
95
96
97
# File 'lib/new_store_api/models/vertex_flexible_field_config_update_dto.rb', line 92

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.



85
86
87
88
89
# File 'lib/new_store_api/models/vertex_flexible_field_config_update_dto.rb', line 85

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