Type annotations for boto3.OpsWorks 1.14.24 service, generated by mypy-boto3-buider 2.2.0
Project description
mypy-boto3-opsworks
Type annotations for boto3.OpsWorks 1.14.24 service compatible with mypy, VSCode, PyCharm and other tools.
Generated by mypy-boto3-buider 2.2.0.
More information can be found on boto3-stubs page.
How to install
Make sure you have mypy installed and activated in your IDE.
Install boto3-stubs
for OpsWorks
service.
python -m pip install boto3-stubs[opsworks]
How to use
Client annotations
OpsWorksClient
provides annotations for boto3.client("opsworks")
.
import boto3
from mypy_boto3_opsworks import OpsWorksClient, OpsWorksServiceResource
from mypy_boto3_opsworks.paginator import DescribeEcsClustersPaginator
from mypy_boto3_opsworks.service_resource import (
Layer,
ServiceResourceStacksCollection,
Stack,
StackSummary,
)
from mypy_boto3_opsworks.type_defs import AgentVersionTypeDef, ...
from mypy_boto3_opsworks.waiter import (
AppExistsWaiter,
DeploymentSuccessfulWaiter,
InstanceOnlineWaiter,
InstanceRegisteredWaiter,
InstanceStoppedWaiter,
InstanceTerminatedWaiter,
)
client: OpsWorksClient = boto3.client("opsworks")
# now client usage is checked by mypy and IDE should provide code auto-complete
# works for session as well
session = boto3.session.Session(region="us-west-1")
session_client: OpsWorksClient = session.client("opsworks")
Paginators annotations
mypy_boto3_opsworks.paginator
module contains type annotations for all paginators.
client: OpsWorksClient = boto3.client("opsworks")
# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
# VSCode requires explicit type annotations
describe_ecs_clusters_paginator: DescribeEcsClustersPaginator = client.get_paginator("describe_ecs_clusters")
Waiters annotations
mypy_boto3_opsworks.waiter
module contains type annotations for all waiters.
client: OpsWorksClient = boto3.client("opsworks")
# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
# VSCode requires explicit type annotations
app_exists_waiter: AppExistsWaiter = client.get_waiter("app_exists")
deployment_successful_waiter: DeploymentSuccessfulWaiter = client.get_waiter("deployment_successful")
instance_online_waiter: InstanceOnlineWaiter = client.get_waiter("instance_online")
instance_registered_waiter: InstanceRegisteredWaiter = client.get_waiter("instance_registered")
instance_stopped_waiter: InstanceStoppedWaiter = client.get_waiter("instance_stopped")
instance_terminated_waiter: InstanceTerminatedWaiter = client.get_waiter("instance_terminated")
Service Resource annotations
OpsWorksServiceResource
provides annotations for boto3.resource("opsworks")
.
resource: OpsWorksServiceResource = boto3.resource("opsworks")
# now resource usage is checked by mypy and IDE should provide code auto-complete
# works for session as well
session = boto3.session.Session(region="us-west-1")
session_resource: OpsWorksServiceResource = session.resource("opsworks")
Other resources annotations
mypy_boto3_opsworks.service_resource
module contains type annotations for all resources.
resource: OpsWorksServiceResource = boto3.resource("opsworks")
# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
my_layer: Layer = resource.Layer(...)
my_stack: Stack = resource.Stack(...)
my_stack_summary: StackSummary = resource.StackSummary(...)
Collections annotations
mypy_boto3_opsworks.service_resource
module contains type annotations
for all OpsWorksServiceResource
collections.
resource: OpsWorksServiceResource = boto3.resource("opsworks")
# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
stacks: opsworks_resources.ServiceResourceStacksCollection = resource.stacks
Typed dictionations
mypy_boto3_opsworks.type_defs
module contains structures and shapes assembled
to typed dictionaries for additional type checking.
def get_structure() -> AgentVersionTypeDef:
return {
...
}
Dynamic type annotations
mypy_boto3
command generates boto3.client/resource
type annotations for
mypy_boto3_opsworks
and other installed services.
# Run this command after you add or remove service packages
python -m mypy_boto3
Generated type annotations provide overloads for boto3.client
and boto3.resource
,
boto3.Session.client
and boto3.Session.resource
functions,
so explicit type annotations are not needed.
mypy
supports function overloads as expectedPyCharm
also supports function overloads, but consumes a lot of RAM, use carefully if you have many services installedVSCode
does not currently support function overloads, use explicit type annotations
# Type is discovered correctly by mypy and PyCharm
# VSCode still needs explicit type annotations
client = boto3.client("opsworks")
resource = boto3.resource("opsworks")
session_client = boto3.Session().client("opsworks")
session_resource = boto3.Session().resource("opsworks")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mypy-boto3-opsworks-1.14.24.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdeead0d51c725e70f48085f304a45fdf7183a2a49b8de190bdc237fe772c1ae |
|
MD5 | bfe9030d0970ad37a3f70112b5c15af2 |
|
BLAKE2b-256 | a763a978d108ef9d124e4e2abb401eedb2967fe522a433b4f804de0ba8db1d78 |
Hashes for mypy_boto3_opsworks-1.14.24.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20036b62846c9b813cdd308d4bd45ce15b5c99a7b5c10ce77196961d7b0c78e4 |
|
MD5 | 2fb692c2b1916f24ebd37d76acb9002d |
|
BLAKE2b-256 | d91bf406326664478424e11cd5ce249d3e59eed5917abbd8a2899e28c756dfc9 |