# coding: utf-8

"""
    Onfido API

    The Onfido API is used to submit check requests.

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

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from pprint import pformat
from six import iteritems
import re


class Webhook(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, id=None, url=None, token=None, enabled=None, href=None, environments=None, events=None):
        """
        Webhook - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'id': 'str',
            'url': 'str',
            'token': 'str',
            'enabled': 'bool',
            'href': 'str',
            'environments': 'list[str]',
            'events': 'list[str]'
        }

        self.attribute_map = {
            'id': 'id',
            'url': 'url',
            'token': 'token',
            'enabled': 'enabled',
            'href': 'href',
            'environments': 'environments',
            'events': 'events'
        }

        self._id = id
        self._url = url
        self._token = token
        self._enabled = enabled
        self._href = href
        self._environments = environments
        self._events = events


    @property
    def id(self):
        """
        Gets the id of this Webhook.
        The unique identifier of the webhook.

        :return: The id of this Webhook.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this Webhook.
        The unique identifier of the webhook.

        :param id: The id of this Webhook.
        :type: str
        """

        self._id = id

    @property
    def url(self):
        """
        Gets the url of this Webhook.
        The url of the webhook

        :return: The url of this Webhook.
        :rtype: str
        """
        return self._url

    @url.setter
    def url(self, url):
        """
        Sets the url of this Webhook.
        The url of the webhook

        :param url: The url of this Webhook.
        :type: str
        """

        self._url = url

    @property
    def token(self):
        """
        Gets the token of this Webhook.
        Webhook secret token used to sign the webhook's payload

        :return: The token of this Webhook.
        :rtype: str
        """
        return self._token

    @token.setter
    def token(self, token):
        """
        Sets the token of this Webhook.
        Webhook secret token used to sign the webhook's payload

        :param token: The token of this Webhook.
        :type: str
        """

        self._token = token

    @property
    def enabled(self):
        """
        Gets the enabled of this Webhook.
        Determine if the webhook is active.

        :return: The enabled of this Webhook.
        :rtype: bool
        """
        return self._enabled

    @enabled.setter
    def enabled(self, enabled):
        """
        Sets the enabled of this Webhook.
        Determine if the webhook is active.

        :param enabled: The enabled of this Webhook.
        :type: bool
        """

        self._enabled = enabled

    @property
    def href(self):
        """
        Gets the href of this Webhook.
        The API endpoint to retrieve the webhook.

        :return: The href of this Webhook.
        :rtype: str
        """
        return self._href

    @href.setter
    def href(self, href):
        """
        Sets the href of this Webhook.
        The API endpoint to retrieve the webhook.

        :param href: The href of this Webhook.
        :type: str
        """

        self._href = href

    @property
    def environments(self):
        """
        Gets the environments of this Webhook.
        The environments from which the webhook will receive events.

        :return: The environments of this Webhook.
        :rtype: list[str]
        """
        return self._environments

    @environments.setter
    def environments(self, environments):
        """
        Sets the environments of this Webhook.
        The environments from which the webhook will receive events.

        :param environments: The environments of this Webhook.
        :type: list[str]
        """

        self._environments = environments

    @property
    def events(self):
        """
        Gets the events of this Webhook.
        The events that will be published to the webhook.

        :return: The events of this Webhook.
        :rtype: list[str]
        """
        return self._events

    @events.setter
    def events(self, events):
        """
        Sets the events of this Webhook.
        The events that will be published to the webhook.

        :param events: The events of this Webhook.
        :type: list[str]
        """

        self._events = events

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

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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
        """
        return self.__dict__ == other.__dict__

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