Type annotations for boto3.OpsWorks 1.14.42 service, generated by mypy-boto3-buider 2.2.0
Project description
mypy-boto3-opsworks
Type annotations for boto3.OpsWorks 1.14.42 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.42.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67f588b2f6fc6d319db86c8c3831d7021bbe389be1dfc320290249beef279f6c |
|
MD5 | dcd0f326eaf042135eeadffb803a7b7a |
|
BLAKE2b-256 | 5efca7507b2f71e7c955a60cd32547971c92d73b2fbb351eb44963cf6417401f |
Hashes for mypy_boto3_opsworks-1.14.42.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ffd6536f1b4fe69f349c5e1c5d1fd7cab4571022d7651921ed8af21d4399045 |
|
MD5 | 01823020fbe6d5e8bbf547192f83f1d9 |
|
BLAKE2b-256 | a31b27a4c01bf5e4b10bed291bdf6d832dca6a52fa102a4f7f9b657b8ec68ca8 |