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