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.

Inheritance
builtins.dict
PipelineContext
PipelineContext

Constructor

PipelineContext(transport: TransportType | None, **kwargs: Any)

Parameters

Name Description
transport
Required

The HTTP transport type.

kwargs
Required
any

Developer-defined keyword arguments.

Methods

clear

Context objects cannot be cleared.

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

Context objects cannot be updated.

values

clear

Context objects cannot be cleared.

clear() -> None

Exceptions

Type Description

copy

copy() -> a shallow copy of D

Exceptions

Type Description

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

Parameters

Name Description
type
Required

Exceptions

Type Description

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

Exceptions

Type Description

items

items() -> a set-like object providing a view on D's items

Exceptions

Type Description

keys

keys() -> a set-like object providing a view on D's keys

Exceptions

Type Description

pop

Removes specified key and returns the value.

pop(__key: str) -> Any

Parameters

Name Description
args
Required
str

The key to remove.

Returns

Type Description
any

The value for this key.

Exceptions

Type Description
ValueError 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()

Exceptions

Type Description

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

Exceptions

Type Description

update

Context objects cannot be updated.

update(*args: Any, **kwargs: Any) -> None

Exceptions

Type Description

values

values() -> an object providing a view on D's values

Exceptions

Type Description