File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 2626
2727
2828def attach_context (func ):
29+ """Attaches a request context object to every graph request"""
2930 def wrapper (* args , ** kwargs ):
3031 middleware_control = dict ()
3132
Original file line number Diff line number Diff line change 88
99
1010class 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
Original file line number Diff line number Diff line change 1919
2020def 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
You can’t perform that action at this time.
0 commit comments