# 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
"""


import pprint
import re  # noqa: F401

import six

from grid.openapi.configuration import Configuration


class V1RunSpec(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',
        'cluster_id': 'str',
        'datastores': 'list[V1DatastoreMounts]',
        'desired_state': 'V1RunState',
        'dry_run': 'bool',
        'env': 'dict(str, str)',
        'image': 'Externalv1ImageSpec',
        'instance_type': 'str',
        'nodes': 'int',
        'payload': 'str',
        'resources': 'V1Resources',
        'run_controller_id': 'str',
        'scratch': 'list[Externalv1ScratchSpace]',
        'source_code': 'str',
        'sweep_options': 'dict(str, str)',
        'sweep_type': 'str',
        'use_spot': 'bool',
        'user_id': 'str'
    }

    attribute_map = {
        'actions': 'actions',
        'cluster_id': 'clusterId',
        'datastores': 'datastores',
        'desired_state': 'desiredState',
        'dry_run': 'dryRun',
        'env': 'env',
        'image': 'image',
        'instance_type': 'instanceType',
        'nodes': 'nodes',
        'payload': 'payload',
        'resources': 'resources',
        'run_controller_id': 'runControllerId',
        'scratch': 'scratch',
        'source_code': 'sourceCode',
        'sweep_options': 'sweepOptions',
        'sweep_type': 'sweepType',
        'use_spot': 'useSpot',
        'user_id': 'userId'
    }

    def __init__(self, actions=None, cluster_id=None, datastores=None, desired_state=None, dry_run=None, env=None, image=None, instance_type=None, nodes=None, payload=None, resources=None, run_controller_id=None, scratch=None, source_code=None, sweep_options=None, sweep_type=None, use_spot=None, user_id=None, _configuration=None):  # noqa: E501
        """V1RunSpec - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._actions = None
        self._cluster_id = None
        self._datastores = None
        self._desired_state = None
        self._dry_run = None
        self._env = None
        self._image = None
        self._instance_type = None
        self._nodes = None
        self._payload = None
        self._resources = None
        self._run_controller_id = None
        self._scratch = None
        self._source_code = None
        self._sweep_options = None
        self._sweep_type = None
        self._use_spot = None
        self._user_id = None
        self.discriminator = None

        if actions is not None:
            self.actions = actions
        if cluster_id is not None:
            self.cluster_id = cluster_id
        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 nodes is not None:
            self.nodes = nodes
        if payload is not None:
            self.payload = payload
        if resources is not None:
            self.resources = resources
        if run_controller_id is not None:
            self.run_controller_id = run_controller_id
        if scratch is not None:
            self.scratch = scratch
        if source_code is not None:
            self.source_code = source_code
        if sweep_options is not None:
            self.sweep_options = sweep_options
        if sweep_type is not None:
            self.sweep_type = sweep_type
        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):
        """Gets the actions of this V1RunSpec.  # noqa: E501


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

    @actions.setter
    def actions(self, actions):
        """Sets the actions of this V1RunSpec.


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

        self._actions = actions

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


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

    @cluster_id.setter
    def cluster_id(self, cluster_id):
        """Sets the cluster_id of this V1RunSpec.


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

        self._cluster_id = cluster_id

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


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

    @datastores.setter
    def datastores(self, datastores):
        """Sets the datastores of this V1RunSpec.


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

        self._datastores = datastores

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


        :return: The desired_state of this V1RunSpec.  # noqa: E501
        :rtype: V1RunState
        """
        return self._desired_state

    @desired_state.setter
    def desired_state(self, desired_state):
        """Sets the desired_state of this V1RunSpec.


        :param desired_state: The desired_state of this V1RunSpec.  # noqa: E501
        :type: V1RunState
        """

        self._desired_state = desired_state

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


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

    @dry_run.setter
    def dry_run(self, dry_run):
        """Sets the dry_run of this V1RunSpec.


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

        self._dry_run = dry_run

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


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

    @env.setter
    def env(self, env):
        """Sets the env of this V1RunSpec.


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

        self._env = env

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


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

    @image.setter
    def image(self, image):
        """Sets the image of this V1RunSpec.


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

        self._image = image

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


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

    @instance_type.setter
    def instance_type(self, instance_type):
        """Sets the instance_type of this V1RunSpec.


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

        self._instance_type = instance_type

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


        :return: The nodes of this V1RunSpec.  # noqa: E501
        :rtype: int
        """
        return self._nodes

    @nodes.setter
    def nodes(self, nodes):
        """Sets the nodes of this V1RunSpec.


        :param nodes: The nodes of this V1RunSpec.  # noqa: E501
        :type: int
        """

        self._nodes = nodes

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


        :return: The payload of this V1RunSpec.  # noqa: E501
        :rtype: str
        """
        return self._payload

    @payload.setter
    def payload(self, payload):
        """Sets the payload of this V1RunSpec.


        :param payload: The payload of this V1RunSpec.  # noqa: E501
        :type: str
        """

        self._payload = payload

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


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

    @resources.setter
    def resources(self, resources):
        """Sets the resources of this V1RunSpec.


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

        self._resources = resources

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


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

    @run_controller_id.setter
    def run_controller_id(self, run_controller_id):
        """Sets the run_controller_id of this V1RunSpec.


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

        self._run_controller_id = run_controller_id

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


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

    @scratch.setter
    def scratch(self, scratch):
        """Sets the scratch of this V1RunSpec.


        :param scratch: The scratch of this V1RunSpec.  # noqa: E501
        :type: list[Externalv1ScratchSpace]
        """

        self._scratch = scratch

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


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

    @source_code.setter
    def source_code(self, source_code):
        """Sets the source_code of this V1RunSpec.


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

        self._source_code = source_code

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


        :return: The sweep_options of this V1RunSpec.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._sweep_options

    @sweep_options.setter
    def sweep_options(self, sweep_options):
        """Sets the sweep_options of this V1RunSpec.


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

        self._sweep_options = sweep_options

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


        :return: The sweep_type of this V1RunSpec.  # noqa: E501
        :rtype: str
        """
        return self._sweep_type

    @sweep_type.setter
    def sweep_type(self, sweep_type):
        """Sets the sweep_type of this V1RunSpec.


        :param sweep_type: The sweep_type of this V1RunSpec.  # noqa: E501
        :type: str
        """

        self._sweep_type = sweep_type

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


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

    @use_spot.setter
    def use_spot(self, use_spot):
        """Sets the use_spot of this V1RunSpec.


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

        self._use_spot = use_spot

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


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

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


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

        self._user_id = user_id

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

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