Class: MistApi::AccountCradlepointConfig

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

Overview

AccountCradlepointConfig 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(cp_api_id = SKIP, cp_api_key = SKIP, ecm_api_id = SKIP, ecm_api_key = SKIP, enable_lldp = SKIP, additional_properties = nil) ⇒ AccountCradlepointConfig

Returns a new instance of AccountCradlepointConfig.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/mist_api/models/account_cradlepoint_config.rb', line 59

def initialize(cp_api_id = SKIP, cp_api_key = SKIP, ecm_api_id = SKIP,
               ecm_api_key = SKIP, enable_lldp = SKIP,
               additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @cp_api_id = cp_api_id unless cp_api_id == SKIP
  @cp_api_key = cp_api_key unless cp_api_key == SKIP
  @ecm_api_id = ecm_api_id unless ecm_api_id == SKIP
  @ecm_api_key = ecm_api_key unless ecm_api_key == SKIP
  @enable_lldp = enable_lldp unless enable_lldp == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#cp_api_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def cp_api_id
  @cp_api_id
end

#cp_api_keyString

TODO: Write general description for this method

Returns:

  • (String)


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

def cp_api_key
  @cp_api_key
end

#ecm_api_idString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/mist_api/models/account_cradlepoint_config.rb', line 22

def ecm_api_id
  @ecm_api_id
end

#ecm_api_keyString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/account_cradlepoint_config.rb', line 26

def ecm_api_key
  @ecm_api_key
end

#enable_lldpTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


30
31
32
# File 'lib/mist_api/models/account_cradlepoint_config.rb', line 30

def enable_lldp
  @enable_lldp
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/mist_api/models/account_cradlepoint_config.rb', line 74

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  cp_api_id = hash.key?('cp_api_id') ? hash['cp_api_id'] : SKIP
  cp_api_key = hash.key?('cp_api_key') ? hash['cp_api_key'] : SKIP
  ecm_api_id = hash.key?('ecm_api_id') ? hash['ecm_api_id'] : SKIP
  ecm_api_key = hash.key?('ecm_api_key') ? hash['ecm_api_key'] : SKIP
  enable_lldp = hash.key?('enable_lldp') ? hash['enable_lldp'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  AccountCradlepointConfig.new(cp_api_id,
                               cp_api_key,
                               ecm_api_id,
                               ecm_api_key,
                               enable_lldp,
                               additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/mist_api/models/account_cradlepoint_config.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cp_api_id'] = 'cp_api_id'
  @_hash['cp_api_key'] = 'cp_api_key'
  @_hash['ecm_api_id'] = 'ecm_api_id'
  @_hash['ecm_api_key'] = 'ecm_api_key'
  @_hash['enable_lldp'] = 'enable_lldp'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/mist_api/models/account_cradlepoint_config.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/mist_api/models/account_cradlepoint_config.rb', line 44

def self.optionals
  %w[
    cp_api_id
    cp_api_key
    ecm_api_id
    ecm_api_key
    enable_lldp
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



109
110
111
112
113
114
# File 'lib/mist_api/models/account_cradlepoint_config.rb', line 109

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} cp_api_id: #{@cp_api_id.inspect}, cp_api_key: #{@cp_api_key.inspect},"\
  " ecm_api_id: #{@ecm_api_id.inspect}, ecm_api_key: #{@ecm_api_key.inspect}, enable_lldp:"\
  " #{@enable_lldp.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



101
102
103
104
105
106
# File 'lib/mist_api/models/account_cradlepoint_config.rb', line 101

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cp_api_id: #{@cp_api_id}, cp_api_key: #{@cp_api_key}, ecm_api_id:"\
  " #{@ecm_api_id}, ecm_api_key: #{@ecm_api_key}, enable_lldp: #{@enable_lldp},"\
  " additional_properties: #{@additional_properties}>"
end