# coding: utf-8

"""
    Workflow Execution Service

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

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


import pprint
import re  # noqa: F401

import six

from libica.openapi.libwes.configuration import Configuration


class WorkflowConnection(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 = {
        'name': 'str',
        'type': 'str',
        'host': 'str',
        'host_validation_regex': 'str',
        'credentials': 'str',
        'options': 'str',
        'auto_disable_url': 'str',
        'auto_disable_http_method': 'str'
    }

    attribute_map = {
        'name': 'name',
        'type': 'type',
        'host': 'host',
        'host_validation_regex': 'hostValidationRegex',
        'credentials': 'credentials',
        'options': 'options',
        'auto_disable_url': 'autoDisableUrl',
        'auto_disable_http_method': 'autoDisableHttpMethod'
    }

    def __init__(self, name=None, type=None, host=None, host_validation_regex=None, credentials=None, options=None, auto_disable_url=None, auto_disable_http_method=None, local_vars_configuration=None):  # noqa: E501
        """WorkflowConnection - 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._name = None
        self._type = None
        self._host = None
        self._host_validation_regex = None
        self._credentials = None
        self._options = None
        self._auto_disable_url = None
        self._auto_disable_http_method = None
        self.discriminator = None

        self.name = name
        if type is not None:
            self.type = type
        if host is not None:
            self.host = host
        if host_validation_regex is not None:
            self.host_validation_regex = host_validation_regex
        if credentials is not None:
            self.credentials = credentials
        if options is not None:
            self.options = options
        if auto_disable_url is not None:
            self.auto_disable_url = auto_disable_url
        if auto_disable_http_method is not None:
            self.auto_disable_http_method = auto_disable_http_method

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


        :return: The name of this WorkflowConnection.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this WorkflowConnection.


        :param name: The name of this WorkflowConnection.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                name is not None and len(name) > 128):
            raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                name is not None and len(name) < 0):
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `0`")  # noqa: E501

        self._name = name

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

        Type of the connection: PlatformJwt, ApiBearerToken, AwsCredentials, ApiCustomAuthentication, BsshOAuthV2  # noqa: E501

        :return: The type of this WorkflowConnection.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this WorkflowConnection.

        Type of the connection: PlatformJwt, ApiBearerToken, AwsCredentials, ApiCustomAuthentication, BsshOAuthV2  # noqa: E501

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

        self._type = type

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

        For API based connections, the Host part of the API endpoint  # noqa: E501

        :return: The host of this WorkflowConnection.  # noqa: E501
        :rtype: str
        """
        return self._host

    @host.setter
    def host(self, host):
        """Sets the host of this WorkflowConnection.

        For API based connections, the Host part of the API endpoint  # noqa: E501

        :param host: The host of this WorkflowConnection.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                host is not None and len(host) > 1024):
            raise ValueError("Invalid value for `host`, length must be less than or equal to `1024`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                host is not None and len(host) < 0):
            raise ValueError("Invalid value for `host`, length must be greater than or equal to `0`")  # noqa: E501

        self._host = host

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

        Regex that hosts associated with this connection must meet (when host override by each run is allowed)  # noqa: E501

        :return: The host_validation_regex of this WorkflowConnection.  # noqa: E501
        :rtype: str
        """
        return self._host_validation_regex

    @host_validation_regex.setter
    def host_validation_regex(self, host_validation_regex):
        """Sets the host_validation_regex of this WorkflowConnection.

        Regex that hosts associated with this connection must meet (when host override by each run is allowed)  # noqa: E501

        :param host_validation_regex: The host_validation_regex of this WorkflowConnection.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                host_validation_regex is not None and len(host_validation_regex) > 100):
            raise ValueError("Invalid value for `host_validation_regex`, length must be less than or equal to `100`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                host_validation_regex is not None and len(host_validation_regex) < 0):
            raise ValueError("Invalid value for `host_validation_regex`, length must be greater than or equal to `0`")  # noqa: E501

        self._host_validation_regex = host_validation_regex

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

        Credentials associated with the connection. Format depends on type of connection.  # noqa: E501

        :return: The credentials of this WorkflowConnection.  # noqa: E501
        :rtype: str
        """
        return self._credentials

    @credentials.setter
    def credentials(self, credentials):
        """Sets the credentials of this WorkflowConnection.

        Credentials associated with the connection. Format depends on type of connection.  # noqa: E501

        :param credentials: The credentials of this WorkflowConnection.  # noqa: E501
        :type: str
        """

        self._credentials = credentials

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

        Comma separated list of options associated with the connection: CredentialsRequired, AllowCredentialsOverride, AutoDisableCredentialsAfterUse, AllowHostOverride  # noqa: E501

        :return: The options of this WorkflowConnection.  # noqa: E501
        :rtype: str
        """
        return self._options

    @options.setter
    def options(self, options):
        """Sets the options of this WorkflowConnection.

        Comma separated list of options associated with the connection: CredentialsRequired, AllowCredentialsOverride, AutoDisableCredentialsAfterUse, AllowHostOverride  # noqa: E501

        :param options: The options of this WorkflowConnection.  # noqa: E501
        :type: str
        """

        self._options = options

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

        Relative URL (relative to Host) to call in order to disable the credentials  # noqa: E501

        :return: The auto_disable_url of this WorkflowConnection.  # noqa: E501
        :rtype: str
        """
        return self._auto_disable_url

    @auto_disable_url.setter
    def auto_disable_url(self, auto_disable_url):
        """Sets the auto_disable_url of this WorkflowConnection.

        Relative URL (relative to Host) to call in order to disable the credentials  # noqa: E501

        :param auto_disable_url: The auto_disable_url of this WorkflowConnection.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                auto_disable_url is not None and len(auto_disable_url) > 1024):
            raise ValueError("Invalid value for `auto_disable_url`, length must be less than or equal to `1024`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                auto_disable_url is not None and len(auto_disable_url) < 0):
            raise ValueError("Invalid value for `auto_disable_url`, length must be greater than or equal to `0`")  # noqa: E501

        self._auto_disable_url = auto_disable_url

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

        Http method to use to disable the credentials. Must be POST, PUT or DELETE  # noqa: E501

        :return: The auto_disable_http_method of this WorkflowConnection.  # noqa: E501
        :rtype: str
        """
        return self._auto_disable_http_method

    @auto_disable_http_method.setter
    def auto_disable_http_method(self, auto_disable_http_method):
        """Sets the auto_disable_http_method of this WorkflowConnection.

        Http method to use to disable the credentials. Must be POST, PUT or DELETE  # noqa: E501

        :param auto_disable_http_method: The auto_disable_http_method of this WorkflowConnection.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                auto_disable_http_method is not None and len(auto_disable_http_method) > 10):
            raise ValueError("Invalid value for `auto_disable_http_method`, length must be less than or equal to `10`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                auto_disable_http_method is not None and len(auto_disable_http_method) < 0):
            raise ValueError("Invalid value for `auto_disable_http_method`, length must be greater than or equal to `0`")  # noqa: E501

        self._auto_disable_http_method = auto_disable_http_method

    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, WorkflowConnection):
            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, WorkflowConnection):
            return True

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