Skip to content

Commit ce0f541

Browse files
committed
Update client docstrings
1 parent 7fb90ad commit ce0f541

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

msgraph/core/graph_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def wrapper(*args, **kwargs):
3636
class GraphClient:
3737
"""Constructs a custom HTTPClient to be used for requests against Microsoft Graph
3838
39-
:keyword credential: TokenCredential used to acquire an access token for the Microsoft
39+
:keyword token_provider: AccessTokenProvider used to acquire an access token for the Microsoft
4040
Graph API. Created through one of the credential classes from `azure.identity`
4141
:keyword list middleware: Custom middleware list that will be used to create
4242
a middleware pipeline. The middleware should be arranged in the order in which they will
@@ -45,7 +45,7 @@ class GraphClient:
4545
`APIVersion.v1` (default). This value is used in setting the base url for all requests for
4646
that session.
4747
:class:`~msgraphcore.enums.APIVersion` defines valid API versions.
48-
:keyword enum cloud: a supported Microsoft Graph cloud endpoint.
48+
:keyword enum base_url: a supported Microsoft Graph cloud endpoint.
4949
Defaults to `NationalClouds.Global`
5050
:class:`~msgraphcore.enums.NationalClouds` defines supported sovereign clouds.
5151
:keyword tuple timeout: Default connection and read timeout values for all session requests.

msgraph/core/graph_client_factory.py

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,8 @@
2222

2323

2424
class GraphClientFactory(KiotaClientFactory):
25-
"""Constructs httpx AsyncClient instances configured with either custom or default
26-
pipeline of middleware.
27-
28-
:func: Class constructor accepts a user provided session object and kwargs to configure the
29-
request handling behaviour of the client
30-
:keyword enum api_version: The Microsoft Graph API version to be used, for example
31-
`APIVersion.v1` (default). This value is used in setting the base url for all requests for
32-
that session.
33-
:class:`~msgraphcore.enums.APIVersion` defines valid API versions.
34-
:keyword enum cloud: a supported Microsoft Graph cloud endpoint.
35-
Defaults to `NationalClouds.Global`
36-
:class:`~msgraphcore.enums.NationalClouds` defines supported sovereign clouds.
37-
:keyword tuple timeout: Default connection and read timeout values for all session requests.
38-
Specify a tuple in the form of Tuple(connect_timeout, read_timeout) if you would like to set
39-
the values separately. If you specify a single value for the timeout, the timeout value will
40-
be applied to both the connect and the read timeouts.
41-
:keyword obj session: A custom Session instance from the python requests library
25+
"""Constructs httpx.AsyncClient instances configured with either custom or default
26+
pipeline of graph specific middleware.
4227
"""
4328

4429
def __init__(
@@ -48,8 +33,20 @@ def __init__(
4833
timeout: httpx.Timeout,
4934
client: Optional[httpx.AsyncClient],
5035
):
51-
"""Class constructor that accepts a user provided session object and kwargs
52-
to configure the request handling behaviour of the client"""
36+
"""Class constructor accepts a user provided client object and kwargs to configure the
37+
request handling behaviour of the client
38+
39+
Args:
40+
api_version (APIVersion): The Microsoft Graph API version to be used, for example
41+
`APIVersion.v1` (default). This value is used in setting
42+
the base url for all requests for that session.
43+
base_url (NationalClouds): a supported Microsoft Graph cloud endpoint.
44+
timeout (httpx.Timeout):Default connection and read timeout values for all session
45+
requests.Specify a tuple in the form of httpx.Timeout(
46+
REQUEST_TIMEOUT, connect=CONNECTION_TIMEOUT),
47+
client (Optional[httpx.AsyncClient]): A custom AsynClient instance from the
48+
python httpx library
49+
"""
5350
self.api_version = api_version
5451
self.base_url = base_url
5552
self.timeout = timeout
@@ -80,7 +77,8 @@ def create_with_custom_middleware(
8077
) -> httpx.AsyncClient:
8178
"""Applies a custom middleware chain to the HTTP Client
8279
83-
:param list middleware: Custom middleware(HTTPAdapter) list that will be used to create
80+
Args:
81+
middleware(List[BaseMiddleware]): Custom middleware list that will be used to create
8482
a middleware pipeline. The middleware should be arranged in the order in which they will
8583
modify the request.
8684
"""

0 commit comments

Comments
 (0)