mypy-boto3-tnb

1.42.3 · active · verified Sat Apr 11

mypy-boto3-tnb provides type annotations for the `boto3` TelcoNetworkBuilder (TNB) service. It is part of the `mypy-boto3` ecosystem, generated by `mypy-boto3-builder`, offering enhanced type checking and IDE auto-completion for `boto3` clients and related objects. The `mypy-boto3` project maintains a frequent release cadence, typically releasing updates monthly or bi-monthly to keep pace with `boto3` and `botocore` changes.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `mypy-boto3-tnb` to add type hints for the TelcoNetworkBuilder service client. It shows the explicit import of the typed client and a `TypeDef` for return values, enhancing code completion and type checking for `boto3` operations. Remember to have AWS credentials configured for the `boto3.client` call to succeed.

import boto3
from mypy_boto3_tnb.client import TelcoNetworkBuilderClient
from mypy_boto3_tnb.type_defs import CreateSolFunctionPackageOutputTypeDef

def create_tnb_function_package(package_name: str) -> CreateSolFunctionPackageOutputTypeDef:
    # mypy-boto3-tnb provides type hints, boto3 is the runtime
    client: TelcoNetworkBuilderClient = boto3.client("tnb")

    # Example API call with type hinting for input and output
    response: CreateSolFunctionPackageOutputTypeDef = client.create_sol_function_package(
        tags={
            "Name": package_name
        }
    )
    print(f"Successfully created SOL Function Package: {response.get('id')}")
    return response

if __name__ == "__main__":
    # This code is for demonstration and requires AWS credentials configured
    # It will attempt to create a resource, which may incur costs.
    # Replace 'my-test-package' with a unique name.
    try:
        package_output = create_tnb_function_package("my-test-package")
        # Additional operations with package_output can be typed here
    except Exception as e:
        print(f"An error occurred: {e}")

view raw JSON →