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.
# S3OutpostsClient usage example
from boto3.session import Session
session = Session()
client = session.client("s3outposts") # (1)
result = client.create_endpoint() # (2)
- client: S3OutpostsClient
- result: CreateEndpointResultTypeDef
# 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)
- client: S3OutpostsClient
- paginator: ListEndpointsPaginator
- 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.
# 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 CreateEndpointRequestRequestTypeDef
session = Session()
client: S3OutpostsClient = session.client("s3outposts")
kwargs: CreateEndpointRequestRequestTypeDef = {...}
result: CreateEndpointResultTypeDef = client.create_endpoint(**kwargs)
# 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)