Class: Verizon::ConfigurationListItem
- Defined in:
- lib/verizon/models/configuration_list_item.rb
Overview
The ConfigurationList’s item that contains the configuration identifier, name, description and the active flag.
Instance Attribute Summary collapse
-
#description ⇒ String
Description of the configuration.
-
#id ⇒ String
The generated ID (UUID v4) for the configuration.
-
#is_active ⇒ TrueClass | FalseClass
Description of the configuration.
-
#name ⇒ String
Name of the configuration.
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(id:, is_active:, name: SKIP, description: SKIP) ⇒ ConfigurationListItem
constructor
A new instance of ConfigurationListItem.
-
#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(id:, is_active:, name: SKIP, description: SKIP) ⇒ ConfigurationListItem
Returns a new instance of ConfigurationListItem.
53 54 55 56 57 58 |
# File 'lib/verizon/models/configuration_list_item.rb', line 53 def initialize(id:, is_active:, name: SKIP, description: SKIP) @id = id @name = name unless name == SKIP @description = description unless description == SKIP @is_active = is_active end |
Instance Attribute Details
#description ⇒ String
Description of the configuration.
24 25 26 |
# File 'lib/verizon/models/configuration_list_item.rb', line 24 def description @description end |
#id ⇒ String
The generated ID (UUID v4) for the configuration. It has to be used when asking for changing any of the configuration parameters.
16 17 18 |
# File 'lib/verizon/models/configuration_list_item.rb', line 16 def id @id end |
#is_active ⇒ TrueClass | FalseClass
Description of the configuration.
28 29 30 |
# File 'lib/verizon/models/configuration_list_item.rb', line 28 def is_active @is_active end |
#name ⇒ String
Name of the configuration.
20 21 22 |
# File 'lib/verizon/models/configuration_list_item.rb', line 20 def name @name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/verizon/models/configuration_list_item.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil is_active = hash.key?('isActive') ? hash['isActive'] : nil name = hash.key?('name') ? hash['name'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP # Create object from extracted values. ConfigurationListItem.new(id: id, is_active: is_active, name: name, description: description) end |
.names ⇒ Object
A mapping from model property names to API property names.
31 32 33 34 35 36 37 38 |
# File 'lib/verizon/models/configuration_list_item.rb', line 31 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['name'] = 'name' @_hash['description'] = 'description' @_hash['is_active'] = 'isActive' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/verizon/models/configuration_list_item.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 46 |
# File 'lib/verizon/models/configuration_list_item.rb', line 41 def self.optionals %w[ name description ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
85 86 87 88 89 |
# File 'lib/verizon/models/configuration_list_item.rb', line 85 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, description:"\ " #{@description.inspect}, is_active: #{@is_active.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
78 79 80 81 82 |
# File 'lib/verizon/models/configuration_list_item.rb', line 78 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, name: #{@name}, description: #{@description}, is_active:"\ " #{@is_active}>" end |