Skip to content

Commit 733aa97

Browse files
Add docstrings to SeamMultiWorkspace (#135)
* Document SeamMultiWorkspace * ci: Format code --------- Co-authored-by: Seam Bot <[email protected]>
1 parent dd0dc12 commit 733aa97

File tree

1 file changed

+59
-11
lines changed

1 file changed

+59
-11
lines changed

seam/seam_multi_workspace.py

+59-11
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,21 @@ def create(self, **kwargs):
2626

2727
class SeamMultiWorkspace(AbstractSeamMultiWorkspace):
2828
"""
29-
Seam class used to interact with Seam API without being scoped to any specific workspace.
29+
Seam class used to interact with Seam API without being scoped to a specific workspace.
30+
31+
This class provides methods to authenticate and interact with Seam API endpoints
32+
that can operate without being tied to a specific workspace. It supports operations such as creating and listing workspaces.
33+
34+
:cvar lts_version: The long-term support (LTS) version of the Seam
35+
Python SDK
36+
:vartype lts_version: str
37+
:ivar wait_for_action_attempt: Controls whether to wait for an action
38+
attempt to complete
39+
:vartype wait_for_action_attempt: Union[bool, Dict[str, float]]
40+
:ivar client: The HTTP client used for making API requests
41+
:vartype client: SeamHttpClient
42+
:ivar workspaces: Proxy to access workspace-related operations
43+
:vartype workspaces: WorkspacesProxy
3044
"""
3145

3246
lts_version: str = LTS_VERSION
@@ -40,16 +54,25 @@ def __init__(
4054
retries: Optional[Retry] = None,
4155
):
4256
"""
43-
Parameters
44-
----------
45-
personal_access_token : str, optional
46-
Personal access token.
47-
endpoint : str, optional
48-
The API endpoint to which the request should be sent.
49-
wait_for_action_attempt : bool or dict, optional
50-
Controls whether to wait for an action attempt to complete, either as a boolean or as a dictionary specifying `timeout` and `poll_interval`. Defaults to `False`.
51-
retries : urllib3.util.Retry, optional
52-
Configuration for retry behavior on failed requests.
57+
Initialize a SeamMultiWorkspace client instance.
58+
59+
This method sets up the SeamMultiWorkspace client with the provided personal access token
60+
and configuration options.
61+
62+
:param personal_access_token: A personal access token for
63+
authenticating with Seam
64+
:type personal_access_token: str
65+
:param endpoint: The custom API endpoint URL. If not provided,
66+
the default Seam API endpoint will be used
67+
:type endpoint: Optional[str]
68+
:param wait_for_action_attempt: Controls whether to wait for an
69+
action attempt to complete. Can be a boolean or a dictionary with
70+
'timeout' and 'poll_interval' keys
71+
:type wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]]
72+
:param retries: Configuration for retry behavior on failed requests
73+
:type retries: Optional[urllib3.util.Retry]
74+
75+
:raises SeamInvalidTokenError: If the provided personal access token format is invalid
5376
"""
5477

5578
self.lts_version = SeamMultiWorkspace.lts_version
@@ -79,6 +102,31 @@ def from_personal_access_token(
79102
wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = True,
80103
retries: Optional[Retry] = None,
81104
) -> Self:
105+
"""
106+
Create a SeamMultiWorkspace instance using a personal access token.
107+
108+
This class method is a convenience constructor for creating a SeamMultiWorkspace instance
109+
authenticated with a personal access token.
110+
111+
:param personal_access_token: The personal access token for authenticating with Seam
112+
:type personal_access_token: str
113+
:param endpoint: The custom API endpoint URL. If not provided, the default Seam API endpoint will be used
114+
:type endpoint: Optional[str]
115+
:param wait_for_action_attempt: Controls whether to wait for an
116+
action attempt to complete. Can be a boolean or a dictionary with
117+
'timeout' and 'poll_interval' keys
118+
:type wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]]
119+
:param retries: Configuration for retry behavior on failed requests
120+
:type retries: Optional[urllib3.util.Retry]
121+
:return: A new instance of the SeamMultiWorkspace class
122+
authenticated with the provided personal access token
123+
:rtype: Self
124+
125+
:Example:
126+
127+
>>> seam = SeamMultiWorkspace.from_personal_access_token("your-personal-access-token-here")
128+
"""
129+
82130
return cls(
83131
personal_access_token=personal_access_token,
84132
endpoint=endpoint,

0 commit comments

Comments
 (0)