Skip to content

Commit 1edfb90

Browse files
committed
Update docstrings for request context and samples
1 parent 77e5b4c commit 1edfb90

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

msgraph/core/_graph_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727

2828
def attach_context(func):
29+
"""Attaches a request context object to every graph request"""
2930
def wrapper(*args, **kwargs):
3031
middleware_control = dict()
3132

msgraph/core/middleware/request_context.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,22 @@
88

99

1010
class RequestContext:
11+
"""A request context contains data that is persisted throughout the request and
12+
includes a ClientRequestId property, MiddlewareControl property to control behavior
13+
of middleware as well as a FeatureUsage  property to keep track of middleware used
14+
in making the request.
15+
"""
1116
def __init__(self, middleware_control, headers):
17+
"""Constructor for request context instances
18+
19+
Args:
20+
middleware_control (dict): A dictionary of optional middleware options
21+
that can be accessed by middleware components to override the options provided
22+
during middleware initialization,
23+
24+
headers (dict): A dictionary containing the request headers. Used to check for a
25+
user provided client request id.
26+
"""
1227
self.middleware_control = middleware_control
1328
self.client_request_id = headers.get('client-request-id', str(uuid.uuid4()))
1429
self._feature_usage = FeatureUsageFlag.NONE

samples/retry_handler_samples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
def sample_http_client_with_custom_retry_defaults():
2121
"""
22-
Initializing a sample client with default middleware using the HTTPClientand passing
22+
Initializing a sample client with default middleware using the HTTPClient and passing
2323
default configs to the retryhandler. These defaults will be used for every subsequent
2424
request using the client."""
2525

0 commit comments

Comments
 (0)