Ejemplo n.º 1
0
 def __init__(self, api_key):
     self.__http = Http(api_key)
     self.__interfaces = {}
     for model_name in allmodels:
         model_cls = ModelRegistry.get_model(model_name)
         namespace = {"session": self}
         mymodel = type(model_name, (model_cls, ), namespace)
         setattr(self, model_name, mymodel)
         self.__interfaces[model_name] = mymodel
Ejemplo n.º 2
0
 def __init__(self, api_key, home=""):
     self.__http = Http(api_key)
     if home:
         self.__http.HOME = f"https://{home}.benchling.com/api/v2"
     self.__interfaces = {}
     for model_name in allmodels:
         model_cls = ModelRegistry.get_model(model_name)
         namespace = {"session": self}
         mymodel = type(model_name, (model_cls, ), namespace)
         setattr(self, model_name, mymodel)
         self.__interfaces[model_name] = mymodel
Ejemplo n.º 3
0
 def batches(self) -> ModelBase:
     """Get an entities batches."""
     result = self.session.http.get(
         self._url_build("entities", self.id, "batches"))
     return ModelRegistry.get_model("Batch").load_many(result["batches"])