Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.11.0"
".": "0.12.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 36
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu%2Fzavudev-578694e0208b4129909ee690abbebfb5ac9e5738768a009c9bfb7aa638a3c984.yml
openapi_spec_hash: 842323c611aa7ea50f039e852d1594cf
config_hash: ff624ca864b3c882a793f2af6b971127
configured_endpoints: 37
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu%2Fzavudev-064fa598a02a9f8529186ca4292253201abbc550c98ed1d2c44dd637e4977cba.yml
openapi_spec_hash: 76468e579e64c10eda3ce647c38482a6
config_hash: 2c81a5597d0125c8a91faaddaadb8b9e
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.12.0 (2025-12-16)

Full Changelog: [v0.11.0...v0.12.0](https://github.com/zavudev/sdk-python/compare/v0.11.0...v0.12.0)

### Features

* **api:** add submit template ([32c5e78](https://github.com/zavudev/sdk-python/commit/32c5e78d0a44385429346db509d4ea5e345afb76))
* **api:** api update ([f00a45c](https://github.com/zavudev/sdk-python/commit/f00a45c4fced1fa32e133ed21b55e23bde611522))
* **api:** api update ([d33336f](https://github.com/zavudev/sdk-python/commit/d33336f7de3862a588decdd3d7ef15c9fadd90d2))


### Chores

* **internal:** add missing files argument to base client ([08b5b97](https://github.com/zavudev/sdk-python/commit/08b5b97210d16560efde81ba335e09a0c3daebf9))

## 0.11.0 (2025-12-16)

Full Changelog: [v0.10.1...v0.11.0](https://github.com/zavudev/sdk-python/compare/v0.10.1...v0.11.0)
Expand Down
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Methods:
- <code title="get /v1/templates/{templateId}">client.templates.<a href="./src/zavudev/resources/templates.py">retrieve</a>(template_id) -> <a href="./src/zavudev/types/template.py">Template</a></code>
- <code title="get /v1/templates">client.templates.<a href="./src/zavudev/resources/templates.py">list</a>(\*\*<a href="src/zavudev/types/template_list_params.py">params</a>) -> <a href="./src/zavudev/types/template.py">SyncCursor[Template]</a></code>
- <code title="delete /v1/templates/{templateId}">client.templates.<a href="./src/zavudev/resources/templates.py">delete</a>(template_id) -> None</code>
- <code title="post /v1/templates/{templateId}/submit">client.templates.<a href="./src/zavudev/resources/templates.py">submit</a>(template_id, \*\*<a href="src/zavudev/types/template_submit_params.py">params</a>) -> <a href="./src/zavudev/types/template.py">Template</a></code>

# Senders

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "zavudev"
version = "0.11.0"
version = "0.12.0"
description = "The official Python library for the zavudev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
10 changes: 8 additions & 2 deletions src/zavudev/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,9 +1247,12 @@ def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
opts = FinalRequestOptions.construct(
method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
)
return self.request(cast_to, opts)

def put(
Expand Down Expand Up @@ -1767,9 +1770,12 @@ async def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
opts = FinalRequestOptions.construct(
method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
)
return await self.request(cast_to, opts)

async def put(
Expand Down
2 changes: 1 addition & 1 deletion src/zavudev/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "zavudev"
__version__ = "0.11.0" # x-release-please-version
__version__ = "0.12.0" # x-release-please-version
112 changes: 111 additions & 1 deletion src/zavudev/resources/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import httpx

from ..types import WhatsappCategory, template_list_params, template_create_params
from ..types import WhatsappCategory, template_list_params, template_create_params, template_submit_params
from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
Expand Down Expand Up @@ -202,6 +202,55 @@ def delete(
cast_to=NoneType,
)

def submit(
self,
template_id: str,
*,
sender_id: str,
category: WhatsappCategory | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Template:
"""Submit a WhatsApp template to Meta for approval.

The template must be in draft
status and associated with a sender that has a WhatsApp Business Account
configured.

Args:
sender_id: The sender ID with the WhatsApp Business Account to submit the template to.

category: Template category. If not provided, uses the category set on the template.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not template_id:
raise ValueError(f"Expected a non-empty value for `template_id` but received {template_id!r}")
return self._post(
f"/v1/templates/{template_id}/submit",
body=maybe_transform(
{
"sender_id": sender_id,
"category": category,
},
template_submit_params.TemplateSubmitParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=Template,
)


class AsyncTemplatesResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -382,6 +431,55 @@ async def delete(
cast_to=NoneType,
)

async def submit(
self,
template_id: str,
*,
sender_id: str,
category: WhatsappCategory | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Template:
"""Submit a WhatsApp template to Meta for approval.

The template must be in draft
status and associated with a sender that has a WhatsApp Business Account
configured.

Args:
sender_id: The sender ID with the WhatsApp Business Account to submit the template to.

category: Template category. If not provided, uses the category set on the template.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not template_id:
raise ValueError(f"Expected a non-empty value for `template_id` but received {template_id!r}")
return await self._post(
f"/v1/templates/{template_id}/submit",
body=await async_maybe_transform(
{
"sender_id": sender_id,
"category": category,
},
template_submit_params.TemplateSubmitParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=Template,
)


class TemplatesResourceWithRawResponse:
def __init__(self, templates: TemplatesResource) -> None:
Expand All @@ -399,6 +497,9 @@ def __init__(self, templates: TemplatesResource) -> None:
self.delete = to_raw_response_wrapper(
templates.delete,
)
self.submit = to_raw_response_wrapper(
templates.submit,
)


class AsyncTemplatesResourceWithRawResponse:
Expand All @@ -417,6 +518,9 @@ def __init__(self, templates: AsyncTemplatesResource) -> None:
self.delete = async_to_raw_response_wrapper(
templates.delete,
)
self.submit = async_to_raw_response_wrapper(
templates.submit,
)


class TemplatesResourceWithStreamingResponse:
Expand All @@ -435,6 +539,9 @@ def __init__(self, templates: TemplatesResource) -> None:
self.delete = to_streamed_response_wrapper(
templates.delete,
)
self.submit = to_streamed_response_wrapper(
templates.submit,
)


class AsyncTemplatesResourceWithStreamingResponse:
Expand All @@ -453,3 +560,6 @@ def __init__(self, templates: AsyncTemplatesResource) -> None:
self.delete = async_to_streamed_response_wrapper(
templates.delete,
)
self.submit = async_to_streamed_response_wrapper(
templates.submit,
)
1 change: 1 addition & 0 deletions src/zavudev/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from .available_phone_number import AvailablePhoneNumber as AvailablePhoneNumber
from .broadcast_message_type import BroadcastMessageType as BroadcastMessageType
from .template_create_params import TemplateCreateParams as TemplateCreateParams
from .template_submit_params import TemplateSubmitParams as TemplateSubmitParams
from .broadcast_content_param import BroadcastContentParam as BroadcastContentParam
from .broadcast_create_params import BroadcastCreateParams as BroadcastCreateParams
from .broadcast_send_response import BroadcastSendResponse as BroadcastSendResponse
Expand Down
18 changes: 18 additions & 0 deletions src/zavudev/types/template_submit_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Required, Annotated, TypedDict

from .._utils import PropertyInfo
from .whatsapp_category import WhatsappCategory

__all__ = ["TemplateSubmitParams"]


class TemplateSubmitParams(TypedDict, total=False):
sender_id: Required[Annotated[str, PropertyInfo(alias="senderId")]]
"""The sender ID with the WhatsApp Business Account to submit the template to."""

category: WhatsappCategory
"""Template category. If not provided, uses the category set on the template."""
Loading