sift_client.transport.base_connection
¶
| CLASS | DESCRIPTION |
|---|---|
SiftConnectionConfig |
Configuration for Grpc and Rest connections. |
WithGrpcClient |
Abstract base class for classes that require a gRPC client. |
WithRestClient |
Abstract base class for classes that require a REST client. |
SiftConnectionConfig
¶
SiftConnectionConfig(
grpc_url: str,
rest_url: str,
api_key: str,
use_ssl: bool = False,
cert_via_openssl: bool = False,
)
Configuration for Grpc and Rest connections.
This class provides a unified configuration for both gRPC and REST connections, allowing for consistent settings across different transport protocols.
Initialize the connection configuration.
| PARAMETER | DESCRIPTION |
|---|---|
grpc_url
|
The URL for the gRPC service.
TYPE:
|
rest_url
|
The URL for the REST service.
TYPE:
|
api_key
|
The API key for authentication.
TYPE:
|
use_ssl
|
Whether to use SSL/TLS for secure connections.
TYPE:
|
cert_via_openssl
|
Whether to use OpenSSL for certificate validation.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_grpc_config |
Create and return a GrpcConfig with the current settings. |
get_rest_config |
Create and return a RestConfig with the current settings. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
api_key |
|
cert_via_openssl |
|
grpc_url |
|
rest_url |
|
use_ssl |
|
get_grpc_config
¶
Create and return a GrpcConfig with the current settings.
| RETURNS | DESCRIPTION |
|---|---|
|
A GrpcConfig object configured with this instance's settings. |
get_rest_config
¶
Create and return a RestConfig with the current settings.
| RETURNS | DESCRIPTION |
|---|---|
|
A RestConfig object configured with this instance's settings. |
WithGrpcClient
¶
WithGrpcClient(grpc_client: GrpcClient)
Bases: ABC
Abstract base class for classes that require a gRPC client.
This class provides access to a gRPC client for making API calls.
Initialize with a gRPC client.
| PARAMETER | DESCRIPTION |
|---|---|
grpc_client
|
The gRPC client to use for API calls.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_asyncio_loop |
Gets the default asyncio loop used by the gRPC client. |
get_asyncio_loop
¶
get_asyncio_loop() -> AbstractEventLoop
Gets the default asyncio loop used by the gRPC client.
| RETURNS | DESCRIPTION |
|---|---|
AbstractEventLoop
|
The default asyncio loop. |
WithRestClient
¶
WithRestClient(rest_client: RestClient)
Bases: ABC
Abstract base class for classes that require a REST client.
This class provides access to a REST client for making API calls.
Initialize with a REST client.
| PARAMETER | DESCRIPTION |
|---|---|
rest_client
|
The REST client to use for API calls.
TYPE:
|