Skip to content

Examples#

Index > CloudFrontKeyValueStore > Examples

Auto-generated documentation for CloudFrontKeyValueStore type annotations stubs module types-boto3-cloudfront-keyvaluestore.

Client#

Implicit type annotations#

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

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

Client method usage example#

# CloudFrontKeyValueStoreClient usage example

from boto3.session import Session


session = Session()

client = session.client("cloudfront-keyvaluestore")  # (1)
result = client.delete_key()  # (2)
  1. client: CloudFrontKeyValueStoreClient
  2. result: DeleteKeyResponseTypeDef

Paginator usage example#

# ListKeysPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("cloudfront-keyvaluestore")  # (1)

paginator = client.get_paginator("list_keys")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: CloudFrontKeyValueStoreClient
  2. paginator: ListKeysPaginator
  3. item: ListKeysResponseTypeDef

Explicit type annotations#

With types-boto3-lite[cloudfront-keyvaluestore] or a standalone types_boto3_cloudfront_keyvaluestore package, you have to explicitly specify client: CloudFrontKeyValueStoreClient 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#

# CloudFrontKeyValueStoreClient usage example with type annotations

from boto3.session import Session

from types_boto3_cloudfront_keyvaluestore.client import CloudFrontKeyValueStoreClient
from types_boto3_cloudfront_keyvaluestore.type_defs import DeleteKeyResponseTypeDef
from types_boto3_cloudfront_keyvaluestore.type_defs import DeleteKeyRequestTypeDef


session = Session()

client: CloudFrontKeyValueStoreClient = session.client("cloudfront-keyvaluestore")

kwargs: DeleteKeyRequestTypeDef = {...}
result: DeleteKeyResponseTypeDef = client.delete_key(**kwargs)

Paginator usage example#

# ListKeysPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_cloudfront_keyvaluestore.client import CloudFrontKeyValueStoreClient
from types_boto3_cloudfront_keyvaluestore.paginator import ListKeysPaginator
from types_boto3_cloudfront_keyvaluestore.type_defs import ListKeysResponseTypeDef


session = Session()
client: CloudFrontKeyValueStoreClient = session.client("cloudfront-keyvaluestore")

paginator: ListKeysPaginator = client.get_paginator("list_keys")
for item in paginator.paginate(...):
    item: ListKeysResponseTypeDef
    print(item)