Class: MistApi::IdpProfileOverwrite

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

Overview

IdpProfileOverwrite 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(action = IdpProfileActionEnum::ALERT, matching = SKIP, name = SKIP) ⇒ IdpProfileOverwrite

Returns a new instance of IdpProfileOverwrite.



56
57
58
59
60
61
# File 'lib/mist_api/models/idp_profile_overwrite.rb', line 56

def initialize(action = IdpProfileActionEnum::ALERT, matching = SKIP,
               name = SKIP)
  @action = action unless action == SKIP
  @matching = matching unless matching == SKIP
  @name = name unless name == SKIP
end

Instance Attribute Details

#actionIdpProfileActionEnum

enum:

* alert (default)
* drop: silently dropping packets
* close: notify client/server to close connection


17
18
19
# File 'lib/mist_api/models/idp_profile_overwrite.rb', line 17

def action
  @action
end

#matchingIdpProfileMatching

enum:

* alert (default)
* drop: silently dropping packets
* close: notify client/server to close connection

Returns:



24
25
26
# File 'lib/mist_api/models/idp_profile_overwrite.rb', line 24

def matching
  @matching
end

#nameString

enum:

* alert (default)
* drop: silently dropping packets
* close: notify client/server to close connection

Returns:

  • (String)


31
32
33
# File 'lib/mist_api/models/idp_profile_overwrite.rb', line 31

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/mist_api/models/idp_profile_overwrite.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  action = hash['action'] ||= IdpProfileActionEnum::ALERT
  matching = IdpProfileMatching.from_hash(hash['matching']) if hash['matching']
  name = hash.key?('name') ? hash['name'] : SKIP

  # Create object from extracted values.
  IdpProfileOverwrite.new(action,
                          matching,
                          name)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['action'] = 'action'
  @_hash['matching'] = 'matching'
  @_hash['name'] = 'name'
  @_hash
end

.nullablesObject

An array for nullable fields



52
53
54
# File 'lib/mist_api/models/idp_profile_overwrite.rb', line 52

def self.nullables
  []
end

.optionalsObject

An array for optional fields



43
44
45
46
47
48
49
# File 'lib/mist_api/models/idp_profile_overwrite.rb', line 43

def self.optionals
  %w[
    action
    matching
    name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



85
86
87
88
89
# File 'lib/mist_api/models/idp_profile_overwrite.rb', line 85

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

#to_sObject

Provides a human-readable string representation of the object.



79
80
81
82
# File 'lib/mist_api/models/idp_profile_overwrite.rb', line 79

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