docs(objects): update docstring & add example obj
This commit is contained in:
@@ -60,4 +60,4 @@ class Account(BaseModel):
|
||||
return f"Account(email: {self.userInfo.email}, server: {self.serverInfo.url}, isDefault: {self.isDefault})"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"Account(email: {self.userInfo.email}, server: {self.serverInfo.url}, isDefault: {self.isDefault})"
|
||||
return self.__repr__()
|
||||
|
||||
@@ -54,7 +54,8 @@ class Resource(ResourceBase):
|
||||
|
||||
def create(self, stream_id: str, objects: List[Dict]) -> str:
|
||||
"""
|
||||
Create a new object on a stream. To send a base object, you can prepare it by running it through the `BaseObjectSerializer.travers_base` function to get a valid (serialisable) object to send.
|
||||
Create a new object on a stream. To send a base object, you can prepare it by running it through the
|
||||
`operations.serialize` function to get a valid (serialisable) object to send.
|
||||
|
||||
NOTE: this does not create a commit - you can create one with `SpeckleClient.commit.create`.
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Optional
|
||||
|
||||
from .base import Base
|
||||
|
||||
CHUNKABLE_PROPS = {
|
||||
"vertices": 100,
|
||||
"faces": 100,
|
||||
"colors": 100,
|
||||
"textureCoordinates": 100,
|
||||
"test_bases": 10,
|
||||
}
|
||||
|
||||
|
||||
class FakeMesh(Base):
|
||||
vertices: List[float] = None
|
||||
faces: List[int] = None
|
||||
colors: List[int] = None
|
||||
textureCoordinates: List[float] = None
|
||||
test_bases: List[Base] = None
|
||||
|
||||
def __init__(self, **kwargs) -> None:
|
||||
super().__init__(**kwargs)
|
||||
self._chunkable.update(CHUNKABLE_PROPS)
|
||||
Reference in New Issue
Block a user