Class: OCI::DataSafe::Models::UpdateSqlFirewallPolicyDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_safe/models/update_sql_firewall_policy_details.rb

Overview

Details to update the SQL Firewall policy.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_ENABLED = 'ENABLED'.freeze,
  STATUS_DISABLED = 'DISABLED'.freeze
].freeze
ENFORCEMENT_SCOPE_ENUM =
[
  ENFORCEMENT_SCOPE_ENFORCE_CONTEXT = 'ENFORCE_CONTEXT'.freeze,
  ENFORCEMENT_SCOPE_ENFORCE_SQL = 'ENFORCE_SQL'.freeze,
  ENFORCEMENT_SCOPE_ENFORCE_ALL = 'ENFORCE_ALL'.freeze
].freeze
VIOLATION_ACTION_ENUM =
[
  VIOLATION_ACTION_BLOCK = 'BLOCK'.freeze,
  VIOLATION_ACTION_OBSERVE = 'OBSERVE'.freeze
].freeze
VIOLATION_AUDIT_ENUM =
[
  VIOLATION_AUDIT_ENABLED = 'ENABLED'.freeze,
  VIOLATION_AUDIT_DISABLED = 'DISABLED'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UpdateSqlFirewallPolicyDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :display_name (String)

    The value to assign to the #display_name property

  • :description (String)

    The value to assign to the #description property

  • :status (String)

    The value to assign to the #status property

  • :enforcement_scope (String)

    The value to assign to the #enforcement_scope property

  • :violation_action (String)

    The value to assign to the #violation_action property

  • :violation_audit (String)

    The value to assign to the #violation_audit property

  • :allowed_client_ips (Array<String>)

    The value to assign to the #allowed_client_ips property

  • :allowed_client_os_usernames (Array<String>)

    The value to assign to the #allowed_client_os_usernames property

  • :allowed_client_programs (Array<String>)

    The value to assign to the #allowed_client_programs property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :defined_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #defined_tags property



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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 136

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.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.status = attributes[:'status'] if attributes[:'status']

  self.enforcement_scope = attributes[:'enforcementScope'] if attributes[:'enforcementScope']

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

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

  self.violation_action = attributes[:'violationAction'] if attributes[:'violationAction']

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

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

  self.violation_audit = attributes[:'violationAudit'] if attributes[:'violationAudit']

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

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

  self.allowed_client_ips = attributes[:'allowedClientIps'] if attributes[:'allowedClientIps']

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

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

  self.allowed_client_os_usernames = attributes[:'allowedClientOsUsernames'] if attributes[:'allowedClientOsUsernames']

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

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

  self.allowed_client_programs = attributes[:'allowedClientPrograms'] if attributes[:'allowedClientPrograms']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

Instance Attribute Details

#allowed_client_ipsArray<String>

List of allowed ip addresses for the SQL Firewall policy.

Returns:

  • (Array<String>)


58
59
60
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 58

def allowed_client_ips
  @allowed_client_ips
end

#allowed_client_os_usernamesArray<String>

List of allowed operating system user names for the SQL Firewall policy.

Returns:

  • (Array<String>)


62
63
64
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 62

def allowed_client_os_usernames
  @allowed_client_os_usernames
end

#allowed_client_programsArray<String>

List of allowed client programs for the SQL Firewall policy.

Returns:

  • (Array<String>)


66
67
68
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 66

def allowed_client_programs
  @allowed_client_programs
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags Example: {\"Operations\": {\"CostCenter\": \"42\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


79
80
81
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 79

def defined_tags
  @defined_tags
end

#descriptionString

The description of the SQL Firewall policy.

Returns:

  • (String)


38
39
40
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 38

def description
  @description
end

#display_nameString

The display name of the SQL Firewall policy. The name does not have to be unique, and it is changeable.

Returns:

  • (String)


34
35
36
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 34

def display_name
  @display_name
end

#enforcement_scopeString

Specifies the SQL Firewall policy enforcement option.

Returns:

  • (String)


46
47
48
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 46

def enforcement_scope
  @enforcement_scope
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags

Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


73
74
75
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 73

def freeform_tags
  @freeform_tags
end

#statusString

Specifies whether the SQL Firewall policy is enabled or disabled.

Returns:

  • (String)


42
43
44
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 42

def status
  @status
end

#violation_actionString

Specifies the SQL Firewall action based on detection of SQL Firewall violations.

Returns:

  • (String)


50
51
52
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 50

def violation_action
  @violation_action
end

#violation_auditString

Specifies whether a unified audit policy should be enabled for auditing the SQL Firewall policy violations.

Returns:

  • (String)


54
55
56
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 54

def violation_audit
  @violation_audit
end

Class Method Details

.attribute_mapObject

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



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 82

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'description': :'description',
    'status': :'status',
    'enforcement_scope': :'enforcementScope',
    'violation_action': :'violationAction',
    'violation_audit': :'violationAudit',
    'allowed_client_ips': :'allowedClientIps',
    'allowed_client_os_usernames': :'allowedClientOsUsernames',
    'allowed_client_programs': :'allowedClientPrograms',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 101

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'description': :'String',
    'status': :'String',
    'enforcement_scope': :'String',
    'violation_action': :'String',
    'violation_audit': :'String',
    'allowed_client_ips': :'Array<String>',
    'allowed_client_os_usernames': :'Array<String>',
    'allowed_client_programs': :'Array<String>',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 240

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

  self.class == other.class &&
    display_name == other.display_name &&
    description == other.description &&
    status == other.status &&
    enforcement_scope == other.enforcement_scope &&
    violation_action == other.violation_action &&
    violation_audit == other.violation_audit &&
    allowed_client_ips == other.allowed_client_ips &&
    allowed_client_os_usernames == other.allowed_client_os_usernames &&
    allowed_client_programs == other.allowed_client_programs &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 280

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


260
261
262
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 260

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



269
270
271
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 269

def hash
  [display_name, description, status, enforcement_scope, violation_action, violation_audit, allowed_client_ips, allowed_client_os_usernames, allowed_client_programs, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



313
314
315
316
317
318
319
320
321
322
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 313

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

Returns:

  • (String)

    String presentation of the object



307
308
309
# File 'lib/oci/data_safe/models/update_sql_firewall_policy_details.rb', line 307

def to_s
  to_hash.to_s
end