# {{ package.client.name }}

> [Index](../README.md) > [{{ service_name.class_name }}](./README.md) > {{ package.client.name }}

{% include "common/header_note.md.jinja2" with context %}

## {{ package.client.name }}

Type annotations and code completion for `#!python {{ package.library_name }}.client("{{ service_name.boto3_name }}")`.
[:material-aws: boto3 documentation]({{ package.client.boto3_doc_link }})

```python title="Usage example"
from {{ package.library_name }}.session import Session
from {{ package.name }}.client import {{ package.client.name }}

def get_{{ service_name.boto3_name }}_client() -> {{ package.client.name }}:
    return Session().client("{{ service_name.boto3_name }}")
```

## Exceptions

{% if package.client.exceptions_class.attributes %}
`{{ package.library_name }}` client exceptions are generated in runtime.
This class provides code completion for `#!python {{ package.library_name }}.client("{{ service_name.boto3_name }}").exceptions` structure.

```python title="Usage example"
client = {{ package.library_name }}.client("{{ service_name.boto3_name }}")

try:
    do_something(client)
except (
{% for attribute in package.client.exceptions_class.attributes -%}
{{ '    ' -}}client.{{ attribute.name }},{{ '\n' -}}
{% endfor -%}
) as e:
    print(e)
```

```python title="Type checking example"
from {{ package.name }}.client import {{ package.client.exceptions_class.name }}

def handle_error(exc: {{ package.client.exceptions_class.name }}.{{ package.client.exceptions_class.attributes[0].name }}) -> None:
    ...
```
{% else %}
{{ package.client.name }} has no exceptions.
{% endif %}

## Methods

{% for method in package.client.own_methods %}
### {{ method.name|escape_md }}

{{ method.short_docstring }}

Type annotations and code completion for `#!python {{ package.library_name }}.client("{{ service_name.boto3_name }}").{{ method.name }}` method.
[:material-aws: boto3 documentation]({{ service_name.get_boto3_doc_link("Client", method.name) }})

{% include "common/method_code.md.jinja2" with context -%}

{% else %}
{{ package.client.name }} has no public methods.
{% endfor %}

{% if package.paginators %}
### get_paginator

Type annotations and code completion for `#!python {{ package.library_name }}.client("{{ service_name.boto3_name }}").get_paginator` method with overloads.

{% for paginator in package.paginators -%}
- `client.get_paginator("{{ paginator.operation_name }}")` -> [{{ paginator.name }}]({{ service_name.get_md_doc_link('paginators', paginator.name) }}){{ '\n' -}}
{% endfor %}
{% endif %}

{% if package.waiters %}
### get_waiter

Type annotations and code completion for `#!python {{ package.library_name }}.client("{{ service_name.boto3_name }}").get_waiter` method with overloads.

{% for waiter in package.waiters -%}
- `client.get_waiter("{{ waiter.waiter_name }}")` -> [{{ waiter.name }}]({{ service_name.get_md_doc_link('waiters', waiter.name) }}){{ '\n' -}}
{% endfor %}
{% endif %}
