File: //lib/mysqlsh/lib/python3.8/site-packages/oci/network_firewall/models/nat_v4_nat_rule.py
# coding: utf-8
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20230501
from .nat_rule import NatRule
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class NatV4NatRule(NatRule):
"""
A Nat Rule is used to define to which traffic NAT should be applied by the firewall.
"""
#: A constant which can be used with the action property of a NatV4NatRule.
#: This constant has a value of "DIPP_SRC_NAT"
ACTION_DIPP_SRC_NAT = "DIPP_SRC_NAT"
def __init__(self, **kwargs):
"""
Initializes a new NatV4NatRule object with values from keyword arguments. The default value of the :py:attr:`~oci.network_firewall.models.NatV4NatRule.type` attribute
of this class is ``NATV4`` and it should not be changed.
The following keyword arguments are supported (corresponding to the getters/setters of this class):
:param name:
The value to assign to the name property of this NatV4NatRule.
:type name: str
:param type:
The value to assign to the type property of this NatV4NatRule.
Allowed values for this property are: "NATV4", 'UNKNOWN_ENUM_VALUE'.
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
:type type: str
:param description:
The value to assign to the description property of this NatV4NatRule.
:type description: str
:param priority_order:
The value to assign to the priority_order property of this NatV4NatRule.
:type priority_order: int
:param position:
The value to assign to the position property of this NatV4NatRule.
:type position: oci.network_firewall.models.RulePosition
:param parent_resource_id:
The value to assign to the parent_resource_id property of this NatV4NatRule.
:type parent_resource_id: str
:param condition:
The value to assign to the condition property of this NatV4NatRule.
:type condition: oci.network_firewall.models.NatRuleMatchCriteria
:param action:
The value to assign to the action property of this NatV4NatRule.
Allowed values for this property are: "DIPP_SRC_NAT", 'UNKNOWN_ENUM_VALUE'.
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
:type action: str
"""
self.swagger_types = {
'name': 'str',
'type': 'str',
'description': 'str',
'priority_order': 'int',
'position': 'RulePosition',
'parent_resource_id': 'str',
'condition': 'NatRuleMatchCriteria',
'action': 'str'
}
self.attribute_map = {
'name': 'name',
'type': 'type',
'description': 'description',
'priority_order': 'priorityOrder',
'position': 'position',
'parent_resource_id': 'parentResourceId',
'condition': 'condition',
'action': 'action'
}
self._name = None
self._type = None
self._description = None
self._priority_order = None
self._position = None
self._parent_resource_id = None
self._condition = None
self._action = None
self._type = 'NATV4'
@property
def condition(self):
"""
**[Required]** Gets the condition of this NatV4NatRule.
:return: The condition of this NatV4NatRule.
:rtype: oci.network_firewall.models.NatRuleMatchCriteria
"""
return self._condition
@condition.setter
def condition(self, condition):
"""
Sets the condition of this NatV4NatRule.
:param condition: The condition of this NatV4NatRule.
:type: oci.network_firewall.models.NatRuleMatchCriteria
"""
self._condition = condition
@property
def action(self):
"""
**[Required]** Gets the action of this NatV4NatRule.
action:
* DIPP_SRC_NAT - Dynamic-ip-port source NAT.
Allowed values for this property are: "DIPP_SRC_NAT", 'UNKNOWN_ENUM_VALUE'.
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
:return: The action of this NatV4NatRule.
:rtype: str
"""
return self._action
@action.setter
def action(self, action):
"""
Sets the action of this NatV4NatRule.
action:
* DIPP_SRC_NAT - Dynamic-ip-port source NAT.
:param action: The action of this NatV4NatRule.
:type: str
"""
allowed_values = ["DIPP_SRC_NAT"]
if not value_allowed_none_or_none_sentinel(action, allowed_values):
action = 'UNKNOWN_ENUM_VALUE'
self._action = action
def __repr__(self):
return formatted_flat_dict(self)
def __eq__(self, other):
if other is None:
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
return not self == other