Class: MistApi::ServicePolicySecintel

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

Overview

SRX only

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(enabled = false, profile = ServicePolicySecintelProfileEnum::DEFAULT, secintelprofile_id = SKIP) ⇒ ServicePolicySecintel

Returns a new instance of ServicePolicySecintel.



48
49
50
51
52
53
54
# File 'lib/mist_api/models/service_policy_secintel.rb', line 48

def initialize(enabled = false,
               profile = ServicePolicySecintelProfileEnum::DEFAULT,
               secintelprofile_id = SKIP)
  @enabled = enabled unless enabled == SKIP
  @profile = profile unless profile == SKIP
  @secintelprofile_id = secintelprofile_id unless secintelprofile_id == SKIP
end

Instance Attribute Details

#enabledTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def enabled
  @enabled
end

#profileServicePolicySecintelProfileEnum

enum: ‘default`, `standard`, `strict`



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

def profile
  @profile
end

#secintelprofile_idString

org-level secintel Profile can be used, this takes precedence over ‘profile’

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/service_policy_secintel.rb', line 23

def secintelprofile_id
  @secintelprofile_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  enabled = hash['enabled'] ||= false
  profile = hash['profile'] ||= ServicePolicySecintelProfileEnum::DEFAULT
  secintelprofile_id =
    hash.key?('secintelprofile_id') ? hash['secintelprofile_id'] : SKIP

  # Create object from extracted values.
  ServicePolicySecintel.new(enabled,
                            profile,
                            secintelprofile_id)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/mist_api/models/service_policy_secintel.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['enabled'] = 'enabled'
  @_hash['profile'] = 'profile'
  @_hash['secintelprofile_id'] = 'secintelprofile_id'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
# File 'lib/mist_api/models/service_policy_secintel.rb', line 44

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    enabled
    profile
    secintelprofile_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



80
81
82
83
84
# File 'lib/mist_api/models/service_policy_secintel.rb', line 80

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

#to_sObject

Provides a human-readable string representation of the object.



73
74
75
76
77
# File 'lib/mist_api/models/service_policy_secintel.rb', line 73

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} enabled: #{@enabled}, profile: #{@profile}, secintelprofile_id:"\
  " #{@secintelprofile_id}>"
end