Examples#
Index > ServiceQuotas > Examples
Auto-generated documentation for ServiceQuotas type annotations stubs module types-boto3-service-quotas.
Client#
Implicit type annotations#
Can be used with types-boto3[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 boto3.session import Session
session = Session()
client = session.client("service-quotas") # (1)
result = client.get_aws_default_service_quota() # (2)
- client: ServiceQuotasClient
- result: GetAWSDefaultServiceQuotaResponseTypeDef
# ListAWSDefaultServiceQuotasPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("service-quotas") # (1)
paginator = client.get_paginator("list_aws_default_service_quotas") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: ServiceQuotasClient
- paginator: ListAWSDefaultServiceQuotasPaginator
- item: ListAWSDefaultServiceQuotasResponseTypeDef
Explicit type annotations#
With types-boto3-lite[service-quotas]
or a standalone types_boto3_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 boto3.session import Session
from types_boto3_service_quotas.client import ServiceQuotasClient
from types_boto3_service_quotas.type_defs import GetAWSDefaultServiceQuotaResponseTypeDef
from types_boto3_service_quotas.type_defs import GetAWSDefaultServiceQuotaRequestRequestTypeDef
session = Session()
client: ServiceQuotasClient = session.client("service-quotas")
kwargs: GetAWSDefaultServiceQuotaRequestRequestTypeDef = {...}
result: GetAWSDefaultServiceQuotaResponseTypeDef = client.get_aws_default_service_quota(**kwargs)
# ListAWSDefaultServiceQuotasPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_service_quotas.client import ServiceQuotasClient
from types_boto3_service_quotas.paginator import ListAWSDefaultServiceQuotasPaginator
from types_boto3_service_quotas.type_defs import ListAWSDefaultServiceQuotasResponseTypeDef
session = Session()
client: ServiceQuotasClient = session.client("service-quotas")
paginator: ListAWSDefaultServiceQuotasPaginator = client.get_paginator("list_aws_default_service_quotas")
for item in paginator.paginate(...):
item: ListAWSDefaultServiceQuotasResponseTypeDef
print(item)