Skip to content

Examples#

Index > S3Outposts > Examples

Auto-generated documentation for S3Outposts type annotations stubs module types-boto3-s3outposts.

Client#

Implicit type annotations#

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

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

Client method usage example#

# S3OutpostsClient usage example

from boto3.session import Session


session = Session()

client = session.client("s3outposts")  # (1)
result = client.create_endpoint()  # (2)
  1. client: S3OutpostsClient
  2. result: CreateEndpointResultTypeDef

Paginator usage example#

# ListEndpointsPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_endpoints")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: S3OutpostsClient
  2. paginator: ListEndpointsPaginator
  3. item: ListEndpointsResultTypeDef

Explicit type annotations#

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

# S3OutpostsClient usage example with type annotations

from boto3.session import Session

from types_boto3_s3outposts.client import S3OutpostsClient
from types_boto3_s3outposts.type_defs import CreateEndpointResultTypeDef
from types_boto3_s3outposts.type_defs import CreateEndpointRequestTypeDef


session = Session()

client: S3OutpostsClient = session.client("s3outposts")

kwargs: CreateEndpointRequestTypeDef = {...}
result: CreateEndpointResultTypeDef = client.create_endpoint(**kwargs)

Paginator usage example#

# ListEndpointsPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_s3outposts.client import S3OutpostsClient
from types_boto3_s3outposts.paginator import ListEndpointsPaginator
from types_boto3_s3outposts.type_defs import ListEndpointsResultTypeDef


session = Session()
client: S3OutpostsClient = session.client("s3outposts")

paginator: ListEndpointsPaginator = client.get_paginator("list_endpoints")
for item in paginator.paginate(...):
    item: ListEndpointsResultTypeDef
    print(item)