Skip to content

Examples#

Index > EKSAuth > Examples

Auto-generated documentation for EKSAuth type annotations stubs module types-aiobotocore-eks-auth.

Client#

Implicit type annotations#

Can be used with types-aioboto3[eks-auth] package installed.

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

# EKSAuthClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("eks-auth") as client:  # (1)
    result = await client.assume_role_for_pod_identity()  # (2)
  1. client: EKSAuthClient
  2. result: AssumeRoleForPodIdentityResponseTypeDef

Explicit type annotations#

With types-aioboto3-lite[eks-auth] or a standalone types_aiobotocore_eks_auth package, you have to explicitly specify client: EKSAuthClient 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.

# EKSAuthClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_eks_auth.client import EKSAuthClient
from types_aiobotocore_eks_auth.type_defs import AssumeRoleForPodIdentityResponseTypeDef
from types_aiobotocore_eks_auth.type_defs import AssumeRoleForPodIdentityRequestRequestTypeDef


session = Session()

client: EKSAuthClient
async with session.client("eks-auth") as client:  # (1)
    kwargs: AssumeRoleForPodIdentityRequestRequestTypeDef = {...}  # (2)
    result: AssumeRoleForPodIdentityResponseTypeDef = await client.assume_role_for_pod_identity(**kwargs)  # (3)
  1. client: EKSAuthClient
  2. kwargs: AssumeRoleForPodIdentityRequestRequestTypeDef
  3. result: AssumeRoleForPodIdentityResponseTypeDef