mypy-boto3-chime-sdk-media-pipelines

1.42.3 · active · verified Sat Apr 11

This library provides comprehensive type annotations for the `boto3` AWS SDK, specifically for the Chime SDK Media Pipelines service (version 1.42.3). It enhances developer experience by enabling static type checking with tools like MyPy, PyRight, and improved auto-completion in IDEs such as VSCode and PyCharm. The package is actively maintained, with releases frequently synchronized with `boto3` versions, generated by the `mypy-boto3-builder`.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and use the `ChimeSDKMediaPipelinesClient` type from `mypy-boto3-chime-sdk-media-pipelines` to get type hints for `boto3.client('chime-sdk-media-pipelines')`. It also shows how to use a `TypedDict` for request parameters, ensuring type correctness for API calls. The `if TYPE_CHECKING:` guard ensures that `mypy-boto3` is only a development dependency.

from typing import TYPE_CHECKING
import boto3

if TYPE_CHECKING:
    from mypy_boto3_chime_sdk_media_pipelines.client import ChimeSDKMediaPipelinesClient
    from mypy_boto3_chime_sdk_media_pipelines.type_defs import CreateMediaPipelineRequestTypeDef

def create_media_pipeline(name: str) -> dict:
    # In a real application, you would pass credentials or rely on environment variables/config
    # For demonstration, a client is created without explicit credentials.
    client: "ChimeSDKMediaPipelinesClient" = boto3.client("chime-sdk-media-pipelines")

    # Example of using a TypedDict for request parameters
    request_params: "CreateMediaPipelineRequestTypeDef" = {
        "DisplayName": name,
        "Tags": [{"Key": "Environment", "Value": "Dev"}]
        # Add other required parameters as per AWS documentation
    }

    # This call is for demonstration; actual Chime SDK Media Pipelines creation might require more specific parameters.
    # print(f"Attempting to create media pipeline: {name}")
    # response = client.create_media_pipeline(DisplayName=name, **request_params)
    # print(f"Media pipeline created: {response['MediaPipeline']['MediaPipelineId']}")

    # Simulate a successful response for a runnable quickstart
    return {
        'MediaPipeline': {
            'MediaPipelineId': 'dummy-pipeline-id-123',
            'MediaPipelineArn': f'arn:aws:chime::123456789012:media-pipeline/{name}/dummy-pipeline-id-123',
            'DisplayName': name,
            'Status': 'InProgress'
        }
    }

if __name__ == "__main__":
    pipeline_name = "MyTestMediaPipeline"
    result = create_media_pipeline(pipeline_name)
    print(result)

view raw JSON →