Initial version
This commit is contained in:
@@ -0,0 +1,614 @@
|
||||
# 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 CompoundCreateRequest(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 = {
|
||||
'action': 'str',
|
||||
'name': 'str',
|
||||
'inchi': 'str',
|
||||
'inchi_key': 'str',
|
||||
'smiles': 'str',
|
||||
'molecular_formula': 'str',
|
||||
'cas_number': 'str',
|
||||
'iupac_name': 'str',
|
||||
'pubchem_cid': 'int',
|
||||
'is_corrosive': 'int',
|
||||
'is_serious_health_hazard': 'int',
|
||||
'is_explosive': 'int',
|
||||
'is_flammable': 'int',
|
||||
'is_gas_under_pressure': 'int',
|
||||
'is_hazardous2env': 'int',
|
||||
'is_hazardous2health': 'int',
|
||||
'is_oxidising': 'int',
|
||||
'is_toxic': 'int'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'action': 'action',
|
||||
'name': 'name',
|
||||
'inchi': 'inchi',
|
||||
'inchi_key': 'inchi_key',
|
||||
'smiles': 'smiles',
|
||||
'molecular_formula': 'molecular_formula',
|
||||
'cas_number': 'cas_number',
|
||||
'iupac_name': 'iupac_name',
|
||||
'pubchem_cid': 'pubchem_cid',
|
||||
'is_corrosive': 'is_corrosive',
|
||||
'is_serious_health_hazard': 'is_serious_health_hazard',
|
||||
'is_explosive': 'is_explosive',
|
||||
'is_flammable': 'is_flammable',
|
||||
'is_gas_under_pressure': 'is_gas_under_pressure',
|
||||
'is_hazardous2env': 'is_hazardous2env',
|
||||
'is_hazardous2health': 'is_hazardous2health',
|
||||
'is_oxidising': 'is_oxidising',
|
||||
'is_toxic': 'is_toxic'
|
||||
}
|
||||
|
||||
def __init__(self, action='create', name=None, inchi=None, inchi_key=None, smiles=None, molecular_formula=None, cas_number=None, iupac_name=None, pubchem_cid=None, is_corrosive=None, is_serious_health_hazard=None, is_explosive=None, is_flammable=None, is_gas_under_pressure=None, is_hazardous2env=None, is_hazardous2health=None, is_oxidising=None, is_toxic=None): # noqa: E501
|
||||
"""CompoundCreateRequest - a model defined in Swagger""" # noqa: E501
|
||||
self._action = None
|
||||
self._name = None
|
||||
self._inchi = None
|
||||
self._inchi_key = None
|
||||
self._smiles = None
|
||||
self._molecular_formula = None
|
||||
self._cas_number = None
|
||||
self._iupac_name = None
|
||||
self._pubchem_cid = None
|
||||
self._is_corrosive = None
|
||||
self._is_serious_health_hazard = None
|
||||
self._is_explosive = None
|
||||
self._is_flammable = None
|
||||
self._is_gas_under_pressure = None
|
||||
self._is_hazardous2env = None
|
||||
self._is_hazardous2health = None
|
||||
self._is_oxidising = None
|
||||
self._is_toxic = None
|
||||
self.discriminator = None
|
||||
if action is not None:
|
||||
self.action = action
|
||||
if name is not None:
|
||||
self.name = name
|
||||
if inchi is not None:
|
||||
self.inchi = inchi
|
||||
if inchi_key is not None:
|
||||
self.inchi_key = inchi_key
|
||||
if smiles is not None:
|
||||
self.smiles = smiles
|
||||
if molecular_formula is not None:
|
||||
self.molecular_formula = molecular_formula
|
||||
if cas_number is not None:
|
||||
self.cas_number = cas_number
|
||||
if iupac_name is not None:
|
||||
self.iupac_name = iupac_name
|
||||
if pubchem_cid is not None:
|
||||
self.pubchem_cid = pubchem_cid
|
||||
if is_corrosive is not None:
|
||||
self.is_corrosive = is_corrosive
|
||||
if is_serious_health_hazard is not None:
|
||||
self.is_serious_health_hazard = is_serious_health_hazard
|
||||
if is_explosive is not None:
|
||||
self.is_explosive = is_explosive
|
||||
if is_flammable is not None:
|
||||
self.is_flammable = is_flammable
|
||||
if is_gas_under_pressure is not None:
|
||||
self.is_gas_under_pressure = is_gas_under_pressure
|
||||
if is_hazardous2env is not None:
|
||||
self.is_hazardous2env = is_hazardous2env
|
||||
if is_hazardous2health is not None:
|
||||
self.is_hazardous2health = is_hazardous2health
|
||||
if is_oxidising is not None:
|
||||
self.is_oxidising = is_oxidising
|
||||
if is_toxic is not None:
|
||||
self.is_toxic = is_toxic
|
||||
|
||||
@property
|
||||
def action(self):
|
||||
"""Gets the action of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
Note: the default value for `action` attribute is `create`, and as such it can be omitted. # noqa: E501
|
||||
|
||||
:return: The action of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._action
|
||||
|
||||
@action.setter
|
||||
def action(self, action):
|
||||
"""Sets the action of this CompoundCreateRequest.
|
||||
|
||||
Note: the default value for `action` attribute is `create`, and as such it can be omitted. # noqa: E501
|
||||
|
||||
:param action: The action of this CompoundCreateRequest. # noqa: E501
|
||||
:type: str
|
||||
"""
|
||||
allowed_values = ["create"] # noqa: E501
|
||||
if action not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `action` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(action, allowed_values)
|
||||
)
|
||||
|
||||
self._action = action
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Gets the name of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The name of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
"""Sets the name of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param name: The name of this CompoundCreateRequest. # noqa: E501
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def inchi(self):
|
||||
"""Gets the inchi of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The inchi of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._inchi
|
||||
|
||||
@inchi.setter
|
||||
def inchi(self, inchi):
|
||||
"""Sets the inchi of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param inchi: The inchi of this CompoundCreateRequest. # noqa: E501
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._inchi = inchi
|
||||
|
||||
@property
|
||||
def inchi_key(self):
|
||||
"""Gets the inchi_key of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The inchi_key of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._inchi_key
|
||||
|
||||
@inchi_key.setter
|
||||
def inchi_key(self, inchi_key):
|
||||
"""Sets the inchi_key of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param inchi_key: The inchi_key of this CompoundCreateRequest. # noqa: E501
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._inchi_key = inchi_key
|
||||
|
||||
@property
|
||||
def smiles(self):
|
||||
"""Gets the smiles of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The smiles of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._smiles
|
||||
|
||||
@smiles.setter
|
||||
def smiles(self, smiles):
|
||||
"""Sets the smiles of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param smiles: The smiles of this CompoundCreateRequest. # noqa: E501
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._smiles = smiles
|
||||
|
||||
@property
|
||||
def molecular_formula(self):
|
||||
"""Gets the molecular_formula of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The molecular_formula of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._molecular_formula
|
||||
|
||||
@molecular_formula.setter
|
||||
def molecular_formula(self, molecular_formula):
|
||||
"""Sets the molecular_formula of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param molecular_formula: The molecular_formula of this CompoundCreateRequest. # noqa: E501
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._molecular_formula = molecular_formula
|
||||
|
||||
@property
|
||||
def cas_number(self):
|
||||
"""Gets the cas_number of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The cas_number of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._cas_number
|
||||
|
||||
@cas_number.setter
|
||||
def cas_number(self, cas_number):
|
||||
"""Sets the cas_number of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param cas_number: The cas_number of this CompoundCreateRequest. # noqa: E501
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._cas_number = cas_number
|
||||
|
||||
@property
|
||||
def iupac_name(self):
|
||||
"""Gets the iupac_name of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The iupac_name of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._iupac_name
|
||||
|
||||
@iupac_name.setter
|
||||
def iupac_name(self, iupac_name):
|
||||
"""Sets the iupac_name of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param iupac_name: The iupac_name of this CompoundCreateRequest. # noqa: E501
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._iupac_name = iupac_name
|
||||
|
||||
@property
|
||||
def pubchem_cid(self):
|
||||
"""Gets the pubchem_cid of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The pubchem_cid of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._pubchem_cid
|
||||
|
||||
@pubchem_cid.setter
|
||||
def pubchem_cid(self, pubchem_cid):
|
||||
"""Sets the pubchem_cid of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param pubchem_cid: The pubchem_cid of this CompoundCreateRequest. # noqa: E501
|
||||
:type: int
|
||||
"""
|
||||
|
||||
self._pubchem_cid = pubchem_cid
|
||||
|
||||
@property
|
||||
def is_corrosive(self):
|
||||
"""Gets the is_corrosive of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The is_corrosive of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._is_corrosive
|
||||
|
||||
@is_corrosive.setter
|
||||
def is_corrosive(self, is_corrosive):
|
||||
"""Sets the is_corrosive of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param is_corrosive: The is_corrosive of this CompoundCreateRequest. # noqa: E501
|
||||
:type: int
|
||||
"""
|
||||
allowed_values = [0, 1] # noqa: E501
|
||||
if is_corrosive not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `is_corrosive` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(is_corrosive, allowed_values)
|
||||
)
|
||||
|
||||
self._is_corrosive = is_corrosive
|
||||
|
||||
@property
|
||||
def is_serious_health_hazard(self):
|
||||
"""Gets the is_serious_health_hazard of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The is_serious_health_hazard of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._is_serious_health_hazard
|
||||
|
||||
@is_serious_health_hazard.setter
|
||||
def is_serious_health_hazard(self, is_serious_health_hazard):
|
||||
"""Sets the is_serious_health_hazard of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param is_serious_health_hazard: The is_serious_health_hazard of this CompoundCreateRequest. # noqa: E501
|
||||
:type: int
|
||||
"""
|
||||
allowed_values = [0, 1] # noqa: E501
|
||||
if is_serious_health_hazard not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `is_serious_health_hazard` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(is_serious_health_hazard, allowed_values)
|
||||
)
|
||||
|
||||
self._is_serious_health_hazard = is_serious_health_hazard
|
||||
|
||||
@property
|
||||
def is_explosive(self):
|
||||
"""Gets the is_explosive of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The is_explosive of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._is_explosive
|
||||
|
||||
@is_explosive.setter
|
||||
def is_explosive(self, is_explosive):
|
||||
"""Sets the is_explosive of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param is_explosive: The is_explosive of this CompoundCreateRequest. # noqa: E501
|
||||
:type: int
|
||||
"""
|
||||
allowed_values = [0, 1] # noqa: E501
|
||||
if is_explosive not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `is_explosive` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(is_explosive, allowed_values)
|
||||
)
|
||||
|
||||
self._is_explosive = is_explosive
|
||||
|
||||
@property
|
||||
def is_flammable(self):
|
||||
"""Gets the is_flammable of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The is_flammable of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._is_flammable
|
||||
|
||||
@is_flammable.setter
|
||||
def is_flammable(self, is_flammable):
|
||||
"""Sets the is_flammable of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param is_flammable: The is_flammable of this CompoundCreateRequest. # noqa: E501
|
||||
:type: int
|
||||
"""
|
||||
allowed_values = [0, 1] # noqa: E501
|
||||
if is_flammable not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `is_flammable` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(is_flammable, allowed_values)
|
||||
)
|
||||
|
||||
self._is_flammable = is_flammable
|
||||
|
||||
@property
|
||||
def is_gas_under_pressure(self):
|
||||
"""Gets the is_gas_under_pressure of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The is_gas_under_pressure of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._is_gas_under_pressure
|
||||
|
||||
@is_gas_under_pressure.setter
|
||||
def is_gas_under_pressure(self, is_gas_under_pressure):
|
||||
"""Sets the is_gas_under_pressure of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param is_gas_under_pressure: The is_gas_under_pressure of this CompoundCreateRequest. # noqa: E501
|
||||
:type: int
|
||||
"""
|
||||
allowed_values = [0, 1] # noqa: E501
|
||||
if is_gas_under_pressure not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `is_gas_under_pressure` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(is_gas_under_pressure, allowed_values)
|
||||
)
|
||||
|
||||
self._is_gas_under_pressure = is_gas_under_pressure
|
||||
|
||||
@property
|
||||
def is_hazardous2env(self):
|
||||
"""Gets the is_hazardous2env of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The is_hazardous2env of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._is_hazardous2env
|
||||
|
||||
@is_hazardous2env.setter
|
||||
def is_hazardous2env(self, is_hazardous2env):
|
||||
"""Sets the is_hazardous2env of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param is_hazardous2env: The is_hazardous2env of this CompoundCreateRequest. # noqa: E501
|
||||
:type: int
|
||||
"""
|
||||
allowed_values = [0, 1] # noqa: E501
|
||||
if is_hazardous2env not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `is_hazardous2env` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(is_hazardous2env, allowed_values)
|
||||
)
|
||||
|
||||
self._is_hazardous2env = is_hazardous2env
|
||||
|
||||
@property
|
||||
def is_hazardous2health(self):
|
||||
"""Gets the is_hazardous2health of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The is_hazardous2health of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._is_hazardous2health
|
||||
|
||||
@is_hazardous2health.setter
|
||||
def is_hazardous2health(self, is_hazardous2health):
|
||||
"""Sets the is_hazardous2health of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param is_hazardous2health: The is_hazardous2health of this CompoundCreateRequest. # noqa: E501
|
||||
:type: int
|
||||
"""
|
||||
allowed_values = [0, 1] # noqa: E501
|
||||
if is_hazardous2health not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `is_hazardous2health` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(is_hazardous2health, allowed_values)
|
||||
)
|
||||
|
||||
self._is_hazardous2health = is_hazardous2health
|
||||
|
||||
@property
|
||||
def is_oxidising(self):
|
||||
"""Gets the is_oxidising of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The is_oxidising of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._is_oxidising
|
||||
|
||||
@is_oxidising.setter
|
||||
def is_oxidising(self, is_oxidising):
|
||||
"""Sets the is_oxidising of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param is_oxidising: The is_oxidising of this CompoundCreateRequest. # noqa: E501
|
||||
:type: int
|
||||
"""
|
||||
allowed_values = [0, 1] # noqa: E501
|
||||
if is_oxidising not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `is_oxidising` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(is_oxidising, allowed_values)
|
||||
)
|
||||
|
||||
self._is_oxidising = is_oxidising
|
||||
|
||||
@property
|
||||
def is_toxic(self):
|
||||
"""Gets the is_toxic of this CompoundCreateRequest. # noqa: E501
|
||||
|
||||
|
||||
:return: The is_toxic of this CompoundCreateRequest. # noqa: E501
|
||||
:rtype: int
|
||||
"""
|
||||
return self._is_toxic
|
||||
|
||||
@is_toxic.setter
|
||||
def is_toxic(self, is_toxic):
|
||||
"""Sets the is_toxic of this CompoundCreateRequest.
|
||||
|
||||
|
||||
:param is_toxic: The is_toxic of this CompoundCreateRequest. # noqa: E501
|
||||
:type: int
|
||||
"""
|
||||
allowed_values = [0, 1] # noqa: E501
|
||||
if is_toxic not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `is_toxic` ({0}), must be one of {1}" # noqa: E501
|
||||
.format(is_toxic, allowed_values)
|
||||
)
|
||||
|
||||
self._is_toxic = is_toxic
|
||||
|
||||
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(CompoundCreateRequest, 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, CompoundCreateRequest):
|
||||
return False
|
||||
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
return not self == other
|
||||
Reference in New Issue
Block a user