@@ -50,6 +50,10 @@ def lock(self, *, force: bool = False):
5050 Attempt to lock your own account (will raise `RuntimeError` unless `force` is set to `True`):
5151
5252 >>> user.lock(force=True)
53+
54+ See Also
55+ --------
56+ * https://docs.posit.co/connect/api/#post-/v1/users/-guid-/lock
5357 """
5458 _me = me .get (self ._ctx )
5559 if _me ["guid" ] == self ["guid" ] and not force :
@@ -76,6 +80,10 @@ def unlock(self):
7680 Unlock a user's account:
7781
7882 >>> user.unlock()
83+
84+ See Also
85+ --------
86+ * https://docs.posit.co/connect/api/#post-/v1/users/-guid-/lock
7987 """
8088 url = self ._ctx .url + f"v1/users/{ self ['guid' ]} /lock"
8189 body = {"locked" : False }
@@ -124,6 +132,10 @@ def update(
124132 Update the user's first and last name:
125133
126134 >>> user.update(first_name="Jane", last_name="Smith")
135+
136+ See Also
137+ --------
138+ * https://docs.posit.co/connect/api/#put-/v1/users/-guid-
127139 """
128140 url = self ._ctx .url + f"v1/users/{ self ['guid' ]} "
129141 response = self ._ctx .session .put (url , json = kwargs )
@@ -204,6 +216,10 @@ def add(
204216 # Add the user to a group by GUID
205217 user.groups.add(group_guid="GROUP_GUID_HERE")
206218 ```
219+
220+ See Also
221+ --------
222+ * https://docs.posit.co/connect/api/#post-/v1/groups/-group_guid-/members
207223 """
208224 if len (args ) > 0 :
209225 from .groups import Group
@@ -272,6 +288,10 @@ def delete(
272288 # Remove the user from a group by GUID
273289 user.groups.delete(group_guid="GROUP_GUID_HERE")
274290 ```
291+
292+ See Also
293+ --------
294+ * https://docs.posit.co/connect/api/#delete-/v1/groups/-group_guid-/members/-user_guid-
275295 """
276296 if len (args ) > 0 :
277297 from .groups import Group
@@ -307,9 +327,18 @@ def find(self) -> List[Group]:
307327
308328 Examples
309329 --------
310- Retrieve the groups to which the user belongs:
330+ ```python
331+ from posit.connect import Client
332+
333+ client = Client("https://posit.example.com", "API_KEY")
311334
312- >>> groups = user.groups()
335+ user = client.users.get("USER_GUID_HERE")
336+ groups = user.groups.find()
337+ ```
338+
339+ See Also
340+ --------
341+ * https://docs.posit.co/connect/api/#get-/v1/groups/-group_guid-/members
313342 """
314343 self_groups : list [Group ] = []
315344 for group in self ._ctx .client .groups .find ():
@@ -396,6 +425,10 @@ def create(self, **attributes: Unpack[CreateUser]) -> User:
396425 ... user_must_set_password=True,
397426 ... user_role="viewer",
398427 ... )
428+
429+ See Also
430+ --------
431+ * https://docs.posit.co/connect/api/#post-/v1/users
399432 """
400433 # todo - use the 'context' module to inspect the 'authentication' object and route to POST (local) or PUT (remote).
401434 url = self ._ctx .url + "v1/users"
@@ -440,6 +473,10 @@ def find(self, **conditions: Unpack[FindUser]) -> List[User]:
440473 Find all users who are locked or licensed:
441474
442475 >>> users = client.find(account_status="locked|licensed")
476+
477+ See Also
478+ --------
479+ * https://docs.posit.co/connect/api/#get-/v1/users
443480 """
444481 url = self ._ctx .url + "v1/users"
445482 paginator = Paginator (self ._ctx .session , url , params = {** conditions })
@@ -483,6 +520,10 @@ def find_one(self, **conditions: Unpack[FindUser]) -> User | None:
483520 Find a user who is locked or licensed:
484521
485522 >>> user = client.find_one(account_status="locked|licensed")
523+
524+ See Also
525+ --------
526+ * https://docs.posit.co/connect/api/#get-/v1/users
486527 """
487528 url = self ._ctx .url + "v1/users"
488529 paginator = Paginator (self ._ctx .session , url , params = {** conditions })
@@ -513,6 +554,10 @@ def get(self, uid: str) -> User:
513554 Examples
514555 --------
515556 >>> user = client.get("123e4567-e89b-12d3-a456-426614174000")
557+
558+ See Also
559+ --------
560+ * https://docs.posit.co/connect/api/#get-/v1/users
516561 """
517562 url = self ._ctx .url + f"v1/users/{ uid } "
518563 response = self ._ctx .session .get (url )
@@ -528,6 +573,10 @@ def count(self) -> int:
528573 Returns
529574 -------
530575 int
576+
577+ See Also
578+ --------
579+ * https://docs.posit.co/connect/api/#get-/v1/users
531580 """
532581 url = self ._ctx .url + "v1/users"
533582 response = self ._ctx .session .get (url , params = {"page_size" : 1 })
0 commit comments