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 @@
{
".": "1.4.0"
".": "1.5.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 89
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-2c885f8f3762bcc577255242aa61b3ad890170497c865f664d8ab42c8872d97c.yml
openapi_spec_hash: e0f6dd3ae8329fa8b96d1ffdc937cbc9
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-5ce0d88003acccf6111cd40663ad7b4d468696fc439fca41d88087ab84b465c3.yml
openapi_spec_hash: ff864d7f3cad6a98a0e39fee0fb2b16a
config_hash: 2ae8965d371a03bd30c6a56819c04cf2
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 1.5.0 (2025-06-04)

Full Changelog: [v1.4.0...v1.5.0](https://github.com/knocklabs/knock-python/compare/v1.4.0...v1.5.0)

### Features

* **api:** api update ([d1373fc](https://github.com/knocklabs/knock-python/commit/d1373fca14df49d70f39a976cfc06655d47e63f4))
* **client:** add follow_redirects request option ([89019e2](https://github.com/knocklabs/knock-python/commit/89019e20bc3f965a662dfa8abc33b4608b5b2e12))


### Chores

* **docs:** remove reference to rye shell ([7a8cea9](https://github.com/knocklabs/knock-python/commit/7a8cea9054c4c620a621d79eb15ba0159deadd39))
* **docs:** remove unnecessary param examples ([bd97370](https://github.com/knocklabs/knock-python/commit/bd973709e9044293a48639c3a9fb403f7448f697))

## 1.4.0 (2025-05-29)

Full Changelog: [v1.3.0...v1.4.0](https://github.com/knocklabs/knock-python/compare/v1.3.0...v1.4.0)
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ $ rye sync --all-features
You can then run scripts using `rye run python script.py` or by activating the virtual environment:

```sh
$ rye shell
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
$ source .venv/bin/activate

# now you can omit the `rye run` prefix
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,7 @@ client = Knock()

page = client.users.list_messages(
user_id="user-123",
inserted_at={
"gt": "gt",
"gte": "gte",
"lt": "lt",
"lte": "lte",
},
inserted_at={},
)
print(page.items)
```
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 = "knockapi"
version = "1.4.0"
version = "1.5.0"
description = "The official Python library for the knock API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
6 changes: 6 additions & 0 deletions src/knockapi/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,9 @@ def request(
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth

if options.follow_redirects is not None:
kwargs["follow_redirects"] = options.follow_redirects

log.debug("Sending HTTP Request: %s %s", request.method, request.url)

response = None
Expand Down Expand Up @@ -1460,6 +1463,9 @@ async def request(
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth

if options.follow_redirects is not None:
kwargs["follow_redirects"] = options.follow_redirects

log.debug("Sending HTTP Request: %s %s", request.method, request.url)

response = None
Expand Down
2 changes: 2 additions & 0 deletions src/knockapi/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
idempotency_key: str
json_data: Body
extra_json: AnyMapping
follow_redirects: bool


@final
Expand All @@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
files: Union[HttpxRequestFiles, None] = None
idempotency_key: Union[str, None] = None
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
follow_redirects: Union[bool, None] = None

# It should be noted that we cannot use `json` here as that would override
# a BaseModel method in an incompatible fashion.
Expand Down
2 changes: 2 additions & 0 deletions src/knockapi/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
params: Query
extra_json: AnyMapping
idempotency_key: str
follow_redirects: bool


# Sentinel class used until PEP 0661 is accepted
Expand Down Expand Up @@ -215,3 +216,4 @@ class _GenericAlias(Protocol):

class HttpxSendArgs(TypedDict, total=False):
auth: httpx.Auth
follow_redirects: bool
2 changes: 1 addition & 1 deletion src/knockapi/_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__ = "knockapi"
__version__ = "1.4.0" # x-release-please-version
__version__ = "1.5.0" # x-release-please-version
28 changes: 20 additions & 8 deletions src/knockapi/resources/schedules/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ def create(
self,
*,
recipients: List[RecipientRequestParam],
repeats: Iterable[ScheduleRepeatRuleParam],
workflow: str,
actor: Optional[RecipientRequestParam] | NotGiven = NOT_GIVEN,
data: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
ending_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
repeats: Iterable[ScheduleRepeatRuleParam] | NotGiven = NOT_GIVEN,
scheduled_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
tenant: Optional[InlineTenantRequestParam] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -96,17 +97,21 @@ def create(
Args:
recipients: The recipients to set the schedule for. Limited to 100 recipients per request.

repeats: The repeat rule for the schedule.

workflow: The key of the workflow.

actor: Specifies a recipient in a request. This can either be a user identifier
(string), an inline user request (object), or an inline object request, which is
determined by the presence of a `collection` property.

data: An optional map of data to pass into the workflow execution. There is a 1024
byte limit on the size of any single string value (with the exception of
[email attachments](/integrations/email/attachments)), and a 10MB limit on the
size of the full `data` payload.

ending_at: The ending date and time for the schedule.

repeats: The repeat rule for the schedule.

scheduled_at: The starting date and time for the schedule.

tenant: An request to set a tenant inline.
Expand All @@ -124,10 +129,11 @@ def create(
body=maybe_transform(
{
"recipients": recipients,
"repeats": repeats,
"workflow": workflow,
"actor": actor,
"data": data,
"ending_at": ending_at,
"repeats": repeats,
"scheduled_at": scheduled_at,
"tenant": tenant,
},
Expand Down Expand Up @@ -338,10 +344,11 @@ async def create(
self,
*,
recipients: List[RecipientRequestParam],
repeats: Iterable[ScheduleRepeatRuleParam],
workflow: str,
actor: Optional[RecipientRequestParam] | NotGiven = NOT_GIVEN,
data: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
ending_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
repeats: Iterable[ScheduleRepeatRuleParam] | NotGiven = NOT_GIVEN,
scheduled_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
tenant: Optional[InlineTenantRequestParam] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -361,17 +368,21 @@ async def create(
Args:
recipients: The recipients to set the schedule for. Limited to 100 recipients per request.

repeats: The repeat rule for the schedule.

workflow: The key of the workflow.

actor: Specifies a recipient in a request. This can either be a user identifier
(string), an inline user request (object), or an inline object request, which is
determined by the presence of a `collection` property.

data: An optional map of data to pass into the workflow execution. There is a 1024
byte limit on the size of any single string value (with the exception of
[email attachments](/integrations/email/attachments)), and a 10MB limit on the
size of the full `data` payload.

ending_at: The ending date and time for the schedule.

repeats: The repeat rule for the schedule.

scheduled_at: The starting date and time for the schedule.

tenant: An request to set a tenant inline.
Expand All @@ -389,10 +400,11 @@ async def create(
body=await async_maybe_transform(
{
"recipients": recipients,
"repeats": repeats,
"workflow": workflow,
"actor": actor,
"data": data,
"ending_at": ending_at,
"repeats": repeats,
"scheduled_at": scheduled_at,
"tenant": tenant,
},
Expand Down
14 changes: 11 additions & 3 deletions src/knockapi/types/schedule_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ class ScheduleCreateParams(TypedDict, total=False):
recipients: Required[List[RecipientRequestParam]]
"""The recipients to set the schedule for. Limited to 100 recipients per request."""

repeats: Required[Iterable[ScheduleRepeatRuleParam]]
"""The repeat rule for the schedule."""

workflow: Required[str]
"""The key of the workflow."""

actor: Optional[RecipientRequestParam]
"""Specifies a recipient in a request.

This can either be a user identifier (string), an inline user request (object),
or an inline object request, which is determined by the presence of a
`collection` property.
"""

data: Optional[Dict[str, object]]
"""An optional map of data to pass into the workflow execution.

Expand All @@ -35,6 +40,9 @@ class ScheduleCreateParams(TypedDict, total=False):
ending_at: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""The ending date and time for the schedule."""

repeats: Iterable[ScheduleRepeatRuleParam]
"""The repeat rule for the schedule."""

scheduled_at: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""The starting date and time for the schedule."""

Expand Down
Loading