from typing import Any, Dict, Optional, Union

import httpx

from .base_client import BaseClient
from .models import *


{{#apis}}
class {{class_name}}(BaseClient):
    """
    Autogenerated {{#tag}}{{tag}} {{/tag}}httpx {{#async}}async {{/async}}client
    """
{{#endpoints}}
    {{#async}}async {{/async}}def {{name}}(
        self,
{{#args}}
        {{name}}: {{type}}{{#has_default}} = {{{default}}}{{/has_default}},
{{/args}}
{{#has_json_body}}
        body_serializer_args: Dict[str, Any] = {},
{{/has_json_body}}
        **kwargs: Any
    ) -> {{#return_type}}{{return_type}}{{/return_type}}{{^return_type}}None{{/return_type}}:
        """
        {{docs}}
        """ # noqa 

{{#has_query_params}}
        _query_params = { 
{{/has_query_params}}
{{#query_params}}
            "{{name}}": {{name}},
{{/query_params}}
{{#has_query_params}}
        }

{{/has_query_params}}
{{#has_header_params}}
        _headers = { 
{{/has_header_params}}
{{#header_params}}
            "{{name}}": {{name}},
{{/header_params}}
{{#has_header_params}}
        }

{{/has_header_params}}
{{#has_multipart_data}}
        _multipart_data = { 
{{/has_multipart_data}}
{{#multipart_data}}
            "{{name}}": {{name}},
{{/multipart_data}}
{{#has_multipart_data}}
        }
        
{{/has_multipart_data}}
{{#has_multipart_files}}
        _files = { 
{{/has_multipart_files}}
{{#multipart_files}}
            "{{name}}": {{name}},
{{/multipart_files}}
{{#has_multipart_files}}
        }

{{/has_multipart_files}}
        response = {{#async}}await {{/async}}self._request(
            "{{method}}",
            {{{path}}},
{{#has_query_params}}
            _query_params=_query_params, 
{{/has_query_params}}
{{#has_header_params}}
            _headers=_headers, 
{{/has_header_params}}
{{#multipart_data}}
            _multipart_data=_multipart_data,
{{/multipart_data}}
{{#multipart_files}}
            files=_files,
{{/multipart_files}}
{{#has_json_body}}
            _body=body,
            body_serializer_args=body_serializer_args,
{{/has_json_body}}
            **kwargs
        )
        response.raise_for_status()
{{#return_type}}
        return {{return_type}}.parse_raw(response.content)
{{/return_type}}

{{/endpoints}}

{{/apis}}
