# coding: utf-8

"""
    DigitalRebar Provision Server

    # An RestFUL API-driven Provisioner and DHCP server  # noqa: E501

    OpenAPI spec version: 4.14.0
    Contact: support@rackn.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from drppy_client.configuration import Configuration


class Stage(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 = {
        'available': 'bool',
        'boot_env': 'str',
        'bundle': 'str',
        'created_at': 'datetime',
        'created_by': 'str',
        'description': 'str',
        'documentation': 'str',
        'endpoint': 'str',
        'errors': 'list[str]',
        'last_modified_at': 'datetime',
        'last_modified_by': 'str',
        'meta': 'Meta',
        'name': 'str',
        'optional_params': 'list[str]',
        'output_params': 'list[str]',
        'params': 'dict(str, object)',
        'partial': 'bool',
        'profiles': 'list[str]',
        'read_only': 'bool',
        'reboot': 'bool',
        'required_params': 'list[str]',
        'runner_wait': 'bool',
        'tasks': 'list[str]',
        'templates': 'list[TemplateInfo]',
        'validated': 'bool'
    }

    attribute_map = {
        'available': 'Available',
        'boot_env': 'BootEnv',
        'bundle': 'Bundle',
        'created_at': 'CreatedAt',
        'created_by': 'CreatedBy',
        'description': 'Description',
        'documentation': 'Documentation',
        'endpoint': 'Endpoint',
        'errors': 'Errors',
        'last_modified_at': 'LastModifiedAt',
        'last_modified_by': 'LastModifiedBy',
        'meta': 'Meta',
        'name': 'Name',
        'optional_params': 'OptionalParams',
        'output_params': 'OutputParams',
        'params': 'Params',
        'partial': 'Partial',
        'profiles': 'Profiles',
        'read_only': 'ReadOnly',
        'reboot': 'Reboot',
        'required_params': 'RequiredParams',
        'runner_wait': 'RunnerWait',
        'tasks': 'Tasks',
        'templates': 'Templates',
        'validated': 'Validated'
    }

    def __init__(self, available=None, boot_env=None, bundle=None, created_at=None, created_by=None, description=None, documentation=None, endpoint=None, errors=None, last_modified_at=None, last_modified_by=None, meta=None, name=None, optional_params=None, output_params=None, params=None, partial=None, profiles=None, read_only=None, reboot=None, required_params=None, runner_wait=None, tasks=None, templates=None, validated=None, _configuration=None):  # noqa: E501
        """Stage - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._available = None
        self._boot_env = None
        self._bundle = None
        self._created_at = None
        self._created_by = None
        self._description = None
        self._documentation = None
        self._endpoint = None
        self._errors = None
        self._last_modified_at = None
        self._last_modified_by = None
        self._meta = None
        self._name = None
        self._optional_params = None
        self._output_params = None
        self._params = None
        self._partial = None
        self._profiles = None
        self._read_only = None
        self._reboot = None
        self._required_params = None
        self._runner_wait = None
        self._tasks = None
        self._templates = None
        self._validated = None
        self.discriminator = None

        if available is not None:
            self.available = available
        self.boot_env = boot_env
        if bundle is not None:
            self.bundle = bundle
        if created_at is not None:
            self.created_at = created_at
        if created_by is not None:
            self.created_by = created_by
        if description is not None:
            self.description = description
        if documentation is not None:
            self.documentation = documentation
        if endpoint is not None:
            self.endpoint = endpoint
        if errors is not None:
            self.errors = errors
        if last_modified_at is not None:
            self.last_modified_at = last_modified_at
        if last_modified_by is not None:
            self.last_modified_by = last_modified_by
        if meta is not None:
            self.meta = meta
        self.name = name
        if optional_params is not None:
            self.optional_params = optional_params
        if output_params is not None:
            self.output_params = output_params
        if params is not None:
            self.params = params
        if partial is not None:
            self.partial = partial
        if profiles is not None:
            self.profiles = profiles
        if read_only is not None:
            self.read_only = read_only
        if reboot is not None:
            self.reboot = reboot
        self.required_params = required_params
        if runner_wait is not None:
            self.runner_wait = runner_wait
        if tasks is not None:
            self.tasks = tasks
        self.templates = templates
        if validated is not None:
            self.validated = validated

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

        Available tracks whether or not the model passed validation.  # noqa: E501

        :return: The available of this Stage.  # noqa: E501
        :rtype: bool
        """
        return self._available

    @available.setter
    def available(self, available):
        """Sets the available of this Stage.

        Available tracks whether or not the model passed validation.  # noqa: E501

        :param available: The available of this Stage.  # noqa: E501
        :type: bool
        """

        self._available = available

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

        The BootEnv the machine should be in to run this stage. If the machine is not in this bootenv, the bootenv of the machine will be changed.  # noqa: E501

        :return: The boot_env of this Stage.  # noqa: E501
        :rtype: str
        """
        return self._boot_env

    @boot_env.setter
    def boot_env(self, boot_env):
        """Sets the boot_env of this Stage.

        The BootEnv the machine should be in to run this stage. If the machine is not in this bootenv, the bootenv of the machine will be changed.  # noqa: E501

        :param boot_env: The boot_env of this Stage.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and boot_env is None:
            raise ValueError("Invalid value for `boot_env`, must not be `None`")  # noqa: E501

        self._boot_env = boot_env

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

        Bundle tracks the name of the store containing this object. This field is read-only, and cannot be changed via the API.  # noqa: E501

        :return: The bundle of this Stage.  # noqa: E501
        :rtype: str
        """
        return self._bundle

    @bundle.setter
    def bundle(self, bundle):
        """Sets the bundle of this Stage.

        Bundle tracks the name of the store containing this object. This field is read-only, and cannot be changed via the API.  # noqa: E501

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

        self._bundle = bundle

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

        CreatedAt is the time that this object was created.  # noqa: E501

        :return: The created_at of this Stage.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this Stage.

        CreatedAt is the time that this object was created.  # noqa: E501

        :param created_at: The created_at of this Stage.  # noqa: E501
        :type: datetime
        """

        self._created_at = created_at

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

        CreatedBy stores the value of the user that created this object. Note: This value is stored ONLY if the object was created by a user which means that `currentUserName` needs to be populated in the authBlob  # noqa: E501

        :return: The created_by of this Stage.  # noqa: E501
        :rtype: str
        """
        return self._created_by

    @created_by.setter
    def created_by(self, created_by):
        """Sets the created_by of this Stage.

        CreatedBy stores the value of the user that created this object. Note: This value is stored ONLY if the object was created by a user which means that `currentUserName` needs to be populated in the authBlob  # noqa: E501

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

        self._created_by = created_by

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

        Description is a string for providing a simple description  # noqa: E501

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

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

        Description is a string for providing a simple description  # noqa: E501

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

        self._description = description

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

        Documentation is a string for providing additional in depth information.  # noqa: E501

        :return: The documentation of this Stage.  # noqa: E501
        :rtype: str
        """
        return self._documentation

    @documentation.setter
    def documentation(self, documentation):
        """Sets the documentation of this Stage.

        Documentation is a string for providing additional in depth information.  # noqa: E501

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

        self._documentation = documentation

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

        Endpoint tracks the owner of the object among DRP endpoints  # noqa: E501

        :return: The endpoint of this Stage.  # noqa: E501
        :rtype: str
        """
        return self._endpoint

    @endpoint.setter
    def endpoint(self, endpoint):
        """Sets the endpoint of this Stage.

        Endpoint tracks the owner of the object among DRP endpoints  # noqa: E501

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

        self._endpoint = endpoint

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

        If there are any errors in the validation process, they will be available here.  # noqa: E501

        :return: The errors of this Stage.  # noqa: E501
        :rtype: list[str]
        """
        return self._errors

    @errors.setter
    def errors(self, errors):
        """Sets the errors of this Stage.

        If there are any errors in the validation process, they will be available here.  # noqa: E501

        :param errors: The errors of this Stage.  # noqa: E501
        :type: list[str]
        """

        self._errors = errors

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

        LastModifiedAt is the time that this object was last modified.  # noqa: E501

        :return: The last_modified_at of this Stage.  # noqa: E501
        :rtype: datetime
        """
        return self._last_modified_at

    @last_modified_at.setter
    def last_modified_at(self, last_modified_at):
        """Sets the last_modified_at of this Stage.

        LastModifiedAt is the time that this object was last modified.  # noqa: E501

        :param last_modified_at: The last_modified_at of this Stage.  # noqa: E501
        :type: datetime
        """

        self._last_modified_at = last_modified_at

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

        LastModifiedBy stores the value of the user that last modified this object. NOTE: This value is populated ONLY if the object was modified by a user which means any actions done using machine tokens will not get tracked  # noqa: E501

        :return: The last_modified_by of this Stage.  # noqa: E501
        :rtype: str
        """
        return self._last_modified_by

    @last_modified_by.setter
    def last_modified_by(self, last_modified_by):
        """Sets the last_modified_by of this Stage.

        LastModifiedBy stores the value of the user that last modified this object. NOTE: This value is populated ONLY if the object was modified by a user which means any actions done using machine tokens will not get tracked  # noqa: E501

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

        self._last_modified_by = last_modified_by

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


        :return: The meta of this Stage.  # noqa: E501
        :rtype: Meta
        """
        return self._meta

    @meta.setter
    def meta(self, meta):
        """Sets the meta of this Stage.


        :param meta: The meta of this Stage.  # noqa: E501
        :type: Meta
        """

        self._meta = meta

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

        The name of the stage.  # noqa: E501

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

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

        The name of the stage.  # noqa: E501

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

        self._name = name

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

        The list of extra optional parameters for this stage. They can be present as Machine.Params when the stage is applied to the machine.  These are more other consumers of the stage to know what parameters could additionally be applied to the stage by the renderer based upon the Machine.Params  # noqa: E501

        :return: The optional_params of this Stage.  # noqa: E501
        :rtype: list[str]
        """
        return self._optional_params

    @optional_params.setter
    def optional_params(self, optional_params):
        """Sets the optional_params of this Stage.

        The list of extra optional parameters for this stage. They can be present as Machine.Params when the stage is applied to the machine.  These are more other consumers of the stage to know what parameters could additionally be applied to the stage by the renderer based upon the Machine.Params  # noqa: E501

        :param optional_params: The optional_params of this Stage.  # noqa: E501
        :type: list[str]
        """

        self._optional_params = optional_params

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

        OutputParams are that parameters that are possibly set by the Task  # noqa: E501

        :return: The output_params of this Stage.  # noqa: E501
        :rtype: list[str]
        """
        return self._output_params

    @output_params.setter
    def output_params(self, output_params):
        """Sets the output_params of this Stage.

        OutputParams are that parameters that are possibly set by the Task  # noqa: E501

        :param output_params: The output_params of this Stage.  # noqa: E501
        :type: list[str]
        """

        self._output_params = output_params

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

        Params holds the values of parameters on the object.  The field is a key / value store of the parameters. The key is the name of a parameter.  The key is of type string. The value is the value of the parameter.  The type of the value is defined by the parameter object.  If the key doesn't reference a parameter, the type of the object can be anything.  The system will enforce the named parameter's value's type.  Go calls the \"anything\" parameters as \"interface {}\".  Hence, the type of this field is a map[string]interface{}.  # noqa: E501

        :return: The params of this Stage.  # noqa: E501
        :rtype: dict(str, object)
        """
        return self._params

    @params.setter
    def params(self, params):
        """Sets the params of this Stage.

        Params holds the values of parameters on the object.  The field is a key / value store of the parameters. The key is the name of a parameter.  The key is of type string. The value is the value of the parameter.  The type of the value is defined by the parameter object.  If the key doesn't reference a parameter, the type of the object can be anything.  The system will enforce the named parameter's value's type.  Go calls the \"anything\" parameters as \"interface {}\".  Hence, the type of this field is a map[string]interface{}.  # noqa: E501

        :param params: The params of this Stage.  # noqa: E501
        :type: dict(str, object)
        """

        self._params = params

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

        Partial tracks if the object is not complete when returned.  # noqa: E501

        :return: The partial of this Stage.  # noqa: E501
        :rtype: bool
        """
        return self._partial

    @partial.setter
    def partial(self, partial):
        """Sets the partial of this Stage.

        Partial tracks if the object is not complete when returned.  # noqa: E501

        :param partial: The partial of this Stage.  # noqa: E501
        :type: bool
        """

        self._partial = partial

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

        Profiles is an array of profiles to apply to this object in order when looking for a parameter during rendering.  # noqa: E501

        :return: The profiles of this Stage.  # noqa: E501
        :rtype: list[str]
        """
        return self._profiles

    @profiles.setter
    def profiles(self, profiles):
        """Sets the profiles of this Stage.

        Profiles is an array of profiles to apply to this object in order when looking for a parameter during rendering.  # noqa: E501

        :param profiles: The profiles of this Stage.  # noqa: E501
        :type: list[str]
        """

        self._profiles = profiles

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

        ReadOnly tracks if the store for this object is read-only. This flag is informational, and cannot be changed via the API.  # noqa: E501

        :return: The read_only of this Stage.  # noqa: E501
        :rtype: bool
        """
        return self._read_only

    @read_only.setter
    def read_only(self, read_only):
        """Sets the read_only of this Stage.

        ReadOnly tracks if the store for this object is read-only. This flag is informational, and cannot be changed via the API.  # noqa: E501

        :param read_only: The read_only of this Stage.  # noqa: E501
        :type: bool
        """

        self._read_only = read_only

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

        Flag to indicate if a node should be PXE booted on this transition into this Stage.  The nextbootpxe and reboot machine actions will be called if present and Reboot is true  # noqa: E501

        :return: The reboot of this Stage.  # noqa: E501
        :rtype: bool
        """
        return self._reboot

    @reboot.setter
    def reboot(self, reboot):
        """Sets the reboot of this Stage.

        Flag to indicate if a node should be PXE booted on this transition into this Stage.  The nextbootpxe and reboot machine actions will be called if present and Reboot is true  # noqa: E501

        :param reboot: The reboot of this Stage.  # noqa: E501
        :type: bool
        """

        self._reboot = reboot

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

        The list of extra required parameters for this stage. They should be present as Machine.Params when the stage is applied to the machine.  # noqa: E501

        :return: The required_params of this Stage.  # noqa: E501
        :rtype: list[str]
        """
        return self._required_params

    @required_params.setter
    def required_params(self, required_params):
        """Sets the required_params of this Stage.

        The list of extra required parameters for this stage. They should be present as Machine.Params when the stage is applied to the machine.  # noqa: E501

        :param required_params: The required_params of this Stage.  # noqa: E501
        :type: list[str]
        """
        if self._configuration.client_side_validation and required_params is None:
            raise ValueError("Invalid value for `required_params`, must not be `None`")  # noqa: E501

        self._required_params = required_params

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

        This flag is deprecated and will always be TRUE.  # noqa: E501

        :return: The runner_wait of this Stage.  # noqa: E501
        :rtype: bool
        """
        return self._runner_wait

    @runner_wait.setter
    def runner_wait(self, runner_wait):
        """Sets the runner_wait of this Stage.

        This flag is deprecated and will always be TRUE.  # noqa: E501

        :param runner_wait: The runner_wait of this Stage.  # noqa: E501
        :type: bool
        """

        self._runner_wait = runner_wait

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

        The list of initial machine tasks that the stage should run  # noqa: E501

        :return: The tasks of this Stage.  # noqa: E501
        :rtype: list[str]
        """
        return self._tasks

    @tasks.setter
    def tasks(self, tasks):
        """Sets the tasks of this Stage.

        The list of initial machine tasks that the stage should run  # noqa: E501

        :param tasks: The tasks of this Stage.  # noqa: E501
        :type: list[str]
        """

        self._tasks = tasks

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

        The templates that should be expanded into files for the stage.  # noqa: E501

        :return: The templates of this Stage.  # noqa: E501
        :rtype: list[TemplateInfo]
        """
        return self._templates

    @templates.setter
    def templates(self, templates):
        """Sets the templates of this Stage.

        The templates that should be expanded into files for the stage.  # noqa: E501

        :param templates: The templates of this Stage.  # noqa: E501
        :type: list[TemplateInfo]
        """
        if self._configuration.client_side_validation and templates is None:
            raise ValueError("Invalid value for `templates`, must not be `None`")  # noqa: E501

        self._templates = templates

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

        Validated tracks whether or not the model has been validated.  # noqa: E501

        :return: The validated of this Stage.  # noqa: E501
        :rtype: bool
        """
        return self._validated

    @validated.setter
    def validated(self, validated):
        """Sets the validated of this Stage.

        Validated tracks whether or not the model has been validated.  # noqa: E501

        :param validated: The validated of this Stage.  # noqa: E501
        :type: bool
        """

        self._validated = validated

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

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