Type annotations for boto3.OpsWorks 1.14.36 service, generated by mypy-boto3-buider 2.2.0
Project description
mypy-boto3-opsworks
Type annotations for boto3.OpsWorks 1.14.36 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.36.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b32df1f41dc33689e91a1fb88953644e4b17d8034f2493da6e5b554ea160328d |
|
MD5 | 72d85acb52ec53489dbce25705a067e1 |
|
BLAKE2b-256 | 288dc83b39626c1455fc75d9656a5a195cec9caa3ebc0b5a21e5e90637626c8d |
Hashes for mypy_boto3_opsworks-1.14.36.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea7c3912c7156e8d5505ae7a74e4e83c87b4db891bc08c145ba8c5a942e26370 |
|
MD5 | 45d565b39548cdfb069d12fbcac09501 |
|
BLAKE2b-256 | ba56a48e86afaddf7466c658240c5dbedd9b66f74738bbd23642a7b732dc66ff |