PipelineContext Class
A context object carried by the pipeline request and response containers.
This is transport specific and can contain data persisted between pipeline requests (for example reusing an open connection pool or "session"), as well as used by the SDK developer to carry arbitrary data through the pipeline.
Constructor
PipelineContext(transport: TransportType | None, **kwargs: Any)
Parameters
Name | Description |
---|---|
transport
Required
|
The HTTP transport type. |
kwargs
Required
|
Developer-defined keyword arguments. |
Methods
clear |
Clears the context objects. |
copy | |
fromkeys |
Create a new dictionary with keys from iterable and values set to value. |
get |
Return the value for key if key is in the dictionary, else default. |
items | |
keys | |
pop |
Removes specified key and returns the value. |
popitem |
Remove and return a (key, value) pair as a 2-tuple. Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty. |
setdefault |
Insert key with a value of default if key is not in the dictionary. Return the value for key if key is in the dictionary, else default. |
update |
Updates the context objects. |
values |
clear
Clears the context objects.
clear() -> None
Exceptions
Type | Description |
---|---|
If context objects cannot be cleared |
copy
copy() -> a shallow copy of D
fromkeys
Create a new dictionary with keys from iterable and values set to value.
fromkeys(value=None, /)
Positional-Only Parameters
Name | Description |
---|---|
iterable
Required
|
|
value
|
Default value: None
|
get
Return the value for key if key is in the dictionary, else default.
get(key, default=None, /)
Positional-Only Parameters
Name | Description |
---|---|
key
Required
|
|
default
|
Default value: None
|
items
items() -> a set-like object providing a view on D's items
keys
keys() -> a set-like object providing a view on D's keys
pop
Removes specified key and returns the value.
pop(__key: str) -> Any
Parameters
Name | Description |
---|---|
args
Required
|
The key to remove. |
Returns
Type | Description |
---|---|
The value for this key. |
Exceptions
Type | Description |
---|---|
If the key is in the protected list. |
popitem
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
popitem()
setdefault
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
setdefault(key, default=None, /)
Positional-Only Parameters
Name | Description |
---|---|
key
Required
|
|
default
|
Default value: None
|
update
Updates the context objects.
update(*args: Any, **kwargs: Any) -> None
Exceptions
Type | Description |
---|---|
If context objects cannot be updated |
values
values() -> an object providing a view on D's values