Type annotations for boto3.GuardDuty 1.14.0 service, generated by mypy-boto3-buider 2.1.0
Project description
mypy-boto3-guardduty
Type annotations for boto3.GuardDuty 1.14.0 service compatible with mypy, VSCode, PyCharm and other tools.
Generated by mypy-boto3-buider 2.1.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 GuardDuty
service.
python -m pip install boto3-stubs[guardduty]
How to use
Client annotations
GuardDutyClient
provides annotations for boto3.client("guardduty")
.
import boto3
from mypy_boto3_guardduty import GuardDutyClient
client: GuardDutyClient = boto3.client("guardduty")
# 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: GuardDutyClient = session.client("guardduty")
Paginators annotations
mypy_boto3_guardduty.paginator
module contains type annotations for all paginators.
from mypy_boto3_guardduty import GuardDutyClient
from mypy_boto3_guardduty.paginator import (
ListDetectorsPaginator,
ListFiltersPaginator,
ListFindingsPaginator,
ListIPSetsPaginator,
ListInvitationsPaginator,
ListMembersPaginator,
ListOrganizationAdminAccountsPaginator,
ListThreatIntelSetsPaginator,
)
client: GuardDutyClient = boto3.client("guardduty")
# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
# VSCode requires explicit type annotations
list_detectors_paginator: ListDetectorsPaginator = client.get_paginator("list_detectors")
list_filters_paginator: ListFiltersPaginator = client.get_paginator("list_filters")
list_findings_paginator: ListFindingsPaginator = client.get_paginator("list_findings")
list_ip_sets_paginator: ListIPSetsPaginator = client.get_paginator("list_ip_sets")
list_invitations_paginator: ListInvitationsPaginator = client.get_paginator("list_invitations")
list_members_paginator: ListMembersPaginator = client.get_paginator("list_members")
list_organization_admin_accounts_paginator: ListOrganizationAdminAccountsPaginator = client.get_paginator("list_organization_admin_accounts")
list_threat_intel_sets_paginator: ListThreatIntelSetsPaginator = client.get_paginator("list_threat_intel_sets")
Typed dictionations
mypy_boto3_guardduty.type_defs
module contains structures and shapes assembled
to typed dictionaries for additional type checking.
from mypy_boto3_guardduty.type_defs import AccessControlListTypeDef, ...
def get_structure() -> AccessControlListTypeDef:
return {
...
}
Dynamic type annotations
mypy_boto3
command generates boto3.client/resource
type annotations for
mypy_boto3_guardduty
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
import boto3
# Type is discovered correctly by mypy and PyCharm
# VSCode still needs explicit type annotations
client = boto3.client("guardduty")
session_client = boto3.Session().client("guardduty")
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-guardduty-1.14.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e34023e0e2c03a31007a2a507f286ff9bdc06285494c97738e3aa51c202e01df |
|
MD5 | 71bdd82aa370524756caa3bd0ce14f48 |
|
BLAKE2b-256 | 7d7ee045097856243b2ac2cdf47015fea5a823a3b2a5c0ad356c004280ef02af |
Hashes for mypy_boto3_guardduty-1.14.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b419eedee7cec4ac9d6bcda122837677d162e66b8bbb21bb5233fe85af972779 |
|
MD5 | 0fb531596187c2833adc631021a7e676 |
|
BLAKE2b-256 | 437250ad8f745d080b7dd608c561ab38d1baa2bcdaa9444928f6c729716f2f60 |