pyoaev.base
Module Contents
- class pyoaev.base.RESTObject(manager: RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False)
- _id_attr: str | None = 'id'
- _attrs: Dict[str, Any]
- _created_from_list: bool
- _module: types.ModuleType
- _parent_attrs: Dict[str, Any]
- _repr_attr: str | None = None
- _updated_attrs: Dict[str, Any]
- manager: RESTManager
- asdict(*, with_parent_attrs: bool = False) Dict[str, Any]
- property attributes: Dict[str, Any]
- to_json(*, with_parent_attrs: bool = False, **kwargs: Any) str
- pformat() str
- pprint() None
- _create_managers() None
- _update_attrs(new_attrs: Dict[str, Any]) None
- get_id() int | str | None
Returns the id of the resource.
- property _repr_value: str | None
Safely returns the human-readable resource name if present.
- property encoded_id: int | str | None
Ensure that the ID is url-encoded so that it can be safely used in a URL path
- class pyoaev.base.RESTObjectList(manager: RESTManager, obj_cls: Type[RESTObject], _list: pyoaev.client.OpenAEVList)
- manager
- _obj_cls
- _list
- next() RESTObject
- property current_page: int
The current page number.
- property prev_page: int | None
The previous page number.
If None, the current page is the first.
- property next_page: int | None
The next page number.
If None, the current page is the last.
- property per_page: int | None
The number of items per page.
- property total_pages: int | None
The total number of pages.
- property total: int | None
The total number of items.
- class pyoaev.base.RESTManager(openaev: pyoaev.client.OpenAEV, parent: RESTObject | None = None)
Base class for CRUD operations on objects.
Derived class must define
_pathand_obj_cls._path: Base URL path on which requests will be sent (e.g. ‘/projects’)_obj_cls: The class of objects that will be created- _create_attrs: Any
- _update_attrs: Any
- _path: str | None = None
- _obj_cls: Type[RESTObject] | None = None
- _from_parent_attrs: Dict[str, Any]
- _types: Dict[str, Any]
- _computed_path: str | None
- _parent: RESTObject | None
- _parent_attrs: Dict[str, Any]
- openaev: pyoaev.client.OpenAEV
- property parent_attrs: Dict[str, Any] | None
- _compute_path(path: str | None = None) str | None
- property path: str | None