# coding: utf-8

"""
    Karbon Platform Services API reference.

    OpenAPI documentation for public facing Karbon Platform Services API  This API documentation is generated from source code using go-swagger. Do not edit the generated kps_api.json directly!  # noqa: E501

    OpenAPI spec version: 1.0
    Contact: karbon-platform-services-api@nutanix.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six
from kps_api.models.category_info import CategoryInfo  # noqa: F401,E501
from kps_api.models.data_ifc_endpoint import DataIfcEndpoint  # noqa: F401,E501
from kps_api.models.helm_app_metadata import HelmAppMetadata  # noqa: F401,E501


class Application(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 = {
        'data_ifc_endpoints': 'list[DataIfcEndpoint]',
        'description': 'str',
        'edge_ids': 'list[str]',
        'edge_selectors': 'list[CategoryInfo]',
        'exclude_edge_ids': 'list[str]',
        'helm_metadata': 'HelmAppMetadata',
        'id': 'str',
        'name': 'str',
        'only_pre_pull_on_update': 'bool',
        'origin_selectors': 'list[CategoryInfo]',
        'packaging_type': 'str',
        'project_id': 'str',
        'state': 'str',
        'user_id': 'str',
        'yaml_data': 'str'
    }

    attribute_map = {
        'data_ifc_endpoints': 'dataIfcEndpoints',
        'description': 'description',
        'edge_ids': 'edgeIds',
        'edge_selectors': 'edgeSelectors',
        'exclude_edge_ids': 'excludeEdgeIds',
        'helm_metadata': 'helmMetadata',
        'id': 'id',
        'name': 'name',
        'only_pre_pull_on_update': 'onlyPrePullOnUpdate',
        'origin_selectors': 'originSelectors',
        'packaging_type': 'packagingType',
        'project_id': 'projectId',
        'state': 'state',
        'user_id': 'userId',
        'yaml_data': 'yamlData'
    }

    def __init__(self, data_ifc_endpoints=None, description=None, edge_ids=None, edge_selectors=None, exclude_edge_ids=None, helm_metadata=None, id=None, name=None, only_pre_pull_on_update=None, origin_selectors=None, packaging_type=None, project_id=None, state=None, user_id=None, yaml_data=None):  # noqa: E501
        """Application - a model defined in Swagger"""  # noqa: E501
        self._data_ifc_endpoints = None
        self._description = None
        self._edge_ids = None
        self._edge_selectors = None
        self._exclude_edge_ids = None
        self._helm_metadata = None
        self._id = None
        self._name = None
        self._only_pre_pull_on_update = None
        self._origin_selectors = None
        self._packaging_type = None
        self._project_id = None
        self._state = None
        self._user_id = None
        self._yaml_data = None
        self.discriminator = None
        if data_ifc_endpoints is not None:
            self.data_ifc_endpoints = data_ifc_endpoints
        if description is not None:
            self.description = description
        if edge_ids is not None:
            self.edge_ids = edge_ids
        if edge_selectors is not None:
            self.edge_selectors = edge_selectors
        if exclude_edge_ids is not None:
            self.exclude_edge_ids = exclude_edge_ids
        if helm_metadata is not None:
            self.helm_metadata = helm_metadata
        if id is not None:
            self.id = id
        self.name = name
        if only_pre_pull_on_update is not None:
            self.only_pre_pull_on_update = only_pre_pull_on_update
        if origin_selectors is not None:
            self.origin_selectors = origin_selectors
        if packaging_type is not None:
            self.packaging_type = packaging_type
        self.project_id = project_id
        if state is not None:
            self.state = state
        if user_id is not None:
            self.user_id = user_id
        self.yaml_data = yaml_data

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

        DataIfcEndpoints is a list of endpoints exposed to an application.  # noqa: E501

        :return: The data_ifc_endpoints of this Application.  # noqa: E501
        :rtype: list[DataIfcEndpoint]
        """
        return self._data_ifc_endpoints

    @data_ifc_endpoints.setter
    def data_ifc_endpoints(self, data_ifc_endpoints):
        """Sets the data_ifc_endpoints of this Application.

        DataIfcEndpoints is a list of endpoints exposed to an application.  # noqa: E501

        :param data_ifc_endpoints: The data_ifc_endpoints of this Application.  # noqa: E501
        :type: list[DataIfcEndpoint]
        """

        self._data_ifc_endpoints = data_ifc_endpoints

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

        A description of the application. Maximum length of 200 characters.  # noqa: E501

        :return: The description of this Application.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this Application.

        A description of the application. Maximum length of 200 characters.  # noqa: E501

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

        self._description = description

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

        Edges listed according to ID where the application is deployed. Only relevant if the parent project EdgeSelectorType value is set to Explicit.  # noqa: E501

        :return: The edge_ids of this Application.  # noqa: E501
        :rtype: list[str]
        """
        return self._edge_ids

    @edge_ids.setter
    def edge_ids(self, edge_ids):
        """Sets the edge_ids of this Application.

        Edges listed according to ID where the application is deployed. Only relevant if the parent project EdgeSelectorType value is set to Explicit.  # noqa: E501

        :param edge_ids: The edge_ids of this Application.  # noqa: E501
        :type: list[str]
        """

        self._edge_ids = edge_ids

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

        Select edges according to CategoryInfo. Only relevant if the parent project EdgeSelectorType value is set to Category.  # noqa: E501

        :return: The edge_selectors of this Application.  # noqa: E501
        :rtype: list[CategoryInfo]
        """
        return self._edge_selectors

    @edge_selectors.setter
    def edge_selectors(self, edge_selectors):
        """Sets the edge_selectors of this Application.

        Select edges according to CategoryInfo. Only relevant if the parent project EdgeSelectorType value is set to Category.  # noqa: E501

        :param edge_selectors: The edge_selectors of this Application.  # noqa: E501
        :type: list[CategoryInfo]
        """

        self._edge_selectors = edge_selectors

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

        Edges to be excluded from the application deployment.  # noqa: E501

        :return: The exclude_edge_ids of this Application.  # noqa: E501
        :rtype: list[str]
        """
        return self._exclude_edge_ids

    @exclude_edge_ids.setter
    def exclude_edge_ids(self, exclude_edge_ids):
        """Sets the exclude_edge_ids of this Application.

        Edges to be excluded from the application deployment.  # noqa: E501

        :param exclude_edge_ids: The exclude_edge_ids of this Application.  # noqa: E501
        :type: list[str]
        """

        self._exclude_edge_ids = exclude_edge_ids

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


        :return: The helm_metadata of this Application.  # noqa: E501
        :rtype: HelmAppMetadata
        """
        return self._helm_metadata

    @helm_metadata.setter
    def helm_metadata(self, helm_metadata):
        """Sets the helm_metadata of this Application.


        :param helm_metadata: The helm_metadata of this Application.  # noqa: E501
        :type: HelmAppMetadata
        """

        self._helm_metadata = helm_metadata

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

        ID of the entity Maximum character length is 64 for project, category, and runtime environment, 36 for other entity types.  # noqa: E501

        :return: The id of this Application.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Application.

        ID of the entity Maximum character length is 64 for project, category, and runtime environment, 36 for other entity types.  # noqa: E501

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

        self._id = id

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

        The application name. Maximum length of 200 characters.  # noqa: E501

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

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

        The application name. Maximum length of 200 characters.  # noqa: E501

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

        self._name = name

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

        Only pre-pull images on service domains w/o doing an actual update. Service domain which have not yet deployed the app will deploy application like usual. Update will commence once this flag is unset.  # noqa: E501

        :return: The only_pre_pull_on_update of this Application.  # noqa: E501
        :rtype: bool
        """
        return self._only_pre_pull_on_update

    @only_pre_pull_on_update.setter
    def only_pre_pull_on_update(self, only_pre_pull_on_update):
        """Sets the only_pre_pull_on_update of this Application.

        Only pre-pull images on service domains w/o doing an actual update. Service domain which have not yet deployed the app will deploy application like usual. Update will commence once this flag is unset.  # noqa: E501

        :param only_pre_pull_on_update: The only_pre_pull_on_update of this Application.  # noqa: E501
        :type: bool
        """

        self._only_pre_pull_on_update = only_pre_pull_on_update

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

        OriginSelectors is the list of CategoryInfo used as criteria to feed data into applications.  # noqa: E501

        :return: The origin_selectors of this Application.  # noqa: E501
        :rtype: list[CategoryInfo]
        """
        return self._origin_selectors

    @origin_selectors.setter
    def origin_selectors(self, origin_selectors):
        """Sets the origin_selectors of this Application.

        OriginSelectors is the list of CategoryInfo used as criteria to feed data into applications.  # noqa: E501

        :param origin_selectors: The origin_selectors of this Application.  # noqa: E501
        :type: list[CategoryInfo]
        """

        self._origin_selectors = origin_selectors

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

        PackagingType vanilla or helm, nil = vanilla  # noqa: E501

        :return: The packaging_type of this Application.  # noqa: E501
        :rtype: str
        """
        return self._packaging_type

    @packaging_type.setter
    def packaging_type(self, packaging_type):
        """Sets the packaging_type of this Application.

        PackagingType vanilla or helm, nil = vanilla  # noqa: E501

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

        self._packaging_type = packaging_type

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

        Parent project ID. Not required (to maintain backward compatibility).  # noqa: E501

        :return: The project_id of this Application.  # noqa: E501
        :rtype: str
        """
        return self._project_id

    @project_id.setter
    def project_id(self, project_id):
        """Sets the project_id of this Application.

        Parent project ID. Not required (to maintain backward compatibility).  # noqa: E501

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

        self._project_id = project_id

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

        State of this entity  # noqa: E501

        :return: The state of this Application.  # noqa: E501
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this Application.

        State of this entity  # noqa: E501

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

        self._state = state

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

        Last modified user ID. Only required by edge for privilege check.  # noqa: E501

        :return: The user_id of this Application.  # noqa: E501
        :rtype: str
        """
        return self._user_id

    @user_id.setter
    def user_id(self, user_id):
        """Sets the user_id of this Application.

        Last modified user ID. Only required by edge for privilege check.  # noqa: E501

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

        self._user_id = user_id

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

        The YAML content for the application.  # noqa: E501

        :return: The yaml_data of this Application.  # noqa: E501
        :rtype: str
        """
        return self._yaml_data

    @yaml_data.setter
    def yaml_data(self, yaml_data):
        """Sets the yaml_data of this Application.

        The YAML content for the application.  # noqa: E501

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

        self._yaml_data = yaml_data

    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(Application, 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, Application):
            return False

        return self.__dict__ == other.__dict__

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