# coding: utf-8

"""
    Argo Server API

    You can get examples of requests and responses by using the CLI with `--gloglevel=9`, e.g. `argo list --gloglevel=9`  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from argo.workflows.client.configuration import Configuration


class IoArgoprojEventsV1alpha1KafkaTrigger(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 = {
        'compress': 'bool',
        'flush_frequency': 'int',
        'parameters': 'list[IoArgoprojEventsV1alpha1TriggerParameter]',
        'partition': 'int',
        'partitioning_key': 'str',
        'payload': 'list[IoArgoprojEventsV1alpha1TriggerParameter]',
        'required_acks': 'int',
        'tls': 'IoArgoprojEventsV1alpha1TLSConfig',
        'topic': 'str',
        'url': 'str',
        'version': 'str'
    }

    attribute_map = {
        'compress': 'compress',
        'flush_frequency': 'flushFrequency',
        'parameters': 'parameters',
        'partition': 'partition',
        'partitioning_key': 'partitioningKey',
        'payload': 'payload',
        'required_acks': 'requiredAcks',
        'tls': 'tls',
        'topic': 'topic',
        'url': 'url',
        'version': 'version'
    }

    def __init__(self, compress=None, flush_frequency=None, parameters=None, partition=None, partitioning_key=None, payload=None, required_acks=None, tls=None, topic=None, url=None, version=None, local_vars_configuration=None):  # noqa: E501
        """IoArgoprojEventsV1alpha1KafkaTrigger - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._compress = None
        self._flush_frequency = None
        self._parameters = None
        self._partition = None
        self._partitioning_key = None
        self._payload = None
        self._required_acks = None
        self._tls = None
        self._topic = None
        self._url = None
        self._version = None
        self.discriminator = None

        if compress is not None:
            self.compress = compress
        if flush_frequency is not None:
            self.flush_frequency = flush_frequency
        if parameters is not None:
            self.parameters = parameters
        if partition is not None:
            self.partition = partition
        if partitioning_key is not None:
            self.partitioning_key = partitioning_key
        if payload is not None:
            self.payload = payload
        if required_acks is not None:
            self.required_acks = required_acks
        if tls is not None:
            self.tls = tls
        if topic is not None:
            self.topic = topic
        if url is not None:
            self.url = url
        if version is not None:
            self.version = version

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


        :return: The compress of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: bool
        """
        return self._compress

    @compress.setter
    def compress(self, compress):
        """Sets the compress of this IoArgoprojEventsV1alpha1KafkaTrigger.


        :param compress: The compress of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: bool
        """

        self._compress = compress

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


        :return: The flush_frequency of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: int
        """
        return self._flush_frequency

    @flush_frequency.setter
    def flush_frequency(self, flush_frequency):
        """Sets the flush_frequency of this IoArgoprojEventsV1alpha1KafkaTrigger.


        :param flush_frequency: The flush_frequency of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: int
        """

        self._flush_frequency = flush_frequency

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


        :return: The parameters of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: list[IoArgoprojEventsV1alpha1TriggerParameter]
        """
        return self._parameters

    @parameters.setter
    def parameters(self, parameters):
        """Sets the parameters of this IoArgoprojEventsV1alpha1KafkaTrigger.


        :param parameters: The parameters of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: list[IoArgoprojEventsV1alpha1TriggerParameter]
        """

        self._parameters = parameters

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

        Partition to write data to.  # noqa: E501

        :return: The partition of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: int
        """
        return self._partition

    @partition.setter
    def partition(self, partition):
        """Sets the partition of this IoArgoprojEventsV1alpha1KafkaTrigger.

        Partition to write data to.  # noqa: E501

        :param partition: The partition of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: int
        """

        self._partition = partition

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

        The partitioning key for the messages put on the Kafka topic. Defaults to broker url. +optional.  # noqa: E501

        :return: The partitioning_key of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: str
        """
        return self._partitioning_key

    @partitioning_key.setter
    def partitioning_key(self, partitioning_key):
        """Sets the partitioning_key of this IoArgoprojEventsV1alpha1KafkaTrigger.

        The partitioning key for the messages put on the Kafka topic. Defaults to broker url. +optional.  # noqa: E501

        :param partitioning_key: The partitioning_key of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: str
        """

        self._partitioning_key = partitioning_key

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


        :return: The payload of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: list[IoArgoprojEventsV1alpha1TriggerParameter]
        """
        return self._payload

    @payload.setter
    def payload(self, payload):
        """Sets the payload of this IoArgoprojEventsV1alpha1KafkaTrigger.


        :param payload: The payload of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: list[IoArgoprojEventsV1alpha1TriggerParameter]
        """

        self._payload = payload

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

        RequiredAcks used in producer to tell the broker how many replica acknowledgements Defaults to 1 (Only wait for the leader to ack). +optional.  # noqa: E501

        :return: The required_acks of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: int
        """
        return self._required_acks

    @required_acks.setter
    def required_acks(self, required_acks):
        """Sets the required_acks of this IoArgoprojEventsV1alpha1KafkaTrigger.

        RequiredAcks used in producer to tell the broker how many replica acknowledgements Defaults to 1 (Only wait for the leader to ack). +optional.  # noqa: E501

        :param required_acks: The required_acks of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: int
        """

        self._required_acks = required_acks

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


        :return: The tls of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: IoArgoprojEventsV1alpha1TLSConfig
        """
        return self._tls

    @tls.setter
    def tls(self, tls):
        """Sets the tls of this IoArgoprojEventsV1alpha1KafkaTrigger.


        :param tls: The tls of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: IoArgoprojEventsV1alpha1TLSConfig
        """

        self._tls = tls

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


        :return: The topic of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: str
        """
        return self._topic

    @topic.setter
    def topic(self, topic):
        """Sets the topic of this IoArgoprojEventsV1alpha1KafkaTrigger.


        :param topic: The topic of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: str
        """

        self._topic = topic

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

        URL of the Kafka broker.  # noqa: E501

        :return: The url of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: str
        """
        return self._url

    @url.setter
    def url(self, url):
        """Sets the url of this IoArgoprojEventsV1alpha1KafkaTrigger.

        URL of the Kafka broker.  # noqa: E501

        :param url: The url of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: str
        """

        self._url = url

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


        :return: The version of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :rtype: str
        """
        return self._version

    @version.setter
    def version(self, version):
        """Sets the version of this IoArgoprojEventsV1alpha1KafkaTrigger.


        :param version: The version of this IoArgoprojEventsV1alpha1KafkaTrigger.  # noqa: E501
        :type: str
        """

        self._version = version

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

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = 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, IoArgoprojEventsV1alpha1KafkaTrigger):
            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, IoArgoprojEventsV1alpha1KafkaTrigger):
            return True

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