Class: OCI::Waf::Models::ProtectionCapabilitySummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/waf/models/protection_capability_summary.rb

Overview

A summary of available OCI-managed protection capabilities in WebAppFirewallPolicy. Protection capabilies checks HTTP requests/responses if they are malicious.

Constant Summary collapse

TYPE_ENUM =
[
  TYPE_REQUEST_PROTECTION_CAPABILITY = 'REQUEST_PROTECTION_CAPABILITY'.freeze,
  TYPE_RESPONSE_PROTECTION_CAPABILITY = 'RESPONSE_PROTECTION_CAPABILITY'.freeze,
  TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ProtectionCapabilitySummary

Initializes the object

Options Hash (attributes):



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 124

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.key = attributes[:'key'] if attributes[:'key']

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')

  self.display_name = attributes[:'display_name'] if attributes[:'display_name']

  self.description = attributes[:'description'] if attributes[:'description']

  self.version = attributes[:'version'] if attributes[:'version']

  self.is_latest_version = attributes[:'isLatestVersion'] unless attributes[:'isLatestVersion'].nil?

  raise 'You cannot provide both :isLatestVersion and :is_latest_version' if attributes.key?(:'isLatestVersion') && attributes.key?(:'is_latest_version')

  self.is_latest_version = attributes[:'is_latest_version'] unless attributes[:'is_latest_version'].nil?

  self.group_tags = attributes[:'groupTags'] if attributes[:'groupTags']

  raise 'You cannot provide both :groupTags and :group_tags' if attributes.key?(:'groupTags') && attributes.key?(:'group_tags')

  self.group_tags = attributes[:'group_tags'] if attributes[:'group_tags']

  self.type = attributes[:'type'] if attributes[:'type']

  self.collaborative_action_threshold = attributes[:'collaborativeActionThreshold'] if attributes[:'collaborativeActionThreshold']

  raise 'You cannot provide both :collaborativeActionThreshold and :collaborative_action_threshold' if attributes.key?(:'collaborativeActionThreshold') && attributes.key?(:'collaborative_action_threshold')

  self.collaborative_action_threshold = attributes[:'collaborative_action_threshold'] if attributes[:'collaborative_action_threshold']

  self.collaborative_weights = attributes[:'collaborativeWeights'] if attributes[:'collaborativeWeights']

  raise 'You cannot provide both :collaborativeWeights and :collaborative_weights' if attributes.key?(:'collaborativeWeights') && attributes.key?(:'collaborative_weights')

  self.collaborative_weights = attributes[:'collaborative_weights'] if attributes[:'collaborative_weights']
end

Instance Attribute Details

#collaborative_action_thresholdInteger

The default collaborative action threshold for OCI-managed collaborative protection capability. Collaborative protection capabilities are made of several simple, non-collaborative protection capabilities (referred to as ‘contributing capabilities` later on) which have weights assigned to them. These weights can be found in the collaborativeWeights array. For incoming/outgoing HTTP messages, all contributing capabilities are executed and the sum of all triggered contributing capabilities weights is calculated. Only if this sum is greater than or equal to collaborativeActionThreshold is the incoming/outgoing HTTP message marked as malicious.

This field is ignored for non-collaborative capabilities.



65
66
67
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 65

def collaborative_action_threshold
  @collaborative_action_threshold
end

#collaborative_weightsArray<OCI::Waf::Models::CollaborativeCapabilityWeight>

The weights of contributing capabilities. Defines how much each contributing capability contributes towards the action threshold of a collaborative protection capability.

This field is ignored for non-collaborative capabilities.



73
74
75
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 73

def collaborative_weights
  @collaborative_weights
end

#descriptionString

[Required] The description of protection capability.



29
30
31
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 29

def description
  @description
end

#display_nameString

[Required] The display name of protection capability.



25
26
27
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 25

def display_name
  @display_name
end

#group_tagsArray<String>

The list of unique names protection capability group tags that are associated with this capability. Example: ["PCI", "Recommended"]



43
44
45
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 43

def group_tags
  @group_tags
end

#is_latest_versionBOOLEAN

[Required] The field that shows if this is the latest version of protection capability.



37
38
39
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 37

def is_latest_version
  @is_latest_version
end

#keyString

[Required] Unique key of protection capability.



21
22
23
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 21

def key
  @key
end

#typeString

[Required] The type of protection capability.

  • REQUEST_PROTECTION_CAPABILITY can only be used in requestProtection module of WebAppFirewallPolicy.

  • RESPONSE_PROTECTION_CAPABILITY can only be used in responseProtection module of WebAppFirewallPolicy.



52
53
54
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 52

def type
  @type
end

#versionInteger

[Required] The version of protection capability.



33
34
35
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 33

def version
  @version
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 76

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'display_name': :'displayName',
    'description': :'description',
    'version': :'version',
    'is_latest_version': :'isLatestVersion',
    'group_tags': :'groupTags',
    'type': :'type',
    'collaborative_action_threshold': :'collaborativeActionThreshold',
    'collaborative_weights': :'collaborativeWeights'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 93

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'display_name': :'String',
    'description': :'String',
    'version': :'Integer',
    'is_latest_version': :'BOOLEAN',
    'group_tags': :'Array<String>',
    'type': :'String',
    'collaborative_action_threshold': :'Integer',
    'collaborative_weights': :'Array<OCI::Waf::Models::CollaborativeCapabilityWeight>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.



189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 189

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    key == other.key &&
    display_name == other.display_name &&
    description == other.description &&
    version == other.version &&
    is_latest_version == other.is_latest_version &&
    group_tags == other.group_tags &&
    type == other.type &&
    collaborative_action_threshold == other.collaborative_action_threshold &&
    collaborative_weights == other.collaborative_weights
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 227

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

See Also:

  • `==` method


207
208
209
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 207

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.



216
217
218
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 216

def hash
  [key, display_name, description, version, is_latest_version, group_tags, type, collaborative_action_threshold, collaborative_weights].hash
end

#to_hashHash

Returns the object in the form of hash



260
261
262
263
264
265
266
267
268
269
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 260

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object



254
255
256
# File 'lib/oci/waf/models/protection_capability_summary.rb', line 254

def to_s
  to_hash.to_s
end