Type annotations for boto3.OpsWorks 1.14.45 service, generated by mypy-boto3-buider 2.2.0
Project description
mypy-boto3-opsworks
Type annotations for boto3.OpsWorks 1.14.45 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.45.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d3f80eccc7a1cb831fc5e27333b7522fff2a9339c36e5ab1e1bcfbbbc67cad2 |
|
MD5 | 1a915f2e461690591586dd8ae71d9da9 |
|
BLAKE2b-256 | 30db86c594aa9178f6b5033436ee8c0119fef547d27a97c97494556f733ce337 |
Hashes for mypy_boto3_opsworks-1.14.45.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecbf658f8e59b13ec7f6be9e71e8cf938250022316067e5fc29aaa7ee612a2e2 |
|
MD5 | 96cf9b8b514c9f2d2022e8623452b073 |
|
BLAKE2b-256 | a9116d9fcdafef1be82b0c04767f394098e660f97e14857bccb2258dab328d2d |