github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/job_spec_docker.py (about)

     1  # coding: utf-8
     2  
     3  """
     4      Bacalhau API
     5  
     6      This page is the reference of the Bacalhau REST API. Project docs are available at https://docs.bacalhau.org/. Find more information about Bacalhau at https://github.com/filecoin-project/bacalhau.  # noqa: E501
     7  
     8      OpenAPI spec version: 0.3.22.post4
     9      Contact: team@bacalhau.org
    10      Generated by: https://github.com/swagger-api/swagger-codegen.git
    11  """
    12  
    13  
    14  import pprint
    15  import re  # noqa: F401
    16  
    17  import six
    18  
    19  from bacalhau_apiclient.configuration import Configuration
    20  
    21  
    22  class JobSpecDocker(object):
    23      """NOTE: This class is auto generated by the swagger code generator program.
    24  
    25      Do not edit the class manually.
    26      """
    27  
    28      """
    29      Attributes:
    30        swagger_types (dict): The key is attribute name
    31                              and the value is attribute type.
    32        attribute_map (dict): The key is attribute name
    33                              and the value is json key in definition.
    34      """
    35      swagger_types = {
    36          'entrypoint': 'list[str]',
    37          'environment_variables': 'list[str]',
    38          'image': 'str',
    39          'working_directory': 'str'
    40      }
    41  
    42      attribute_map = {
    43          'entrypoint': 'Entrypoint',
    44          'environment_variables': 'EnvironmentVariables',
    45          'image': 'Image',
    46          'working_directory': 'WorkingDirectory'
    47      }
    48  
    49      def __init__(self, entrypoint=None, environment_variables=None, image=None, working_directory=None, _configuration=None):  # noqa: E501
    50          """JobSpecDocker - a model defined in Swagger"""  # noqa: E501
    51          if _configuration is None:
    52              _configuration = Configuration()
    53          self._configuration = _configuration
    54  
    55          self._entrypoint = None
    56          self._environment_variables = None
    57          self._image = None
    58          self._working_directory = None
    59          self.discriminator = None
    60  
    61          if entrypoint is not None:
    62              self.entrypoint = entrypoint
    63          if environment_variables is not None:
    64              self.environment_variables = environment_variables
    65          if image is not None:
    66              self.image = image
    67          if working_directory is not None:
    68              self.working_directory = working_directory
    69  
    70      @property
    71      def entrypoint(self):
    72          """Gets the entrypoint of this JobSpecDocker.  # noqa: E501
    73  
    74          optionally override the default entrypoint  # noqa: E501
    75  
    76          :return: The entrypoint of this JobSpecDocker.  # noqa: E501
    77          :rtype: list[str]
    78          """
    79          return self._entrypoint
    80  
    81      @entrypoint.setter
    82      def entrypoint(self, entrypoint):
    83          """Sets the entrypoint of this JobSpecDocker.
    84  
    85          optionally override the default entrypoint  # noqa: E501
    86  
    87          :param entrypoint: The entrypoint of this JobSpecDocker.  # noqa: E501
    88          :type: list[str]
    89          """
    90  
    91          self._entrypoint = entrypoint
    92  
    93      @property
    94      def environment_variables(self):
    95          """Gets the environment_variables of this JobSpecDocker.  # noqa: E501
    96  
    97          a map of env to run the container with  # noqa: E501
    98  
    99          :return: The environment_variables of this JobSpecDocker.  # noqa: E501
   100          :rtype: list[str]
   101          """
   102          return self._environment_variables
   103  
   104      @environment_variables.setter
   105      def environment_variables(self, environment_variables):
   106          """Sets the environment_variables of this JobSpecDocker.
   107  
   108          a map of env to run the container with  # noqa: E501
   109  
   110          :param environment_variables: The environment_variables of this JobSpecDocker.  # noqa: E501
   111          :type: list[str]
   112          """
   113  
   114          self._environment_variables = environment_variables
   115  
   116      @property
   117      def image(self):
   118          """Gets the image of this JobSpecDocker.  # noqa: E501
   119  
   120          this should be pullable by docker  # noqa: E501
   121  
   122          :return: The image of this JobSpecDocker.  # noqa: E501
   123          :rtype: str
   124          """
   125          return self._image
   126  
   127      @image.setter
   128      def image(self, image):
   129          """Sets the image of this JobSpecDocker.
   130  
   131          this should be pullable by docker  # noqa: E501
   132  
   133          :param image: The image of this JobSpecDocker.  # noqa: E501
   134          :type: str
   135          """
   136  
   137          self._image = image
   138  
   139      @property
   140      def working_directory(self):
   141          """Gets the working_directory of this JobSpecDocker.  # noqa: E501
   142  
   143          working directory inside the container  # noqa: E501
   144  
   145          :return: The working_directory of this JobSpecDocker.  # noqa: E501
   146          :rtype: str
   147          """
   148          return self._working_directory
   149  
   150      @working_directory.setter
   151      def working_directory(self, working_directory):
   152          """Sets the working_directory of this JobSpecDocker.
   153  
   154          working directory inside the container  # noqa: E501
   155  
   156          :param working_directory: The working_directory of this JobSpecDocker.  # noqa: E501
   157          :type: str
   158          """
   159  
   160          self._working_directory = working_directory
   161  
   162      def to_dict(self):
   163          """Returns the model properties as a dict"""
   164          result = {}
   165  
   166          for attr, _ in six.iteritems(self.swagger_types):
   167              value = getattr(self, attr)
   168              if isinstance(value, list):
   169                  result[attr] = list(map(
   170                      lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
   171                      value
   172                  ))
   173              elif hasattr(value, "to_dict"):
   174                  result[attr] = value.to_dict()
   175              elif isinstance(value, dict):
   176                  result[attr] = dict(map(
   177                      lambda item: (item[0], item[1].to_dict())
   178                      if hasattr(item[1], "to_dict") else item,
   179                      value.items()
   180                  ))
   181              else:
   182                  result[attr] = value
   183          if issubclass(JobSpecDocker, dict):
   184              for key, value in self.items():
   185                  result[key] = value
   186  
   187          return result
   188  
   189      def to_str(self):
   190          """Returns the string representation of the model"""
   191          return pprint.pformat(self.to_dict())
   192  
   193      def __repr__(self):
   194          """For `print` and `pprint`"""
   195          return self.to_str()
   196  
   197      def __eq__(self, other):
   198          """Returns true if both objects are equal"""
   199          if not isinstance(other, JobSpecDocker):
   200              return False
   201  
   202          return self.to_dict() == other.to_dict()
   203  
   204      def __ne__(self, other):
   205          """Returns true if both objects are not equal"""
   206          if not isinstance(other, JobSpecDocker):
   207              return True
   208  
   209          return self.to_dict() != other.to_dict()