mypy-boto3 Type Stubs for RTBFabric

1.42.88 · active · verified Sat Apr 11

mypy-boto3-rtbfabric provides type annotations for the `boto3` RTBFabric service, enabling static type checking for AWS SDK operations. It is generated by the `mypy-boto3-builder` project. The current version is 1.42.88, with frequent releases often multiple times a month, synchronized with upstream `boto3` API changes and `mypy-boto3-builder` updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a `boto3` client for the `rtbfabric` service with type hints from `mypy-boto3-rtbfabric`. It shows how to use the `RTBFabricClient` type and how `type_defs` can be imported for response objects. Note that RTBFabric might be a niche AWS service, so specific method calls might vary; the example uses a common pattern to illustrate type stub usage.

import boto3
from mypy_boto3_rtbfabric import RTBFabricClient
from mypy_boto3_rtbfabric.type_defs import ResponseMetadataTypeDef # Using a common base TypeDef for demo

# Initialize the boto3 client with type hints
# The 'rtbfabric' service might be an internal or less common AWS service.
# Replace with your actual service details and methods if available.
client: RTBFabricClient = boto3.client("rtbfabric")

# Call a hypothetical API method and type-hint its response.
# This demonstrates how type stubs enable static analysis for your boto3 calls.
print("Attempting to call a hypothetical RTBFabric method (e.g., list_profiles)...")
try:
    # Actual method names and TypeDefs depend on the RTBFabric service API.
    # Using get_paginator('list_profiles') as a plausible example of stub interaction.
    paginator = client.get_paginator("list_profiles")
    # The paginate() method typically returns a generator of response dicts.
    # For simplicity, we'll just demonstrate the client's type-hinted methods.
    response_meta: ResponseMetadataTypeDef = client.list_tags_for_resource(ResourceArn="dummy-arn")["ResponseMetadata"]
    print(f"Successfully interacted with RTBFabric client. Status Code: {response_meta['HTTPStatusCode']}")
except client.exceptions.RTBFabricException as e:
    print(f"RTBFabric specific exception caught: {e} (Expected if service is not configured or method is unknown).")
except Exception as e:
    print(f"Generic exception caught: {e} (Expected if service or method is unavailable).")

print("\nClient methods available (demonstration of type-hinted access):")
# dir(client) will show many methods, demonstrating the stubs are active
print(f"Client methods (first 5): {dir(client)[10:15]}")

view raw JSON →