Skip to content

Commit

Permalink
Issue #14: add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos García-Mauriño committed Apr 19, 2023
1 parent bb045f5 commit 2e73d49
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ History
2.2.2 (2023-04-14)
------------------

* Support HEAD for ``SchoolClass``, ``User``, ``WorkGroup``, and ``Role``.
* Support HEAD for ``SchoolClass``, ``User`` and ``WorkGroup``

2.2.1 (2022-12-15)
------------------
Expand Down
12 changes: 12 additions & 0 deletions docs/usage-school-class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ It is necessary to pass both ``name`` and ``school`` arguments to the :py:meth:`
'url': 'https://10.200.3.70/ucsschool/kelvin/v1/classes/DEMOSCHOOL/testclass'}
Check if school class exists
----------------------------

.. code-block:: python
from ucsschool.kelvin.client import Session, SchoolClassResource
async with Session(**credentials) as session:
if await SchoolClassResource(session=session).exists(name="testclass", school="DEMOSCHOOL"):
print("The school class exists!")
Search school classes
---------------------

Expand Down
12 changes: 12 additions & 0 deletions docs/usage-users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,18 @@ Retrieve user
'url': 'https://master.ucs.local/ucsschool/kelvin/v1/users/test1'}
Check if user exists
--------------------

.. code-block:: python
from ucsschool.kelvin.client import Session, UserResource
async with Session(**credentials) as session:
if await UserResource(session=session).exists(name="test1"):
print("The user exists!")
Search users
------------

Expand Down
12 changes: 12 additions & 0 deletions docs/usage-workgroups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,18 @@ It is necessary to pass both ``name`` and ``school`` arguments to the :py:meth:`
'url': 'https://10.200.3.70/ucsschool/kelvin/v1/workgroups/DEMOSCHOOL/testworkgroup'}
Check if workgroup exists
-------------------------

.. code-block:: python
from ucsschool.kelvin.client import Session, WorkGroupResource
async with Session(**credentials) as session:
if await WorkGroupResource(session=session).exists(school="DEMOSCHOOL", name="testworkgroup"):
print("The workgroup exists!")
Search workgroups
---------------------

Expand Down

0 comments on commit 2e73d49

Please sign in to comment.