harp_apps.http_client.settings

Inheritance diagram of harp_apps.http_client.settings

class HttpClientSettings[source]

Bases: Service

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

arguments: dict

Arguments for the service constructor, by name.

cache: CacheSettings
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'arguments': FieldInfo(annotation=dict, required=False, default={'timeout': 30.0}), 'base': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Base type for service definition.'), 'cache': FieldInfo(annotation=CacheSettings, required=False, default=CacheSettings(enabled=True, transport=Service(base=None, type='hishel.AsyncCacheTransport', constructor=None, arguments={}), controller=Service(base=None, type='hishel.Controller', constructor=None, arguments={'allow_heuristics': False, 'allow_stale': False, 'cacheable_methods': ['GET', 'HEAD'], 'cacheable_status_codes': [200, 203, 204, 206, 300, 301, 308, 404, 405, 410, 414, 501]}), storage=Service(base='hishel.AsyncBaseStorage', type='harp_apps.http_client.contrib.hishel.storages.AsyncStorage', constructor=None, arguments={'ttl': None, 'check_ttl_every': 60.0}))), 'constructor': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Optional custom constructor for the service.'), 'proxy_transport': FieldInfo(annotation=Service, required=False, default=Service(base=None, type='harp_apps.http_client.transport.AsyncFilterableTransport', constructor=None, arguments={})), 'transport': FieldInfo(annotation=Service, required=False, default=Service(base=None, type='httpx.AsyncHTTPTransport', constructor=None, arguments={'verify': True, 'retries': 0})), 'type': FieldInfo(annotation=str, required=False, default='httpx.AsyncClient', description='Type for service definition.')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

proxy_transport: Service
transport: Service

HTTP transport to use for the client. This is usually a httpx.AsyncHTTPTransport (or subclass) instance.

type: str

Type for service definition. This is the actual type that will be instanciated.

Submodules