mypy-boto3-sso-oidc Type Stubs
mypy-boto3-sso-oidc provides a complete set of type annotations for the boto3 SSOOIDC client, enabling static type checking with tools like mypy. It's part of the `mypy-boto3` ecosystem, which generates stubs for all boto3 services. The package version typically aligns with the boto3 version it types, leading to frequent updates tied to boto3 releases and `mypy-boto3-builder` enhancements.
Warnings
- breaking Starting with `mypy-boto3-builder` version 8.12.0 (which generated `mypy-boto3` packages like `1.42.x`+), Python 3.8 is no longer supported for any generated stub packages. This affects users running Python 3.8 environments.
- gotcha The `mypy-boto3` ecosystem migrated to PEP 561-compliant packages (marked with `py.typed`) in `mypy-boto3-builder` 8.12.0. While this is generally beneficial for type discovery, ensure your `mypy` version is up-to-date to correctly discover these new-style stubs, especially if you had custom stub paths or configurations.
- breaking Some TypeDef names, particularly for request/response payloads, underwent breaking changes (shortened or reordered) in `mypy-boto3-builder` 8.9.0. For example, `CreateDistributionRequestRequestTypeDef` was shortened to `CreateDistributionRequestTypeDef` (though specific name changes vary by service). Code relying on older stub versions might require updating TypeDef names.
- gotcha Service names and their corresponding `mypy-boto3` package names can change or be deprecated, mirroring changes in AWS or `boto3`. For instance, the `sms-voice` service was removed in builder 8.11.0. While `sso-oidc` is currently stable, be aware of this pattern for other services or potential future changes.
Install
-
pip install mypy-boto3-sso-oidc boto3
Imports
- SSOOIDCClient
from mypy_boto3_sso_oidc.client import SSOOIDCClient
- SSOOIDCServiceResource
from mypy_boto3_sso_oidc.service_resource import SSOOIDCServiceResource
- CreateTokenRequestRequestTypeDef
from mypy_boto3_sso_oidc.type_defs import CreateTokenRequestRequestTypeDef
Quickstart
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_sso_oidc.client import SSOOIDCClient
from mypy_boto3_sso_oidc.type_defs import StartDeviceAuthorizationResponseTypeDef
# Instantiate a boto3 client (runtime)
client = boto3.client("sso-oidc")
# Use type hints for static analysis
# The 'if TYPE_CHECKING:' block ensures these imports are only for type checkers
# and do not create runtime dependencies.
if TYPE_CHECKING:
sso_oidc_client: SSOOIDCClient = client
# Example usage with type-hinted client
# Replace placeholders with actual values for a runnable example
response: StartDeviceAuthorizationResponseTypeDef = sso_oidc_client.start_device_authorization(
clientCode='YOUR_CLIENT_CODE',
startUrl='https://example.com'
)
print(f"Device Code: {response.get('deviceCode')}")
print("Boto3 SSOOIDC client created and type-hinted successfully (check with mypy)")