# coding: utf-8

"""
    Prisma Cloud Compute API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 21.04.439
    Generated by: https://openapi-generator.tech
"""


try:
    from inspect import getfullargspec
except ImportError:
    from inspect import getargspec as getfullargspec
import pprint
import re  # noqa: F401
import six

from openapi_client.configuration import Configuration


class RuntimeContainerNetworkRule(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    openapi_types = {
        'blacklist_ips': 'list[str]',
        'blacklist_listening_ports': 'list[CommonPortRange]',
        'blacklist_outbound_ports': 'list[CommonPortRange]',
        'detect_port_scan': 'bool',
        'effect': 'RuntimeRuleEffect',
        'skip_modified_proc': 'bool',
        'skip_raw_sockets': 'bool',
        'whitelist_ips': 'list[str]',
        'whitelist_listening_ports': 'list[CommonPortRange]',
        'whitelist_outbound_ports': 'list[CommonPortRange]'
    }

    attribute_map = {
        'blacklist_ips': 'blacklistIPs',
        'blacklist_listening_ports': 'blacklistListeningPorts',
        'blacklist_outbound_ports': 'blacklistOutboundPorts',
        'detect_port_scan': 'detectPortScan',
        'effect': 'effect',
        'skip_modified_proc': 'skipModifiedProc',
        'skip_raw_sockets': 'skipRawSockets',
        'whitelist_ips': 'whitelistIPs',
        'whitelist_listening_ports': 'whitelistListeningPorts',
        'whitelist_outbound_ports': 'whitelistOutboundPorts'
    }

    def __init__(self, blacklist_ips=None, blacklist_listening_ports=None, blacklist_outbound_ports=None, detect_port_scan=None, effect=None, skip_modified_proc=None, skip_raw_sockets=None, whitelist_ips=None, whitelist_listening_ports=None, whitelist_outbound_ports=None, local_vars_configuration=None):  # noqa: E501
        """RuntimeContainerNetworkRule - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration.get_default_copy()
        self.local_vars_configuration = local_vars_configuration

        self._blacklist_ips = None
        self._blacklist_listening_ports = None
        self._blacklist_outbound_ports = None
        self._detect_port_scan = None
        self._effect = None
        self._skip_modified_proc = None
        self._skip_raw_sockets = None
        self._whitelist_ips = None
        self._whitelist_listening_ports = None
        self._whitelist_outbound_ports = None
        self.discriminator = None

        if blacklist_ips is not None:
            self.blacklist_ips = blacklist_ips
        if blacklist_listening_ports is not None:
            self.blacklist_listening_ports = blacklist_listening_ports
        if blacklist_outbound_ports is not None:
            self.blacklist_outbound_ports = blacklist_outbound_ports
        if detect_port_scan is not None:
            self.detect_port_scan = detect_port_scan
        if effect is not None:
            self.effect = effect
        if skip_modified_proc is not None:
            self.skip_modified_proc = skip_modified_proc
        if skip_raw_sockets is not None:
            self.skip_raw_sockets = skip_raw_sockets
        if whitelist_ips is not None:
            self.whitelist_ips = whitelist_ips
        if whitelist_listening_ports is not None:
            self.whitelist_listening_ports = whitelist_listening_ports
        if whitelist_outbound_ports is not None:
            self.whitelist_outbound_ports = whitelist_outbound_ports

    @property
    def blacklist_ips(self):
        """Gets the blacklist_ips of this RuntimeContainerNetworkRule.  # noqa: E501

        Deny-listed IP addresses.   # noqa: E501

        :return: The blacklist_ips of this RuntimeContainerNetworkRule.  # noqa: E501
        :rtype: list[str]
        """
        return self._blacklist_ips

    @blacklist_ips.setter
    def blacklist_ips(self, blacklist_ips):
        """Sets the blacklist_ips of this RuntimeContainerNetworkRule.

        Deny-listed IP addresses.   # noqa: E501

        :param blacklist_ips: The blacklist_ips of this RuntimeContainerNetworkRule.  # noqa: E501
        :type blacklist_ips: list[str]
        """

        self._blacklist_ips = blacklist_ips

    @property
    def blacklist_listening_ports(self):
        """Gets the blacklist_listening_ports of this RuntimeContainerNetworkRule.  # noqa: E501

        Deny-listed listening ports.   # noqa: E501

        :return: The blacklist_listening_ports of this RuntimeContainerNetworkRule.  # noqa: E501
        :rtype: list[CommonPortRange]
        """
        return self._blacklist_listening_ports

    @blacklist_listening_ports.setter
    def blacklist_listening_ports(self, blacklist_listening_ports):
        """Sets the blacklist_listening_ports of this RuntimeContainerNetworkRule.

        Deny-listed listening ports.   # noqa: E501

        :param blacklist_listening_ports: The blacklist_listening_ports of this RuntimeContainerNetworkRule.  # noqa: E501
        :type blacklist_listening_ports: list[CommonPortRange]
        """

        self._blacklist_listening_ports = blacklist_listening_ports

    @property
    def blacklist_outbound_ports(self):
        """Gets the blacklist_outbound_ports of this RuntimeContainerNetworkRule.  # noqa: E501

        Deny-listed outbound ports.   # noqa: E501

        :return: The blacklist_outbound_ports of this RuntimeContainerNetworkRule.  # noqa: E501
        :rtype: list[CommonPortRange]
        """
        return self._blacklist_outbound_ports

    @blacklist_outbound_ports.setter
    def blacklist_outbound_ports(self, blacklist_outbound_ports):
        """Sets the blacklist_outbound_ports of this RuntimeContainerNetworkRule.

        Deny-listed outbound ports.   # noqa: E501

        :param blacklist_outbound_ports: The blacklist_outbound_ports of this RuntimeContainerNetworkRule.  # noqa: E501
        :type blacklist_outbound_ports: list[CommonPortRange]
        """

        self._blacklist_outbound_ports = blacklist_outbound_ports

    @property
    def detect_port_scan(self):
        """Gets the detect_port_scan of this RuntimeContainerNetworkRule.  # noqa: E501

        Specifies whether port scanning detection is enabled (true) or not (false).   # noqa: E501

        :return: The detect_port_scan of this RuntimeContainerNetworkRule.  # noqa: E501
        :rtype: bool
        """
        return self._detect_port_scan

    @detect_port_scan.setter
    def detect_port_scan(self, detect_port_scan):
        """Sets the detect_port_scan of this RuntimeContainerNetworkRule.

        Specifies whether port scanning detection is enabled (true) or not (false).   # noqa: E501

        :param detect_port_scan: The detect_port_scan of this RuntimeContainerNetworkRule.  # noqa: E501
        :type detect_port_scan: bool
        """

        self._detect_port_scan = detect_port_scan

    @property
    def effect(self):
        """Gets the effect of this RuntimeContainerNetworkRule.  # noqa: E501


        :return: The effect of this RuntimeContainerNetworkRule.  # noqa: E501
        :rtype: RuntimeRuleEffect
        """
        return self._effect

    @effect.setter
    def effect(self, effect):
        """Sets the effect of this RuntimeContainerNetworkRule.


        :param effect: The effect of this RuntimeContainerNetworkRule.  # noqa: E501
        :type effect: RuntimeRuleEffect
        """

        self._effect = effect

    @property
    def skip_modified_proc(self):
        """Gets the skip_modified_proc of this RuntimeContainerNetworkRule.  # noqa: E501

        Specifies whether Prisma Cloud detects when modified processes perform malicious networking activity.   # noqa: E501

        :return: The skip_modified_proc of this RuntimeContainerNetworkRule.  # noqa: E501
        :rtype: bool
        """
        return self._skip_modified_proc

    @skip_modified_proc.setter
    def skip_modified_proc(self, skip_modified_proc):
        """Sets the skip_modified_proc of this RuntimeContainerNetworkRule.

        Specifies whether Prisma Cloud detects when modified processes perform malicious networking activity.   # noqa: E501

        :param skip_modified_proc: The skip_modified_proc of this RuntimeContainerNetworkRule.  # noqa: E501
        :type skip_modified_proc: bool
        """

        self._skip_modified_proc = skip_modified_proc

    @property
    def skip_raw_sockets(self):
        """Gets the skip_raw_sockets of this RuntimeContainerNetworkRule.  # noqa: E501

        Specifies whether raw socket detection should be skipped (true) or not (false).   # noqa: E501

        :return: The skip_raw_sockets of this RuntimeContainerNetworkRule.  # noqa: E501
        :rtype: bool
        """
        return self._skip_raw_sockets

    @skip_raw_sockets.setter
    def skip_raw_sockets(self, skip_raw_sockets):
        """Sets the skip_raw_sockets of this RuntimeContainerNetworkRule.

        Specifies whether raw socket detection should be skipped (true) or not (false).   # noqa: E501

        :param skip_raw_sockets: The skip_raw_sockets of this RuntimeContainerNetworkRule.  # noqa: E501
        :type skip_raw_sockets: bool
        """

        self._skip_raw_sockets = skip_raw_sockets

    @property
    def whitelist_ips(self):
        """Gets the whitelist_ips of this RuntimeContainerNetworkRule.  # noqa: E501

        Allow-listed IP addresses.   # noqa: E501

        :return: The whitelist_ips of this RuntimeContainerNetworkRule.  # noqa: E501
        :rtype: list[str]
        """
        return self._whitelist_ips

    @whitelist_ips.setter
    def whitelist_ips(self, whitelist_ips):
        """Sets the whitelist_ips of this RuntimeContainerNetworkRule.

        Allow-listed IP addresses.   # noqa: E501

        :param whitelist_ips: The whitelist_ips of this RuntimeContainerNetworkRule.  # noqa: E501
        :type whitelist_ips: list[str]
        """

        self._whitelist_ips = whitelist_ips

    @property
    def whitelist_listening_ports(self):
        """Gets the whitelist_listening_ports of this RuntimeContainerNetworkRule.  # noqa: E501

        Allow-listed listening ports.   # noqa: E501

        :return: The whitelist_listening_ports of this RuntimeContainerNetworkRule.  # noqa: E501
        :rtype: list[CommonPortRange]
        """
        return self._whitelist_listening_ports

    @whitelist_listening_ports.setter
    def whitelist_listening_ports(self, whitelist_listening_ports):
        """Sets the whitelist_listening_ports of this RuntimeContainerNetworkRule.

        Allow-listed listening ports.   # noqa: E501

        :param whitelist_listening_ports: The whitelist_listening_ports of this RuntimeContainerNetworkRule.  # noqa: E501
        :type whitelist_listening_ports: list[CommonPortRange]
        """

        self._whitelist_listening_ports = whitelist_listening_ports

    @property
    def whitelist_outbound_ports(self):
        """Gets the whitelist_outbound_ports of this RuntimeContainerNetworkRule.  # noqa: E501

        Allow-listed outbound ports.   # noqa: E501

        :return: The whitelist_outbound_ports of this RuntimeContainerNetworkRule.  # noqa: E501
        :rtype: list[CommonPortRange]
        """
        return self._whitelist_outbound_ports

    @whitelist_outbound_ports.setter
    def whitelist_outbound_ports(self, whitelist_outbound_ports):
        """Sets the whitelist_outbound_ports of this RuntimeContainerNetworkRule.

        Allow-listed outbound ports.   # noqa: E501

        :param whitelist_outbound_ports: The whitelist_outbound_ports of this RuntimeContainerNetworkRule.  # noqa: E501
        :type whitelist_outbound_ports: list[CommonPortRange]
        """

        self._whitelist_outbound_ports = whitelist_outbound_ports

    def to_dict(self, serialize=False):
        """Returns the model properties as a dict"""
        result = {}

        def convert(x):
            if hasattr(x, "to_dict"):
                args = getfullargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: convert(x),
                    value
                ))
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], convert(item[1])),
                    value.items()
                ))
            else:
                result[attr] = convert(value)

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, RuntimeContainerNetworkRule):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, RuntimeContainerNetworkRule):
            return True

        return self.to_dict() != other.to_dict()
