# coding: utf-8

"""
    DagsHub API

    The api docs are made with SwaggerUI using the OpenAPI 3 specification.   # noqa: E501

    OpenAPI spec version: 1.0.1
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class WebhookConfig(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """
    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'url': 'str',
        'content_type': 'str',
        'secret': 'str'
    }

    attribute_map = {
        'url': 'url',
        'content_type': 'content_type',
        'secret': 'secret'
    }

    def __init__(self, url=None, content_type=None, secret=None):  # noqa: E501
        """WebhookConfig - a model defined in Swagger"""  # noqa: E501
        self._url = None
        self._content_type = None
        self._secret = None
        self.discriminator = None
        self.url = url
        self.content_type = content_type
        if secret is not None:
            self.secret = secret

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

        A string defining the URL to which the payloads will be delivered.  # noqa: E501

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

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

        A string defining the URL to which the payloads will be delivered.  # noqa: E501

        :param url: The url of this WebhookConfig.  # noqa: E501
        :type: str
        """
        if url is None:
            raise ValueError("Invalid value for `url`, must not be `None`")  # noqa: E501

        self._url = url

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

        A string defining the media type used to serialize the payloads.  # noqa: E501

        :return: The content_type of this WebhookConfig.  # noqa: E501
        :rtype: str
        """
        return self._content_type

    @content_type.setter
    def content_type(self, content_type):
        """Sets the content_type of this WebhookConfig.

        A string defining the media type used to serialize the payloads.  # noqa: E501

        :param content_type: The content_type of this WebhookConfig.  # noqa: E501
        :type: str
        """
        if content_type is None:
            raise ValueError("Invalid value for `content_type`, must not be `None`")  # noqa: E501
        allowed_values = ["json", "form"]  # noqa: E501
        if content_type not in allowed_values:
            raise ValueError(
                "Invalid value for `content_type` ({0}), must be one of {1}"  # noqa: E501
                .format(content_type, allowed_values)
            )

        self._content_type = content_type

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

        An optional string that's passed with the HTTP requests body.  # noqa: E501

        :return: The secret of this WebhookConfig.  # noqa: E501
        :rtype: str
        """
        return self._secret

    @secret.setter
    def secret(self, secret):
        """Sets the secret of this WebhookConfig.

        An optional string that's passed with the HTTP requests body.  # noqa: E501

        :param secret: The secret of this WebhookConfig.  # noqa: E501
        :type: str
        """

        self._secret = secret

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

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(WebhookConfig, dict):
            for key, value in self.items():
                result[key] = 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, WebhookConfig):
            return False

        return self.__dict__ == other.__dict__

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