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.10.1"
".": "0.11.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: 35
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu%2Fzavudev-85dfcb4cc3f8dc232241dbb9a4ac493e076382453af15bf5a1915141381b6f0f.yml
openapi_spec_hash: 7ee3ffc9cd38e0a05837a67dfb382214
config_hash: c5064558e83c1689ffeee7ef09f5d03a
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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 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)

### Features

* **api:** api update ([bb8af00](https://github.com/zavudev/sdk-python/commit/bb8af003e952918262b8502959de28520de6ed10))
* **api:** api update ([39a0632](https://github.com/zavudev/sdk-python/commit/39a0632944c04190ccaf8b56db9dc245d758c5c6))
* **api:** api update ([69c25f3](https://github.com/zavudev/sdk-python/commit/69c25f337070ddc7756fe61a6324f1b1d4eb2dd8))
* **api:** api update ([575e5ea](https://github.com/zavudev/sdk-python/commit/575e5eaa04124422b74f4268410f010a37908c6e))
* **api:** manual updates ([8fedeac](https://github.com/zavudev/sdk-python/commit/8fedeac87ef5a5f1b6fa9781e9cfbbe80a50ab74))

## 0.10.1 (2025-12-09)

Full Changelog: [v0.10.0...v0.10.1](https://github.com/zavudev/sdk-python/compare/v0.10.0...v0.10.1)
Expand Down
3 changes: 2 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Methods:
Types:

```python
from zavudev.types import Sender
from zavudev.types import Sender, SenderWebhook, WebhookEvent, WebhookSecretResponse
```

Methods:
Expand All @@ -50,6 +50,7 @@ Methods:
- <code title="patch /v1/senders/{senderId}">client.senders.<a href="./src/zavudev/resources/senders.py">update</a>(sender_id, \*\*<a href="src/zavudev/types/sender_update_params.py">params</a>) -> <a href="./src/zavudev/types/sender.py">Sender</a></code>
- <code title="get /v1/senders">client.senders.<a href="./src/zavudev/resources/senders.py">list</a>(\*\*<a href="src/zavudev/types/sender_list_params.py">params</a>) -> <a href="./src/zavudev/types/sender.py">SyncCursor[Sender]</a></code>
- <code title="delete /v1/senders/{senderId}">client.senders.<a href="./src/zavudev/resources/senders.py">delete</a>(sender_id) -> None</code>
- <code title="post /v1/senders/{senderId}/webhook/secret">client.senders.<a href="./src/zavudev/resources/senders.py">regenerate_webhook_secret</a>(sender_id) -> <a href="./src/zavudev/types/webhook_secret_response.py">WebhookSecretResponse</a></code>

# Contacts

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.10.1"
version = "0.11.0"
description = "The official Python library for the zavudev API"
dynamic = ["readme"]
license = "Apache-2.0"
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.10.1" # x-release-please-version
__version__ = "0.11.0" # x-release-please-version
126 changes: 126 additions & 0 deletions src/zavudev/resources/senders.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from __future__ import annotations

from typing import List, Optional

import httpx

from ..types import sender_list_params, sender_create_params, sender_update_params
Expand All @@ -18,6 +20,8 @@
from ..pagination import SyncCursor, AsyncCursor
from .._base_client import AsyncPaginator, make_request_options
from ..types.sender import Sender
from ..types.webhook_event import WebhookEvent
from ..types.webhook_secret_response import WebhookSecretResponse

__all__ = ["SendersResource", "AsyncSendersResource"]

Expand Down Expand Up @@ -48,6 +52,8 @@ def create(
name: str,
phone_number: str,
set_as_default: bool | Omit = omit,
webhook_events: List[WebhookEvent] | Omit = omit,
webhook_url: str | 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,
Expand All @@ -59,6 +65,10 @@ def create(
Create sender

Args:
webhook_events: Events to subscribe to.

webhook_url: HTTPS URL for webhook events.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -74,6 +84,8 @@ def create(
"name": name,
"phone_number": phone_number,
"set_as_default": set_as_default,
"webhook_events": webhook_events,
"webhook_url": webhook_url,
},
sender_create_params.SenderCreateParams,
),
Expand Down Expand Up @@ -122,6 +134,9 @@ def update(
*,
name: str | Omit = omit,
set_as_default: bool | Omit = omit,
webhook_active: bool | Omit = omit,
webhook_events: List[WebhookEvent] | Omit = omit,
webhook_url: Optional[str] | 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,
Expand All @@ -133,6 +148,12 @@ def update(
Update sender

Args:
webhook_active: Whether the webhook is active.

webhook_events: Events to subscribe to.

webhook_url: HTTPS URL for webhook events. Set to null to remove webhook.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -149,6 +170,9 @@ def update(
{
"name": name,
"set_as_default": set_as_default,
"webhook_active": webhook_active,
"webhook_events": webhook_events,
"webhook_url": webhook_url,
},
sender_update_params.SenderUpdateParams,
),
Expand Down Expand Up @@ -235,6 +259,41 @@ def delete(
cast_to=NoneType,
)

def regenerate_webhook_secret(
self,
sender_id: str,
*,
# 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,
) -> WebhookSecretResponse:
"""Regenerate the webhook secret for a sender.

The old secret will be invalidated
immediately.

Args:
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 sender_id:
raise ValueError(f"Expected a non-empty value for `sender_id` but received {sender_id!r}")
return self._post(
f"/v1/senders/{sender_id}/webhook/secret",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=WebhookSecretResponse,
)


class AsyncSendersResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -262,6 +321,8 @@ async def create(
name: str,
phone_number: str,
set_as_default: bool | Omit = omit,
webhook_events: List[WebhookEvent] | Omit = omit,
webhook_url: str | 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,
Expand All @@ -273,6 +334,10 @@ async def create(
Create sender

Args:
webhook_events: Events to subscribe to.

webhook_url: HTTPS URL for webhook events.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -288,6 +353,8 @@ async def create(
"name": name,
"phone_number": phone_number,
"set_as_default": set_as_default,
"webhook_events": webhook_events,
"webhook_url": webhook_url,
},
sender_create_params.SenderCreateParams,
),
Expand Down Expand Up @@ -336,6 +403,9 @@ async def update(
*,
name: str | Omit = omit,
set_as_default: bool | Omit = omit,
webhook_active: bool | Omit = omit,
webhook_events: List[WebhookEvent] | Omit = omit,
webhook_url: Optional[str] | 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,
Expand All @@ -347,6 +417,12 @@ async def update(
Update sender

Args:
webhook_active: Whether the webhook is active.

webhook_events: Events to subscribe to.

webhook_url: HTTPS URL for webhook events. Set to null to remove webhook.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -363,6 +439,9 @@ async def update(
{
"name": name,
"set_as_default": set_as_default,
"webhook_active": webhook_active,
"webhook_events": webhook_events,
"webhook_url": webhook_url,
},
sender_update_params.SenderUpdateParams,
),
Expand Down Expand Up @@ -449,6 +528,41 @@ async def delete(
cast_to=NoneType,
)

async def regenerate_webhook_secret(
self,
sender_id: str,
*,
# 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,
) -> WebhookSecretResponse:
"""Regenerate the webhook secret for a sender.

The old secret will be invalidated
immediately.

Args:
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 sender_id:
raise ValueError(f"Expected a non-empty value for `sender_id` but received {sender_id!r}")
return await self._post(
f"/v1/senders/{sender_id}/webhook/secret",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=WebhookSecretResponse,
)


class SendersResourceWithRawResponse:
def __init__(self, senders: SendersResource) -> None:
Expand All @@ -469,6 +583,9 @@ def __init__(self, senders: SendersResource) -> None:
self.delete = to_raw_response_wrapper(
senders.delete,
)
self.regenerate_webhook_secret = to_raw_response_wrapper(
senders.regenerate_webhook_secret,
)


class AsyncSendersResourceWithRawResponse:
Expand All @@ -490,6 +607,9 @@ def __init__(self, senders: AsyncSendersResource) -> None:
self.delete = async_to_raw_response_wrapper(
senders.delete,
)
self.regenerate_webhook_secret = async_to_raw_response_wrapper(
senders.regenerate_webhook_secret,
)


class SendersResourceWithStreamingResponse:
Expand All @@ -511,6 +631,9 @@ def __init__(self, senders: SendersResource) -> None:
self.delete = to_streamed_response_wrapper(
senders.delete,
)
self.regenerate_webhook_secret = to_streamed_response_wrapper(
senders.regenerate_webhook_secret,
)


class AsyncSendersResourceWithStreamingResponse:
Expand All @@ -532,3 +655,6 @@ def __init__(self, senders: AsyncSendersResource) -> None:
self.delete = async_to_streamed_response_wrapper(
senders.delete,
)
self.regenerate_webhook_secret = async_to_streamed_response_wrapper(
senders.regenerate_webhook_secret,
)
3 changes: 3 additions & 0 deletions src/zavudev/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
from .broadcast import Broadcast as Broadcast
from .line_type import LineType as LineType
from .message_type import MessageType as MessageType
from .webhook_event import WebhookEvent as WebhookEvent
from .message_status import MessageStatus as MessageStatus
from .sender_webhook import SenderWebhook as SenderWebhook
from .message_content import MessageContent as MessageContent
from .broadcast_status import BroadcastStatus as BroadcastStatus
from .message_response import MessageResponse as MessageResponse
Expand Down Expand Up @@ -42,6 +44,7 @@
from .broadcast_create_params import BroadcastCreateParams as BroadcastCreateParams
from .broadcast_send_response import BroadcastSendResponse as BroadcastSendResponse
from .broadcast_update_params import BroadcastUpdateParams as BroadcastUpdateParams
from .webhook_secret_response import WebhookSecretResponse as WebhookSecretResponse
from .broadcast_contact_status import BroadcastContactStatus as BroadcastContactStatus
from .phone_number_list_params import PhoneNumberListParams as PhoneNumberListParams
from .broadcast_cancel_response import BroadcastCancelResponse as BroadcastCancelResponse
Expand Down
3 changes: 3 additions & 0 deletions src/zavudev/types/contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class Contact(BaseModel):

metadata: Optional[Dict[str, str]] = None

profile_name: Optional[str] = FieldInfo(alias="profileName", default=None)
"""Contact's WhatsApp profile name. Only available for WhatsApp contacts."""

updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None)

verified: Optional[bool] = None
Expand Down
4 changes: 4 additions & 0 deletions src/zavudev/types/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pydantic import Field as FieldInfo

from .._models import BaseModel
from .sender_webhook import SenderWebhook

__all__ = ["Sender"]

Expand All @@ -24,3 +25,6 @@ class Sender(BaseModel):
"""Whether this sender is the project's default."""

updated_at: Optional[datetime] = FieldInfo(alias="updatedAt", default=None)

webhook: Optional[SenderWebhook] = None
"""Webhook configuration for the sender."""
8 changes: 8 additions & 0 deletions src/zavudev/types/sender_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

from __future__ import annotations

from typing import List
from typing_extensions import Required, Annotated, TypedDict

from .._utils import PropertyInfo
from .webhook_event import WebhookEvent

__all__ = ["SenderCreateParams"]

Expand All @@ -15,3 +17,9 @@ class SenderCreateParams(TypedDict, total=False):
phone_number: Required[Annotated[str, PropertyInfo(alias="phoneNumber")]]

set_as_default: Annotated[bool, PropertyInfo(alias="setAsDefault")]

webhook_events: Annotated[List[WebhookEvent], PropertyInfo(alias="webhookEvents")]
"""Events to subscribe to."""

webhook_url: Annotated[str, PropertyInfo(alias="webhookUrl")]
"""HTTPS URL for webhook events."""
Loading