Files
Labvoice/vendor/elabapi-python/elabapi_python/models/item.py
T
2026-08-30 20:44:00 +02:00

451 lines
15 KiB
Python

# 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
from elabapi_python.models.entity import Entity # noqa: F401,E501
class Item(Entity):
"""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 = {
'is_bookable': 'int',
'canbook_base': 'float',
'canbook': 'str',
'book_max_minutes': 'int',
'book_max_slots': 'int',
'book_can_overlap': 'int',
'book_users_can_in_past': 'int',
'book_is_cancellable': 'int',
'book_cancel_minutes': 'int',
'booking_window_days': 'int',
'booking_hourly_rate_notax': 'float',
'booking_hourly_rate_tax': 'float',
'booking_hourly_rate_currency': 'int'
}
if hasattr(Entity, "swagger_types"):
swagger_types.update(Entity.swagger_types)
attribute_map = {
'is_bookable': 'is_bookable',
'canbook_base': 'canbook_base',
'canbook': 'canbook',
'book_max_minutes': 'book_max_minutes',
'book_max_slots': 'book_max_slots',
'book_can_overlap': 'book_can_overlap',
'book_users_can_in_past': 'book_users_can_in_past',
'book_is_cancellable': 'book_is_cancellable',
'book_cancel_minutes': 'book_cancel_minutes',
'booking_window_days': 'booking_window_days',
'booking_hourly_rate_notax': 'booking_hourly_rate_notax',
'booking_hourly_rate_tax': 'booking_hourly_rate_tax',
'booking_hourly_rate_currency': 'booking_hourly_rate_currency'
}
if hasattr(Entity, "attribute_map"):
attribute_map.update(Entity.attribute_map)
def __init__(self, is_bookable=None, canbook_base=None, canbook=None, book_max_minutes=None, book_max_slots=None, book_can_overlap=None, book_users_can_in_past=None, book_is_cancellable=None, book_cancel_minutes=None, booking_window_days=None, booking_hourly_rate_notax=None, booking_hourly_rate_tax=None, booking_hourly_rate_currency=None, *args, **kwargs): # noqa: E501
"""Item - a model defined in Swagger""" # noqa: E501
self._is_bookable = None
self._canbook_base = None
self._canbook = None
self._book_max_minutes = None
self._book_max_slots = None
self._book_can_overlap = None
self._book_users_can_in_past = None
self._book_is_cancellable = None
self._book_cancel_minutes = None
self._booking_window_days = None
self._booking_hourly_rate_notax = None
self._booking_hourly_rate_tax = None
self._booking_hourly_rate_currency = None
self.discriminator = None
if is_bookable is not None:
self.is_bookable = is_bookable
if canbook_base is not None:
self.canbook_base = canbook_base
if canbook is not None:
self.canbook = canbook
if book_max_minutes is not None:
self.book_max_minutes = book_max_minutes
if book_max_slots is not None:
self.book_max_slots = book_max_slots
if book_can_overlap is not None:
self.book_can_overlap = book_can_overlap
if book_users_can_in_past is not None:
self.book_users_can_in_past = book_users_can_in_past
if book_is_cancellable is not None:
self.book_is_cancellable = book_is_cancellable
if book_cancel_minutes is not None:
self.book_cancel_minutes = book_cancel_minutes
if booking_window_days is not None:
self.booking_window_days = booking_window_days
if booking_hourly_rate_notax is not None:
self.booking_hourly_rate_notax = booking_hourly_rate_notax
if booking_hourly_rate_tax is not None:
self.booking_hourly_rate_tax = booking_hourly_rate_tax
if booking_hourly_rate_currency is not None:
self.booking_hourly_rate_currency = booking_hourly_rate_currency
Entity.__init__(self, *args, **kwargs)
@property
def is_bookable(self):
"""Gets the is_bookable of this Item. # noqa: E501
:return: The is_bookable of this Item. # noqa: E501
:rtype: int
"""
return self._is_bookable
@is_bookable.setter
def is_bookable(self, is_bookable):
"""Sets the is_bookable of this Item.
:param is_bookable: The is_bookable of this Item. # noqa: E501
:type: int
"""
self._is_bookable = is_bookable
@property
def canbook_base(self):
"""Gets the canbook_base of this Item. # noqa: E501
Base permission for booking access: - 10: Owner only - 20: Owner + Admins - 30: Team members - 40: Everyone with an account - 50: Everyone including anonymous users # noqa: E501
:return: The canbook_base of this Item. # noqa: E501
:rtype: float
"""
return self._canbook_base
@canbook_base.setter
def canbook_base(self, canbook_base):
"""Sets the canbook_base of this Item.
Base permission for booking access: - 10: Owner only - 20: Owner + Admins - 30: Team members - 40: Everyone with an account - 50: Everyone including anonymous users # noqa: E501
:param canbook_base: The canbook_base of this Item. # noqa: E501
:type: float
"""
allowed_values = [10, 20, 30, 40, 50] # noqa: E501
if canbook_base not in allowed_values:
raise ValueError(
"Invalid value for `canbook_base` ({0}), must be one of {1}" # noqa: E501
.format(canbook_base, allowed_values)
)
self._canbook_base = canbook_base
@property
def canbook(self):
"""Gets the canbook of this Item. # noqa: E501
:return: The canbook of this Item. # noqa: E501
:rtype: str
"""
return self._canbook
@canbook.setter
def canbook(self, canbook):
"""Sets the canbook of this Item.
:param canbook: The canbook of this Item. # noqa: E501
:type: str
"""
self._canbook = canbook
@property
def book_max_minutes(self):
"""Gets the book_max_minutes of this Item. # noqa: E501
:return: The book_max_minutes of this Item. # noqa: E501
:rtype: int
"""
return self._book_max_minutes
@book_max_minutes.setter
def book_max_minutes(self, book_max_minutes):
"""Sets the book_max_minutes of this Item.
:param book_max_minutes: The book_max_minutes of this Item. # noqa: E501
:type: int
"""
self._book_max_minutes = book_max_minutes
@property
def book_max_slots(self):
"""Gets the book_max_slots of this Item. # noqa: E501
:return: The book_max_slots of this Item. # noqa: E501
:rtype: int
"""
return self._book_max_slots
@book_max_slots.setter
def book_max_slots(self, book_max_slots):
"""Sets the book_max_slots of this Item.
:param book_max_slots: The book_max_slots of this Item. # noqa: E501
:type: int
"""
self._book_max_slots = book_max_slots
@property
def book_can_overlap(self):
"""Gets the book_can_overlap of this Item. # noqa: E501
:return: The book_can_overlap of this Item. # noqa: E501
:rtype: int
"""
return self._book_can_overlap
@book_can_overlap.setter
def book_can_overlap(self, book_can_overlap):
"""Sets the book_can_overlap of this Item.
:param book_can_overlap: The book_can_overlap of this Item. # noqa: E501
:type: int
"""
self._book_can_overlap = book_can_overlap
@property
def book_users_can_in_past(self):
"""Gets the book_users_can_in_past of this Item. # noqa: E501
:return: The book_users_can_in_past of this Item. # noqa: E501
:rtype: int
"""
return self._book_users_can_in_past
@book_users_can_in_past.setter
def book_users_can_in_past(self, book_users_can_in_past):
"""Sets the book_users_can_in_past of this Item.
:param book_users_can_in_past: The book_users_can_in_past of this Item. # noqa: E501
:type: int
"""
self._book_users_can_in_past = book_users_can_in_past
@property
def book_is_cancellable(self):
"""Gets the book_is_cancellable of this Item. # noqa: E501
:return: The book_is_cancellable of this Item. # noqa: E501
:rtype: int
"""
return self._book_is_cancellable
@book_is_cancellable.setter
def book_is_cancellable(self, book_is_cancellable):
"""Sets the book_is_cancellable of this Item.
:param book_is_cancellable: The book_is_cancellable of this Item. # noqa: E501
:type: int
"""
self._book_is_cancellable = book_is_cancellable
@property
def book_cancel_minutes(self):
"""Gets the book_cancel_minutes of this Item. # noqa: E501
:return: The book_cancel_minutes of this Item. # noqa: E501
:rtype: int
"""
return self._book_cancel_minutes
@book_cancel_minutes.setter
def book_cancel_minutes(self, book_cancel_minutes):
"""Sets the book_cancel_minutes of this Item.
:param book_cancel_minutes: The book_cancel_minutes of this Item. # noqa: E501
:type: int
"""
self._book_cancel_minutes = book_cancel_minutes
@property
def booking_window_days(self):
"""Gets the booking_window_days of this Item. # noqa: E501
How many days in advance users can book an item. 0 means no limit. # noqa: E501
:return: The booking_window_days of this Item. # noqa: E501
:rtype: int
"""
return self._booking_window_days
@booking_window_days.setter
def booking_window_days(self, booking_window_days):
"""Sets the booking_window_days of this Item.
How many days in advance users can book an item. 0 means no limit. # noqa: E501
:param booking_window_days: The booking_window_days of this Item. # noqa: E501
:type: int
"""
self._booking_window_days = booking_window_days
@property
def booking_hourly_rate_notax(self):
"""Gets the booking_hourly_rate_notax of this Item. # noqa: E501
The hourly rate of booked resource, without taxes. # noqa: E501
:return: The booking_hourly_rate_notax of this Item. # noqa: E501
:rtype: float
"""
return self._booking_hourly_rate_notax
@booking_hourly_rate_notax.setter
def booking_hourly_rate_notax(self, booking_hourly_rate_notax):
"""Sets the booking_hourly_rate_notax of this Item.
The hourly rate of booked resource, without taxes. # noqa: E501
:param booking_hourly_rate_notax: The booking_hourly_rate_notax of this Item. # noqa: E501
:type: float
"""
self._booking_hourly_rate_notax = booking_hourly_rate_notax
@property
def booking_hourly_rate_tax(self):
"""Gets the booking_hourly_rate_tax of this Item. # noqa: E501
The hourly rate of booked resource, with taxes. # noqa: E501
:return: The booking_hourly_rate_tax of this Item. # noqa: E501
:rtype: float
"""
return self._booking_hourly_rate_tax
@booking_hourly_rate_tax.setter
def booking_hourly_rate_tax(self, booking_hourly_rate_tax):
"""Sets the booking_hourly_rate_tax of this Item.
The hourly rate of booked resource, with taxes. # noqa: E501
:param booking_hourly_rate_tax: The booking_hourly_rate_tax of this Item. # noqa: E501
:type: float
"""
self._booking_hourly_rate_tax = booking_hourly_rate_tax
@property
def booking_hourly_rate_currency(self):
"""Gets the booking_hourly_rate_currency of this Item. # noqa: E501
The currency of the hourly rate: - 0: CAD - 1: CHF - 2: CNY - 3: DKK - 4: EUR - 5: GBP - 6: JPY - 7: USD - 8: SEK - 9: NOK # noqa: E501
:return: The booking_hourly_rate_currency of this Item. # noqa: E501
:rtype: int
"""
return self._booking_hourly_rate_currency
@booking_hourly_rate_currency.setter
def booking_hourly_rate_currency(self, booking_hourly_rate_currency):
"""Sets the booking_hourly_rate_currency of this Item.
The currency of the hourly rate: - 0: CAD - 1: CHF - 2: CNY - 3: DKK - 4: EUR - 5: GBP - 6: JPY - 7: USD - 8: SEK - 9: NOK # noqa: E501
:param booking_hourly_rate_currency: The booking_hourly_rate_currency of this Item. # noqa: E501
:type: int
"""
allowed_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] # noqa: E501
if booking_hourly_rate_currency not in allowed_values:
raise ValueError(
"Invalid value for `booking_hourly_rate_currency` ({0}), must be one of {1}" # noqa: E501
.format(booking_hourly_rate_currency, allowed_values)
)
self._booking_hourly_rate_currency = booking_hourly_rate_currency
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(Item, 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, Item):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other