# coding: utf-8

"""
    

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

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


from pprint import pformat

from six import iteritems


class ProcessRun(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 = {
        'pk': 'ProcessRunPK',
        'launched_by_user_ref': 'UserRef',
        'executed_code_version_ref': 'CodeVersionRef',
        'environment': 'str',
        'projects_refs': 'list[ProjectRef]'
    }

    attribute_map = {
        'pk': 'pk',
        'launched_by_user_ref': 'launchedByUserRef',
        'executed_code_version_ref': 'executedCodeVersionRef',
        'environment': 'environment',
        'projects_refs': 'projectsRefs'
    }

    def __init__(self, pk=None, launched_by_user_ref=None, executed_code_version_ref=None, environment=None, projects_refs=None):
        """
        ProcessRun - a model defined in Swagger
        """

        self._pk = None
        self._launched_by_user_ref = None
        self._executed_code_version_ref = None
        self._environment = None
        self._projects_refs = None

        self.pk = pk
        if launched_by_user_ref is not None:
          self.launched_by_user_ref = launched_by_user_ref
        if executed_code_version_ref is not None:
          self.executed_code_version_ref = executed_code_version_ref
        if environment is not None:
          self.environment = environment
        if projects_refs is not None:
          self.projects_refs = projects_refs

    @property
    def pk(self):
        """
        Gets the pk of this ProcessRun.

        :return: The pk of this ProcessRun.
        :rtype: ProcessRunPK
        """
        return self._pk

    @pk.setter
    def pk(self, pk):
        """
        Sets the pk of this ProcessRun.

        :param pk: The pk of this ProcessRun.
        :type: ProcessRunPK
        """
        if pk is None:
            raise ValueError("Invalid value for `pk`, must not be `None`")

        self._pk = pk

    @property
    def launched_by_user_ref(self):
        """
        Gets the launched_by_user_ref of this ProcessRun.
        a user responsible for the start of the process

        :return: The launched_by_user_ref of this ProcessRun.
        :rtype: UserRef
        """
        return self._launched_by_user_ref

    @launched_by_user_ref.setter
    def launched_by_user_ref(self, launched_by_user_ref):
        """
        Sets the launched_by_user_ref of this ProcessRun.
        a user responsible for the start of the process

        :param launched_by_user_ref: The launched_by_user_ref of this ProcessRun.
        :type: UserRef
        """

        self._launched_by_user_ref = launched_by_user_ref

    @property
    def executed_code_version_ref(self):
        """
        Gets the executed_code_version_ref of this ProcessRun.
        indicates which code version is executed in the given process

        :return: The executed_code_version_ref of this ProcessRun.
        :rtype: CodeVersionRef
        """
        return self._executed_code_version_ref

    @executed_code_version_ref.setter
    def executed_code_version_ref(self, executed_code_version_ref):
        """
        Sets the executed_code_version_ref of this ProcessRun.
        indicates which code version is executed in the given process

        :param executed_code_version_ref: The executed_code_version_ref of this ProcessRun.
        :type: CodeVersionRef
        """

        self._executed_code_version_ref = executed_code_version_ref

    @property
    def environment(self):
        """
        Gets the environment of this ProcessRun.
        indicates environment (Prod, Dev, Test) in which the process was executed

        :return: The environment of this ProcessRun.
        :rtype: str
        """
        return self._environment

    @environment.setter
    def environment(self, environment):
        """
        Sets the environment of this ProcessRun.
        indicates environment (Prod, Dev, Test) in which the process was executed

        :param environment: The environment of this ProcessRun.
        :type: str
        """

        self._environment = environment

    @property
    def projects_refs(self):
        """
        Gets the projects_refs of this ProcessRun.
        indicates the top-level Projects to which this process is assigned

        :return: The projects_refs of this ProcessRun.
        :rtype: list[ProjectRef]
        """
        return self._projects_refs

    @projects_refs.setter
    def projects_refs(self, projects_refs):
        """
        Sets the projects_refs of this ProcessRun.
        indicates the top-level Projects to which this process is assigned

        :param projects_refs: The projects_refs of this ProcessRun.
        :type: list[ProjectRef]
        """

        self._projects_refs = projects_refs

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

        return self.__dict__ == other.__dict__

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