# coding: utf-8 """ eLabFTW REST API v2 Documentation This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501 OpenAPI spec version: 2.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class ImportBody(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 = { 'file': 'str', 'entity_type': 'str', 'category': 'int', 'canread_base': 'float', 'canwrite_base': 'float', 'owner': 'int' } attribute_map = { 'file': 'file', 'entity_type': 'entity_type', 'category': 'category', 'canread_base': 'canread_base', 'canwrite_base': 'canwrite_base', 'owner': 'owner' } def __init__(self, file=None, entity_type=None, category=None, canread_base=None, canwrite_base=None, owner=None): # noqa: E501 """ImportBody - a model defined in Swagger""" # noqa: E501 self._file = None self._entity_type = None self._category = None self._canread_base = None self._canwrite_base = None self._owner = None self.discriminator = None self.file = file self.entity_type = entity_type if category is not None: self.category = category if canread_base is not None: self.canread_base = canread_base if canwrite_base is not None: self.canwrite_base = canwrite_base if owner is not None: self.owner = owner @property def file(self): """Gets the file of this ImportBody. # noqa: E501 The file to upload. # noqa: E501 :return: The file of this ImportBody. # noqa: E501 :rtype: str """ return self._file @file.setter def file(self, file): """Sets the file of this ImportBody. The file to upload. # noqa: E501 :param file: The file of this ImportBody. # noqa: E501 :type: str """ if file is None: raise ValueError("Invalid value for `file`, must not be `None`") # noqa: E501 self._file = file @property def entity_type(self): """Gets the entity_type of this ImportBody. # noqa: E501 The target entity type # noqa: E501 :return: The entity_type of this ImportBody. # noqa: E501 :rtype: str """ return self._entity_type @entity_type.setter def entity_type(self, entity_type): """Sets the entity_type of this ImportBody. The target entity type # noqa: E501 :param entity_type: The entity_type of this ImportBody. # noqa: E501 :type: str """ if entity_type is None: raise ValueError("Invalid value for `entity_type`, must not be `None`") # noqa: E501 allowed_values = ["experiments", "items", "experiments_templates", "items_types"] # noqa: E501 if entity_type not in allowed_values: raise ValueError( "Invalid value for `entity_type` ({0}), must be one of {1}" # noqa: E501 .format(entity_type, allowed_values) ) self._entity_type = entity_type @property def category(self): """Gets the category of this ImportBody. # noqa: E501 The default category ID if no category is defined for a given entry # noqa: E501 :return: The category of this ImportBody. # noqa: E501 :rtype: int """ return self._category @category.setter def category(self, category): """Sets the category of this ImportBody. The default category ID if no category is defined for a given entry # noqa: E501 :param category: The category of this ImportBody. # noqa: E501 :type: int """ self._category = category @property def canread_base(self): """Gets the canread_base of this ImportBody. # noqa: E501 Base permission for read access: - 10: Owner only - 20: Owner + Admins - 30: Team members - 40: Everyone with an account - 50: Everyone including anonymous users # noqa: E501 :return: The canread_base of this ImportBody. # noqa: E501 :rtype: float """ return self._canread_base @canread_base.setter def canread_base(self, canread_base): """Sets the canread_base of this ImportBody. Base permission for read access: - 10: Owner only - 20: Owner + Admins - 30: Team members - 40: Everyone with an account - 50: Everyone including anonymous users # noqa: E501 :param canread_base: The canread_base of this ImportBody. # noqa: E501 :type: float """ allowed_values = [10, 20, 30, 40, 50] # noqa: E501 if canread_base not in allowed_values: raise ValueError( "Invalid value for `canread_base` ({0}), must be one of {1}" # noqa: E501 .format(canread_base, allowed_values) ) self._canread_base = canread_base @property def canwrite_base(self): """Gets the canwrite_base of this ImportBody. # noqa: E501 Base permission for write access: - 10: Owner only - 20: Owner + Admins - 30: Team members - 40: Everyone with an account - 50: Everyone including anonymous users # noqa: E501 :return: The canwrite_base of this ImportBody. # noqa: E501 :rtype: float """ return self._canwrite_base @canwrite_base.setter def canwrite_base(self, canwrite_base): """Sets the canwrite_base of this ImportBody. Base permission for write access: - 10: Owner only - 20: Owner + Admins - 30: Team members - 40: Everyone with an account - 50: Everyone including anonymous users # noqa: E501 :param canwrite_base: The canwrite_base of this ImportBody. # noqa: E501 :type: float """ allowed_values = [10, 20, 30, 40, 50] # noqa: E501 if canwrite_base not in allowed_values: raise ValueError( "Invalid value for `canwrite_base` ({0}), must be one of {1}" # noqa: E501 .format(canwrite_base, allowed_values) ) self._canwrite_base = canwrite_base @property def owner(self): """Gets the owner of this ImportBody. # noqa: E501 Userid of future owner of imported data # noqa: E501 :return: The owner of this ImportBody. # noqa: E501 :rtype: int """ return self._owner @owner.setter def owner(self, owner): """Sets the owner of this ImportBody. Userid of future owner of imported data # noqa: E501 :param owner: The owner of this ImportBody. # noqa: E501 :type: int """ self._owner = owner 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(ImportBody, 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, ImportBody): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other