Class: MistApi::SnmpVacmAccessItem

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/snmp_vacm_access_item.rb

Overview

SnmpVacmAccessItem 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(group_name = SKIP, prefix_list = SKIP) ⇒ SnmpVacmAccessItem

Returns a new instance of SnmpVacmAccessItem.



41
42
43
44
# File 'lib/mist_api/models/snmp_vacm_access_item.rb', line 41

def initialize(group_name = SKIP, prefix_list = SKIP)
  @group_name = group_name unless group_name == SKIP
  @prefix_list = prefix_list unless prefix_list == SKIP
end

Instance Attribute Details

#group_nameString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/mist_api/models/snmp_vacm_access_item.rb', line 14

def group_name
  @group_name
end

#prefix_listArray[SnmpVacmAccessItemPrefixListItem]

TODO: Write general description for this method



18
19
20
# File 'lib/mist_api/models/snmp_vacm_access_item.rb', line 18

def prefix_list
  @prefix_list
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/mist_api/models/snmp_vacm_access_item.rb', line 47

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  group_name = hash.key?('group_name') ? hash['group_name'] : SKIP
  # Parameter is an array, so we need to iterate through it
  prefix_list = nil
  unless hash['prefix_list'].nil?
    prefix_list = []
    hash['prefix_list'].each do |structure|
      prefix_list << (SnmpVacmAccessItemPrefixListItem.from_hash(structure) if structure)
    end
  end

  prefix_list = SKIP unless hash.key?('prefix_list')

  # Create object from extracted values.
  SnmpVacmAccessItem.new(group_name,
                         prefix_list)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/mist_api/models/snmp_vacm_access_item.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['group_name'] = 'group_name'
  @_hash['prefix_list'] = 'prefix_list'
  @_hash
end

.nullablesObject

An array for nullable fields



37
38
39
# File 'lib/mist_api/models/snmp_vacm_access_item.rb', line 37

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
32
33
34
# File 'lib/mist_api/models/snmp_vacm_access_item.rb', line 29

def self.optionals
  %w[
    group_name
    prefix_list
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



75
76
77
78
# File 'lib/mist_api/models/snmp_vacm_access_item.rb', line 75

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} group_name: #{@group_name.inspect}, prefix_list: #{@prefix_list.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



69
70
71
72
# File 'lib/mist_api/models/snmp_vacm_access_item.rb', line 69

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} group_name: #{@group_name}, prefix_list: #{@prefix_list}>"
end