Skip to content

Examples#

Index > NetworkManager > Examples

Auto-generated documentation for NetworkManager type annotations stubs module types-boto3-networkmanager.

Client#

Implicit type annotations#

Can be used with types-boto3[networkmanager] package installed.

Write your NetworkManager code as usual, type checking and code completion should work out of the box.

Client method usage example#

# NetworkManagerClient usage example

from boto3.session import Session


session = Session()

client = session.client("networkmanager")  # (1)
result = client.accept_attachment()  # (2)
  1. client: NetworkManagerClient
  2. result: AcceptAttachmentResponseTypeDef

Paginator usage example#

# DescribeGlobalNetworksPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("networkmanager")  # (1)

paginator = client.get_paginator("describe_global_networks")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: NetworkManagerClient
  2. paginator: DescribeGlobalNetworksPaginator
  3. item: DescribeGlobalNetworksResponseTypeDef

Explicit type annotations#

With types-boto3-lite[networkmanager] or a standalone types_boto3_networkmanager package, you have to explicitly specify client: NetworkManagerClient type annotation.

All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.

Client method usage example#

# NetworkManagerClient usage example with type annotations

from boto3.session import Session

from types_boto3_networkmanager.client import NetworkManagerClient
from types_boto3_networkmanager.type_defs import AcceptAttachmentResponseTypeDef
from types_boto3_networkmanager.type_defs import AcceptAttachmentRequestTypeDef


session = Session()

client: NetworkManagerClient = session.client("networkmanager")

kwargs: AcceptAttachmentRequestTypeDef = {...}
result: AcceptAttachmentResponseTypeDef = client.accept_attachment(**kwargs)

Paginator usage example#

# DescribeGlobalNetworksPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_networkmanager.client import NetworkManagerClient
from types_boto3_networkmanager.paginator import DescribeGlobalNetworksPaginator
from types_boto3_networkmanager.type_defs import DescribeGlobalNetworksResponseTypeDef


session = Session()
client: NetworkManagerClient = session.client("networkmanager")

paginator: DescribeGlobalNetworksPaginator = client.get_paginator("describe_global_networks")
for item in paginator.paginate(...):
    item: DescribeGlobalNetworksResponseTypeDef
    print(item)