Examples#
Index > ServiceQuotas > Examples
Auto-generated documentation for ServiceQuotas type annotations stubs module types-aiobotocore-service-quotas.
Client#
Implicit type annotations#
Can be used with types-aiobotocore[service-quotas]
package installed.
Write your ServiceQuotas
code as usual,
type checking and code completion should work out of the box.
# ServiceQuotasClient usage example
from aiobotocore.session import get_session
session = get_session()
async with session.create_client("service-quotas") as client: # (1)
result = await client.get_aws_default_service_quota() # (2)
- client: ServiceQuotasClient
- result: GetAWSDefaultServiceQuotaResponseTypeDef
# ListAWSDefaultServiceQuotasPaginator usage example
from aiobotocore.session import get_session
session = get_session()
async with session.create_client("service-quotas") as client: # (1)
paginator = client.get_paginator("list_aws_default_service_quotas") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: ServiceQuotasClient
- paginator: ListAWSDefaultServiceQuotasPaginator
- item: ListAWSDefaultServiceQuotasResponseTypeDef
Explicit type annotations#
With types-aiobotocore-lite[service-quotas]
or a standalone types_aiobotocore_service_quotas
package, you have to explicitly specify
client: ServiceQuotasClient
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.
# ServiceQuotasClient usage example with type annotations
from aiobotocore.session import get_session
from types_aiobotocore_service_quotas.client import ServiceQuotasClient
from types_aiobotocore_service_quotas.type_defs import GetAWSDefaultServiceQuotaResponseTypeDef
from types_aiobotocore_service_quotas.type_defs import GetAWSDefaultServiceQuotaRequestRequestTypeDef
session = get_session()
async with session.create_client("service-quotas") as client:
client: ServiceQuotasClient
kwargs: GetAWSDefaultServiceQuotaRequestRequestTypeDef = {...}
result: GetAWSDefaultServiceQuotaResponseTypeDef = await client.get_aws_default_service_quota(**kwargs)
# ListAWSDefaultServiceQuotasPaginator usage example with type annotations
from aiobotocore.session import get_session
from types_aiobotocore_service_quotas.client import ServiceQuotasClient
from types_aiobotocore_service_quotas.paginator import ListAWSDefaultServiceQuotasPaginator
from types_aiobotocore_service_quotas.type_defs import ListAWSDefaultServiceQuotasResponseTypeDef
session = get_session()
async with session.create_client("service-quotas") as client:
client: ServiceQuotasClient
paginator: ListAWSDefaultServiceQuotasPaginator = client.get_paginator("list_aws_default_service_quotas")
async for item in paginator.paginate(...):
item: ListAWSDefaultServiceQuotasResponseTypeDef
print(item)