Type annotations for boto3.OpsWorks 1.14.20 service, generated by mypy-boto3-buider 2.2.0
Project description
mypy-boto3-opsworks
Type annotations for boto3.OpsWorks 1.14.20 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.20.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | be7d8486f4a20a80422726a9602dc903e6d41861a88ef1abf675861a4b271a25 |
|
MD5 | 79db197c0e0a3fd774a691fa12c3776b |
|
BLAKE2b-256 | 47fa9b70bfd9d4e658089fa6a86118194f92db672f7f5d3f6a38d3744cfd2a38 |
Hashes for mypy_boto3_opsworks-1.14.20.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08b085b5066590e814da18b3e376aee9fb6bafb0ed1c1e81f03a0c4e9e10a2c0 |
|
MD5 | 045714537e1bc616f0b06ee996956eae |
|
BLAKE2b-256 | f6c1b1bae3bd12a887cd2ea0dde129f8be4763445493ad4fb7a21dcfe7aa5fad |