Metadata-Version: 2.4
Name: rboto-sns
Version: 0.2.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Framework :: AsyncIO
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: rboto==0.2.0
License-File: LICENSE
Summary: rboto: async-only, typed Python client for Amazon SNS, powered by Rust. Alpha preview.
Keywords: rboto,aws,sns,asyncio,typing,rust
Home-Page: https://github.com/ferrumio/rboto
Author-email: Leandro Cavalcante Damascena <leandro.damascena@gmail.com>
License-Expression: Apache-2.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/ferrumio/rboto/releases
Project-URL: Documentation, https://ferrumio.github.io/rboto/guides/messaging/
Project-URL: Homepage, https://ferrumio.github.io/rboto/
Project-URL: Issues, https://github.com/ferrumio/rboto/issues
Project-URL: Repository, https://github.com/ferrumio/rboto

<!-- Generated by rboto-codegen. Edit the descriptor, template, or example source. -->
# rboto-sns

rboto is an independent project maintained by [Ferrumio](https://github.com/ferrumio).
It is not affiliated with, sponsored by, or endorsed by Amazon Web Services (AWS).

**Preview (Alpha).** rboto is under active development. APIs may change between releases.

rboto provides an **async-only, typed Python client for Amazon SNS**,
powered by Rust. This package contains `SNSClient` and
**42 operations**.

## Installation

Requires Python 3.12 or newer and a native wheel for your Python version and platform.

```bash
python -m pip install "rboto[sns]"
```

You can also install `rboto-sns` directly; it installs the matching
`rboto` package. Only the selected service is installed.

These are the package names to use when a release is available on your package index.
If your index has no release yet, follow the
[source installation instructions](https://ferrumio.github.io/rboto/getting-started/).

## Usage

Configure credentials through your environment, shared profile, or workload role.
The example uses `us-east-1`; select a region where your service and resources are available.
Resource names, identifiers, input files, and model IDs in the example are placeholders
to replace with your own.

```python
import asyncio

from rboto import SNSClient


async def main() -> None:
    client = SNSClient(region="us-east-1")
    response = await client.publish(
        topic_arn="arn:aws:sns:us-east-1:123456789012:notifications",
        message="Your report is ready",
    )
    print(response.message_id)


if __name__ == "__main__":
    asyncio.run(main())
```

In an application with an event loop, call `await main()` instead of `asyncio.run(main())`.
Reuse the client across calls. Constructing a client does not send a request.

## API conventions

- Import the client with `from rboto import SNSClient`.
- Every operation is asynchronous: use `await client.method(...)`.
- Operation arguments are keyword-only and use the Python names listed below.
- Structured inputs use typed dictionaries and tagged unions from `rboto_sns.types`.
- Regular responses expose typed attributes; `response.to_dict()` converts them to a dictionary.
- Event-stream responses may be typed dictionaries containing async iterators. Follow the
  declared return type; consume event streams with `async for`.
- Byte streams are consumed asynchronously. `await stream.read()` buffers the complete body;
  iterate the stream when processing a large response.
- Direct operation calls return one page.
- Use `async for page in client.paginators.method(...)` for supported paginated operations.
  Paginators accept the same typed arguments as the corresponding client method.

- Catch modeled exceptions from `rboto_sns.exceptions`. Their `error_code`,
  `message`, and `operation_name` identify service failures.

Clients also accept `profile`, `endpoint_url`, or shared `Session` settings.
See [configuration](https://ferrumio.github.io/rboto/guides/configuration/),
[errors](https://ferrumio.github.io/rboto/guides/errors/), and
[streaming](https://ferrumio.github.io/rboto/guides/streaming/).

## Operations

The [operation reference](https://ferrumio.github.io/rboto/reference/sns/)
documents arguments, nested types, Output fields, errors and pagination.
Method and type docstrings link to their reference pages.

This is the complete operation catalog for this generated package. “Required arguments”
lists arguments without defaults in the Python signature. Service-side conditions may
require additional arguments. Each method links to its complete signature, including
optional arguments. Nested input definitions are in `rboto_sns.types`;
native response definitions are in the package's `_native.pyi`.

| Method | Required arguments | Return type |
|---|---|---|
| [`add_permission`](#add_permission) | <code>topic_arn: str</code>, <code>label: str</code>, <code>aws_account_id: Sequence[str]</code>, <code>action_name: Sequence[str]</code> | <code>None</code> |
| [`check_if_phone_number_is_opted_out`](#check_if_phone_number_is_opted_out) | <code>phone_number: str</code> | <code>CheckIfPhoneNumberIsOptedOutOutput</code> |
| [`confirm_subscription`](#confirm_subscription) | <code>topic_arn: str</code>, <code>token: str</code> | <code>ConfirmSubscriptionOutput</code> |
| [`create_platform_application`](#create_platform_application) | <code>name: str</code>, <code>platform: str</code>, <code>attributes: dict[str, str]</code> | <code>CreatePlatformApplicationOutput</code> |
| [`create_platform_endpoint`](#create_platform_endpoint) | <code>platform_application_arn: str</code>, <code>token: str</code> | <code>CreatePlatformEndpointOutput</code> |
| [`create_sms_sandbox_phone_number`](#create_sms_sandbox_phone_number) | <code>phone_number: str</code> | <code>CreateSMSSandboxPhoneNumberOutput</code> |
| [`create_topic`](#create_topic) | <code>name: str</code> | <code>CreateTopicOutput</code> |
| [`delete_endpoint`](#delete_endpoint) | <code>endpoint_arn: str</code> | <code>None</code> |
| [`delete_platform_application`](#delete_platform_application) | <code>platform_application_arn: str</code> | <code>None</code> |
| [`delete_sms_sandbox_phone_number`](#delete_sms_sandbox_phone_number) | <code>phone_number: str</code> | <code>DeleteSMSSandboxPhoneNumberOutput</code> |
| [`delete_topic`](#delete_topic) | <code>topic_arn: str</code> | <code>None</code> |
| [`get_data_protection_policy`](#get_data_protection_policy) | <code>resource_arn: str</code> | <code>GetDataProtectionPolicyOutput</code> |
| [`get_endpoint_attributes`](#get_endpoint_attributes) | <code>endpoint_arn: str</code> | <code>GetEndpointAttributesOutput</code> |
| [`get_platform_application_attributes`](#get_platform_application_attributes) | <code>platform_application_arn: str</code> | <code>GetPlatformApplicationAttributesOutput</code> |
| [`get_sms_attributes`](#get_sms_attributes) | None | <code>GetSMSAttributesOutput</code> |
| [`get_sms_sandbox_account_status`](#get_sms_sandbox_account_status) | None | <code>GetSMSSandboxAccountStatusOutput</code> |
| [`get_subscription_attributes`](#get_subscription_attributes) | <code>subscription_arn: str</code> | <code>GetSubscriptionAttributesOutput</code> |
| [`get_topic_attributes`](#get_topic_attributes) | <code>topic_arn: str</code> | <code>GetTopicAttributesOutput</code> |
| [`list_endpoints_by_platform_application`](#list_endpoints_by_platform_application) | <code>platform_application_arn: str</code> | <code>ListEndpointsByPlatformApplicationOutput</code> |
| [`list_origination_numbers`](#list_origination_numbers) | None | <code>ListOriginationNumbersOutput</code> |
| [`list_phone_numbers_opted_out`](#list_phone_numbers_opted_out) | None | <code>ListPhoneNumbersOptedOutOutput</code> |
| [`list_platform_applications`](#list_platform_applications) | None | <code>ListPlatformApplicationsOutput</code> |
| [`list_sms_sandbox_phone_numbers`](#list_sms_sandbox_phone_numbers) | None | <code>ListSMSSandboxPhoneNumbersOutput</code> |
| [`list_subscriptions`](#list_subscriptions) | None | <code>ListSubscriptionsOutput</code> |
| [`list_subscriptions_by_topic`](#list_subscriptions_by_topic) | <code>topic_arn: str</code> | <code>ListSubscriptionsByTopicOutput</code> |
| [`list_tags_for_resource`](#list_tags_for_resource) | <code>resource_arn: str</code> | <code>ListTagsForResourceOutput</code> |
| [`list_topics`](#list_topics) | None | <code>ListTopicsOutput</code> |
| [`opt_in_phone_number`](#opt_in_phone_number) | <code>phone_number: str</code> | <code>OptInPhoneNumberOutput</code> |
| [`publish`](#publish) | <code>message: str</code> | <code>PublishOutput</code> |
| [`publish_batch`](#publish_batch) | <code>topic_arn: str</code>, <code>publish_batch_request_entries: Sequence[PublishBatchRequestEntry]</code> | <code>PublishBatchOutput</code> |
| [`put_data_protection_policy`](#put_data_protection_policy) | <code>resource_arn: str</code>, <code>data_protection_policy: str</code> | <code>None</code> |
| [`remove_permission`](#remove_permission) | <code>topic_arn: str</code>, <code>label: str</code> | <code>None</code> |
| [`set_endpoint_attributes`](#set_endpoint_attributes) | <code>endpoint_arn: str</code>, <code>attributes: dict[str, str]</code> | <code>None</code> |
| [`set_platform_application_attributes`](#set_platform_application_attributes) | <code>platform_application_arn: str</code>, <code>attributes: dict[str, str]</code> | <code>None</code> |
| [`set_sms_attributes`](#set_sms_attributes) | <code>attributes: dict[str, str]</code> | <code>SetSMSAttributesOutput</code> |
| [`set_subscription_attributes`](#set_subscription_attributes) | <code>subscription_arn: str</code>, <code>attribute_name: str</code> | <code>None</code> |
| [`set_topic_attributes`](#set_topic_attributes) | <code>topic_arn: str</code>, <code>attribute_name: str</code> | <code>None</code> |
| [`subscribe`](#subscribe) | <code>topic_arn: str</code>, <code>protocol: str</code> | <code>SubscribeOutput</code> |
| [`tag_resource`](#tag_resource) | <code>resource_arn: str</code>, <code>tags: Sequence[Tag]</code> | <code>TagResourceOutput</code> |
| [`unsubscribe`](#unsubscribe) | <code>subscription_arn: str</code> | <code>None</code> |
| [`untag_resource`](#untag_resource) | <code>resource_arn: str</code>, <code>tag_keys: Sequence[str]</code> | <code>UntagResourceOutput</code> |
| [`verify_sms_sandbox_phone_number`](#verify_sms_sandbox_phone_number) | <code>phone_number: str</code>, <code>one_time_password: str</code> | <code>VerifySMSSandboxPhoneNumberOutput</code> |

## Complete signatures

### add_permission

```python
async def add_permission(
    *,
    topic_arn: str,
    label: str,
    aws_account_id: Sequence[str],
    action_name: Sequence[str],
) -> None: ...
```


### check_if_phone_number_is_opted_out

```python
async def check_if_phone_number_is_opted_out(
    *,
    phone_number: str,
) -> CheckIfPhoneNumberIsOptedOutOutput: ...
```


### confirm_subscription

```python
async def confirm_subscription(
    *,
    topic_arn: str,
    token: str,
    authenticate_on_unsubscribe: str | None = None,
) -> ConfirmSubscriptionOutput: ...
```


### create_platform_application

```python
async def create_platform_application(
    *,
    name: str,
    platform: str,
    attributes: dict[str, str],
) -> CreatePlatformApplicationOutput: ...
```


### create_platform_endpoint

```python
async def create_platform_endpoint(
    *,
    platform_application_arn: str,
    token: str,
    custom_user_data: str | None = None,
    attributes: dict[str, str] | None = None,
) -> CreatePlatformEndpointOutput: ...
```


### create_sms_sandbox_phone_number

```python
async def create_sms_sandbox_phone_number(
    *,
    phone_number: str,
    language_code: LanguageCodeString | None = None,
) -> CreateSMSSandboxPhoneNumberOutput: ...
```


### create_topic

```python
async def create_topic(
    *,
    name: str,
    attributes: dict[str, str] | None = None,
    tags: Sequence[Tag] | None = None,
    data_protection_policy: str | None = None,
) -> CreateTopicOutput: ...
```


### delete_endpoint

```python
async def delete_endpoint(
    *,
    endpoint_arn: str,
) -> None: ...
```


### delete_platform_application

```python
async def delete_platform_application(
    *,
    platform_application_arn: str,
) -> None: ...
```


### delete_sms_sandbox_phone_number

```python
async def delete_sms_sandbox_phone_number(
    *,
    phone_number: str,
) -> DeleteSMSSandboxPhoneNumberOutput: ...
```


### delete_topic

```python
async def delete_topic(
    *,
    topic_arn: str,
) -> None: ...
```


### get_data_protection_policy

```python
async def get_data_protection_policy(
    *,
    resource_arn: str,
) -> GetDataProtectionPolicyOutput: ...
```


### get_endpoint_attributes

```python
async def get_endpoint_attributes(
    *,
    endpoint_arn: str,
) -> GetEndpointAttributesOutput: ...
```


### get_platform_application_attributes

```python
async def get_platform_application_attributes(
    *,
    platform_application_arn: str,
) -> GetPlatformApplicationAttributesOutput: ...
```


### get_sms_attributes

```python
async def get_sms_attributes(
    *,
    attributes: Sequence[str] | None = None,
) -> GetSMSAttributesOutput: ...
```


### get_sms_sandbox_account_status

```python
async def get_sms_sandbox_account_status() -> GetSMSSandboxAccountStatusOutput: ...
```


### get_subscription_attributes

```python
async def get_subscription_attributes(
    *,
    subscription_arn: str,
) -> GetSubscriptionAttributesOutput: ...
```


### get_topic_attributes

```python
async def get_topic_attributes(
    *,
    topic_arn: str,
) -> GetTopicAttributesOutput: ...
```


### list_endpoints_by_platform_application

```python
async def list_endpoints_by_platform_application(
    *,
    platform_application_arn: str,
    next_token: str | None = None,
) -> ListEndpointsByPlatformApplicationOutput: ...
```

Also available as `client.paginators.list_endpoints_by_platform_application(...)`, returning an
async iterator of the response type above.


### list_origination_numbers

```python
async def list_origination_numbers(
    *,
    next_token: str | None = None,
    max_results: int | None = None,
) -> ListOriginationNumbersOutput: ...
```

Also available as `client.paginators.list_origination_numbers(...)`, returning an
async iterator of the response type above.


### list_phone_numbers_opted_out

```python
async def list_phone_numbers_opted_out(
    *,
    next_token: str | None = None,
) -> ListPhoneNumbersOptedOutOutput: ...
```

Also available as `client.paginators.list_phone_numbers_opted_out(...)`, returning an
async iterator of the response type above.


### list_platform_applications

```python
async def list_platform_applications(
    *,
    next_token: str | None = None,
) -> ListPlatformApplicationsOutput: ...
```

Also available as `client.paginators.list_platform_applications(...)`, returning an
async iterator of the response type above.


### list_sms_sandbox_phone_numbers

```python
async def list_sms_sandbox_phone_numbers(
    *,
    next_token: str | None = None,
    max_results: int | None = None,
) -> ListSMSSandboxPhoneNumbersOutput: ...
```

Also available as `client.paginators.list_sms_sandbox_phone_numbers(...)`, returning an
async iterator of the response type above.


### list_subscriptions

```python
async def list_subscriptions(
    *,
    next_token: str | None = None,
) -> ListSubscriptionsOutput: ...
```

Also available as `client.paginators.list_subscriptions(...)`, returning an
async iterator of the response type above.


### list_subscriptions_by_topic

```python
async def list_subscriptions_by_topic(
    *,
    topic_arn: str,
    next_token: str | None = None,
) -> ListSubscriptionsByTopicOutput: ...
```

Also available as `client.paginators.list_subscriptions_by_topic(...)`, returning an
async iterator of the response type above.


### list_tags_for_resource

```python
async def list_tags_for_resource(
    *,
    resource_arn: str,
) -> ListTagsForResourceOutput: ...
```


### list_topics

```python
async def list_topics(
    *,
    next_token: str | None = None,
) -> ListTopicsOutput: ...
```

Also available as `client.paginators.list_topics(...)`, returning an
async iterator of the response type above.


### opt_in_phone_number

```python
async def opt_in_phone_number(
    *,
    phone_number: str,
) -> OptInPhoneNumberOutput: ...
```


### publish

```python
async def publish(
    *,
    message: str,
    topic_arn: str | None = None,
    target_arn: str | None = None,
    phone_number: str | None = None,
    subject: str | None = None,
    message_structure: str | None = None,
    message_attributes: dict[str, MessageAttributeValue] | None = None,
    message_deduplication_id: str | None = None,
    message_group_id: str | None = None,
) -> PublishOutput: ...
```


### publish_batch

```python
async def publish_batch(
    *,
    topic_arn: str,
    publish_batch_request_entries: Sequence[PublishBatchRequestEntry],
) -> PublishBatchOutput: ...
```


### put_data_protection_policy

```python
async def put_data_protection_policy(
    *,
    resource_arn: str,
    data_protection_policy: str,
) -> None: ...
```


### remove_permission

```python
async def remove_permission(
    *,
    topic_arn: str,
    label: str,
) -> None: ...
```


### set_endpoint_attributes

```python
async def set_endpoint_attributes(
    *,
    endpoint_arn: str,
    attributes: dict[str, str],
) -> None: ...
```


### set_platform_application_attributes

```python
async def set_platform_application_attributes(
    *,
    platform_application_arn: str,
    attributes: dict[str, str],
) -> None: ...
```


### set_sms_attributes

```python
async def set_sms_attributes(
    *,
    attributes: dict[str, str],
) -> SetSMSAttributesOutput: ...
```


### set_subscription_attributes

```python
async def set_subscription_attributes(
    *,
    subscription_arn: str,
    attribute_name: str,
    attribute_value: str | None = None,
) -> None: ...
```


### set_topic_attributes

```python
async def set_topic_attributes(
    *,
    topic_arn: str,
    attribute_name: str,
    attribute_value: str | None = None,
) -> None: ...
```


### subscribe

```python
async def subscribe(
    *,
    topic_arn: str,
    protocol: str,
    endpoint: str | None = None,
    attributes: dict[str, str] | None = None,
    return_subscription_arn: bool | None = None,
) -> SubscribeOutput: ...
```


### tag_resource

```python
async def tag_resource(
    *,
    resource_arn: str,
    tags: Sequence[Tag],
) -> TagResourceOutput: ...
```


### unsubscribe

```python
async def unsubscribe(
    *,
    subscription_arn: str,
) -> None: ...
```


### untag_resource

```python
async def untag_resource(
    *,
    resource_arn: str,
    tag_keys: Sequence[str],
) -> UntagResourceOutput: ...
```


### verify_sms_sandbox_phone_number

```python
async def verify_sms_sandbox_phone_number(
    *,
    phone_number: str,
    one_time_password: str,
) -> VerifySMSSandboxPhoneNumberOutput: ...
```


## Links

- [Service guide](https://ferrumio.github.io/rboto/guides/messaging/)
- [Repository](https://github.com/ferrumio/rboto)
- [Issues](https://github.com/ferrumio/rboto/issues)
- [Releases](https://github.com/ferrumio/rboto/releases)

Licensed under Apache-2.0.

