Skip to content

Examples#

Index > CodePipeline > Examples

Auto-generated documentation for CodePipeline type annotations stubs module types-boto3-codepipeline.

Client#

Implicit type annotations#

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

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

# CodePipelineClient usage example

from boto3.session import Session


session = Session()

client = session.client("codepipeline")  # (1)
result = client.acknowledge_job()  # (2)
  1. client: CodePipelineClient
  2. result: AcknowledgeJobOutputTypeDef
# ListActionExecutionsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("codepipeline")  # (1)

paginator = client.get_paginator("list_action_executions")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: CodePipelineClient
  2. paginator: ListActionExecutionsPaginator
  3. item: ListActionExecutionsOutputTypeDef

Explicit type annotations#

With types-boto3-lite[codepipeline] or a standalone types_boto3_codepipeline package, you have to explicitly specify client: CodePipelineClient 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.

# CodePipelineClient usage example with type annotations

from boto3.session import Session

from types_boto3_codepipeline.client import CodePipelineClient
from types_boto3_codepipeline.type_defs import AcknowledgeJobOutputTypeDef
from types_boto3_codepipeline.type_defs import AcknowledgeJobInputRequestTypeDef


session = Session()

client: CodePipelineClient = session.client("codepipeline")

kwargs: AcknowledgeJobInputRequestTypeDef = {...}
result: AcknowledgeJobOutputTypeDef = client.acknowledge_job(**kwargs)
# ListActionExecutionsPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_codepipeline.client import CodePipelineClient
from types_boto3_codepipeline.paginator import ListActionExecutionsPaginator
from types_boto3_codepipeline.type_defs import ListActionExecutionsOutputTypeDef


session = Session()
client: CodePipelineClient = session.client("codepipeline")

paginator: ListActionExecutionsPaginator = client.get_paginator("list_action_executions")
for item in paginator.paginate(...):
    item: ListActionExecutionsOutputTypeDef
    print(item)