github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/cancel_request.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 CancelRequest(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          'client_public_key': 'str',
    37          'job_cancel_payload': 'list[int]',
    38          'signature': 'str'
    39      }
    40  
    41      attribute_map = {
    42          'client_public_key': 'client_public_key',
    43          'job_cancel_payload': 'job_cancel_payload',
    44          'signature': 'signature'
    45      }
    46  
    47      def __init__(self, client_public_key=None, job_cancel_payload=None, signature=None, _configuration=None):  # noqa: E501
    48          """CancelRequest - a model defined in Swagger"""  # noqa: E501
    49          if _configuration is None:
    50              _configuration = Configuration()
    51          self._configuration = _configuration
    52  
    53          self._client_public_key = None
    54          self._job_cancel_payload = None
    55          self._signature = None
    56          self.discriminator = None
    57  
    58          self.client_public_key = client_public_key
    59          self.job_cancel_payload = job_cancel_payload
    60          self.signature = signature
    61  
    62      @property
    63      def client_public_key(self):
    64          """Gets the client_public_key of this CancelRequest.  # noqa: E501
    65  
    66          The base64-encoded public key of the client:  # noqa: E501
    67  
    68          :return: The client_public_key of this CancelRequest.  # noqa: E501
    69          :rtype: str
    70          """
    71          return self._client_public_key
    72  
    73      @client_public_key.setter
    74      def client_public_key(self, client_public_key):
    75          """Sets the client_public_key of this CancelRequest.
    76  
    77          The base64-encoded public key of the client:  # noqa: E501
    78  
    79          :param client_public_key: The client_public_key of this CancelRequest.  # noqa: E501
    80          :type: str
    81          """
    82          if self._configuration.client_side_validation and client_public_key is None:
    83              raise ValueError("Invalid value for `client_public_key`, must not be `None`")  # noqa: E501
    84  
    85          self._client_public_key = client_public_key
    86  
    87      @property
    88      def job_cancel_payload(self):
    89          """Gets the job_cancel_payload of this CancelRequest.  # noqa: E501
    90  
    91          The data needed to cancel a running job on the network  # noqa: E501
    92  
    93          :return: The job_cancel_payload of this CancelRequest.  # noqa: E501
    94          :rtype: list[int]
    95          """
    96          return self._job_cancel_payload
    97  
    98      @job_cancel_payload.setter
    99      def job_cancel_payload(self, job_cancel_payload):
   100          """Sets the job_cancel_payload of this CancelRequest.
   101  
   102          The data needed to cancel a running job on the network  # noqa: E501
   103  
   104          :param job_cancel_payload: The job_cancel_payload of this CancelRequest.  # noqa: E501
   105          :type: list[int]
   106          """
   107          if self._configuration.client_side_validation and job_cancel_payload is None:
   108              raise ValueError("Invalid value for `job_cancel_payload`, must not be `None`")  # noqa: E501
   109  
   110          self._job_cancel_payload = job_cancel_payload
   111  
   112      @property
   113      def signature(self):
   114          """Gets the signature of this CancelRequest.  # noqa: E501
   115  
   116          A base64-encoded signature of the data, signed by the client:  # noqa: E501
   117  
   118          :return: The signature of this CancelRequest.  # noqa: E501
   119          :rtype: str
   120          """
   121          return self._signature
   122  
   123      @signature.setter
   124      def signature(self, signature):
   125          """Sets the signature of this CancelRequest.
   126  
   127          A base64-encoded signature of the data, signed by the client:  # noqa: E501
   128  
   129          :param signature: The signature of this CancelRequest.  # noqa: E501
   130          :type: str
   131          """
   132          if self._configuration.client_side_validation and signature is None:
   133              raise ValueError("Invalid value for `signature`, must not be `None`")  # noqa: E501
   134  
   135          self._signature = signature
   136  
   137      def to_dict(self):
   138          """Returns the model properties as a dict"""
   139          result = {}
   140  
   141          for attr, _ in six.iteritems(self.swagger_types):
   142              value = getattr(self, attr)
   143              if isinstance(value, list):
   144                  result[attr] = list(map(
   145                      lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
   146                      value
   147                  ))
   148              elif hasattr(value, "to_dict"):
   149                  result[attr] = value.to_dict()
   150              elif isinstance(value, dict):
   151                  result[attr] = dict(map(
   152                      lambda item: (item[0], item[1].to_dict())
   153                      if hasattr(item[1], "to_dict") else item,
   154                      value.items()
   155                  ))
   156              else:
   157                  result[attr] = value
   158          if issubclass(CancelRequest, dict):
   159              for key, value in self.items():
   160                  result[key] = value
   161  
   162          return result
   163  
   164      def to_str(self):
   165          """Returns the string representation of the model"""
   166          return pprint.pformat(self.to_dict())
   167  
   168      def __repr__(self):
   169          """For `print` and `pprint`"""
   170          return self.to_str()
   171  
   172      def __eq__(self, other):
   173          """Returns true if both objects are equal"""
   174          if not isinstance(other, CancelRequest):
   175              return False
   176  
   177          return self.to_dict() == other.to_dict()
   178  
   179      def __ne__(self, other):
   180          """Returns true if both objects are not equal"""
   181          if not isinstance(other, CancelRequest):
   182              return True
   183  
   184          return self.to_dict() != other.to_dict()