# coding: utf-8

"""
    external/v1/external_session_service.proto

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

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

    NOTE
    ----
    standard swagger-codegen-cli for this python client has been modified
    by custom templates. The purpose of these templates is to include
    typing information in the API and Model code. Please refer to the
    main grid repository for more info
"""


import pprint
import re  # noqa: F401
from typing import TYPE_CHECKING

import six

from grid.openapi.configuration import Configuration

if TYPE_CHECKING:
    from datetime import datetime
    from grid.openapi.models import *

class Externalv1ExperimentSpec(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 = {
        'actions': 'V1RunActions',
        'auto_resume': 'bool',
        'cluster_id': 'str',
        'command': 'list[str]',
        'datastores': 'list[V1DatastoreMounts]',
        'desired_state': 'V1ExperimentState',
        'dry_run': 'bool',
        'env': 'dict(str, str)',
        'image': 'Externalv1ImageSpec',
        'instance_type': 'str',
        'resources': 'V1Resources',
        'run_controller_id': 'str',
        'run_id': 'str',
        'scratch': 'list[Gridv1ScratchSpace]',
        'source_code': 'str',
        'use_spot': 'bool',
        'user_id': 'str'
    }

    attribute_map = {
        'actions': 'actions',
        'auto_resume': 'autoResume',
        'cluster_id': 'clusterId',
        'command': 'command',
        'datastores': 'datastores',
        'desired_state': 'desiredState',
        'dry_run': 'dryRun',
        'env': 'env',
        'image': 'image',
        'instance_type': 'instanceType',
        'resources': 'resources',
        'run_controller_id': 'runControllerId',
        'run_id': 'runId',
        'scratch': 'scratch',
        'source_code': 'sourceCode',
        'use_spot': 'useSpot',
        'user_id': 'userId'
    }

    def __init__(self, actions: 'V1RunActions' = None, auto_resume: 'bool' = None, cluster_id: 'str' = None, command: 'list[str]' = None, datastores: 'list[V1DatastoreMounts]' = None, desired_state: 'V1ExperimentState' = None, dry_run: 'bool' = None, env: 'dict(str, str)' = None, image: 'Externalv1ImageSpec' = None, instance_type: 'str' = None, resources: 'V1Resources' = None, run_controller_id: 'str' = None, run_id: 'str' = None, scratch: 'list[Gridv1ScratchSpace]' = None, source_code: 'str' = None, use_spot: 'bool' = None, user_id: 'str' = None, _configuration=None):  # noqa: E501
        """Externalv1ExperimentSpec - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._actions = None
        self._auto_resume = None
        self._cluster_id = None
        self._command = None
        self._datastores = None
        self._desired_state = None
        self._dry_run = None
        self._env = None
        self._image = None
        self._instance_type = None
        self._resources = None
        self._run_controller_id = None
        self._run_id = None
        self._scratch = None
        self._source_code = None
        self._use_spot = None
        self._user_id = None
        self.discriminator = None

        if actions is not None:
            self.actions = actions
        if auto_resume is not None:
            self.auto_resume = auto_resume
        if cluster_id is not None:
            self.cluster_id = cluster_id
        if command is not None:
            self.command = command
        if datastores is not None:
            self.datastores = datastores
        if desired_state is not None:
            self.desired_state = desired_state
        if dry_run is not None:
            self.dry_run = dry_run
        if env is not None:
            self.env = env
        if image is not None:
            self.image = image
        if instance_type is not None:
            self.instance_type = instance_type
        if resources is not None:
            self.resources = resources
        if run_controller_id is not None:
            self.run_controller_id = run_controller_id
        if run_id is not None:
            self.run_id = run_id
        if scratch is not None:
            self.scratch = scratch
        if source_code is not None:
            self.source_code = source_code
        if use_spot is not None:
            self.use_spot = use_spot
        if user_id is not None:
            self.user_id = user_id

    @property
    def actions(self) -> 'V1RunActions':
        """Gets the actions of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The actions of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: V1RunActions
        """
        return self._actions

    @actions.setter
    def actions(self, actions: 'V1RunActions'):
        """Sets the actions of this Externalv1ExperimentSpec.


        :param actions: The actions of this Externalv1ExperimentSpec.  # noqa: E501
        :type: V1RunActions
        """

        self._actions = actions

    @property
    def auto_resume(self) -> 'bool':
        """Gets the auto_resume of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The auto_resume of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: bool
        """
        return self._auto_resume

    @auto_resume.setter
    def auto_resume(self, auto_resume: 'bool'):
        """Sets the auto_resume of this Externalv1ExperimentSpec.


        :param auto_resume: The auto_resume of this Externalv1ExperimentSpec.  # noqa: E501
        :type: bool
        """

        self._auto_resume = auto_resume

    @property
    def cluster_id(self) -> 'str':
        """Gets the cluster_id of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The cluster_id of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: str
        """
        return self._cluster_id

    @cluster_id.setter
    def cluster_id(self, cluster_id: 'str'):
        """Sets the cluster_id of this Externalv1ExperimentSpec.


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

        self._cluster_id = cluster_id

    @property
    def command(self) -> 'list[str]':
        """Gets the command of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The command of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: list[str]
        """
        return self._command

    @command.setter
    def command(self, command: 'list[str]'):
        """Sets the command of this Externalv1ExperimentSpec.


        :param command: The command of this Externalv1ExperimentSpec.  # noqa: E501
        :type: list[str]
        """

        self._command = command

    @property
    def datastores(self) -> 'list[V1DatastoreMounts]':
        """Gets the datastores of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The datastores of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: list[V1DatastoreMounts]
        """
        return self._datastores

    @datastores.setter
    def datastores(self, datastores: 'list[V1DatastoreMounts]'):
        """Sets the datastores of this Externalv1ExperimentSpec.


        :param datastores: The datastores of this Externalv1ExperimentSpec.  # noqa: E501
        :type: list[V1DatastoreMounts]
        """

        self._datastores = datastores

    @property
    def desired_state(self) -> 'V1ExperimentState':
        """Gets the desired_state of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The desired_state of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: V1ExperimentState
        """
        return self._desired_state

    @desired_state.setter
    def desired_state(self, desired_state: 'V1ExperimentState'):
        """Sets the desired_state of this Externalv1ExperimentSpec.


        :param desired_state: The desired_state of this Externalv1ExperimentSpec.  # noqa: E501
        :type: V1ExperimentState
        """

        self._desired_state = desired_state

    @property
    def dry_run(self) -> 'bool':
        """Gets the dry_run of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The dry_run of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: bool
        """
        return self._dry_run

    @dry_run.setter
    def dry_run(self, dry_run: 'bool'):
        """Sets the dry_run of this Externalv1ExperimentSpec.


        :param dry_run: The dry_run of this Externalv1ExperimentSpec.  # noqa: E501
        :type: bool
        """

        self._dry_run = dry_run

    @property
    def env(self) -> 'dict(str, str)':
        """Gets the env of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The env of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._env

    @env.setter
    def env(self, env: 'dict(str, str)'):
        """Sets the env of this Externalv1ExperimentSpec.


        :param env: The env of this Externalv1ExperimentSpec.  # noqa: E501
        :type: dict(str, str)
        """

        self._env = env

    @property
    def image(self) -> 'Externalv1ImageSpec':
        """Gets the image of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The image of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: Externalv1ImageSpec
        """
        return self._image

    @image.setter
    def image(self, image: 'Externalv1ImageSpec'):
        """Sets the image of this Externalv1ExperimentSpec.


        :param image: The image of this Externalv1ExperimentSpec.  # noqa: E501
        :type: Externalv1ImageSpec
        """

        self._image = image

    @property
    def instance_type(self) -> 'str':
        """Gets the instance_type of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The instance_type of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: str
        """
        return self._instance_type

    @instance_type.setter
    def instance_type(self, instance_type: 'str'):
        """Sets the instance_type of this Externalv1ExperimentSpec.


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

        self._instance_type = instance_type

    @property
    def resources(self) -> 'V1Resources':
        """Gets the resources of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The resources of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: V1Resources
        """
        return self._resources

    @resources.setter
    def resources(self, resources: 'V1Resources'):
        """Sets the resources of this Externalv1ExperimentSpec.


        :param resources: The resources of this Externalv1ExperimentSpec.  # noqa: E501
        :type: V1Resources
        """

        self._resources = resources

    @property
    def run_controller_id(self) -> 'str':
        """Gets the run_controller_id of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The run_controller_id of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: str
        """
        return self._run_controller_id

    @run_controller_id.setter
    def run_controller_id(self, run_controller_id: 'str'):
        """Sets the run_controller_id of this Externalv1ExperimentSpec.


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

        self._run_controller_id = run_controller_id

    @property
    def run_id(self) -> 'str':
        """Gets the run_id of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The run_id of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: str
        """
        return self._run_id

    @run_id.setter
    def run_id(self, run_id: 'str'):
        """Sets the run_id of this Externalv1ExperimentSpec.


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

        self._run_id = run_id

    @property
    def scratch(self) -> 'list[Gridv1ScratchSpace]':
        """Gets the scratch of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The scratch of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: list[Gridv1ScratchSpace]
        """
        return self._scratch

    @scratch.setter
    def scratch(self, scratch: 'list[Gridv1ScratchSpace]'):
        """Sets the scratch of this Externalv1ExperimentSpec.


        :param scratch: The scratch of this Externalv1ExperimentSpec.  # noqa: E501
        :type: list[Gridv1ScratchSpace]
        """

        self._scratch = scratch

    @property
    def source_code(self) -> 'str':
        """Gets the source_code of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The source_code of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: str
        """
        return self._source_code

    @source_code.setter
    def source_code(self, source_code: 'str'):
        """Sets the source_code of this Externalv1ExperimentSpec.


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

        self._source_code = source_code

    @property
    def use_spot(self) -> 'bool':
        """Gets the use_spot of this Externalv1ExperimentSpec.  # noqa: E501


        :return: The use_spot of this Externalv1ExperimentSpec.  # noqa: E501
        :rtype: bool
        """
        return self._use_spot

    @use_spot.setter
    def use_spot(self, use_spot: 'bool'):
        """Sets the use_spot of this Externalv1ExperimentSpec.


        :param use_spot: The use_spot of this Externalv1ExperimentSpec.  # noqa: E501
        :type: bool
        """

        self._use_spot = use_spot

    @property
    def user_id(self) -> 'str':
        """Gets the user_id of this Externalv1ExperimentSpec.  # noqa: E501


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

    @user_id.setter
    def user_id(self, user_id: 'str'):
        """Sets the user_id of this Externalv1ExperimentSpec.


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

        self._user_id = user_id

    def to_dict(self) -> dict:
        """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(Externalv1ExperimentSpec, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self) -> str:
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self) -> str:
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other: 'Externalv1ExperimentSpec') -> bool:
        """Returns true if both objects are equal"""
        if not isinstance(other, Externalv1ExperimentSpec):
            return False

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

    def __ne__(self, other: 'Externalv1ExperimentSpec') -> bool:
        """Returns true if both objects are not equal"""
        if not isinstance(other, Externalv1ExperimentSpec):
            return True

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