Skip to content

Examples#

Index > Omics > Examples

Auto-generated documentation for Omics type annotations stubs module mypy-boto3-omics.

Client#

Implicit type annotations#

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

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

# OmicsClient usage example

from boto3.session import Session


session = Session()

client = session.client("omics")  # (1)
result = client.accept_share()  # (2)
  1. client: OmicsClient
  2. result: AcceptShareResponseTypeDef
# ListAnnotationImportJobsPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_annotation_import_jobs")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: OmicsClient
  2. paginator: ListAnnotationImportJobsPaginator
  3. item: ListAnnotationImportJobsResponseTypeDef
# AnnotationImportJobCreatedWaiter usage example

from boto3.session import Session


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

waiter = client.get_waiter("annotation_import_job_created")  # (2)
waiter.wait()
  1. client: OmicsClient
  2. waiter: AnnotationImportJobCreatedWaiter

Explicit type annotations#

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

# OmicsClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_omics.client import OmicsClient
from mypy_boto3_omics.type_defs import AcceptShareResponseTypeDef
from mypy_boto3_omics.type_defs import AcceptShareRequestRequestTypeDef


session = Session()

client: OmicsClient = session.client("omics")

kwargs: AcceptShareRequestRequestTypeDef = {...}
result: AcceptShareResponseTypeDef = client.accept_share(**kwargs)
# ListAnnotationImportJobsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_omics.client import OmicsClient
from mypy_boto3_omics.paginator import ListAnnotationImportJobsPaginator
from mypy_boto3_omics.type_defs import ListAnnotationImportJobsResponseTypeDef


session = Session()
client: OmicsClient = session.client("omics")

paginator: ListAnnotationImportJobsPaginator = client.get_paginator("list_annotation_import_jobs")
for item in paginator.paginate(...):
    item: ListAnnotationImportJobsResponseTypeDef
    print(item)
# AnnotationImportJobCreatedWaiter usage example with type annotations

from boto3.session import Session

from mypy_boto3_omics.client import OmicsClient
from mypy_boto3_omics.waiter import AnnotationImportJobCreatedWaiter

session = Session()
client: OmicsClient = session.client("omics")

waiter: AnnotationImportJobCreatedWaiter = client.get_waiter("annotation_import_job_created")
waiter.wait()