mypy-boto3-sso-oidc Type Stubs

1.42.67 · active · verified Sat Apr 11

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

Install

Imports

Quickstart

Demonstrates how to instantiate a boto3 SSOOIDC client and apply the type hints provided by `mypy-boto3-sso-oidc`. The `if TYPE_CHECKING:` block is a standard pattern to isolate type-only imports, preventing them from causing runtime issues or unnecessary dependencies.

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)")

view raw JSON →