<filename>whoville/cloudbreak/models/gateway_json.py<gh_stars>10-100
# coding: utf-8

"""
    Cloudbreak API

    Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloudbreak is a RESTful application development platform with the goal of helping developers to build solutions for deploying Hadoop YARN clusters in different environments. Once it is deployed in your favourite servlet container it exposes a REST API allowing to span up Hadoop clusters of arbitary sizes and cloud providers. Provisioning Hadoop has never been easier. Cloudbreak is built on the foundation of cloud providers API (Amazon AWS, Microsoft Azure, Google Cloud Platform, Openstack), Apache Ambari, Docker lightweight containers, Swarm and Consul. For further product documentation follow the link: <a href=\"http://hortonworks.com/apache/cloudbreak/\">http://hortonworks.com/apache/cloudbreak/</a>

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


from pprint import pformat
from six import iteritems
import re


class GatewayJson(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 = {
        'enable_gateway': 'bool',
        'topology_name': 'str',
        'topologies': 'list[GatewayTopologyJson]',
        'exposed_services': 'list[str]',
        'token_cert': 'str',
        'gateway_type': 'str',
        'sso_type': 'str'
    }

    attribute_map = {
        'enable_gateway': 'enableGateway',
        'topology_name': 'topologyName',
        'topologies': 'topologies',
        'exposed_services': 'exposedServices',
        'token_cert': 'tokenCert',
        'gateway_type': 'gatewayType',
        'sso_type': 'ssoType'
    }

    def __init__(self, enable_gateway=False, topology_name=None, topologies=None, exposed_services=None, token_cert=None, gateway_type=None, sso_type=None):
        """
        GatewayJson - a model defined in Swagger
        """

        self._enable_gateway = None
        self._topology_name = None
        self._topologies = None
        self._exposed_services = None
        self._token_cert = None
        self._gateway_type = None
        self._sso_type = None

        if enable_gateway is not None:
          self.enable_gateway = enable_gateway
        if topology_name is not None:
          self.topology_name = topology_name
        if topologies is not None:
          self.topologies = topologies
        if exposed_services is not None:
          self.exposed_services = exposed_services
        if token_cert is not None:
          self.token_cert = token_cert
        if gateway_type is not None:
          self.gateway_type = gateway_type
        if sso_type is not None:
          self.sso_type = sso_type

    @property
    def enable_gateway(self):
        """
        Gets the enable_gateway of this GatewayJson.
        [DEPRECATED] 'enableGateway' is no longer needed to determine if gateway needs to be launched or not. Presence of gateway definition in request is suffucicient. This value is only used in legacy requests,  when 'topologyName' or 'exposedServices' is defined in the root of Gateway, instead of using topologies. When it is a legacy request and 'enableGateway' is set to 'false', gateway will not be saved and created.

        :return: The enable_gateway of this GatewayJson.
        :rtype: bool
        """
        return self._enable_gateway

    @enable_gateway.setter
    def enable_gateway(self, enable_gateway):
        """
        Sets the enable_gateway of this GatewayJson.
        [DEPRECATED] 'enableGateway' is no longer needed to determine if gateway needs to be launched or not. Presence of gateway definition in request is suffucicient. This value is only used in legacy requests,  when 'topologyName' or 'exposedServices' is defined in the root of Gateway, instead of using topologies. When it is a legacy request and 'enableGateway' is set to 'false', gateway will not be saved and created.

        :param enable_gateway: The enable_gateway of this GatewayJson.
        :type: bool
        """

        self._enable_gateway = enable_gateway

    @property
    def topology_name(self):
        """
        Gets the topology_name of this GatewayJson.
        [DEPRECATED] Use the 'topologyName' inside the 'topologies' part of the request. If 'topologyName' is specified, other deprecated properties ('exposedServices' and 'enableGateway') will be used as well, and 'topologies' will be ignored.

        :return: The topology_name of this GatewayJson.
        :rtype: str
        """
        return self._topology_name

    @topology_name.setter
    def topology_name(self, topology_name):
        """
        Sets the topology_name of this GatewayJson.
        [DEPRECATED] Use the 'topologyName' inside the 'topologies' part of the request. If 'topologyName' is specified, other deprecated properties ('exposedServices' and 'enableGateway') will be used as well, and 'topologies' will be ignored.

        :param topology_name: The topology_name of this GatewayJson.
        :type: str
        """

        self._topology_name = topology_name

    @property
    def topologies(self):
        """
        Gets the topologies of this GatewayJson.
        Topology definitions of the gateway.

        :return: The topologies of this GatewayJson.
        :rtype: list[GatewayTopologyJson]
        """
        return self._topologies

    @topologies.setter
    def topologies(self, topologies):
        """
        Sets the topologies of this GatewayJson.
        Topology definitions of the gateway.

        :param topologies: The topologies of this GatewayJson.
        :type: list[GatewayTopologyJson]
        """

        self._topologies = topologies

    @property
    def exposed_services(self):
        """
        Gets the exposed_services of this GatewayJson.
        [DEPRECATED] Use the 'exposedServices' inside the 'topologies' part of the request. If 'exposedServices' is specified, other deprecated properties ('topologyName' and 'enableGateway') will be used as well, and 'topologies' will be ignored.

        :return: The exposed_services of this GatewayJson.
        :rtype: list[str]
        """
        return self._exposed_services

    @exposed_services.setter
    def exposed_services(self, exposed_services):
        """
        Sets the exposed_services of this GatewayJson.
        [DEPRECATED] Use the 'exposedServices' inside the 'topologies' part of the request. If 'exposedServices' is specified, other deprecated properties ('topologyName' and 'enableGateway') will be used as well, and 'topologies' will be ignored.

        :param exposed_services: The exposed_services of this GatewayJson.
        :type: list[str]
        """

        self._exposed_services = exposed_services

    @property
    def token_cert(self):
        """
        Gets the token_cert of this GatewayJson.
        SSO Provider certificate

        :return: The token_cert of this GatewayJson.
        :rtype: str
        """
        return self._token_cert

    @token_cert.setter
    def token_cert(self, token_cert):
        """
        Sets the token_cert of this GatewayJson.
        SSO Provider certificate

        :param token_cert: The token_cert of this GatewayJson.
        :type: str
        """

        self._token_cert = token_cert

    @property
    def gateway_type(self):
        """
        Gets the gateway_type of this GatewayJson.
        Knox gateway type

        :return: The gateway_type of this GatewayJson.
        :rtype: str
        """
        return self._gateway_type

    @gateway_type.setter
    def gateway_type(self, gateway_type):
        """
        Sets the gateway_type of this GatewayJson.
        Knox gateway type

        :param gateway_type: The gateway_type of this GatewayJson.
        :type: str
        """
        allowed_values = ["CENTRAL", "INDIVIDUAL"]
        if gateway_type not in allowed_values:
            raise ValueError(
                "Invalid value for `gateway_type` ({0}), must be one of {1}"
                .format(gateway_type, allowed_values)
            )

        self._gateway_type = gateway_type

    @property
    def sso_type(self):
        """
        Gets the sso_type of this GatewayJson.
        Knox SSO type

        :return: The sso_type of this GatewayJson.
        :rtype: str
        """
        return self._sso_type

    @sso_type.setter
    def sso_type(self, sso_type):
        """
        Sets the sso_type of this GatewayJson.
        Knox SSO type

        :param sso_type: The sso_type of this GatewayJson.
        :type: str
        """
        allowed_values = ["SSO_PROVIDER", "NONE"]
        if sso_type not in allowed_values:
            raise ValueError(
                "Invalid value for `sso_type` ({0}), must be one of {1}"
                .format(sso_type, allowed_values)
            )

        self._sso_type = sso_type

    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
        """
        if not isinstance(other, GatewayJson):
            return False

        return self.__dict__ == other.__dict__

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