Skip to content

Examples#

Index > Artifact > Examples

Auto-generated documentation for Artifact type annotations stubs module types-boto3-artifact.

Client#

Implicit type annotations#

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

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

Client method usage example#

# ArtifactClient usage example

from boto3.session import Session


session = Session()

client = session.client("artifact")  # (1)
result = client.create_compliance_inquiry()  # (2)
  1. client: ArtifactClient
  2. result: CreateComplianceInquiryResponseTypeDef

Paginator usage example#

# ListComplianceInquiriesPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_compliance_inquiries")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: ArtifactClient
  2. paginator: ListComplianceInquiriesPaginator
  3. item: ListComplianceInquiriesResponseTypeDef

Explicit type annotations#

With types-boto3-lite[artifact] or a standalone types_boto3_artifact package, you have to explicitly specify client: ArtifactClient 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#

# ArtifactClient usage example with type annotations

from boto3.session import Session

from types_boto3_artifact.client import ArtifactClient
from types_boto3_artifact.type_defs import CreateComplianceInquiryResponseTypeDef
from types_boto3_artifact.type_defs import CreateComplianceInquiryRequestTypeDef


session = Session()

client: ArtifactClient = session.client("artifact")

kwargs: CreateComplianceInquiryRequestTypeDef = {...}
result: CreateComplianceInquiryResponseTypeDef = client.create_compliance_inquiry(**kwargs)

Paginator usage example#

# ListComplianceInquiriesPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_artifact.client import ArtifactClient
from types_boto3_artifact.paginator import ListComplianceInquiriesPaginator
from types_boto3_artifact.type_defs import ListComplianceInquiriesResponseTypeDef


session = Session()
client: ArtifactClient = session.client("artifact")

paginator: ListComplianceInquiriesPaginator = client.get_paginator("list_compliance_inquiries")
for item in paginator.paginate(...):
    item: ListComplianceInquiriesResponseTypeDef
    print(item)