Skip to content

Examples#

Index > Private5G > Examples

Auto-generated documentation for Private5G type annotations stubs module mypy-boto3-privatenetworks.

Client#

Implicit type annotations#

Can be used with boto3-stubs[privatenetworks] package installed.

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

# Private5GClient usage example

from boto3.session import Session


session = Session()

client = session.client("privatenetworks")  # (1)
result = client.acknowledge_order_receipt()  # (2)
  1. client: Private5GClient
  2. result: AcknowledgeOrderReceiptResponseTypeDef
# ListDeviceIdentifiersPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_device_identifiers")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: Private5GClient
  2. paginator: ListDeviceIdentifiersPaginator
  3. item: ListDeviceIdentifiersResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[privatenetworks] or a standalone mypy_boto3_privatenetworks package, you have to explicitly specify client: Private5GClient 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.

# Private5GClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_privatenetworks.client import Private5GClient
from mypy_boto3_privatenetworks.type_defs import AcknowledgeOrderReceiptResponseTypeDef
from mypy_boto3_privatenetworks.type_defs import AcknowledgeOrderReceiptRequestRequestTypeDef


session = Session()

client: Private5GClient = session.client("privatenetworks")

kwargs: AcknowledgeOrderReceiptRequestRequestTypeDef = {...}
result: AcknowledgeOrderReceiptResponseTypeDef = client.acknowledge_order_receipt(**kwargs)
# ListDeviceIdentifiersPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_privatenetworks.client import Private5GClient
from mypy_boto3_privatenetworks.paginator import ListDeviceIdentifiersPaginator
from mypy_boto3_privatenetworks.type_defs import ListDeviceIdentifiersResponseTypeDef


session = Session()
client: Private5GClient = session.client("privatenetworks")

paginator: ListDeviceIdentifiersPaginator = client.get_paginator("list_device_identifiers")
for item in paginator.paginate(...):
    item: ListDeviceIdentifiersResponseTypeDef
    print(item)