Examples#
Index > NeptuneGraph > Examples
Auto-generated documentation for NeptuneGraph type annotations stubs module types-aiobotocore-neptune-graph.
Client#
Implicit type annotations#
Can be used with types-aioboto3[neptune-graph]
package installed.
Write your NeptuneGraph
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# NeptuneGraphClient usage example
from aioboto3.session import Session
session = Session()
async with session.client("neptune-graph") as client: # (1)
result = await client.cancel_export_task() # (2)
- client: NeptuneGraphClient
- result: CancelExportTaskOutputTypeDef
Paginator usage example#
# ListExportTasksPaginator usage example
from aioboto3.session import Session
session = Session()
async with session.client("neptune-graph") as client: # (1)
paginator = client.get_paginator("list_export_tasks") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: NeptuneGraphClient
- paginator: ListExportTasksPaginator
- item: ListExportTasksOutputTypeDef
Waiter usage example#
# ExportTaskCancelledWaiter usage example
from aioboto3.session import Session
session = Session()
async with session.client("neptune-graph") as client: # (1)
waiter = client.get_waiter("export_task_cancelled") # (2)
await waiter.wait(...)
- client: NeptuneGraphClient
- waiter: ExportTaskCancelledWaiter
Explicit type annotations#
With types-aioboto3-lite[neptune-graph]
or a standalone types_aiobotocore_neptune_graph
package, you have to explicitly specify
client: NeptuneGraphClient
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#
# NeptuneGraphClient usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_neptune_graph.client import NeptuneGraphClient
from types_aiobotocore_neptune_graph.type_defs import CancelExportTaskOutputTypeDef
from types_aiobotocore_neptune_graph.type_defs import CancelExportTaskInputTypeDef
session = Session()
client: NeptuneGraphClient
async with session.client("neptune-graph") as client: # (1)
kwargs: CancelExportTaskInputTypeDef = {...} # (2)
result: CancelExportTaskOutputTypeDef = await client.cancel_export_task(**kwargs) # (3)
- client: NeptuneGraphClient
- kwargs: CancelExportTaskInputTypeDef
- result: CancelExportTaskOutputTypeDef
Paginator usage example#
# ListExportTasksPaginator usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_neptune_graph.client import NeptuneGraphClient
from types_aiobotocore_neptune_graph.paginator import ListExportTasksPaginator
from types_aiobotocore_neptune_graph.type_defs import ListExportTasksOutputTypeDef
session = Session()
client: NeptuneGraphClient
async with session.client("neptune-graph") as client: # (1)
paginator: ListExportTasksPaginator = client.get_paginator("list_export_tasks") # (2)
async for item in paginator.paginate(...):
item: ListExportTasksOutputTypeDef
print(item) # (3)
- client: NeptuneGraphClient
- paginator: ListExportTasksPaginator
- item: ListExportTasksOutputTypeDef
Waiter usage example#
# ExportTaskCancelledWaiter usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_neptune_graph.client import NeptuneGraphClient
from types_aiobotocore_neptune_graph.waiter import ExportTaskCancelledWaiter
session = Session()
async with session.client("neptune-graph") as client: # (1)
waiter = client.get_waiter("export_task_cancelled") # (2)
await waiter.wait(...)
- client: NeptuneGraphClient
- waiter: ExportTaskCancelledWaiter