Files
2026-08-30 20:44:00 +02:00

629 lines
19 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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 EntityEditable(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 = {
'body': 'str',
'bodyappend': 'str',
'canread_base': 'float',
'canread': 'str',
'canwrite_base': 'float',
'canwrite': 'str',
'category': 'int',
'_date': 'str',
'content_type': 'int',
'custom_id': 'int',
'metadata': 'Metadata',
'metadatamerge': 'AllOfentityEditableMetadatamerge',
'rating': 'int',
'state': 'int',
'status': 'int',
'title': 'str',
'template': 'int',
'userid': 'int',
'team': 'int'
}
attribute_map = {
'body': 'body',
'bodyappend': 'bodyappend',
'canread_base': 'canread_base',
'canread': 'canread',
'canwrite_base': 'canwrite_base',
'canwrite': 'canwrite',
'category': 'category',
'_date': 'date',
'content_type': 'content_type',
'custom_id': 'custom_id',
'metadata': 'metadata',
'metadatamerge': 'metadatamerge',
'rating': 'rating',
'state': 'state',
'status': 'status',
'title': 'title',
'template': 'template',
'userid': 'userid',
'team': 'team'
}
def __init__(self, body=None, bodyappend=None, canread_base=None, canread='{"teams": [], "users": [], "teamgroups": []}', canwrite_base=None, canwrite='{"teams": [], "users": [], "teamgroups": []}', category=None, _date=None, content_type=None, custom_id=None, metadata=None, metadatamerge=None, rating=0, state=None, status=None, title='Untitled', template=-1, userid=None, team=None): # noqa: E501
"""EntityEditable - a model defined in Swagger""" # noqa: E501
self._body = None
self._bodyappend = None
self._canread_base = None
self._canread = None
self._canwrite_base = None
self._canwrite = None
self._category = None
self.__date = None
self._content_type = None
self._custom_id = None
self._metadata = None
self._metadatamerge = None
self._rating = None
self._state = None
self._status = None
self._title = None
self._template = None
self._userid = None
self._team = None
self.discriminator = None
if body is not None:
self.body = body
if bodyappend is not None:
self.bodyappend = bodyappend
if canread_base is not None:
self.canread_base = canread_base
if canread is not None:
self.canread = canread
if canwrite_base is not None:
self.canwrite_base = canwrite_base
if canwrite is not None:
self.canwrite = canwrite
if category is not None:
self.category = category
if _date is not None:
self._date = _date
if content_type is not None:
self.content_type = content_type
if custom_id is not None:
self.custom_id = custom_id
if metadata is not None:
self.metadata = metadata
if metadatamerge is not None:
self.metadatamerge = metadatamerge
if rating is not None:
self.rating = rating
if state is not None:
self.state = state
if status is not None:
self.status = status
if title is not None:
self.title = title
if template is not None:
self.template = template
if userid is not None:
self.userid = userid
if team is not None:
self.team = team
@property
def body(self):
"""Gets the body of this EntityEditable. # noqa: E501
The main text content (HTML or Markdown) # noqa: E501
:return: The body of this EntityEditable. # noqa: E501
:rtype: str
"""
return self._body
@body.setter
def body(self, body):
"""Sets the body of this EntityEditable.
The main text content (HTML or Markdown) # noqa: E501
:param body: The body of this EntityEditable. # noqa: E501
:type: str
"""
self._body = body
@property
def bodyappend(self):
"""Gets the bodyappend of this EntityEditable. # noqa: E501
Append content to the existing entity body instead of replacing it. # noqa: E501
:return: The bodyappend of this EntityEditable. # noqa: E501
:rtype: str
"""
return self._bodyappend
@bodyappend.setter
def bodyappend(self, bodyappend):
"""Sets the bodyappend of this EntityEditable.
Append content to the existing entity body instead of replacing it. # noqa: E501
:param bodyappend: The bodyappend of this EntityEditable. # noqa: E501
:type: str
"""
self._bodyappend = bodyappend
@property
def canread_base(self):
"""Gets the canread_base of this EntityEditable. # 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 EntityEditable. # noqa: E501
:rtype: float
"""
return self._canread_base
@canread_base.setter
def canread_base(self, canread_base):
"""Sets the canread_base of this EntityEditable.
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 EntityEditable. # 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 canread(self):
"""Gets the canread of this EntityEditable. # noqa: E501
JSON permissions for reading the entry # noqa: E501
:return: The canread of this EntityEditable. # noqa: E501
:rtype: str
"""
return self._canread
@canread.setter
def canread(self, canread):
"""Sets the canread of this EntityEditable.
JSON permissions for reading the entry # noqa: E501
:param canread: The canread of this EntityEditable. # noqa: E501
:type: str
"""
self._canread = canread
@property
def canwrite_base(self):
"""Gets the canwrite_base of this EntityEditable. # 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 EntityEditable. # noqa: E501
:rtype: float
"""
return self._canwrite_base
@canwrite_base.setter
def canwrite_base(self, canwrite_base):
"""Sets the canwrite_base of this EntityEditable.
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 EntityEditable. # 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 canwrite(self):
"""Gets the canwrite of this EntityEditable. # noqa: E501
JSON permissions for writing the entry # noqa: E501
:return: The canwrite of this EntityEditable. # noqa: E501
:rtype: str
"""
return self._canwrite
@canwrite.setter
def canwrite(self, canwrite):
"""Sets the canwrite of this EntityEditable.
JSON permissions for writing the entry # noqa: E501
:param canwrite: The canwrite of this EntityEditable. # noqa: E501
:type: str
"""
self._canwrite = canwrite
@property
def category(self):
"""Gets the category of this EntityEditable. # noqa: E501
The experiment category ID # noqa: E501
:return: The category of this EntityEditable. # noqa: E501
:rtype: int
"""
return self._category
@category.setter
def category(self, category):
"""Sets the category of this EntityEditable.
The experiment category ID # noqa: E501
:param category: The category of this EntityEditable. # noqa: E501
:type: int
"""
self._category = category
@property
def _date(self):
"""Gets the _date of this EntityEditable. # noqa: E501
:return: The _date of this EntityEditable. # noqa: E501
:rtype: str
"""
return self.__date
@_date.setter
def _date(self, _date):
"""Sets the _date of this EntityEditable.
:param _date: The _date of this EntityEditable. # noqa: E501
:type: str
"""
self.__date = _date
@property
def content_type(self):
"""Gets the content_type of this EntityEditable. # noqa: E501
Set the content type for main text: - 1: HTML (default) - 2: Markdown If unset, it will use the user's preference value. # noqa: E501
:return: The content_type of this EntityEditable. # noqa: E501
:rtype: int
"""
return self._content_type
@content_type.setter
def content_type(self, content_type):
"""Sets the content_type of this EntityEditable.
Set the content type for main text: - 1: HTML (default) - 2: Markdown If unset, it will use the user's preference value. # noqa: E501
:param content_type: The content_type of this EntityEditable. # noqa: E501
:type: int
"""
allowed_values = [1, 2] # noqa: E501
if content_type not in allowed_values:
raise ValueError(
"Invalid value for `content_type` ({0}), must be one of {1}" # noqa: E501
.format(content_type, allowed_values)
)
self._content_type = content_type
@property
def custom_id(self):
"""Gets the custom_id of this EntityEditable. # noqa: E501
Cannot be negative. Can be reset with \"0\", null or empty string. # noqa: E501
:return: The custom_id of this EntityEditable. # noqa: E501
:rtype: int
"""
return self._custom_id
@custom_id.setter
def custom_id(self, custom_id):
"""Sets the custom_id of this EntityEditable.
Cannot be negative. Can be reset with \"0\", null or empty string. # noqa: E501
:param custom_id: The custom_id of this EntityEditable. # noqa: E501
:type: int
"""
self._custom_id = custom_id
@property
def metadata(self):
"""Gets the metadata of this EntityEditable. # noqa: E501
:return: The metadata of this EntityEditable. # noqa: E501
:rtype: Metadata
"""
return self._metadata
@metadata.setter
def metadata(self, metadata):
"""Sets the metadata of this EntityEditable.
:param metadata: The metadata of this EntityEditable. # noqa: E501
:type: Metadata
"""
self._metadata = metadata
@property
def metadatamerge(self):
"""Gets the metadatamerge of this EntityEditable. # noqa: E501
Merge incoming metadata into the existing entity metadata. Existing extra fields keep their schema such as type, options, units and description; only their value is updated. Incoming extra fields that do not already exist are added. # noqa: E501
:return: The metadatamerge of this EntityEditable. # noqa: E501
:rtype: AllOfentityEditableMetadatamerge
"""
return self._metadatamerge
@metadatamerge.setter
def metadatamerge(self, metadatamerge):
"""Sets the metadatamerge of this EntityEditable.
Merge incoming metadata into the existing entity metadata. Existing extra fields keep their schema such as type, options, units and description; only their value is updated. Incoming extra fields that do not already exist are added. # noqa: E501
:param metadatamerge: The metadatamerge of this EntityEditable. # noqa: E501
:type: AllOfentityEditableMetadatamerge
"""
self._metadatamerge = metadatamerge
@property
def rating(self):
"""Gets the rating of this EntityEditable. # noqa: E501
Rating value from 0 to 5 # noqa: E501
:return: The rating of this EntityEditable. # noqa: E501
:rtype: int
"""
return self._rating
@rating.setter
def rating(self, rating):
"""Sets the rating of this EntityEditable.
Rating value from 0 to 5 # noqa: E501
:param rating: The rating of this EntityEditable. # noqa: E501
:type: int
"""
self._rating = rating
@property
def state(self):
"""Gets the state of this EntityEditable. # noqa: E501
:return: The state of this EntityEditable. # noqa: E501
:rtype: int
"""
return self._state
@state.setter
def state(self, state):
"""Sets the state of this EntityEditable.
:param state: The state of this EntityEditable. # noqa: E501
:type: int
"""
self._state = state
@property
def status(self):
"""Gets the status of this EntityEditable. # noqa: E501
Cannot be negative nor empty string. Can be reset with \"0\" and null. # noqa: E501
:return: The status of this EntityEditable. # noqa: E501
:rtype: int
"""
return self._status
@status.setter
def status(self, status):
"""Sets the status of this EntityEditable.
Cannot be negative nor empty string. Can be reset with \"0\" and null. # noqa: E501
:param status: The status of this EntityEditable. # noqa: E501
:type: int
"""
self._status = status
@property
def title(self):
"""Gets the title of this EntityEditable. # noqa: E501
The title of the entry # noqa: E501
:return: The title of this EntityEditable. # noqa: E501
:rtype: str
"""
return self._title
@title.setter
def title(self, title):
"""Sets the title of this EntityEditable.
The title of the entry # noqa: E501
:param title: The title of this EntityEditable. # noqa: E501
:type: str
"""
self._title = title
@property
def template(self):
"""Gets the template of this EntityEditable. # noqa: E501
The template id to use, or 0 to use the common team template, or -1 to have an empty body. # noqa: E501
:return: The template of this EntityEditable. # noqa: E501
:rtype: int
"""
return self._template
@template.setter
def template(self, template):
"""Sets the template of this EntityEditable.
The template id to use, or 0 to use the common team template, or -1 to have an empty body. # noqa: E501
:param template: The template of this EntityEditable. # noqa: E501
:type: int
"""
self._template = template
@property
def userid(self):
"""Gets the userid of this EntityEditable. # noqa: E501
User ID of the entity owner. When transferring ownership, the `team` field should also be provided (optional). # noqa: E501
:return: The userid of this EntityEditable. # noqa: E501
:rtype: int
"""
return self._userid
@userid.setter
def userid(self, userid):
"""Sets the userid of this EntityEditable.
User ID of the entity owner. When transferring ownership, the `team` field should also be provided (optional). # noqa: E501
:param userid: The userid of this EntityEditable. # noqa: E501
:type: int
"""
self._userid = userid
@property
def team(self):
"""Gets the team of this EntityEditable. # noqa: E501
Optional team context for ownership transfer. If omitted, the requester’s team is used by default. If provided, the API validates that the target user is a member of the specified team. # noqa: E501
:return: The team of this EntityEditable. # noqa: E501
:rtype: int
"""
return self._team
@team.setter
def team(self, team):
"""Sets the team of this EntityEditable.
Optional team context for ownership transfer. If omitted, the requester’s team is used by default. If provided, the API validates that the target user is a member of the specified team. # noqa: E501
:param team: The team of this EntityEditable. # noqa: E501
:type: int
"""
self._team = team
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(EntityEditable, 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, EntityEditable):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other