diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87d9206a..683bc1d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/knock-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | @@ -44,7 +44,7 @@ jobs: id-token: write runs-on: ${{ github.repository == 'stainless-sdks/knock-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | @@ -63,7 +63,7 @@ jobs: - name: Get GitHub OIDC Token if: github.repository == 'stainless-sdks/knock-python' id: github-oidc - uses: actions/github-script@v6 + uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -81,7 +81,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/knock-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 03546d7a..02565d35 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index e76d44c7..7c384aa7 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'knocklabs/knock-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check release environment run: | diff --git a/.release-please-manifest.json b/.release-please-manifest.json index de44c40d..69eb19a7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.19.0" + ".": "1.20.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 84e29ab3..7a06e222 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 90 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-ce72fff9b44a47ab7e0425e496f09c61cde5b4258feb20cb5dbef6fa615a57e4.yml -openapi_spec_hash: 3054ea299cf43dc89b68266818fecfe4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-b0b2bad50557aa0fe95d42cd97c6b45e8c45f6f257950048545faafafc851a17.yml +openapi_spec_hash: 4e26fcff8efa06e31f3b2bfc191a7006 config_hash: 2b42d138d85c524e65fa7e205d36cc4a diff --git a/CHANGELOG.md b/CHANGELOG.md index 8228415c..e357063f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,65 @@ # Changelog +## 1.20.0 (2026-02-19) + +Full Changelog: [v1.19.0...v1.20.0](https://github.com/knocklabs/knock-python/compare/v1.19.0...v1.20.0) + +### Features + +* **api:** api update ([05255a7](https://github.com/knocklabs/knock-python/commit/05255a72441648cd184eb325fc66e24c18603cb7)) +* **api:** api update ([dea9649](https://github.com/knocklabs/knock-python/commit/dea9649ac66c95288d2033d6e963827638c21572)) +* **api:** api update ([a339941](https://github.com/knocklabs/knock-python/commit/a339941af5f8ead6905ef2a6bb1481f3345b3e91)) +* **api:** api update ([56da8e9](https://github.com/knocklabs/knock-python/commit/56da8e943787fc0749e39e7cb6018e0c2ace35b3)) +* **api:** api update ([44d9cb3](https://github.com/knocklabs/knock-python/commit/44d9cb30c7a1d8262d8ffa97d253634a4bbedafd)) +* **api:** api update ([7549fe1](https://github.com/knocklabs/knock-python/commit/7549fe137fc6ed74676af248f979e0760c0948b1)) +* **api:** api update ([5d9adba](https://github.com/knocklabs/knock-python/commit/5d9adbadcccf8a27d153a34d2190593757a05512)) +* **api:** api update ([9f83db0](https://github.com/knocklabs/knock-python/commit/9f83db099daf463a4472fd154f3bad7ea697b1ad)) +* **api:** api update ([a27fbba](https://github.com/knocklabs/knock-python/commit/a27fbbadfa3928f36d6fa7c0b824bc9bfd9dbde0)) +* **api:** api update ([119c586](https://github.com/knocklabs/knock-python/commit/119c5866c95ab580fa3650d83fba133a6d51aa1f)) +* **api:** api update ([8906815](https://github.com/knocklabs/knock-python/commit/89068157d348f7579adcd21e2514781a784f7bef)) +* **api:** api update ([53f67f5](https://github.com/knocklabs/knock-python/commit/53f67f56d7aef82576bb80c1e26ad44c2f1a1d85)) +* **api:** api update ([de9af64](https://github.com/knocklabs/knock-python/commit/de9af6473687644be3598673a1aedd37d170b329)) +* **api:** api update ([8c88c54](https://github.com/knocklabs/knock-python/commit/8c88c545b234b0bbf876106d889c6f3ce41ef32d)) +* **api:** api update ([6fa8331](https://github.com/knocklabs/knock-python/commit/6fa83315060530d14ad296f4d725e1e544d43faf)) +* **api:** api update ([3ef2d85](https://github.com/knocklabs/knock-python/commit/3ef2d85dcb10221fb441a7c3869d19391e0504b6)) +* **api:** api update ([c50a8ee](https://github.com/knocklabs/knock-python/commit/c50a8eeadf1e424505f2c112d74f66cadaa1d2cf)) +* **api:** api update ([f4573c3](https://github.com/knocklabs/knock-python/commit/f4573c32948495b568f1201a5fb7404df4aadf51)) +* **api:** api update ([94f9a57](https://github.com/knocklabs/knock-python/commit/94f9a57672939b32bb54f5586d778e25add94904)) +* **api:** api update ([b85a638](https://github.com/knocklabs/knock-python/commit/b85a63858e283b9b898abd766a40eda69cc96889)) +* **api:** api update ([7f5b0fc](https://github.com/knocklabs/knock-python/commit/7f5b0fc648526fe857fc615a3f583ce9b4c76697)) +* **api:** api update ([79859d6](https://github.com/knocklabs/knock-python/commit/79859d6ca10acd18814ba447bf59d8289f361e74)) +* **api:** api update ([66931f9](https://github.com/knocklabs/knock-python/commit/66931f970f1e98fb2152194ba9834e914538d109)) +* **api:** api update ([c8a206a](https://github.com/knocklabs/knock-python/commit/c8a206a627961a6ece03ff8d9aeb371d73e5be04)) +* **api:** api update ([47806ce](https://github.com/knocklabs/knock-python/commit/47806ce73d09bedb21d6ded55c68a5401d50abbe)) +* **client:** add custom JSON encoder for extended type support ([0472a35](https://github.com/knocklabs/knock-python/commit/0472a35893d9d01adb3fcf1d272ebf57ee9e0fef)) +* **client:** add support for binary request streaming ([a0ff5ec](https://github.com/knocklabs/knock-python/commit/a0ff5ec2d3132a0289449df2d5d2995488f79d42)) + + +### Bug Fixes + +* ensure streams are always closed ([007d337](https://github.com/knocklabs/knock-python/commit/007d337f07c9de1883d0580209aa743384e24925)) +* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([ab076a9](https://github.com/knocklabs/knock-python/commit/ab076a9225fe2b2d013603b7136c7a76ea0f3300)) +* use async_to_httpx_files in patch method ([47196d1](https://github.com/knocklabs/knock-python/commit/47196d100147ab585fdb4fb3e7e05b92b953c2ec)) + + +### Chores + +* add missing docstrings ([dad2da6](https://github.com/knocklabs/knock-python/commit/dad2da6573ee829b4ac6c44d480e7becd19a25e0)) +* **ci:** upgrade `actions/github-script` ([751818a](https://github.com/knocklabs/knock-python/commit/751818aeedc73b4a53e9ddeb9966ff5973cdb3cf)) +* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([227e51f](https://github.com/knocklabs/knock-python/commit/227e51fa9f367e8aa67f9fe9ce96c844c3925b9e)) +* **docs:** use environment variables for authentication in code snippets ([89f2835](https://github.com/knocklabs/knock-python/commit/89f283596c21f14a316593dd8542c0ae8b872afc)) +* format all `api.md` files ([867dcfb](https://github.com/knocklabs/knock-python/commit/867dcfbfb2039d433fd8e434fd59d82e410bcc0e)) +* **internal:** add `--fix` argument to lint script ([be20a97](https://github.com/knocklabs/knock-python/commit/be20a97526ee33e626576d27f817f186218facb4)) +* **internal:** add missing files argument to base client ([8737e4a](https://github.com/knocklabs/knock-python/commit/8737e4a0cd84c85d0887b2e0ce5d9acd034abe87)) +* **internal:** bump dependencies ([82c06e8](https://github.com/knocklabs/knock-python/commit/82c06e8ac65112bcede6c98dfc5c1d645a03e458)) +* **internal:** codegen related update ([fb3e366](https://github.com/knocklabs/knock-python/commit/fb3e366f5c969b8c9956faeccab88f0882d6a263)) +* **internal:** codegen related update ([98724ee](https://github.com/knocklabs/knock-python/commit/98724ee95eeaf2dffd5e725b212d223b9db1096a)) +* **internal:** fix lint error on Python 3.14 ([82900b2](https://github.com/knocklabs/knock-python/commit/82900b2dd806553ad778e04ad77de0dc0cf276ac)) +* **internal:** update `actions/checkout` version ([ef96980](https://github.com/knocklabs/knock-python/commit/ef96980eff0e3a1d600df5e777cfdeabb486ce32)) +* speedup initial import ([f5c9aa6](https://github.com/knocklabs/knock-python/commit/f5c9aa6dd753849ac29c12ca41e1723ac77d1892)) +* update lockfile ([48e85d7](https://github.com/knocklabs/knock-python/commit/48e85d7d0cdd44f342abd95e1517dc4f51f1d67d)) +* update mock server docs ([97e6a8a](https://github.com/knocklabs/knock-python/commit/97e6a8aab842615b61cb9c433626b4fba02734fc)) + ## 1.19.0 (2025-11-20) Full Changelog: [v1.18.1...v1.19.0](https://github.com/knocklabs/knock-python/compare/v1.18.1...v1.19.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2a13546b..e12d6933 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,8 +88,7 @@ $ pip install ./path-to-wheel-file.whl Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. ```sh -# you will need npm installed -$ npx prism mock path/to/your/openapi.yml +$ ./scripts/mock ``` ```sh diff --git a/LICENSE b/LICENSE index 07c8d389..ae52933b 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Knock + Copyright 2026 Knock Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index b3962b5b..169ec8e7 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ pip install knockapi[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python +import os import asyncio from knockapi import DefaultAioHttpClient from knockapi import AsyncKnock @@ -94,7 +95,7 @@ from knockapi import AsyncKnock async def main() -> None: async with AsyncKnock( - api_key="My API Key", + api_key=os.environ.get("KNOCK_API_KEY"), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: response = await client.workflows.trigger( diff --git a/pyproject.toml b/pyproject.toml index ba8f9b04..d2dc1966 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,22 @@ [project] name = "knockapi" -version = "1.19.0" +version = "1.20.0" description = "The official Python library for the knock API" dynamic = ["readme"] license = "Apache-2.0" authors = [ { name = "Knock", email = "support@knock.app" }, ] + dependencies = [ - "httpx>=0.23.0, <1", - "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", - "anyio>=3.5.0, <5", - "distro>=1.7.0, <2", - "sniffio", + "httpx>=0.23.0, <1", + "pydantic>=1.9.0, <3", + "typing-extensions>=4.10, <5", + "anyio>=3.5.0, <5", + "distro>=1.7.0, <2", + "sniffio", ] + requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", @@ -24,6 +26,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", @@ -45,7 +48,7 @@ managed = true # version pins are in requirements-dev.lock dev-dependencies = [ "pyright==1.1.399", - "mypy", + "mypy==1.17", "respx", "pytest", "pytest-asyncio", @@ -66,7 +69,7 @@ format = { chain = [ # run formatting again to fix any inconsistencies when imports are stripped "format:ruff", ]} -"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" +"format:docs" = "bash -c 'python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)'" "format:ruff" = "ruff format" "lint" = { chain = [ diff --git a/requirements-dev.lock b/requirements-dev.lock index 7348fc42..ad7e24d3 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,40 +12,45 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.3 # via httpx-aiohttp # via knockapi -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.1 # via httpx # via knockapi -argcomplete==3.1.2 +argcomplete==3.6.3 # via nox async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 + # via nox +backports-asyncio-runner==1.2.0 + # via pytest-asyncio +certifi==2026.1.4 # via httpcore # via httpx -colorlog==6.7.0 +colorlog==6.10.1 + # via nox +dependency-groups==1.3.1 # via nox -dirty-equals==0.6.0 -distlib==0.3.7 +dirty-equals==0.11 +distlib==0.4.0 # via virtualenv -distro==1.8.0 +distro==1.9.0 # via knockapi -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio # via pytest -execnet==2.1.1 +execnet==2.1.2 # via pytest-xdist -filelock==3.12.4 +filelock==3.19.1 # via virtualenv -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -56,82 +61,89 @@ httpx==0.28.1 # via httpx-aiohttp # via knockapi # via respx -httpx-aiohttp==0.1.9 +httpx-aiohttp==0.1.12 # via knockapi -idna==3.4 +humanize==4.13.0 + # via nox +idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==7.0.0 -iniconfig==2.0.0 +importlib-metadata==8.7.1 +iniconfig==2.1.0 # via pytest markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -mypy==1.14.1 -mypy-extensions==1.0.0 +mypy==1.17.0 +mypy-extensions==1.1.0 # via mypy -nodeenv==1.8.0 +nodeenv==1.10.0 # via pyright -nox==2023.4.22 -packaging==23.2 +nox==2025.11.12 +packaging==25.0 + # via dependency-groups # via nox # via pytest -platformdirs==3.11.0 +pathspec==1.0.3 + # via mypy +platformdirs==4.4.0 # via virtualenv -pluggy==1.5.0 +pluggy==1.6.0 # via pytest -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via knockapi -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic -pygments==2.18.0 +pygments==2.19.2 + # via pytest # via rich pyright==1.1.399 -pytest==8.3.3 +pytest==8.4.2 # via pytest-asyncio # via pytest-xdist -pytest-asyncio==0.24.0 -pytest-xdist==3.7.0 -python-dateutil==2.8.2 +pytest-asyncio==1.2.0 +pytest-xdist==3.8.0 +python-dateutil==2.9.0.post0 # via time-machine -pytz==2023.3.post1 - # via dirty-equals respx==0.22.0 -rich==13.7.1 -ruff==0.9.4 -setuptools==68.2.2 - # via nodeenv -six==1.16.0 +rich==14.2.0 +ruff==0.14.13 +six==1.17.0 # via python-dateutil -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via knockapi -time-machine==2.9.0 -tomli==2.0.2 +time-machine==2.19.0 +tomli==2.4.0 + # via dependency-groups # via mypy + # via nox # via pytest -typing-extensions==4.12.2 +typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via knockapi # via multidict # via mypy # via pydantic # via pydantic-core # via pyright + # via pytest-asyncio # via typing-inspection -typing-inspection==0.4.1 + # via virtualenv +typing-inspection==0.4.2 # via pydantic -virtualenv==20.24.5 +virtualenv==20.36.1 # via nox -yarl==1.20.0 +yarl==1.22.0 # via aiohttp -zipp==3.17.0 +zipp==3.23.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index e35bc1f2..829d23fe 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,28 +12,28 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.3 # via httpx-aiohttp # via knockapi -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.1 # via httpx # via knockapi async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 +certifi==2026.1.4 # via httpcore # via httpx -distro==1.8.0 +distro==1.9.0 # via knockapi -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -43,33 +43,34 @@ httpcore==1.0.9 httpx==0.28.1 # via httpx-aiohttp # via knockapi -httpx-aiohttp==0.1.9 +httpx-aiohttp==0.1.12 # via knockapi -idna==3.4 +idna==3.11 # via anyio # via httpx # via yarl -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via knockapi -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via knockapi -typing-extensions==4.12.2 +typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via knockapi # via multidict # via pydantic # via pydantic-core # via typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via pydantic -yarl==1.20.0 +yarl==1.22.0 # via aiohttp diff --git a/scripts/lint b/scripts/lint index 4e1035ba..dc1ec6fc 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,8 +4,13 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running lints" -rye run lint +if [ "$1" = "--fix" ]; then + echo "==> Running lints with --fix" + rye run fix:ruff +else + echo "==> Running lints" + rye run lint +fi echo "==> Making sure it imports" rye run python -c 'import knockapi' diff --git a/src/knockapi/_base_client.py b/src/knockapi/_base_client.py index 07161fcb..406fc8a2 100644 --- a/src/knockapi/_base_client.py +++ b/src/knockapi/_base_client.py @@ -9,6 +9,7 @@ import inspect import logging import platform +import warnings import email.utils from types import TracebackType from random import random @@ -51,9 +52,11 @@ ResponseT, AnyMapping, PostParser, + BinaryTypes, RequestFiles, HttpxSendArgs, RequestOptions, + AsyncBinaryTypes, HttpxRequestFiles, ModelBuilderProtocol, not_given, @@ -83,6 +86,7 @@ APIConnectionError, APIResponseValidationError, ) +from ._utils._json import openapi_dumps log: logging.Logger = logging.getLogger(__name__) @@ -477,8 +481,19 @@ def _build_request( retries_taken: int = 0, ) -> httpx.Request: if log.isEnabledFor(logging.DEBUG): - log.debug("Request options: %s", model_dump(options, exclude_unset=True)) - + log.debug( + "Request options: %s", + model_dump( + options, + exclude_unset=True, + # Pydantic v1 can't dump every type we support in content, so we exclude it for now. + exclude={ + "content", + } + if PYDANTIC_V1 + else {}, + ), + ) kwargs: dict[str, Any] = {} json_data = options.json_data @@ -532,10 +547,18 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - if isinstance(json_data, bytes): + if options.content is not None and json_data is not None: + raise TypeError("Passing both `content` and `json_data` is not supported") + if options.content is not None and files is not None: + raise TypeError("Passing both `content` and `files` is not supported") + if options.content is not None: + kwargs["content"] = options.content + elif isinstance(json_data, bytes): kwargs["content"] = json_data - else: - kwargs["json"] = json_data if is_given(json_data) else None + elif not files: + # Don't set content when JSON is sent as multipart/form-data, + # since httpx's content param overrides other body arguments + kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None kwargs["files"] = files else: headers.pop("Content-Type", None) @@ -1194,6 +1217,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[False] = False, @@ -1206,6 +1230,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[True], @@ -1219,6 +1244,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: bool, @@ -1231,13 +1257,25 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: bool = False, stream_cls: type[_StreamT] | None = None, ) -> ResponseT | _StreamT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="post", url=path, json_data=body, files=to_httpx_files(files), **options + method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) @@ -1247,9 +1285,24 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options + ) return self.request(cast_to, opts) def put( @@ -1258,11 +1311,23 @@ def put( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="put", url=path, json_data=body, files=to_httpx_files(files), **options + method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return self.request(cast_to, opts) @@ -1272,9 +1337,19 @@ def delete( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options) return self.request(cast_to, opts) def get_api_list( @@ -1714,6 +1789,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[False] = False, @@ -1726,6 +1802,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[True], @@ -1739,6 +1816,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: bool, @@ -1751,13 +1829,25 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: bool = False, stream_cls: type[_AsyncStreamT] | None = None, ) -> ResponseT | _AsyncStreamT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) @@ -1767,9 +1857,29 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct( + method="patch", + url=path, + json_data=body, + content=content, + files=await async_to_httpx_files(files), + **options, + ) return await self.request(cast_to, opts) async def put( @@ -1778,11 +1888,23 @@ async def put( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) @@ -1792,9 +1914,19 @@ async def delete( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options) return await self.request(cast_to, opts) def get_api_list( diff --git a/src/knockapi/_client.py b/src/knockapi/_client.py index 8f498445..c7bbfdca 100644 --- a/src/knockapi/_client.py +++ b/src/knockapi/_client.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Mapping +from typing import TYPE_CHECKING, Any, Mapping from typing_extensions import Self, override import httpx @@ -20,8 +20,8 @@ not_given, ) from ._utils import is_given, get_async_library +from ._compat import cached_property from ._version import __version__ -from .resources import audiences, workflows, bulk_operations from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import KnockError, APIStatusError from ._base_client import ( @@ -29,33 +29,37 @@ SyncAPIClient, AsyncAPIClient, ) -from .resources.users import users -from .resources.objects import objects -from .resources.tenants import tenants -from .resources.channels import channels -from .resources.messages import messages -from .resources.providers import providers -from .resources.schedules import schedules -from .resources.integrations import integrations + +if TYPE_CHECKING: + from .resources import ( + users, + objects, + tenants, + channels, + messages, + audiences, + providers, + schedules, + workflows, + integrations, + bulk_operations, + ) + from .resources.audiences import AudiencesResource, AsyncAudiencesResource + from .resources.workflows import WorkflowsResource, AsyncWorkflowsResource + from .resources.users.users import UsersResource, AsyncUsersResource + from .resources.bulk_operations import BulkOperationsResource, AsyncBulkOperationsResource + from .resources.objects.objects import ObjectsResource, AsyncObjectsResource + from .resources.tenants.tenants import TenantsResource, AsyncTenantsResource + from .resources.channels.channels import ChannelsResource, AsyncChannelsResource + from .resources.messages.messages import MessagesResource, AsyncMessagesResource + from .resources.providers.providers import ProvidersResource, AsyncProvidersResource + from .resources.schedules.schedules import SchedulesResource, AsyncSchedulesResource + from .resources.integrations.integrations import IntegrationsResource, AsyncIntegrationsResource __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Knock", "AsyncKnock", "Client", "AsyncClient"] class Knock(SyncAPIClient): - users: users.UsersResource - objects: objects.ObjectsResource - tenants: tenants.TenantsResource - bulk_operations: bulk_operations.BulkOperationsResource - messages: messages.MessagesResource - providers: providers.ProvidersResource - integrations: integrations.IntegrationsResource - workflows: workflows.WorkflowsResource - schedules: schedules.SchedulesResource - channels: channels.ChannelsResource - audiences: audiences.AudiencesResource - with_raw_response: KnockWithRawResponse - with_streaming_response: KnockWithStreamedResponse - # client options api_key: str branch: str | None @@ -120,19 +124,79 @@ def __init__( self._idempotency_header = "Idempotency-Key" - self.users = users.UsersResource(self) - self.objects = objects.ObjectsResource(self) - self.tenants = tenants.TenantsResource(self) - self.bulk_operations = bulk_operations.BulkOperationsResource(self) - self.messages = messages.MessagesResource(self) - self.providers = providers.ProvidersResource(self) - self.integrations = integrations.IntegrationsResource(self) - self.workflows = workflows.WorkflowsResource(self) - self.schedules = schedules.SchedulesResource(self) - self.channels = channels.ChannelsResource(self) - self.audiences = audiences.AudiencesResource(self) - self.with_raw_response = KnockWithRawResponse(self) - self.with_streaming_response = KnockWithStreamedResponse(self) + @cached_property + def users(self) -> UsersResource: + from .resources.users import UsersResource + + return UsersResource(self) + + @cached_property + def objects(self) -> ObjectsResource: + from .resources.objects import ObjectsResource + + return ObjectsResource(self) + + @cached_property + def tenants(self) -> TenantsResource: + from .resources.tenants import TenantsResource + + return TenantsResource(self) + + @cached_property + def bulk_operations(self) -> BulkOperationsResource: + from .resources.bulk_operations import BulkOperationsResource + + return BulkOperationsResource(self) + + @cached_property + def messages(self) -> MessagesResource: + from .resources.messages import MessagesResource + + return MessagesResource(self) + + @cached_property + def providers(self) -> ProvidersResource: + from .resources.providers import ProvidersResource + + return ProvidersResource(self) + + @cached_property + def integrations(self) -> IntegrationsResource: + from .resources.integrations import IntegrationsResource + + return IntegrationsResource(self) + + @cached_property + def workflows(self) -> WorkflowsResource: + from .resources.workflows import WorkflowsResource + + return WorkflowsResource(self) + + @cached_property + def schedules(self) -> SchedulesResource: + from .resources.schedules import SchedulesResource + + return SchedulesResource(self) + + @cached_property + def channels(self) -> ChannelsResource: + from .resources.channels import ChannelsResource + + return ChannelsResource(self) + + @cached_property + def audiences(self) -> AudiencesResource: + from .resources.audiences import AudiencesResource + + return AudiencesResource(self) + + @cached_property + def with_raw_response(self) -> KnockWithRawResponse: + return KnockWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> KnockWithStreamedResponse: + return KnockWithStreamedResponse(self) @property @override @@ -243,20 +307,6 @@ def _make_status_error( class AsyncKnock(AsyncAPIClient): - users: users.AsyncUsersResource - objects: objects.AsyncObjectsResource - tenants: tenants.AsyncTenantsResource - bulk_operations: bulk_operations.AsyncBulkOperationsResource - messages: messages.AsyncMessagesResource - providers: providers.AsyncProvidersResource - integrations: integrations.AsyncIntegrationsResource - workflows: workflows.AsyncWorkflowsResource - schedules: schedules.AsyncSchedulesResource - channels: channels.AsyncChannelsResource - audiences: audiences.AsyncAudiencesResource - with_raw_response: AsyncKnockWithRawResponse - with_streaming_response: AsyncKnockWithStreamedResponse - # client options api_key: str branch: str | None @@ -321,19 +371,79 @@ def __init__( self._idempotency_header = "Idempotency-Key" - self.users = users.AsyncUsersResource(self) - self.objects = objects.AsyncObjectsResource(self) - self.tenants = tenants.AsyncTenantsResource(self) - self.bulk_operations = bulk_operations.AsyncBulkOperationsResource(self) - self.messages = messages.AsyncMessagesResource(self) - self.providers = providers.AsyncProvidersResource(self) - self.integrations = integrations.AsyncIntegrationsResource(self) - self.workflows = workflows.AsyncWorkflowsResource(self) - self.schedules = schedules.AsyncSchedulesResource(self) - self.channels = channels.AsyncChannelsResource(self) - self.audiences = audiences.AsyncAudiencesResource(self) - self.with_raw_response = AsyncKnockWithRawResponse(self) - self.with_streaming_response = AsyncKnockWithStreamedResponse(self) + @cached_property + def users(self) -> AsyncUsersResource: + from .resources.users import AsyncUsersResource + + return AsyncUsersResource(self) + + @cached_property + def objects(self) -> AsyncObjectsResource: + from .resources.objects import AsyncObjectsResource + + return AsyncObjectsResource(self) + + @cached_property + def tenants(self) -> AsyncTenantsResource: + from .resources.tenants import AsyncTenantsResource + + return AsyncTenantsResource(self) + + @cached_property + def bulk_operations(self) -> AsyncBulkOperationsResource: + from .resources.bulk_operations import AsyncBulkOperationsResource + + return AsyncBulkOperationsResource(self) + + @cached_property + def messages(self) -> AsyncMessagesResource: + from .resources.messages import AsyncMessagesResource + + return AsyncMessagesResource(self) + + @cached_property + def providers(self) -> AsyncProvidersResource: + from .resources.providers import AsyncProvidersResource + + return AsyncProvidersResource(self) + + @cached_property + def integrations(self) -> AsyncIntegrationsResource: + from .resources.integrations import AsyncIntegrationsResource + + return AsyncIntegrationsResource(self) + + @cached_property + def workflows(self) -> AsyncWorkflowsResource: + from .resources.workflows import AsyncWorkflowsResource + + return AsyncWorkflowsResource(self) + + @cached_property + def schedules(self) -> AsyncSchedulesResource: + from .resources.schedules import AsyncSchedulesResource + + return AsyncSchedulesResource(self) + + @cached_property + def channels(self) -> AsyncChannelsResource: + from .resources.channels import AsyncChannelsResource + + return AsyncChannelsResource(self) + + @cached_property + def audiences(self) -> AsyncAudiencesResource: + from .resources.audiences import AsyncAudiencesResource + + return AsyncAudiencesResource(self) + + @cached_property + def with_raw_response(self) -> AsyncKnockWithRawResponse: + return AsyncKnockWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncKnockWithStreamedResponse: + return AsyncKnockWithStreamedResponse(self) @property @override @@ -444,63 +554,295 @@ def _make_status_error( class KnockWithRawResponse: + _client: Knock + def __init__(self, client: Knock) -> None: - self.users = users.UsersResourceWithRawResponse(client.users) - self.objects = objects.ObjectsResourceWithRawResponse(client.objects) - self.tenants = tenants.TenantsResourceWithRawResponse(client.tenants) - self.bulk_operations = bulk_operations.BulkOperationsResourceWithRawResponse(client.bulk_operations) - self.messages = messages.MessagesResourceWithRawResponse(client.messages) - self.providers = providers.ProvidersResourceWithRawResponse(client.providers) - self.integrations = integrations.IntegrationsResourceWithRawResponse(client.integrations) - self.workflows = workflows.WorkflowsResourceWithRawResponse(client.workflows) - self.schedules = schedules.SchedulesResourceWithRawResponse(client.schedules) - self.channels = channels.ChannelsResourceWithRawResponse(client.channels) - self.audiences = audiences.AudiencesResourceWithRawResponse(client.audiences) + self._client = client + + @cached_property + def users(self) -> users.UsersResourceWithRawResponse: + from .resources.users import UsersResourceWithRawResponse + + return UsersResourceWithRawResponse(self._client.users) + + @cached_property + def objects(self) -> objects.ObjectsResourceWithRawResponse: + from .resources.objects import ObjectsResourceWithRawResponse + + return ObjectsResourceWithRawResponse(self._client.objects) + + @cached_property + def tenants(self) -> tenants.TenantsResourceWithRawResponse: + from .resources.tenants import TenantsResourceWithRawResponse + + return TenantsResourceWithRawResponse(self._client.tenants) + + @cached_property + def bulk_operations(self) -> bulk_operations.BulkOperationsResourceWithRawResponse: + from .resources.bulk_operations import BulkOperationsResourceWithRawResponse + + return BulkOperationsResourceWithRawResponse(self._client.bulk_operations) + + @cached_property + def messages(self) -> messages.MessagesResourceWithRawResponse: + from .resources.messages import MessagesResourceWithRawResponse + + return MessagesResourceWithRawResponse(self._client.messages) + + @cached_property + def providers(self) -> providers.ProvidersResourceWithRawResponse: + from .resources.providers import ProvidersResourceWithRawResponse + + return ProvidersResourceWithRawResponse(self._client.providers) + + @cached_property + def integrations(self) -> integrations.IntegrationsResourceWithRawResponse: + from .resources.integrations import IntegrationsResourceWithRawResponse + + return IntegrationsResourceWithRawResponse(self._client.integrations) + + @cached_property + def workflows(self) -> workflows.WorkflowsResourceWithRawResponse: + from .resources.workflows import WorkflowsResourceWithRawResponse + + return WorkflowsResourceWithRawResponse(self._client.workflows) + + @cached_property + def schedules(self) -> schedules.SchedulesResourceWithRawResponse: + from .resources.schedules import SchedulesResourceWithRawResponse + + return SchedulesResourceWithRawResponse(self._client.schedules) + + @cached_property + def channels(self) -> channels.ChannelsResourceWithRawResponse: + from .resources.channels import ChannelsResourceWithRawResponse + + return ChannelsResourceWithRawResponse(self._client.channels) + + @cached_property + def audiences(self) -> audiences.AudiencesResourceWithRawResponse: + from .resources.audiences import AudiencesResourceWithRawResponse + + return AudiencesResourceWithRawResponse(self._client.audiences) class AsyncKnockWithRawResponse: + _client: AsyncKnock + def __init__(self, client: AsyncKnock) -> None: - self.users = users.AsyncUsersResourceWithRawResponse(client.users) - self.objects = objects.AsyncObjectsResourceWithRawResponse(client.objects) - self.tenants = tenants.AsyncTenantsResourceWithRawResponse(client.tenants) - self.bulk_operations = bulk_operations.AsyncBulkOperationsResourceWithRawResponse(client.bulk_operations) - self.messages = messages.AsyncMessagesResourceWithRawResponse(client.messages) - self.providers = providers.AsyncProvidersResourceWithRawResponse(client.providers) - self.integrations = integrations.AsyncIntegrationsResourceWithRawResponse(client.integrations) - self.workflows = workflows.AsyncWorkflowsResourceWithRawResponse(client.workflows) - self.schedules = schedules.AsyncSchedulesResourceWithRawResponse(client.schedules) - self.channels = channels.AsyncChannelsResourceWithRawResponse(client.channels) - self.audiences = audiences.AsyncAudiencesResourceWithRawResponse(client.audiences) + self._client = client + + @cached_property + def users(self) -> users.AsyncUsersResourceWithRawResponse: + from .resources.users import AsyncUsersResourceWithRawResponse + + return AsyncUsersResourceWithRawResponse(self._client.users) + + @cached_property + def objects(self) -> objects.AsyncObjectsResourceWithRawResponse: + from .resources.objects import AsyncObjectsResourceWithRawResponse + + return AsyncObjectsResourceWithRawResponse(self._client.objects) + + @cached_property + def tenants(self) -> tenants.AsyncTenantsResourceWithRawResponse: + from .resources.tenants import AsyncTenantsResourceWithRawResponse + + return AsyncTenantsResourceWithRawResponse(self._client.tenants) + + @cached_property + def bulk_operations(self) -> bulk_operations.AsyncBulkOperationsResourceWithRawResponse: + from .resources.bulk_operations import AsyncBulkOperationsResourceWithRawResponse + + return AsyncBulkOperationsResourceWithRawResponse(self._client.bulk_operations) + + @cached_property + def messages(self) -> messages.AsyncMessagesResourceWithRawResponse: + from .resources.messages import AsyncMessagesResourceWithRawResponse + + return AsyncMessagesResourceWithRawResponse(self._client.messages) + + @cached_property + def providers(self) -> providers.AsyncProvidersResourceWithRawResponse: + from .resources.providers import AsyncProvidersResourceWithRawResponse + + return AsyncProvidersResourceWithRawResponse(self._client.providers) + + @cached_property + def integrations(self) -> integrations.AsyncIntegrationsResourceWithRawResponse: + from .resources.integrations import AsyncIntegrationsResourceWithRawResponse + + return AsyncIntegrationsResourceWithRawResponse(self._client.integrations) + + @cached_property + def workflows(self) -> workflows.AsyncWorkflowsResourceWithRawResponse: + from .resources.workflows import AsyncWorkflowsResourceWithRawResponse + + return AsyncWorkflowsResourceWithRawResponse(self._client.workflows) + + @cached_property + def schedules(self) -> schedules.AsyncSchedulesResourceWithRawResponse: + from .resources.schedules import AsyncSchedulesResourceWithRawResponse + + return AsyncSchedulesResourceWithRawResponse(self._client.schedules) + + @cached_property + def channels(self) -> channels.AsyncChannelsResourceWithRawResponse: + from .resources.channels import AsyncChannelsResourceWithRawResponse + + return AsyncChannelsResourceWithRawResponse(self._client.channels) + + @cached_property + def audiences(self) -> audiences.AsyncAudiencesResourceWithRawResponse: + from .resources.audiences import AsyncAudiencesResourceWithRawResponse + + return AsyncAudiencesResourceWithRawResponse(self._client.audiences) class KnockWithStreamedResponse: + _client: Knock + def __init__(self, client: Knock) -> None: - self.users = users.UsersResourceWithStreamingResponse(client.users) - self.objects = objects.ObjectsResourceWithStreamingResponse(client.objects) - self.tenants = tenants.TenantsResourceWithStreamingResponse(client.tenants) - self.bulk_operations = bulk_operations.BulkOperationsResourceWithStreamingResponse(client.bulk_operations) - self.messages = messages.MessagesResourceWithStreamingResponse(client.messages) - self.providers = providers.ProvidersResourceWithStreamingResponse(client.providers) - self.integrations = integrations.IntegrationsResourceWithStreamingResponse(client.integrations) - self.workflows = workflows.WorkflowsResourceWithStreamingResponse(client.workflows) - self.schedules = schedules.SchedulesResourceWithStreamingResponse(client.schedules) - self.channels = channels.ChannelsResourceWithStreamingResponse(client.channels) - self.audiences = audiences.AudiencesResourceWithStreamingResponse(client.audiences) + self._client = client + + @cached_property + def users(self) -> users.UsersResourceWithStreamingResponse: + from .resources.users import UsersResourceWithStreamingResponse + + return UsersResourceWithStreamingResponse(self._client.users) + + @cached_property + def objects(self) -> objects.ObjectsResourceWithStreamingResponse: + from .resources.objects import ObjectsResourceWithStreamingResponse + + return ObjectsResourceWithStreamingResponse(self._client.objects) + + @cached_property + def tenants(self) -> tenants.TenantsResourceWithStreamingResponse: + from .resources.tenants import TenantsResourceWithStreamingResponse + + return TenantsResourceWithStreamingResponse(self._client.tenants) + + @cached_property + def bulk_operations(self) -> bulk_operations.BulkOperationsResourceWithStreamingResponse: + from .resources.bulk_operations import BulkOperationsResourceWithStreamingResponse + + return BulkOperationsResourceWithStreamingResponse(self._client.bulk_operations) + + @cached_property + def messages(self) -> messages.MessagesResourceWithStreamingResponse: + from .resources.messages import MessagesResourceWithStreamingResponse + + return MessagesResourceWithStreamingResponse(self._client.messages) + + @cached_property + def providers(self) -> providers.ProvidersResourceWithStreamingResponse: + from .resources.providers import ProvidersResourceWithStreamingResponse + + return ProvidersResourceWithStreamingResponse(self._client.providers) + + @cached_property + def integrations(self) -> integrations.IntegrationsResourceWithStreamingResponse: + from .resources.integrations import IntegrationsResourceWithStreamingResponse + + return IntegrationsResourceWithStreamingResponse(self._client.integrations) + + @cached_property + def workflows(self) -> workflows.WorkflowsResourceWithStreamingResponse: + from .resources.workflows import WorkflowsResourceWithStreamingResponse + + return WorkflowsResourceWithStreamingResponse(self._client.workflows) + + @cached_property + def schedules(self) -> schedules.SchedulesResourceWithStreamingResponse: + from .resources.schedules import SchedulesResourceWithStreamingResponse + + return SchedulesResourceWithStreamingResponse(self._client.schedules) + + @cached_property + def channels(self) -> channels.ChannelsResourceWithStreamingResponse: + from .resources.channels import ChannelsResourceWithStreamingResponse + + return ChannelsResourceWithStreamingResponse(self._client.channels) + + @cached_property + def audiences(self) -> audiences.AudiencesResourceWithStreamingResponse: + from .resources.audiences import AudiencesResourceWithStreamingResponse + + return AudiencesResourceWithStreamingResponse(self._client.audiences) class AsyncKnockWithStreamedResponse: + _client: AsyncKnock + def __init__(self, client: AsyncKnock) -> None: - self.users = users.AsyncUsersResourceWithStreamingResponse(client.users) - self.objects = objects.AsyncObjectsResourceWithStreamingResponse(client.objects) - self.tenants = tenants.AsyncTenantsResourceWithStreamingResponse(client.tenants) - self.bulk_operations = bulk_operations.AsyncBulkOperationsResourceWithStreamingResponse(client.bulk_operations) - self.messages = messages.AsyncMessagesResourceWithStreamingResponse(client.messages) - self.providers = providers.AsyncProvidersResourceWithStreamingResponse(client.providers) - self.integrations = integrations.AsyncIntegrationsResourceWithStreamingResponse(client.integrations) - self.workflows = workflows.AsyncWorkflowsResourceWithStreamingResponse(client.workflows) - self.schedules = schedules.AsyncSchedulesResourceWithStreamingResponse(client.schedules) - self.channels = channels.AsyncChannelsResourceWithStreamingResponse(client.channels) - self.audiences = audiences.AsyncAudiencesResourceWithStreamingResponse(client.audiences) + self._client = client + + @cached_property + def users(self) -> users.AsyncUsersResourceWithStreamingResponse: + from .resources.users import AsyncUsersResourceWithStreamingResponse + + return AsyncUsersResourceWithStreamingResponse(self._client.users) + + @cached_property + def objects(self) -> objects.AsyncObjectsResourceWithStreamingResponse: + from .resources.objects import AsyncObjectsResourceWithStreamingResponse + + return AsyncObjectsResourceWithStreamingResponse(self._client.objects) + + @cached_property + def tenants(self) -> tenants.AsyncTenantsResourceWithStreamingResponse: + from .resources.tenants import AsyncTenantsResourceWithStreamingResponse + + return AsyncTenantsResourceWithStreamingResponse(self._client.tenants) + + @cached_property + def bulk_operations(self) -> bulk_operations.AsyncBulkOperationsResourceWithStreamingResponse: + from .resources.bulk_operations import AsyncBulkOperationsResourceWithStreamingResponse + + return AsyncBulkOperationsResourceWithStreamingResponse(self._client.bulk_operations) + + @cached_property + def messages(self) -> messages.AsyncMessagesResourceWithStreamingResponse: + from .resources.messages import AsyncMessagesResourceWithStreamingResponse + + return AsyncMessagesResourceWithStreamingResponse(self._client.messages) + + @cached_property + def providers(self) -> providers.AsyncProvidersResourceWithStreamingResponse: + from .resources.providers import AsyncProvidersResourceWithStreamingResponse + + return AsyncProvidersResourceWithStreamingResponse(self._client.providers) + + @cached_property + def integrations(self) -> integrations.AsyncIntegrationsResourceWithStreamingResponse: + from .resources.integrations import AsyncIntegrationsResourceWithStreamingResponse + + return AsyncIntegrationsResourceWithStreamingResponse(self._client.integrations) + + @cached_property + def workflows(self) -> workflows.AsyncWorkflowsResourceWithStreamingResponse: + from .resources.workflows import AsyncWorkflowsResourceWithStreamingResponse + + return AsyncWorkflowsResourceWithStreamingResponse(self._client.workflows) + + @cached_property + def schedules(self) -> schedules.AsyncSchedulesResourceWithStreamingResponse: + from .resources.schedules import AsyncSchedulesResourceWithStreamingResponse + + return AsyncSchedulesResourceWithStreamingResponse(self._client.schedules) + + @cached_property + def channels(self) -> channels.AsyncChannelsResourceWithStreamingResponse: + from .resources.channels import AsyncChannelsResourceWithStreamingResponse + + return AsyncChannelsResourceWithStreamingResponse(self._client.channels) + + @cached_property + def audiences(self) -> audiences.AsyncAudiencesResourceWithStreamingResponse: + from .resources.audiences import AsyncAudiencesResourceWithStreamingResponse + + return AsyncAudiencesResourceWithStreamingResponse(self._client.audiences) Client = Knock diff --git a/src/knockapi/_compat.py b/src/knockapi/_compat.py index bdef67f0..786ff42a 100644 --- a/src/knockapi/_compat.py +++ b/src/knockapi/_compat.py @@ -139,6 +139,7 @@ def model_dump( exclude_defaults: bool = False, warnings: bool = True, mode: Literal["json", "python"] = "python", + by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): return model.model_dump( @@ -148,13 +149,12 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, + by_alias=by_alias, ) return cast( "dict[str, Any]", model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast] - exclude=exclude, - exclude_unset=exclude_unset, - exclude_defaults=exclude_defaults, + exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias) ), ) diff --git a/src/knockapi/_models.py b/src/knockapi/_models.py index ca9500b2..29070e05 100644 --- a/src/knockapi/_models.py +++ b/src/knockapi/_models.py @@ -3,7 +3,20 @@ import os import inspect import weakref -from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast +from typing import ( + IO, + TYPE_CHECKING, + Any, + Type, + Union, + Generic, + TypeVar, + Callable, + Iterable, + Optional, + AsyncIterable, + cast, +) from datetime import date, datetime from typing_extensions import ( List, @@ -787,6 +800,7 @@ class FinalRequestOptionsInput(TypedDict, total=False): timeout: float | Timeout | None files: HttpxRequestFiles | None idempotency_key: str + content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] json_data: Body extra_json: AnyMapping follow_redirects: bool @@ -805,6 +819,7 @@ class FinalRequestOptions(pydantic.BaseModel): post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() follow_redirects: Union[bool, None] = None + content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] = None # It should be noted that we cannot use `json` here as that would override # a BaseModel method in an incompatible fashion. json_data: Union[Body, None] = None diff --git a/src/knockapi/_streaming.py b/src/knockapi/_streaming.py index 01eb112e..5a41eaef 100644 --- a/src/knockapi/_streaming.py +++ b/src/knockapi/_streaming.py @@ -54,11 +54,12 @@ def __stream__(self) -> Iterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - response.close() + try: + for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + response.close() def __enter__(self) -> Self: return self @@ -117,11 +118,12 @@ async def __stream__(self) -> AsyncIterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - async for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - await response.aclose() + try: + async for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + await response.aclose() async def __aenter__(self) -> Self: return self diff --git a/src/knockapi/_types.py b/src/knockapi/_types.py index da9efb81..8059ac49 100644 --- a/src/knockapi/_types.py +++ b/src/knockapi/_types.py @@ -13,9 +13,11 @@ Mapping, TypeVar, Callable, + Iterable, Iterator, Optional, Sequence, + AsyncIterable, ) from typing_extensions import ( Set, @@ -56,6 +58,13 @@ else: Base64FileInput = Union[IO[bytes], PathLike] FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8. + + +# Used for sending raw binary data / streaming data in request bodies +# e.g. for file uploads without multipart encoding +BinaryTypes = Union[bytes, bytearray, IO[bytes], Iterable[bytes]] +AsyncBinaryTypes = Union[bytes, bytearray, IO[bytes], AsyncIterable[bytes]] + FileTypes = Union[ # file (or bytes) FileContent, @@ -243,6 +252,9 @@ class HttpxSendArgs(TypedDict, total=False): if TYPE_CHECKING: # This works because str.__contains__ does not accept object (either in typeshed or at runtime) # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + # + # Note: index() and count() methods are intentionally omitted to allow pyright to properly + # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr. class SequenceNotStr(Protocol[_T_co]): @overload def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... @@ -251,8 +263,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... def __contains__(self, value: object, /) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T_co]: ... - def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... - def count(self, value: Any, /) -> int: ... def __reversed__(self) -> Iterator[_T_co]: ... else: # just point this to a normal `Sequence` at runtime to avoid having to special case diff --git a/src/knockapi/_utils/_compat.py b/src/knockapi/_utils/_compat.py index dd703233..2c70b299 100644 --- a/src/knockapi/_utils/_compat.py +++ b/src/knockapi/_utils/_compat.py @@ -26,7 +26,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool: else: import types - return tp is Union or tp is types.UnionType + return tp is Union or tp is types.UnionType # type: ignore[comparison-overlap] def is_typeddict(tp: Type[Any]) -> bool: diff --git a/src/knockapi/_utils/_json.py b/src/knockapi/_utils/_json.py new file mode 100644 index 00000000..60584214 --- /dev/null +++ b/src/knockapi/_utils/_json.py @@ -0,0 +1,35 @@ +import json +from typing import Any +from datetime import datetime +from typing_extensions import override + +import pydantic + +from .._compat import model_dump + + +def openapi_dumps(obj: Any) -> bytes: + """ + Serialize an object to UTF-8 encoded JSON bytes. + + Extends the standard json.dumps with support for additional types + commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc. + """ + return json.dumps( + obj, + cls=_CustomEncoder, + # Uses the same defaults as httpx's JSON serialization + ensure_ascii=False, + separators=(",", ":"), + allow_nan=False, + ).encode() + + +class _CustomEncoder(json.JSONEncoder): + @override + def default(self, o: Any) -> Any: + if isinstance(o, datetime): + return o.isoformat() + if isinstance(o, pydantic.BaseModel): + return model_dump(o, exclude_unset=True, mode="json", by_alias=True) + return super().default(o) diff --git a/src/knockapi/_version.py b/src/knockapi/_version.py index 0abf59d2..2b28f911 100644 --- a/src/knockapi/_version.py +++ b/src/knockapi/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "knockapi" -__version__ = "1.19.0" # x-release-please-version +__version__ = "1.20.0" # x-release-please-version diff --git a/src/knockapi/resources/audiences.py b/src/knockapi/resources/audiences.py index d70db9cd..a40199db 100644 --- a/src/knockapi/resources/audiences.py +++ b/src/knockapi/resources/audiences.py @@ -7,7 +7,7 @@ import httpx from ..types import audience_add_members_params, audience_remove_members_params -from .._types import Body, Query, Headers, NoneType, NotGiven, not_given +from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -48,6 +48,7 @@ def add_members( key: str, *, members: Iterable[audience_add_members_params.Member], + create_audience: bool | 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, @@ -60,7 +61,9 @@ def add_members( Adds one or more members to the specified audience. Args: - members: A list of audience members to add. Limited to 1,000 members per request. + members: A list of audience members to add. You can add up to 1,000 members per request. + + create_audience: Create the audience if it does not exist. extra_headers: Send extra headers @@ -84,6 +87,9 @@ def add_members( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=maybe_transform( + {"create_audience": create_audience}, audience_add_members_params.AudienceAddMembersParams + ), ), cast_to=NoneType, ) @@ -138,7 +144,8 @@ def remove_members( Removes one or more members from the specified audience. Args: - members: A list of audience members to remove. + members: A list of audience members to remove. You can remove up to 1,000 members per + request. extra_headers: Send extra headers @@ -192,6 +199,7 @@ async def add_members( key: str, *, members: Iterable[audience_add_members_params.Member], + create_audience: bool | 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, @@ -204,7 +212,9 @@ async def add_members( Adds one or more members to the specified audience. Args: - members: A list of audience members to add. Limited to 1,000 members per request. + members: A list of audience members to add. You can add up to 1,000 members per request. + + create_audience: Create the audience if it does not exist. extra_headers: Send extra headers @@ -230,6 +240,9 @@ async def add_members( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=await async_maybe_transform( + {"create_audience": create_audience}, audience_add_members_params.AudienceAddMembersParams + ), ), cast_to=NoneType, ) @@ -284,7 +297,8 @@ async def remove_members( Removes one or more members from the specified audience. Args: - members: A list of audience members to remove. + members: A list of audience members to remove. You can remove up to 1,000 members per + request. extra_headers: Send extra headers diff --git a/src/knockapi/resources/tenants/bulk.py b/src/knockapi/resources/tenants/bulk.py index 9b510d67..e1c1087b 100644 --- a/src/knockapi/resources/tenants/bulk.py +++ b/src/knockapi/resources/tenants/bulk.py @@ -54,10 +54,10 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BulkOperation: - """Delete up to 100 tenants at a time in a single operation. + """Delete up to 1,000 tenants at a time in a single operation. - This operation cannot - be undone. + This operation + cannot be undone. Args: tenant_ids: The IDs of the tenants to delete. @@ -98,7 +98,7 @@ def set( idempotency_key: str | None = None, ) -> BulkOperation: """ - Set or update up to 100 tenants in a single operation. + Set or update up to 1,000 tenants in a single operation. Args: tenants: The tenants to be upserted. @@ -159,10 +159,10 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BulkOperation: - """Delete up to 100 tenants at a time in a single operation. + """Delete up to 1,000 tenants at a time in a single operation. - This operation cannot - be undone. + This operation + cannot be undone. Args: tenant_ids: The IDs of the tenants to delete. @@ -203,7 +203,7 @@ async def set( idempotency_key: str | None = None, ) -> BulkOperation: """ - Set or update up to 100 tenants in a single operation. + Set or update up to 1,000 tenants in a single operation. Args: tenants: The tenants to be upserted. diff --git a/src/knockapi/resources/users/feeds.py b/src/knockapi/resources/users/feeds.py index 2014f7fb..4f8201de 100644 --- a/src/knockapi/resources/users/feeds.py +++ b/src/knockapi/resources/users/feeds.py @@ -89,8 +89,11 @@ def list_items( after: str | Omit = omit, archived: Literal["exclude", "include", "only"] | Omit = omit, before: str | Omit = omit, + exclude: str | Omit = omit, has_tenant: bool | Omit = omit, + inserted_at: feed_list_items_params.InsertedAt | Omit = omit, locale: str | Omit = omit, + mode: Literal["compact", "rich"] | Omit = omit, page_size: int | Omit = omit, source: str | Omit = omit, status: Literal["unread", "read", "unseen", "seen", "all"] | Omit = omit, @@ -119,6 +122,9 @@ def list_items( along with a user token. - This endpoint’s rate limit is always scoped per-user and per-environment. This is true even for requests made without a signed user token. + - Any [attachments](/integrations/email/attachments) present in trigger data are + automatically excluded from both the `data` and `activities` fields of + `UserInAppFeedResponse`. Args: after: The cursor to fetch entries after. @@ -127,6 +133,10 @@ def list_items( before: The cursor to fetch entries before. + exclude: Comma-separated list of field paths to exclude from the response. Use dot + notation for nested fields (e.g., `entries.archived_at`). Limited to 3 levels + deep. + has_tenant: Whether the feed items have a tenant. locale: The locale to render the feed items in. Must be in the IETF 5646 format (e.g. @@ -134,6 +144,11 @@ def list_items( rendered in. Only available for enterprise plan customers using custom translations. + mode: The mode to render the feed items in. Can be `compact` or `rich`. Defaults to + `rich`. When `mode` is `compact`, feed items will not have `activities` and + `total_activities` fields; the `data` field will not include nested arrays and + objects; and the `actors` field will only have up to one actor. + page_size: The number of items per page (defaults to 50). source: The workflow key associated with the message in the feed. @@ -171,8 +186,11 @@ def list_items( "after": after, "archived": archived, "before": before, + "exclude": exclude, "has_tenant": has_tenant, + "inserted_at": inserted_at, "locale": locale, + "mode": mode, "page_size": page_size, "source": source, "status": status, @@ -251,8 +269,11 @@ def list_items( after: str | Omit = omit, archived: Literal["exclude", "include", "only"] | Omit = omit, before: str | Omit = omit, + exclude: str | Omit = omit, has_tenant: bool | Omit = omit, + inserted_at: feed_list_items_params.InsertedAt | Omit = omit, locale: str | Omit = omit, + mode: Literal["compact", "rich"] | Omit = omit, page_size: int | Omit = omit, source: str | Omit = omit, status: Literal["unread", "read", "unseen", "seen", "all"] | Omit = omit, @@ -281,6 +302,9 @@ def list_items( along with a user token. - This endpoint’s rate limit is always scoped per-user and per-environment. This is true even for requests made without a signed user token. + - Any [attachments](/integrations/email/attachments) present in trigger data are + automatically excluded from both the `data` and `activities` fields of + `UserInAppFeedResponse`. Args: after: The cursor to fetch entries after. @@ -289,6 +313,10 @@ def list_items( before: The cursor to fetch entries before. + exclude: Comma-separated list of field paths to exclude from the response. Use dot + notation for nested fields (e.g., `entries.archived_at`). Limited to 3 levels + deep. + has_tenant: Whether the feed items have a tenant. locale: The locale to render the feed items in. Must be in the IETF 5646 format (e.g. @@ -296,6 +324,11 @@ def list_items( rendered in. Only available for enterprise plan customers using custom translations. + mode: The mode to render the feed items in. Can be `compact` or `rich`. Defaults to + `rich`. When `mode` is `compact`, feed items will not have `activities` and + `total_activities` fields; the `data` field will not include nested arrays and + objects; and the `actors` field will only have up to one actor. + page_size: The number of items per page (defaults to 50). source: The workflow key associated with the message in the feed. @@ -333,8 +366,11 @@ def list_items( "after": after, "archived": archived, "before": before, + "exclude": exclude, "has_tenant": has_tenant, + "inserted_at": inserted_at, "locale": locale, + "mode": mode, "page_size": page_size, "source": source, "status": status, diff --git a/src/knockapi/types/activity.py b/src/knockapi/types/activity.py index 4f1d6e3d..9108451f 100644 --- a/src/knockapi/types/activity.py +++ b/src/knockapi/types/activity.py @@ -12,6 +12,11 @@ class Activity(BaseModel): + """An activity associated with a workflow trigger request. + + Messages produced after a [batch step](/designing-workflows/batch-function) can be associated with one or more activities. Non-batched messages will always be associated with a single activity. + """ + id: Optional[str] = None """Unique identifier for the activity.""" diff --git a/src/knockapi/types/audience_add_members_params.py b/src/knockapi/types/audience_add_members_params.py index 0c23568a..39648b21 100644 --- a/src/knockapi/types/audience_add_members_params.py +++ b/src/knockapi/types/audience_add_members_params.py @@ -5,22 +5,29 @@ from typing import Iterable, Optional from typing_extensions import Required, TypedDict -__all__ = ["AudienceAddMembersParams", "Member", "MemberUser"] +from .inline_identify_user_request_param import InlineIdentifyUserRequestParam + +__all__ = ["AudienceAddMembersParams", "Member"] class AudienceAddMembersParams(TypedDict, total=False): members: Required[Iterable[Member]] - """A list of audience members to add. Limited to 1,000 members per request.""" - + """A list of audience members to add. You can add up to 1,000 members per request.""" -class MemberUser(TypedDict, total=False): - id: str - """The unique identifier of the user.""" + create_audience: bool + """Create the audience if it does not exist.""" class Member(TypedDict, total=False): - user: Required[MemberUser] - """An object containing the user's ID.""" + """An audience member.""" + + user: Required[InlineIdentifyUserRequestParam] + """A set of parameters to inline-identify a user with. + + Inline identifying the user will ensure that the user is available before the + request is executed in Knock. It will perform an upsert for the user you're + supplying, replacing any properties specified. + """ tenant: Optional[str] """The unique identifier for the tenant.""" diff --git a/src/knockapi/types/audience_list_members_response.py b/src/knockapi/types/audience_list_members_response.py index fc2da4a1..049dbab2 100644 --- a/src/knockapi/types/audience_list_members_response.py +++ b/src/knockapi/types/audience_list_members_response.py @@ -10,6 +10,8 @@ class AudienceListMembersResponse(BaseModel): + """A paginated list of audience members.""" + entries: List[AudienceMember] """A list of audience members.""" diff --git a/src/knockapi/types/audience_member.py b/src/knockapi/types/audience_member.py index d7eac530..6c6120ee 100644 --- a/src/knockapi/types/audience_member.py +++ b/src/knockapi/types/audience_member.py @@ -12,6 +12,8 @@ class AudienceMember(BaseModel): + """An audience member.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" diff --git a/src/knockapi/types/audience_remove_members_params.py b/src/knockapi/types/audience_remove_members_params.py index 393c10c9..919eba5d 100644 --- a/src/knockapi/types/audience_remove_members_params.py +++ b/src/knockapi/types/audience_remove_members_params.py @@ -5,22 +5,29 @@ from typing import Iterable, Optional from typing_extensions import Required, TypedDict -__all__ = ["AudienceRemoveMembersParams", "Member", "MemberUser"] +from .inline_identify_user_request_param import InlineIdentifyUserRequestParam + +__all__ = ["AudienceRemoveMembersParams", "Member"] class AudienceRemoveMembersParams(TypedDict, total=False): members: Required[Iterable[Member]] - """A list of audience members to remove.""" - + """A list of audience members to remove. -class MemberUser(TypedDict, total=False): - id: str - """The unique identifier of the user.""" + You can remove up to 1,000 members per request. + """ class Member(TypedDict, total=False): - user: Required[MemberUser] - """An object containing the user's ID.""" + """An audience member.""" + + user: Required[InlineIdentifyUserRequestParam] + """A set of parameters to inline-identify a user with. + + Inline identifying the user will ensure that the user is available before the + request is executed in Knock. It will perform an upsert for the user you're + supplying, replacing any properties specified. + """ tenant: Optional[str] """The unique identifier for the tenant.""" diff --git a/src/knockapi/types/bulk_operation.py b/src/knockapi/types/bulk_operation.py index 58d6e6b7..0c3aef17 100644 --- a/src/knockapi/types/bulk_operation.py +++ b/src/knockapi/types/bulk_operation.py @@ -20,6 +20,8 @@ class ErrorItem(BaseModel): class BulkOperation(BaseModel): + """A bulk operation entity.""" + id: str """Unique identifier for the bulk operation.""" diff --git a/src/knockapi/types/inline_identify_user_request_param.py b/src/knockapi/types/inline_identify_user_request_param.py index c18cc0b5..9254781d 100644 --- a/src/knockapi/types/inline_identify_user_request_param.py +++ b/src/knockapi/types/inline_identify_user_request_param.py @@ -14,6 +14,11 @@ class InlineIdentifyUserRequestParamTyped(TypedDict, total=False): + """A set of parameters to inline-identify a user with. + + Inline identifying the user will ensure that the user is available before the request is executed in Knock. It will perform an upsert for the user you're supplying, replacing any properties specified. + """ + id: Required[str] """The unique identifier of the user.""" diff --git a/src/knockapi/types/inline_object_request_param.py b/src/knockapi/types/inline_object_request_param.py index 59e4d59a..de8a0ec9 100644 --- a/src/knockapi/types/inline_object_request_param.py +++ b/src/knockapi/types/inline_object_request_param.py @@ -14,6 +14,8 @@ class InlineObjectRequestParamTyped(TypedDict, total=False): + """A custom [Object](/concepts/objects) entity which belongs to a collection.""" + id: Required[str] """Unique identifier for the object.""" diff --git a/src/knockapi/types/message.py b/src/knockapi/types/message.py index dc8a8bc4..b368ffd6 100644 --- a/src/knockapi/types/message.py +++ b/src/knockapi/types/message.py @@ -13,6 +13,8 @@ class Source(BaseModel): + """The workflow or guide that triggered the message.""" + api_typename: str = FieldInfo(alias="__typename") categories: List[str] @@ -30,8 +32,23 @@ class Source(BaseModel): type: Optional[Literal["broadcast", "workflow", "guide"]] = None """Whether this message was generated from a workflow, broadcast, or guide.""" + workflow_recipient_run_id: Optional[str] = None + """The unique identifier for the workflow recipient run that generated this + message. + + Only present for workflow/broadcast messages. + """ + + workflow_run_id: Optional[str] = None + """The unique identifier for the workflow run that generated this message. + + Only present for workflow/broadcast messages. + """ + class Channel(BaseModel): + """A configured channel, which is a way to route messages to a provider.""" + id: str """The unique identifier for the channel.""" @@ -55,6 +72,10 @@ class Channel(BaseModel): class Message(BaseModel): + """ + Represents a single message that was generated by a workflow for a given channel. + """ + id: str """The unique identifier for the message.""" diff --git a/src/knockapi/types/message_delivery_log.py b/src/knockapi/types/message_delivery_log.py index 49273a63..a27ceed3 100644 --- a/src/knockapi/types/message_delivery_log.py +++ b/src/knockapi/types/message_delivery_log.py @@ -11,6 +11,8 @@ class Request(BaseModel): + """A message delivery log request.""" + body: Union[str, Dict[str, object], None] = None """The body content that was sent with the request.""" @@ -31,6 +33,8 @@ class Request(BaseModel): class Response(BaseModel): + """A message delivery log response.""" + body: Union[str, Dict[str, object], None] = None """The body content that was received with the response.""" @@ -42,6 +46,10 @@ class Response(BaseModel): class MessageDeliveryLog(BaseModel): + """ + A message delivery log contains a `request` from Knock to a downstream provider and the `response` that was returned. + """ + id: str """The unique identifier for the message delivery log.""" diff --git a/src/knockapi/types/message_event.py b/src/knockapi/types/message_event.py index dba46e24..0bf16aa2 100644 --- a/src/knockapi/types/message_event.py +++ b/src/knockapi/types/message_event.py @@ -13,6 +13,11 @@ class MessageEvent(BaseModel): + """A message event. + + Occurs when a message [delivery or engagement status](/send-notifications/message-statuses) changes. + """ + id: str """The unique identifier for the message event.""" diff --git a/src/knockapi/types/message_get_content_response.py b/src/knockapi/types/message_get_content_response.py index c22339a4..8433cf0d 100644 --- a/src/knockapi/types/message_get_content_response.py +++ b/src/knockapi/types/message_get_content_response.py @@ -26,6 +26,8 @@ class DataMessageEmailContent(BaseModel): + """The content of an email message.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" @@ -55,6 +57,8 @@ class DataMessageEmailContent(BaseModel): class DataMessageSMSContent(BaseModel): + """The content of an SMS message.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" @@ -66,6 +70,8 @@ class DataMessageSMSContent(BaseModel): class DataMessagePushContent(BaseModel): + """Push channel data.""" + token: str """The device token to send the push notification to.""" @@ -83,6 +89,8 @@ class DataMessagePushContent(BaseModel): class DataMessageChatContentTemplateBlock(BaseModel): + """A block in a message in a chat.""" + content: str """The actual content of the block.""" @@ -94,6 +102,8 @@ class DataMessageChatContentTemplateBlock(BaseModel): class DataMessageChatContentTemplate(BaseModel): + """The template structure for the chat message.""" + blocks: Optional[List[DataMessageChatContentTemplateBlock]] = None """The blocks of the message in a chat.""" @@ -105,6 +115,8 @@ class DataMessageChatContentTemplate(BaseModel): class DataMessageChatContent(BaseModel): + """The content of a chat message.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" @@ -119,6 +131,8 @@ class DataMessageChatContent(BaseModel): class DataMessageInAppFeedContentBlockMessageInAppFeedContentBlock(BaseModel): + """A block in a message in an app feed.""" + content: str """The content of the block in a message in an app feed.""" @@ -133,6 +147,8 @@ class DataMessageInAppFeedContentBlockMessageInAppFeedContentBlock(BaseModel): class DataMessageInAppFeedContentBlockMessageInAppFeedButtonSetBlockButton(BaseModel): + """A button in an in app feed message.""" + action: str """The action to take when the button is clicked.""" @@ -144,6 +160,8 @@ class DataMessageInAppFeedContentBlockMessageInAppFeedButtonSetBlockButton(BaseM class DataMessageInAppFeedContentBlockMessageInAppFeedButtonSetBlock(BaseModel): + """A button set block in a message in an app feed.""" + buttons: List[DataMessageInAppFeedContentBlockMessageInAppFeedButtonSetBlockButton] """A list of buttons in an in app feed message.""" @@ -161,6 +179,8 @@ class DataMessageInAppFeedContentBlockMessageInAppFeedButtonSetBlock(BaseModel): class DataMessageInAppFeedContent(BaseModel): + """The content of an in-app feed message.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" @@ -178,6 +198,8 @@ class DataMessageInAppFeedContent(BaseModel): class MessageGetContentResponse(BaseModel): + """The content of a message.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" diff --git a/src/knockapi/types/message_list_params.py b/src/knockapi/types/message_list_params.py index f90a5d15..2b630a03 100644 --- a/src/knockapi/types/message_list_params.py +++ b/src/knockapi/types/message_list_params.py @@ -68,13 +68,13 @@ class MessageListParams(TypedDict, total=False): class InsertedAt(TypedDict, total=False): gt: str - """Limits the results to messages inserted after the given date.""" + """Limits the results to items inserted after the given date.""" gte: str - """Limits the results to messages inserted after or on the given date.""" + """Limits the results to items inserted after or on the given date.""" lt: str - """Limits the results to messages inserted before the given date.""" + """Limits the results to items inserted before the given date.""" lte: str - """Limits the results to messages inserted before or on the given date.""" + """Limits the results to items inserted before or on the given date.""" diff --git a/src/knockapi/types/messages/batch_get_content_response.py b/src/knockapi/types/messages/batch_get_content_response.py index 1205f7a9..b88ebc1a 100644 --- a/src/knockapi/types/messages/batch_get_content_response.py +++ b/src/knockapi/types/messages/batch_get_content_response.py @@ -27,6 +27,8 @@ class BatchGetContentResponseItemDataMessageEmailContent(BaseModel): + """The content of an email message.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" @@ -56,6 +58,8 @@ class BatchGetContentResponseItemDataMessageEmailContent(BaseModel): class BatchGetContentResponseItemDataMessageSMSContent(BaseModel): + """The content of an SMS message.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" @@ -67,6 +71,8 @@ class BatchGetContentResponseItemDataMessageSMSContent(BaseModel): class BatchGetContentResponseItemDataMessagePushContent(BaseModel): + """Push channel data.""" + token: str """The device token to send the push notification to.""" @@ -84,6 +90,8 @@ class BatchGetContentResponseItemDataMessagePushContent(BaseModel): class BatchGetContentResponseItemDataMessageChatContentTemplateBlock(BaseModel): + """A block in a message in a chat.""" + content: str """The actual content of the block.""" @@ -95,6 +103,8 @@ class BatchGetContentResponseItemDataMessageChatContentTemplateBlock(BaseModel): class BatchGetContentResponseItemDataMessageChatContentTemplate(BaseModel): + """The template structure for the chat message.""" + blocks: Optional[List[BatchGetContentResponseItemDataMessageChatContentTemplateBlock]] = None """The blocks of the message in a chat.""" @@ -106,6 +116,8 @@ class BatchGetContentResponseItemDataMessageChatContentTemplate(BaseModel): class BatchGetContentResponseItemDataMessageChatContent(BaseModel): + """The content of a chat message.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" @@ -120,6 +132,8 @@ class BatchGetContentResponseItemDataMessageChatContent(BaseModel): class BatchGetContentResponseItemDataMessageInAppFeedContentBlockMessageInAppFeedContentBlock(BaseModel): + """A block in a message in an app feed.""" + content: str """The content of the block in a message in an app feed.""" @@ -134,6 +148,8 @@ class BatchGetContentResponseItemDataMessageInAppFeedContentBlockMessageInAppFee class BatchGetContentResponseItemDataMessageInAppFeedContentBlockMessageInAppFeedButtonSetBlockButton(BaseModel): + """A button in an in app feed message.""" + action: str """The action to take when the button is clicked.""" @@ -145,6 +161,8 @@ class BatchGetContentResponseItemDataMessageInAppFeedContentBlockMessageInAppFee class BatchGetContentResponseItemDataMessageInAppFeedContentBlockMessageInAppFeedButtonSetBlock(BaseModel): + """A button set block in a message in an app feed.""" + buttons: List[BatchGetContentResponseItemDataMessageInAppFeedContentBlockMessageInAppFeedButtonSetBlockButton] """A list of buttons in an in app feed message.""" @@ -162,6 +180,8 @@ class BatchGetContentResponseItemDataMessageInAppFeedContentBlockMessageInAppFee class BatchGetContentResponseItemDataMessageInAppFeedContent(BaseModel): + """The content of an in-app feed message.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" @@ -179,6 +199,8 @@ class BatchGetContentResponseItemDataMessageInAppFeedContent(BaseModel): class BatchGetContentResponseItem(BaseModel): + """The content of a message.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" diff --git a/src/knockapi/types/object.py b/src/knockapi/types/object.py index 3d2ed638..8148f7a1 100644 --- a/src/knockapi/types/object.py +++ b/src/knockapi/types/object.py @@ -11,6 +11,8 @@ class Object(BaseModel): + """A custom [Object](/concepts/objects) entity which belongs to a collection.""" + id: str """Unique identifier for the object.""" diff --git a/src/knockapi/types/object_list_messages_params.py b/src/knockapi/types/object_list_messages_params.py index 29ad12ed..7e309251 100644 --- a/src/knockapi/types/object_list_messages_params.py +++ b/src/knockapi/types/object_list_messages_params.py @@ -68,13 +68,13 @@ class ObjectListMessagesParams(TypedDict, total=False): class InsertedAt(TypedDict, total=False): gt: str - """Limits the results to messages inserted after the given date.""" + """Limits the results to items inserted after the given date.""" gte: str - """Limits the results to messages inserted after or on the given date.""" + """Limits the results to items inserted after or on the given date.""" lt: str - """Limits the results to messages inserted before the given date.""" + """Limits the results to items inserted before the given date.""" lte: str - """Limits the results to messages inserted before or on the given date.""" + """Limits the results to items inserted before or on the given date.""" diff --git a/src/knockapi/types/object_list_subscriptions_params.py b/src/knockapi/types/object_list_subscriptions_params.py index f8a45fc3..ea79c1e5 100644 --- a/src/knockapi/types/object_list_subscriptions_params.py +++ b/src/knockapi/types/object_list_subscriptions_params.py @@ -39,6 +39,8 @@ class ObjectListSubscriptionsParams(TypedDict, total=False): class Object(TypedDict, total=False): + """A reference to a recipient object.""" + id: str """An identifier for the recipient object.""" diff --git a/src/knockapi/types/object_set_preferences_params.py b/src/knockapi/types/object_set_preferences_params.py index ce0037b7..7bfa77e5 100644 --- a/src/knockapi/types/object_set_preferences_params.py +++ b/src/knockapi/types/object_set_preferences_params.py @@ -59,6 +59,10 @@ class ObjectSetPreferencesParams(TypedDict, total=False): class CategoriesPreferenceSetWorkflowCategorySettingObject(TypedDict, total=False): + """ + The settings object for a workflow or category, where you can specify channel types or conditions. + """ + channel_types: Optional[PreferenceSetChannelTypesParam] """Channel type preferences.""" @@ -77,6 +81,10 @@ class CategoriesPreferenceSetWorkflowCategorySettingObject(TypedDict, total=Fals class WorkflowsPreferenceSetWorkflowCategorySettingObject(TypedDict, total=False): + """ + The settings object for a workflow or category, where you can specify channel types or conditions. + """ + channel_types: Optional[PreferenceSetChannelTypesParam] """Channel type preferences.""" diff --git a/src/knockapi/types/objects/bulk_add_subscriptions_params.py b/src/knockapi/types/objects/bulk_add_subscriptions_params.py index cb4584e5..9f137d7a 100644 --- a/src/knockapi/types/objects/bulk_add_subscriptions_params.py +++ b/src/knockapi/types/objects/bulk_add_subscriptions_params.py @@ -17,6 +17,8 @@ class BulkAddSubscriptionsParams(TypedDict, total=False): class Subscription(TypedDict, total=False): + """A list of subscriptions. 1 subscribed-to id, and N subscriber recipients.""" + id: Required[str] """Unique identifier for the object.""" diff --git a/src/knockapi/types/objects/bulk_delete_subscriptions_params.py b/src/knockapi/types/objects/bulk_delete_subscriptions_params.py index ab332141..08c4c54e 100644 --- a/src/knockapi/types/objects/bulk_delete_subscriptions_params.py +++ b/src/knockapi/types/objects/bulk_delete_subscriptions_params.py @@ -17,6 +17,8 @@ class BulkDeleteSubscriptionsParams(TypedDict, total=False): class Subscription(TypedDict, total=False): + """A list of subscriptions. 1 subscribed-to id, and N subscriber recipients.""" + id: Required[str] """Unique identifier for the object.""" diff --git a/src/knockapi/types/objects/bulk_set_params.py b/src/knockapi/types/objects/bulk_set_params.py index cebd5f86..27a8da0c 100644 --- a/src/knockapi/types/objects/bulk_set_params.py +++ b/src/knockapi/types/objects/bulk_set_params.py @@ -19,6 +19,8 @@ class BulkSetParams(TypedDict, total=False): class ObjectTyped(TypedDict, total=False): + """A custom [Object](/concepts/objects) entity which belongs to a collection.""" + id: Required[str] """Unique identifier for the object.""" diff --git a/src/knockapi/types/providers/ms_team_check_auth_response.py b/src/knockapi/types/providers/ms_team_check_auth_response.py index 154fde3e..c1d5e904 100644 --- a/src/knockapi/types/providers/ms_team_check_auth_response.py +++ b/src/knockapi/types/providers/ms_team_check_auth_response.py @@ -8,6 +8,8 @@ class Connection(BaseModel): + """A Microsoft Teams connection object.""" + ok: bool """Whether the Microsoft Teams connection is valid.""" @@ -16,5 +18,7 @@ class Connection(BaseModel): class MsTeamCheckAuthResponse(BaseModel): + """The response from a Microsoft Teams auth check request.""" + connection: Connection """A Microsoft Teams connection object.""" diff --git a/src/knockapi/types/providers/ms_team_list_channels_response.py b/src/knockapi/types/providers/ms_team_list_channels_response.py index 5d4ad75c..c7d74518 100644 --- a/src/knockapi/types/providers/ms_team_list_channels_response.py +++ b/src/knockapi/types/providers/ms_team_list_channels_response.py @@ -30,5 +30,9 @@ class MsTeamsChannel(BaseModel): class MsTeamListChannelsResponse(BaseModel): + """ + The response from a Microsoft Teams provider request, containing a list of channels. + """ + ms_teams_channels: List[MsTeamsChannel] """List of Microsoft Teams channels.""" diff --git a/src/knockapi/types/providers/ms_team_revoke_access_response.py b/src/knockapi/types/providers/ms_team_revoke_access_response.py index c9c8a1bb..9281e789 100644 --- a/src/knockapi/types/providers/ms_team_revoke_access_response.py +++ b/src/knockapi/types/providers/ms_team_revoke_access_response.py @@ -8,5 +8,7 @@ class MsTeamRevokeAccessResponse(BaseModel): + """A response indicating the operation was successful.""" + ok: Optional[str] = None """OK response.""" diff --git a/src/knockapi/types/providers/slack_check_auth_response.py b/src/knockapi/types/providers/slack_check_auth_response.py index 13b705c8..2d07ca15 100644 --- a/src/knockapi/types/providers/slack_check_auth_response.py +++ b/src/knockapi/types/providers/slack_check_auth_response.py @@ -8,6 +8,8 @@ class Connection(BaseModel): + """A Slack connection object.""" + ok: bool """Whether the Slack connection is valid.""" @@ -16,5 +18,7 @@ class Connection(BaseModel): class SlackCheckAuthResponse(BaseModel): + """The response from a Slack auth check request.""" + connection: Connection """A Slack connection object.""" diff --git a/src/knockapi/types/providers/slack_list_channels_response.py b/src/knockapi/types/providers/slack_list_channels_response.py index 35376d2f..5d374b50 100644 --- a/src/knockapi/types/providers/slack_list_channels_response.py +++ b/src/knockapi/types/providers/slack_list_channels_response.py @@ -6,6 +6,8 @@ class SlackListChannelsResponse(BaseModel): + """A Slack channel.""" + id: str """A Slack channel ID from the Slack provider.""" diff --git a/src/knockapi/types/providers/slack_revoke_access_response.py b/src/knockapi/types/providers/slack_revoke_access_response.py index 613697bf..ad0479d3 100644 --- a/src/knockapi/types/providers/slack_revoke_access_response.py +++ b/src/knockapi/types/providers/slack_revoke_access_response.py @@ -8,5 +8,7 @@ class SlackRevokeAccessResponse(BaseModel): + """A response indicating the operation was successful.""" + ok: Optional[str] = None """OK response.""" diff --git a/src/knockapi/types/recipient_reference.py b/src/knockapi/types/recipient_reference.py index 1a85c860..fd4d4c89 100644 --- a/src/knockapi/types/recipient_reference.py +++ b/src/knockapi/types/recipient_reference.py @@ -9,6 +9,8 @@ class ObjectReference(BaseModel): + """A reference to a recipient object.""" + id: Optional[str] = None """An identifier for the recipient object.""" diff --git a/src/knockapi/types/recipient_reference_param.py b/src/knockapi/types/recipient_reference_param.py index ba1e3aeb..dec0f9e4 100644 --- a/src/knockapi/types/recipient_reference_param.py +++ b/src/knockapi/types/recipient_reference_param.py @@ -9,6 +9,8 @@ class ObjectReference(TypedDict, total=False): + """A reference to a recipient object.""" + id: str """An identifier for the recipient object.""" diff --git a/src/knockapi/types/recipients/aws_sns_push_channel_data_devices_only_param.py b/src/knockapi/types/recipients/aws_sns_push_channel_data_devices_only_param.py index cdeb8039..14eb418a 100644 --- a/src/knockapi/types/recipients/aws_sns_push_channel_data_devices_only_param.py +++ b/src/knockapi/types/recipients/aws_sns_push_channel_data_devices_only_param.py @@ -33,6 +33,8 @@ class Device(TypedDict, total=False): class AwsSnsPushChannelDataDevicesOnlyParam(TypedDict, total=False): + """AWS SNS push channel data.""" + devices: Required[Iterable[Device]] """A list of devices. diff --git a/src/knockapi/types/recipients/aws_sns_push_channel_data_target_arns_only_param.py b/src/knockapi/types/recipients/aws_sns_push_channel_data_target_arns_only_param.py index 53f91727..7a34dd2e 100644 --- a/src/knockapi/types/recipients/aws_sns_push_channel_data_target_arns_only_param.py +++ b/src/knockapi/types/recipients/aws_sns_push_channel_data_target_arns_only_param.py @@ -10,6 +10,8 @@ class AwsSnsPushChannelDataTargetArnsOnlyParam(TypedDict, total=False): + """AWS SNS push channel data.""" + target_arns: Required[SequenceNotStr[str]] """A list of platform endpoint ARNs. diff --git a/src/knockapi/types/recipients/channel_data.py b/src/knockapi/types/recipients/channel_data.py index b9b9a372..6bf83986 100644 --- a/src/knockapi/types/recipients/channel_data.py +++ b/src/knockapi/types/recipients/channel_data.py @@ -42,6 +42,8 @@ class DataPushChannelDataFullDevice(BaseModel): class DataPushChannelDataFull(BaseModel): + """Push channel data.""" + devices: List[DataPushChannelDataFullDevice] """A list of devices. @@ -77,6 +79,8 @@ class DataAwssnsPushChannelDataFullDevice(BaseModel): class DataAwssnsPushChannelDataFull(BaseModel): + """AWS SNS push channel data.""" + devices: List[DataAwssnsPushChannelDataFullDevice] """A list of devices. @@ -102,6 +106,8 @@ class DataAwssnsPushChannelDataFull(BaseModel): class ChannelData(BaseModel): + """Channel data for a given channel type.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" diff --git a/src/knockapi/types/recipients/discord_channel_data.py b/src/knockapi/types/recipients/discord_channel_data.py index 0425a8fe..cc00dfc7 100644 --- a/src/knockapi/types/recipients/discord_channel_data.py +++ b/src/knockapi/types/recipients/discord_channel_data.py @@ -15,16 +15,22 @@ class ConnectionDiscordChannelConnection(BaseModel): + """Discord channel connection.""" + channel_id: str """Discord channel ID.""" class ConnectionDiscordIncomingWebhookConnectionIncomingWebhook(BaseModel): + """Discord incoming webhook object.""" + url: str """Incoming webhook URL.""" class ConnectionDiscordIncomingWebhookConnection(BaseModel): + """Discord incoming webhook connection.""" + incoming_webhook: ConnectionDiscordIncomingWebhookConnectionIncomingWebhook """Discord incoming webhook object.""" @@ -33,5 +39,7 @@ class ConnectionDiscordIncomingWebhookConnection(BaseModel): class DiscordChannelData(BaseModel): + """Discord channel data.""" + connections: List[Connection] """List of Discord channel connections.""" diff --git a/src/knockapi/types/recipients/discord_channel_data_param.py b/src/knockapi/types/recipients/discord_channel_data_param.py index f621934b..f4664a85 100644 --- a/src/knockapi/types/recipients/discord_channel_data_param.py +++ b/src/knockapi/types/recipients/discord_channel_data_param.py @@ -15,16 +15,22 @@ class ConnectionDiscordChannelConnection(TypedDict, total=False): + """Discord channel connection.""" + channel_id: Required[str] """Discord channel ID.""" class ConnectionDiscordIncomingWebhookConnectionIncomingWebhook(TypedDict, total=False): + """Discord incoming webhook object.""" + url: Required[str] """Incoming webhook URL.""" class ConnectionDiscordIncomingWebhookConnection(TypedDict, total=False): + """Discord incoming webhook connection.""" + incoming_webhook: Required[ConnectionDiscordIncomingWebhookConnectionIncomingWebhook] """Discord incoming webhook object.""" @@ -33,5 +39,7 @@ class ConnectionDiscordIncomingWebhookConnection(TypedDict, total=False): class DiscordChannelDataParam(TypedDict, total=False): + """Discord channel data.""" + connections: Required[Iterable[Connection]] """List of Discord channel connections.""" diff --git a/src/knockapi/types/recipients/ms_teams_channel_data.py b/src/knockapi/types/recipients/ms_teams_channel_data.py index 8b259e19..fab64a0a 100644 --- a/src/knockapi/types/recipients/ms_teams_channel_data.py +++ b/src/knockapi/types/recipients/ms_teams_channel_data.py @@ -15,6 +15,8 @@ class ConnectionMsTeamsTokenConnection(BaseModel): + """Microsoft Teams token connection.""" + ms_teams_channel_id: Optional[str] = None """Microsoft Teams channel ID.""" @@ -29,11 +31,15 @@ class ConnectionMsTeamsTokenConnection(BaseModel): class ConnectionMsTeamsIncomingWebhookConnectionIncomingWebhook(BaseModel): + """Microsoft Teams incoming webhook.""" + url: str """Microsoft Teams incoming webhook URL.""" class ConnectionMsTeamsIncomingWebhookConnection(BaseModel): + """Microsoft Teams incoming webhook connection.""" + incoming_webhook: ConnectionMsTeamsIncomingWebhookConnectionIncomingWebhook """Microsoft Teams incoming webhook.""" @@ -42,6 +48,8 @@ class ConnectionMsTeamsIncomingWebhookConnection(BaseModel): class MsTeamsChannelData(BaseModel): + """Microsoft Teams channel data.""" + connections: List[Connection] """List of Microsoft Teams connections.""" diff --git a/src/knockapi/types/recipients/ms_teams_channel_data_param.py b/src/knockapi/types/recipients/ms_teams_channel_data_param.py index 6627b69d..4648a574 100644 --- a/src/knockapi/types/recipients/ms_teams_channel_data_param.py +++ b/src/knockapi/types/recipients/ms_teams_channel_data_param.py @@ -15,6 +15,8 @@ class ConnectionMsTeamsTokenConnection(TypedDict, total=False): + """Microsoft Teams token connection.""" + ms_teams_channel_id: Optional[str] """Microsoft Teams channel ID.""" @@ -29,11 +31,15 @@ class ConnectionMsTeamsTokenConnection(TypedDict, total=False): class ConnectionMsTeamsIncomingWebhookConnectionIncomingWebhook(TypedDict, total=False): + """Microsoft Teams incoming webhook.""" + url: Required[str] """Microsoft Teams incoming webhook URL.""" class ConnectionMsTeamsIncomingWebhookConnection(TypedDict, total=False): + """Microsoft Teams incoming webhook connection.""" + incoming_webhook: Required[ConnectionMsTeamsIncomingWebhookConnectionIncomingWebhook] """Microsoft Teams incoming webhook.""" @@ -42,6 +48,8 @@ class ConnectionMsTeamsIncomingWebhookConnection(TypedDict, total=False): class MsTeamsChannelDataParam(TypedDict, total=False): + """Microsoft Teams channel data.""" + connections: Required[Iterable[Connection]] """List of Microsoft Teams connections.""" diff --git a/src/knockapi/types/recipients/one_signal_channel_data_player_ids_only.py b/src/knockapi/types/recipients/one_signal_channel_data_player_ids_only.py index e683ff42..f0ba659c 100644 --- a/src/knockapi/types/recipients/one_signal_channel_data_player_ids_only.py +++ b/src/knockapi/types/recipients/one_signal_channel_data_player_ids_only.py @@ -8,5 +8,7 @@ class OneSignalChannelDataPlayerIDsOnly(BaseModel): + """OneSignal channel data.""" + player_ids: List[str] """A list of OneSignal player IDs.""" diff --git a/src/knockapi/types/recipients/one_signal_channel_data_player_ids_only_param.py b/src/knockapi/types/recipients/one_signal_channel_data_player_ids_only_param.py index bcc1bfd7..80791e93 100644 --- a/src/knockapi/types/recipients/one_signal_channel_data_player_ids_only_param.py +++ b/src/knockapi/types/recipients/one_signal_channel_data_player_ids_only_param.py @@ -10,5 +10,7 @@ class OneSignalChannelDataPlayerIDsOnlyParam(TypedDict, total=False): + """OneSignal channel data.""" + player_ids: Required[SequenceNotStr[str]] """A list of OneSignal player IDs.""" diff --git a/src/knockapi/types/recipients/preference_set.py b/src/knockapi/types/recipients/preference_set.py index b6905794..ac8b56a8 100644 --- a/src/knockapi/types/recipients/preference_set.py +++ b/src/knockapi/types/recipients/preference_set.py @@ -23,6 +23,10 @@ class CategoriesPreferenceSetWorkflowCategorySettingObject(BaseModel): + """ + The settings object for a workflow or category, where you can specify channel types or conditions. + """ + channel_types: Optional[PreferenceSetChannelTypes] = None """Channel type preferences.""" @@ -41,6 +45,10 @@ class CategoriesPreferenceSetWorkflowCategorySettingObject(BaseModel): class WorkflowsPreferenceSetWorkflowCategorySettingObject(BaseModel): + """ + The settings object for a workflow or category, where you can specify channel types or conditions. + """ + channel_types: Optional[PreferenceSetChannelTypes] = None """Channel type preferences.""" @@ -55,6 +63,10 @@ class WorkflowsPreferenceSetWorkflowCategorySettingObject(BaseModel): class PreferenceSet(BaseModel): + """ + A preference set represents a specific set of notification preferences for a recipient. A recipient can have multiple preference sets. + """ + id: str """Unique identifier for the preference set.""" diff --git a/src/knockapi/types/recipients/preference_set_channel_setting.py b/src/knockapi/types/recipients/preference_set_channel_setting.py index 33388b76..244e32b6 100644 --- a/src/knockapi/types/recipients/preference_set_channel_setting.py +++ b/src/knockapi/types/recipients/preference_set_channel_setting.py @@ -9,5 +9,10 @@ class PreferenceSetChannelSetting(BaseModel): + """A set of settings for a specific channel. + + Currently, this can only be a list of conditions to apply. + """ + conditions: List[Condition] """A list of conditions to apply to a specific channel.""" diff --git a/src/knockapi/types/recipients/preference_set_channel_setting_param.py b/src/knockapi/types/recipients/preference_set_channel_setting_param.py index 660d7014..6caa7a43 100644 --- a/src/knockapi/types/recipients/preference_set_channel_setting_param.py +++ b/src/knockapi/types/recipients/preference_set_channel_setting_param.py @@ -11,5 +11,10 @@ class PreferenceSetChannelSettingParam(TypedDict, total=False): + """A set of settings for a specific channel. + + Currently, this can only be a list of conditions to apply. + """ + conditions: Required[Iterable[Condition]] """A list of conditions to apply to a specific channel.""" diff --git a/src/knockapi/types/recipients/preference_set_channel_type_setting.py b/src/knockapi/types/recipients/preference_set_channel_type_setting.py index 4b744643..0b2115b5 100644 --- a/src/knockapi/types/recipients/preference_set_channel_type_setting.py +++ b/src/knockapi/types/recipients/preference_set_channel_type_setting.py @@ -9,5 +9,10 @@ class PreferenceSetChannelTypeSetting(BaseModel): + """A set of settings for a channel type. + + Currently, this can only be a list of conditions to apply. + """ + conditions: List[Condition] """A list of conditions to apply to a channel type.""" diff --git a/src/knockapi/types/recipients/preference_set_channel_type_setting_param.py b/src/knockapi/types/recipients/preference_set_channel_type_setting_param.py index a0588128..d9a09452 100644 --- a/src/knockapi/types/recipients/preference_set_channel_type_setting_param.py +++ b/src/knockapi/types/recipients/preference_set_channel_type_setting_param.py @@ -11,5 +11,10 @@ class PreferenceSetChannelTypeSettingParam(TypedDict, total=False): + """A set of settings for a channel type. + + Currently, this can only be a list of conditions to apply. + """ + conditions: Required[Iterable[Condition]] """A list of conditions to apply to a channel type.""" diff --git a/src/knockapi/types/recipients/preference_set_channel_types.py b/src/knockapi/types/recipients/preference_set_channel_types.py index d0d9543f..86fde8f1 100644 --- a/src/knockapi/types/recipients/preference_set_channel_types.py +++ b/src/knockapi/types/recipients/preference_set_channel_types.py @@ -22,6 +22,8 @@ class PreferenceSetChannelTypes(BaseModel): + """Channel type preferences.""" + chat: Optional[Chat] = None """Whether the channel type is enabled for the preference set.""" diff --git a/src/knockapi/types/recipients/preference_set_channel_types_param.py b/src/knockapi/types/recipients/preference_set_channel_types_param.py index f9c48f5c..8877db6d 100644 --- a/src/knockapi/types/recipients/preference_set_channel_types_param.py +++ b/src/knockapi/types/recipients/preference_set_channel_types_param.py @@ -23,6 +23,8 @@ class PreferenceSetChannelTypesParam(TypedDict, total=False): + """Channel type preferences.""" + chat: Chat """Whether the channel type is enabled for the preference set.""" diff --git a/src/knockapi/types/recipients/preference_set_request_param.py b/src/knockapi/types/recipients/preference_set_request_param.py index 268d264b..d84aa20e 100644 --- a/src/knockapi/types/recipients/preference_set_request_param.py +++ b/src/knockapi/types/recipients/preference_set_request_param.py @@ -25,6 +25,10 @@ class CategoriesPreferenceSetWorkflowCategorySettingObject(TypedDict, total=False): + """ + The settings object for a workflow or category, where you can specify channel types or conditions. + """ + channel_types: Optional[PreferenceSetChannelTypesParam] """Channel type preferences.""" @@ -43,6 +47,10 @@ class CategoriesPreferenceSetWorkflowCategorySettingObject(TypedDict, total=Fals class WorkflowsPreferenceSetWorkflowCategorySettingObject(TypedDict, total=False): + """ + The settings object for a workflow or category, where you can specify channel types or conditions. + """ + channel_types: Optional[PreferenceSetChannelTypesParam] """Channel type preferences.""" @@ -57,6 +65,8 @@ class WorkflowsPreferenceSetWorkflowCategorySettingObject(TypedDict, total=False class PreferenceSetRequestParam(TypedDict, total=False): + """A request to set a preference set for a recipient.""" + _persistence_strategy: Annotated[Literal["merge", "replace"], PropertyInfo(alias="__persistence_strategy__")] """Controls how the preference set is persisted. diff --git a/src/knockapi/types/recipients/push_channel_data_devices_only_param.py b/src/knockapi/types/recipients/push_channel_data_devices_only_param.py index f183ff65..33f79217 100644 --- a/src/knockapi/types/recipients/push_channel_data_devices_only_param.py +++ b/src/knockapi/types/recipients/push_channel_data_devices_only_param.py @@ -29,6 +29,8 @@ class Device(TypedDict, total=False): class PushChannelDataDevicesOnlyParam(TypedDict, total=False): + """Push channel data.""" + devices: Required[Iterable[Device]] """A list of devices. diff --git a/src/knockapi/types/recipients/push_channel_data_tokens_only_param.py b/src/knockapi/types/recipients/push_channel_data_tokens_only_param.py index 77960f1b..e7d2aad8 100644 --- a/src/knockapi/types/recipients/push_channel_data_tokens_only_param.py +++ b/src/knockapi/types/recipients/push_channel_data_tokens_only_param.py @@ -10,5 +10,7 @@ class PushChannelDataTokensOnlyParam(TypedDict, total=False): + """Push channel data.""" + tokens: Required[SequenceNotStr[str]] """A list of push channel tokens.""" diff --git a/src/knockapi/types/recipients/slack_channel_data.py b/src/knockapi/types/recipients/slack_channel_data.py index 58558724..261631d5 100644 --- a/src/knockapi/types/recipients/slack_channel_data.py +++ b/src/knockapi/types/recipients/slack_channel_data.py @@ -15,6 +15,8 @@ class ConnectionSlackTokenConnection(BaseModel): + """A Slack connection token.""" + access_token: Optional[str] = None """A Slack access token.""" @@ -26,6 +28,8 @@ class ConnectionSlackTokenConnection(BaseModel): class ConnectionSlackIncomingWebhookConnection(BaseModel): + """A Slack connection incoming webhook.""" + url: str """The URL of the incoming webhook for a Slack connection.""" @@ -34,11 +38,15 @@ class ConnectionSlackIncomingWebhookConnection(BaseModel): class Token(BaseModel): + """A Slack connection token.""" + access_token: Optional[str] = None """A Slack access token.""" class SlackChannelData(BaseModel): + """Slack channel data.""" + connections: List[Connection] """List of Slack channel connections.""" diff --git a/src/knockapi/types/recipients/slack_channel_data_param.py b/src/knockapi/types/recipients/slack_channel_data_param.py index 3943fa6a..0100c10f 100644 --- a/src/knockapi/types/recipients/slack_channel_data_param.py +++ b/src/knockapi/types/recipients/slack_channel_data_param.py @@ -15,6 +15,8 @@ class ConnectionSlackTokenConnection(TypedDict, total=False): + """A Slack connection token.""" + access_token: Optional[str] """A Slack access token.""" @@ -26,6 +28,8 @@ class ConnectionSlackTokenConnection(TypedDict, total=False): class ConnectionSlackIncomingWebhookConnection(TypedDict, total=False): + """A Slack connection incoming webhook.""" + url: Required[str] """The URL of the incoming webhook for a Slack connection.""" @@ -34,11 +38,15 @@ class ConnectionSlackIncomingWebhookConnection(TypedDict, total=False): class Token(TypedDict, total=False): + """A Slack connection token.""" + access_token: Required[Optional[str]] """A Slack access token.""" class SlackChannelDataParam(TypedDict, total=False): + """Slack channel data.""" + connections: Required[Iterable[Connection]] """List of Slack channel connections.""" diff --git a/src/knockapi/types/recipients/subscription.py b/src/knockapi/types/recipients/subscription.py index ff47ce98..c4d86627 100644 --- a/src/knockapi/types/recipients/subscription.py +++ b/src/knockapi/types/recipients/subscription.py @@ -14,6 +14,8 @@ class Subscription(BaseModel): + """A subscription object.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" diff --git a/src/knockapi/types/schedule.py b/src/knockapi/types/schedule.py index 56fd93ef..5499496f 100644 --- a/src/knockapi/types/schedule.py +++ b/src/knockapi/types/schedule.py @@ -13,6 +13,8 @@ class Schedule(BaseModel): + """A schedule represents a recurring workflow execution.""" + id: str """Unique identifier for the schedule.""" diff --git a/src/knockapi/types/schedule_repeat_rule.py b/src/knockapi/types/schedule_repeat_rule.py index cec89c83..e778297e 100644 --- a/src/knockapi/types/schedule_repeat_rule.py +++ b/src/knockapi/types/schedule_repeat_rule.py @@ -11,6 +11,8 @@ class ScheduleRepeatRule(BaseModel): + """The repeat rule for the schedule.""" + frequency: Literal["daily", "weekly", "monthly", "hourly"] """The frequency of the schedule.""" diff --git a/src/knockapi/types/schedule_repeat_rule_param.py b/src/knockapi/types/schedule_repeat_rule_param.py index 08133eec..0c527b7b 100644 --- a/src/knockapi/types/schedule_repeat_rule_param.py +++ b/src/knockapi/types/schedule_repeat_rule_param.py @@ -11,6 +11,8 @@ class ScheduleRepeatRuleParam(TypedDict, total=False): + """The repeat rule for the schedule.""" + frequency: Required[Literal["daily", "weekly", "monthly", "hourly"]] """The frequency of the schedule.""" diff --git a/src/knockapi/types/schedules/bulk_create_params.py b/src/knockapi/types/schedules/bulk_create_params.py index 6b59e5ce..f09b60e1 100644 --- a/src/knockapi/types/schedules/bulk_create_params.py +++ b/src/knockapi/types/schedules/bulk_create_params.py @@ -20,6 +20,8 @@ class BulkCreateParams(TypedDict, total=False): class Schedule(TypedDict, total=False): + """A schedule represents a recurring workflow execution.""" + workflow: Required[str] """The key of the workflow.""" diff --git a/src/knockapi/types/shared/condition.py b/src/knockapi/types/shared/condition.py index 0b57d1c6..645b851e 100644 --- a/src/knockapi/types/shared/condition.py +++ b/src/knockapi/types/shared/condition.py @@ -9,6 +9,8 @@ class Condition(BaseModel): + """A condition to be evaluated.""" + argument: Optional[str] = None """The argument value to compare against in the condition.""" @@ -23,11 +25,15 @@ class Condition(BaseModel): "not_contains", "empty", "not_empty", + "exists", + "not_exists", "contains_all", "is_timestamp", "is_not_timestamp", - "is_timestamp_after", + "is_timestamp_on_or_after", "is_timestamp_before", + "is_timestamp_on_or_after_date", + "is_timestamp_before_date", "is_timestamp_between", "is_audience_member", "is_not_audience_member", diff --git a/src/knockapi/types/shared/page_info.py b/src/knockapi/types/shared/page_info.py index c211dbd5..e0b49f36 100644 --- a/src/knockapi/types/shared/page_info.py +++ b/src/knockapi/types/shared/page_info.py @@ -10,6 +10,8 @@ class PageInfo(BaseModel): + """Pagination information for a list of resources.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" diff --git a/src/knockapi/types/shared_params/condition.py b/src/knockapi/types/shared_params/condition.py index 1cbb66ca..c7ef5fa7 100644 --- a/src/knockapi/types/shared_params/condition.py +++ b/src/knockapi/types/shared_params/condition.py @@ -9,6 +9,8 @@ class Condition(TypedDict, total=False): + """A condition to be evaluated.""" + argument: Required[Optional[str]] """The argument value to compare against in the condition.""" @@ -24,11 +26,15 @@ class Condition(TypedDict, total=False): "not_contains", "empty", "not_empty", + "exists", + "not_exists", "contains_all", "is_timestamp", "is_not_timestamp", - "is_timestamp_after", + "is_timestamp_on_or_after", "is_timestamp_before", + "is_timestamp_on_or_after_date", + "is_timestamp_before_date", "is_timestamp_between", "is_audience_member", "is_not_audience_member", diff --git a/src/knockapi/types/tenant.py b/src/knockapi/types/tenant.py index 52703834..d9fd2c21 100644 --- a/src/knockapi/types/tenant.py +++ b/src/knockapi/types/tenant.py @@ -11,6 +11,8 @@ class SettingsBranding(BaseModel): + """The branding for the tenant.""" + icon_url: Optional[str] = None """The icon URL for the tenant. @@ -31,6 +33,8 @@ class SettingsBranding(BaseModel): class Settings(BaseModel): + """The settings for the tenant. Includes branding and preference set.""" + branding: Optional[SettingsBranding] = None """The branding for the tenant.""" @@ -42,6 +46,8 @@ class Settings(BaseModel): class Tenant(BaseModel): + """A tenant entity.""" + id: str """The unique identifier for the tenant.""" diff --git a/src/knockapi/types/tenant_request_param.py b/src/knockapi/types/tenant_request_param.py index a9c7fb28..0949e576 100644 --- a/src/knockapi/types/tenant_request_param.py +++ b/src/knockapi/types/tenant_request_param.py @@ -13,6 +13,8 @@ class SettingsBranding(TypedDict, total=False): + """The branding for the tenant.""" + icon_url: Optional[str] """The icon URL for the tenant. @@ -33,6 +35,8 @@ class SettingsBranding(TypedDict, total=False): class Settings(TypedDict, total=False): + """The settings for the tenant. Includes branding and preference set.""" + branding: SettingsBranding """The branding for the tenant.""" @@ -41,6 +45,11 @@ class Settings(TypedDict, total=False): class TenantRequestParamTyped(TypedDict, total=False): + """A tenant to be set in the system. + + You can supply any additional properties on the tenant object. + """ + id: Required[str] """The unique identifier for the tenant.""" diff --git a/src/knockapi/types/tenant_set_params.py b/src/knockapi/types/tenant_set_params.py index 760794d8..9f694949 100644 --- a/src/knockapi/types/tenant_set_params.py +++ b/src/knockapi/types/tenant_set_params.py @@ -30,6 +30,8 @@ class TenantSetParams(TypedDict, total=False): class SettingsBranding(TypedDict, total=False): + """The branding for the tenant.""" + icon_url: Optional[str] """The icon URL for the tenant. @@ -50,6 +52,8 @@ class SettingsBranding(TypedDict, total=False): class Settings(TypedDict, total=False): + """The settings for the tenant. Includes branding and preference set.""" + branding: SettingsBranding """The branding for the tenant.""" diff --git a/src/knockapi/types/user.py b/src/knockapi/types/user.py index c8416766..11cf87c2 100644 --- a/src/knockapi/types/user.py +++ b/src/knockapi/types/user.py @@ -11,6 +11,10 @@ class User(BaseModel): + """ + A [User](/concepts/users) represents an individual in your system who can receive notifications through Knock. Users are the most common recipients of notifications and are always referenced by your internal identifier. + """ + id: str """The unique identifier of the user.""" diff --git a/src/knockapi/types/user_list_messages_params.py b/src/knockapi/types/user_list_messages_params.py index 2b2e2ee9..b1c4f399 100644 --- a/src/knockapi/types/user_list_messages_params.py +++ b/src/knockapi/types/user_list_messages_params.py @@ -68,13 +68,13 @@ class UserListMessagesParams(TypedDict, total=False): class InsertedAt(TypedDict, total=False): gt: str - """Limits the results to messages inserted after the given date.""" + """Limits the results to items inserted after the given date.""" gte: str - """Limits the results to messages inserted after or on the given date.""" + """Limits the results to items inserted after or on the given date.""" lt: str - """Limits the results to messages inserted before the given date.""" + """Limits the results to items inserted before the given date.""" lte: str - """Limits the results to messages inserted before or on the given date.""" + """Limits the results to items inserted before or on the given date.""" diff --git a/src/knockapi/types/user_set_preferences_params.py b/src/knockapi/types/user_set_preferences_params.py index 511b8a17..9ded001d 100644 --- a/src/knockapi/types/user_set_preferences_params.py +++ b/src/knockapi/types/user_set_preferences_params.py @@ -59,6 +59,10 @@ class UserSetPreferencesParams(TypedDict, total=False): class CategoriesPreferenceSetWorkflowCategorySettingObject(TypedDict, total=False): + """ + The settings object for a workflow or category, where you can specify channel types or conditions. + """ + channel_types: Optional[PreferenceSetChannelTypesParam] """Channel type preferences.""" @@ -77,6 +81,10 @@ class CategoriesPreferenceSetWorkflowCategorySettingObject(TypedDict, total=Fals class WorkflowsPreferenceSetWorkflowCategorySettingObject(TypedDict, total=False): + """ + The settings object for a workflow or category, where you can specify channel types or conditions. + """ + channel_types: Optional[PreferenceSetChannelTypesParam] """Channel type preferences.""" diff --git a/src/knockapi/types/users/feed_get_settings_response.py b/src/knockapi/types/users/feed_get_settings_response.py index bcc30f1d..c0798f22 100644 --- a/src/knockapi/types/users/feed_get_settings_response.py +++ b/src/knockapi/types/users/feed_get_settings_response.py @@ -6,10 +6,14 @@ class Features(BaseModel): + """Features configuration for the user's feed.""" + branding_required: bool """Whether branding is required for the user's feed.""" class FeedGetSettingsResponse(BaseModel): + """The response for the user's feed settings.""" + features: Features """Features configuration for the user's feed.""" diff --git a/src/knockapi/types/users/feed_list_items_params.py b/src/knockapi/types/users/feed_list_items_params.py index a6c61d7b..a62e5323 100644 --- a/src/knockapi/types/users/feed_list_items_params.py +++ b/src/knockapi/types/users/feed_list_items_params.py @@ -6,7 +6,7 @@ from ..._types import SequenceNotStr -__all__ = ["FeedListItemsParams"] +__all__ = ["FeedListItemsParams", "InsertedAt"] class FeedListItemsParams(TypedDict, total=False): @@ -19,9 +19,18 @@ class FeedListItemsParams(TypedDict, total=False): before: str """The cursor to fetch entries before.""" + exclude: str + """Comma-separated list of field paths to exclude from the response. + + Use dot notation for nested fields (e.g., `entries.archived_at`). Limited to 3 + levels deep. + """ + has_tenant: bool """Whether the feed items have a tenant.""" + inserted_at: InsertedAt + locale: str """The locale to render the feed items in. @@ -30,6 +39,15 @@ class FeedListItemsParams(TypedDict, total=False): enterprise plan customers using custom translations. """ + mode: Literal["compact", "rich"] + """The mode to render the feed items in. + + Can be `compact` or `rich`. Defaults to `rich`. When `mode` is `compact`, feed + items will not have `activities` and `total_activities` fields; the `data` field + will not include nested arrays and objects; and the `actors` field will only + have up to one actor. + """ + page_size: int """The number of items per page (defaults to 50).""" @@ -47,3 +65,17 @@ class FeedListItemsParams(TypedDict, total=False): workflow_categories: SequenceNotStr[str] """The workflow categories of the feed items.""" + + +class InsertedAt(TypedDict, total=False): + gt: str + """Limits the results to items inserted after the given date.""" + + gte: str + """Limits the results to items inserted after or on the given date.""" + + lt: str + """Limits the results to items inserted before the given date.""" + + lte: str + """Limits the results to items inserted before or on the given date.""" diff --git a/src/knockapi/types/users/feed_list_items_response.py b/src/knockapi/types/users/feed_list_items_response.py index bb577199..eb461580 100644 --- a/src/knockapi/types/users/feed_list_items_response.py +++ b/src/knockapi/types/users/feed_list_items_response.py @@ -20,6 +20,8 @@ class BlockMessageInAppFeedContentBlock(BaseModel): + """A block in a message in an app feed.""" + content: str """The content of the block in a message in an app feed.""" @@ -34,6 +36,8 @@ class BlockMessageInAppFeedContentBlock(BaseModel): class BlockMessageInAppFeedButtonSetBlockButton(BaseModel): + """A button in an in app feed message.""" + action: str """The action to take when the button is clicked.""" @@ -45,6 +49,8 @@ class BlockMessageInAppFeedButtonSetBlockButton(BaseModel): class BlockMessageInAppFeedButtonSetBlock(BaseModel): + """A button set block in a message in an app feed.""" + buttons: List[BlockMessageInAppFeedButtonSetBlockButton] """A list of buttons in an in app feed message.""" @@ -59,6 +65,8 @@ class BlockMessageInAppFeedButtonSetBlock(BaseModel): class Source(BaseModel): + """Source information for the feed item.""" + api_typename: str = FieldInfo(alias="__typename") """The typename of the schema.""" @@ -73,6 +81,8 @@ class Source(BaseModel): class FeedListItemsResponse(BaseModel): + """An in-app feed message in a user's feed.""" + id: str """Unique identifier for the feed.""" diff --git a/src/knockapi/types/users/guide_get_channel_response.py b/src/knockapi/types/users/guide_get_channel_response.py index 7cdb2960..ef9efb13 100644 --- a/src/knockapi/types/users/guide_get_channel_response.py +++ b/src/knockapi/types/users/guide_get_channel_response.py @@ -2,6 +2,7 @@ from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -15,6 +16,7 @@ "EntryStep", "EntryStepMessage", "GuideGroup", + "IneligibleGuide", ] @@ -25,13 +27,16 @@ class EntryActivationURLPattern(BaseModel): pathname: Optional[str] = None """The pathname pattern to match (supports wildcards like /\\**)""" + search: Optional[str] = None + """The search query params to match""" + class EntryActivationURLRule(BaseModel): argument: Optional[str] = None """The value to compare against""" directive: Optional[str] = None - """The directive for the URL pattern ('allow' or 'block')""" + """The directive for the URL rule ('allow' or 'block')""" operator: Optional[str] = None """The comparison operator ('contains' or 'equal_to')""" @@ -123,7 +128,20 @@ class GuideGroup(BaseModel): updated_at: Optional[datetime] = None +class IneligibleGuide(BaseModel): + key: str + """The guide's key identifier""" + + message: str + """Human-readable explanation of ineligibility""" + + reason: Literal["guide_not_active", "marked_as_archived", "target_conditions_not_met", "not_in_target_audience"] + """Reason code for ineligibility""" + + class GuideGetChannelResponse(BaseModel): + """A response for a list of guides.""" + entries: List[Entry] """A list of guides.""" @@ -132,3 +150,6 @@ class GuideGetChannelResponse(BaseModel): guide_groups: List[GuideGroup] """A list of guide groups with their display sequences and intervals.""" + + ineligible_guides: List[IneligibleGuide] + """Markers for guides the user is not eligible to see.""" diff --git a/src/knockapi/types/users/guide_mark_message_as_archived_response.py b/src/knockapi/types/users/guide_mark_message_as_archived_response.py index 3d3bc4bb..d6d2012d 100644 --- a/src/knockapi/types/users/guide_mark_message_as_archived_response.py +++ b/src/knockapi/types/users/guide_mark_message_as_archived_response.py @@ -6,5 +6,7 @@ class GuideMarkMessageAsArchivedResponse(BaseModel): + """A response for a guide action.""" + status: str """The status of a guide's action.""" diff --git a/src/knockapi/types/users/guide_mark_message_as_interacted_response.py b/src/knockapi/types/users/guide_mark_message_as_interacted_response.py index 1b050830..c9cedac6 100644 --- a/src/knockapi/types/users/guide_mark_message_as_interacted_response.py +++ b/src/knockapi/types/users/guide_mark_message_as_interacted_response.py @@ -6,5 +6,7 @@ class GuideMarkMessageAsInteractedResponse(BaseModel): + """A response for a guide action.""" + status: str """The status of a guide's action.""" diff --git a/src/knockapi/types/users/guide_mark_message_as_seen_response.py b/src/knockapi/types/users/guide_mark_message_as_seen_response.py index d2b3204f..0f260939 100644 --- a/src/knockapi/types/users/guide_mark_message_as_seen_response.py +++ b/src/knockapi/types/users/guide_mark_message_as_seen_response.py @@ -6,5 +6,7 @@ class GuideMarkMessageAsSeenResponse(BaseModel): + """A response for a guide action.""" + status: str """The status of a guide's action.""" diff --git a/src/knockapi/types/workflow_trigger_response.py b/src/knockapi/types/workflow_trigger_response.py index a5fdcd64..4903df95 100644 --- a/src/knockapi/types/workflow_trigger_response.py +++ b/src/knockapi/types/workflow_trigger_response.py @@ -6,6 +6,8 @@ class WorkflowTriggerResponse(BaseModel): + """The response from triggering a workflow.""" + workflow_run_id: str """ This value allows you to track individual messages associated with this trigger diff --git a/tests/api_resources/channels/test_bulk.py b/tests/api_resources/channels/test_bulk.py index 0809c256..189a5b57 100644 --- a/tests/api_resources/channels/test_bulk.py +++ b/tests/api_resources/channels/test_bulk.py @@ -18,7 +18,7 @@ class TestBulk: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update_message_status(self, client: Knock) -> None: bulk = client.channels.bulk.update_message_status( @@ -27,7 +27,7 @@ def test_method_update_message_status(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update_message_status_with_all_params(self, client: Knock) -> None: bulk = client.channels.bulk.update_message_status( @@ -46,7 +46,7 @@ def test_method_update_message_status_with_all_params(self, client: Knock) -> No ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_update_message_status(self, client: Knock) -> None: response = client.channels.bulk.with_raw_response.update_message_status( @@ -59,7 +59,7 @@ def test_raw_response_update_message_status(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_update_message_status(self, client: Knock) -> None: with client.channels.bulk.with_streaming_response.update_message_status( @@ -74,7 +74,7 @@ def test_streaming_response_update_message_status(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_update_message_status(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -89,7 +89,7 @@ class TestAsyncBulk: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update_message_status(self, async_client: AsyncKnock) -> None: bulk = await async_client.channels.bulk.update_message_status( @@ -98,7 +98,7 @@ async def test_method_update_message_status(self, async_client: AsyncKnock) -> N ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update_message_status_with_all_params(self, async_client: AsyncKnock) -> None: bulk = await async_client.channels.bulk.update_message_status( @@ -117,7 +117,7 @@ async def test_method_update_message_status_with_all_params(self, async_client: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_update_message_status(self, async_client: AsyncKnock) -> None: response = await async_client.channels.bulk.with_raw_response.update_message_status( @@ -130,7 +130,7 @@ async def test_raw_response_update_message_status(self, async_client: AsyncKnock bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_update_message_status(self, async_client: AsyncKnock) -> None: async with async_client.channels.bulk.with_streaming_response.update_message_status( @@ -145,7 +145,7 @@ async def test_streaming_response_update_message_status(self, async_client: Asyn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_update_message_status(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): diff --git a/tests/api_resources/integrations/test_census.py b/tests/api_resources/integrations/test_census.py index 6b028b3a..aaa71a34 100644 --- a/tests/api_resources/integrations/test_census.py +++ b/tests/api_resources/integrations/test_census.py @@ -17,7 +17,7 @@ class TestCensus: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_custom_destination(self, client: Knock) -> None: census = client.integrations.census.custom_destination( @@ -27,7 +27,7 @@ def test_method_custom_destination(self, client: Knock) -> None: ) assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_custom_destination_with_all_params(self, client: Knock) -> None: census = client.integrations.census.custom_destination( @@ -38,7 +38,7 @@ def test_method_custom_destination_with_all_params(self, client: Knock) -> None: ) assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_custom_destination(self, client: Knock) -> None: response = client.integrations.census.with_raw_response.custom_destination( @@ -52,7 +52,7 @@ def test_raw_response_custom_destination(self, client: Knock) -> None: census = response.parse() assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_custom_destination(self, client: Knock) -> None: with client.integrations.census.with_streaming_response.custom_destination( @@ -74,7 +74,7 @@ class TestAsyncCensus: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_custom_destination(self, async_client: AsyncKnock) -> None: census = await async_client.integrations.census.custom_destination( @@ -84,7 +84,7 @@ async def test_method_custom_destination(self, async_client: AsyncKnock) -> None ) assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_custom_destination_with_all_params(self, async_client: AsyncKnock) -> None: census = await async_client.integrations.census.custom_destination( @@ -95,7 +95,7 @@ async def test_method_custom_destination_with_all_params(self, async_client: Asy ) assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_custom_destination(self, async_client: AsyncKnock) -> None: response = await async_client.integrations.census.with_raw_response.custom_destination( @@ -109,7 +109,7 @@ async def test_raw_response_custom_destination(self, async_client: AsyncKnock) - census = await response.parse() assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_custom_destination(self, async_client: AsyncKnock) -> None: async with async_client.integrations.census.with_streaming_response.custom_destination( diff --git a/tests/api_resources/integrations/test_hightouch.py b/tests/api_resources/integrations/test_hightouch.py index 25f287d4..98943421 100644 --- a/tests/api_resources/integrations/test_hightouch.py +++ b/tests/api_resources/integrations/test_hightouch.py @@ -17,7 +17,7 @@ class TestHightouch: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_embedded_destination(self, client: Knock) -> None: hightouch = client.integrations.hightouch.embedded_destination( @@ -27,7 +27,7 @@ def test_method_embedded_destination(self, client: Knock) -> None: ) assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_embedded_destination_with_all_params(self, client: Knock) -> None: hightouch = client.integrations.hightouch.embedded_destination( @@ -38,7 +38,7 @@ def test_method_embedded_destination_with_all_params(self, client: Knock) -> Non ) assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_embedded_destination(self, client: Knock) -> None: response = client.integrations.hightouch.with_raw_response.embedded_destination( @@ -52,7 +52,7 @@ def test_raw_response_embedded_destination(self, client: Knock) -> None: hightouch = response.parse() assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_embedded_destination(self, client: Knock) -> None: with client.integrations.hightouch.with_streaming_response.embedded_destination( @@ -74,7 +74,7 @@ class TestAsyncHightouch: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_embedded_destination(self, async_client: AsyncKnock) -> None: hightouch = await async_client.integrations.hightouch.embedded_destination( @@ -84,7 +84,7 @@ async def test_method_embedded_destination(self, async_client: AsyncKnock) -> No ) assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_embedded_destination_with_all_params(self, async_client: AsyncKnock) -> None: hightouch = await async_client.integrations.hightouch.embedded_destination( @@ -95,7 +95,7 @@ async def test_method_embedded_destination_with_all_params(self, async_client: A ) assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_embedded_destination(self, async_client: AsyncKnock) -> None: response = await async_client.integrations.hightouch.with_raw_response.embedded_destination( @@ -109,7 +109,7 @@ async def test_raw_response_embedded_destination(self, async_client: AsyncKnock) hightouch = await response.parse() assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_embedded_destination(self, async_client: AsyncKnock) -> None: async with async_client.integrations.hightouch.with_streaming_response.embedded_destination( diff --git a/tests/api_resources/messages/test_batch.py b/tests/api_resources/messages/test_batch.py index 43fdebf4..1e3ee077 100644 --- a/tests/api_resources/messages/test_batch.py +++ b/tests/api_resources/messages/test_batch.py @@ -26,7 +26,7 @@ class TestBatch: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_archive(self, client: Knock) -> None: batch = client.messages.batch.archive( @@ -34,7 +34,7 @@ def test_method_archive(self, client: Knock) -> None: ) assert_matches_type(BatchArchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_archive(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.archive( @@ -46,7 +46,7 @@ def test_raw_response_archive(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchArchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_archive(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.archive( @@ -60,7 +60,7 @@ def test_streaming_response_archive(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_content(self, client: Knock) -> None: batch = client.messages.batch.get_content( @@ -68,7 +68,7 @@ def test_method_get_content(self, client: Knock) -> None: ) assert_matches_type(BatchGetContentResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_content(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.get_content( @@ -80,7 +80,7 @@ def test_raw_response_get_content(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchGetContentResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_content(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.get_content( @@ -94,7 +94,7 @@ def test_streaming_response_get_content(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_interacted(self, client: Knock) -> None: batch = client.messages.batch.mark_as_interacted( @@ -102,7 +102,7 @@ def test_method_mark_as_interacted(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_interacted_with_all_params(self, client: Knock) -> None: batch = client.messages.batch.mark_as_interacted( @@ -111,7 +111,7 @@ def test_method_mark_as_interacted_with_all_params(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_interacted(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.mark_as_interacted( @@ -123,7 +123,7 @@ def test_raw_response_mark_as_interacted(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_interacted(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.mark_as_interacted( @@ -137,7 +137,7 @@ def test_streaming_response_mark_as_interacted(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_read(self, client: Knock) -> None: batch = client.messages.batch.mark_as_read( @@ -145,7 +145,7 @@ def test_method_mark_as_read(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsReadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_read(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.mark_as_read( @@ -157,7 +157,7 @@ def test_raw_response_mark_as_read(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchMarkAsReadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_read(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.mark_as_read( @@ -171,7 +171,7 @@ def test_streaming_response_mark_as_read(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_seen(self, client: Knock) -> None: batch = client.messages.batch.mark_as_seen( @@ -179,7 +179,7 @@ def test_method_mark_as_seen(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsSeenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_seen(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.mark_as_seen( @@ -191,7 +191,7 @@ def test_raw_response_mark_as_seen(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchMarkAsSeenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_seen(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.mark_as_seen( @@ -205,7 +205,7 @@ def test_streaming_response_mark_as_seen(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_unread(self, client: Knock) -> None: batch = client.messages.batch.mark_as_unread( @@ -213,7 +213,7 @@ def test_method_mark_as_unread(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsUnreadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_unread(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.mark_as_unread( @@ -225,7 +225,7 @@ def test_raw_response_mark_as_unread(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchMarkAsUnreadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_unread(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.mark_as_unread( @@ -239,7 +239,7 @@ def test_streaming_response_mark_as_unread(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_unseen(self, client: Knock) -> None: batch = client.messages.batch.mark_as_unseen( @@ -247,7 +247,7 @@ def test_method_mark_as_unseen(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsUnseenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_unseen(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.mark_as_unseen( @@ -259,7 +259,7 @@ def test_raw_response_mark_as_unseen(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchMarkAsUnseenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_unseen(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.mark_as_unseen( @@ -273,7 +273,7 @@ def test_streaming_response_mark_as_unseen(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_unarchive(self, client: Knock) -> None: batch = client.messages.batch.unarchive( @@ -281,7 +281,7 @@ def test_method_unarchive(self, client: Knock) -> None: ) assert_matches_type(BatchUnarchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_unarchive(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.unarchive( @@ -293,7 +293,7 @@ def test_raw_response_unarchive(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchUnarchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_unarchive(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.unarchive( @@ -313,7 +313,7 @@ class TestAsyncBatch: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_archive(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.archive( @@ -321,7 +321,7 @@ async def test_method_archive(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchArchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_archive(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.archive( @@ -333,7 +333,7 @@ async def test_raw_response_archive(self, async_client: AsyncKnock) -> None: batch = await response.parse() assert_matches_type(BatchArchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_archive(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.archive( @@ -347,7 +347,7 @@ async def test_streaming_response_archive(self, async_client: AsyncKnock) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_content(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.get_content( @@ -355,7 +355,7 @@ async def test_method_get_content(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchGetContentResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_content(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.get_content( @@ -367,7 +367,7 @@ async def test_raw_response_get_content(self, async_client: AsyncKnock) -> None: batch = await response.parse() assert_matches_type(BatchGetContentResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_content(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.get_content( @@ -381,7 +381,7 @@ async def test_streaming_response_get_content(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_interacted(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_interacted( @@ -389,7 +389,7 @@ async def test_method_mark_as_interacted(self, async_client: AsyncKnock) -> None ) assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_interacted_with_all_params(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_interacted( @@ -398,7 +398,7 @@ async def test_method_mark_as_interacted_with_all_params(self, async_client: Asy ) assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_interacted(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.mark_as_interacted( @@ -410,7 +410,7 @@ async def test_raw_response_mark_as_interacted(self, async_client: AsyncKnock) - batch = await response.parse() assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_interacted(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.mark_as_interacted( @@ -424,7 +424,7 @@ async def test_streaming_response_mark_as_interacted(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_read(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_read( @@ -432,7 +432,7 @@ async def test_method_mark_as_read(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchMarkAsReadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_read(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.mark_as_read( @@ -444,7 +444,7 @@ async def test_raw_response_mark_as_read(self, async_client: AsyncKnock) -> None batch = await response.parse() assert_matches_type(BatchMarkAsReadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_read(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.mark_as_read( @@ -458,7 +458,7 @@ async def test_streaming_response_mark_as_read(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_seen(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_seen( @@ -466,7 +466,7 @@ async def test_method_mark_as_seen(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchMarkAsSeenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_seen(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.mark_as_seen( @@ -478,7 +478,7 @@ async def test_raw_response_mark_as_seen(self, async_client: AsyncKnock) -> None batch = await response.parse() assert_matches_type(BatchMarkAsSeenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_seen(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.mark_as_seen( @@ -492,7 +492,7 @@ async def test_streaming_response_mark_as_seen(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_unread(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_unread( @@ -500,7 +500,7 @@ async def test_method_mark_as_unread(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchMarkAsUnreadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_unread(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.mark_as_unread( @@ -512,7 +512,7 @@ async def test_raw_response_mark_as_unread(self, async_client: AsyncKnock) -> No batch = await response.parse() assert_matches_type(BatchMarkAsUnreadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_unread(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.mark_as_unread( @@ -526,7 +526,7 @@ async def test_streaming_response_mark_as_unread(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_unseen(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_unseen( @@ -534,7 +534,7 @@ async def test_method_mark_as_unseen(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchMarkAsUnseenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_unseen(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.mark_as_unseen( @@ -546,7 +546,7 @@ async def test_raw_response_mark_as_unseen(self, async_client: AsyncKnock) -> No batch = await response.parse() assert_matches_type(BatchMarkAsUnseenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_unseen(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.mark_as_unseen( @@ -560,7 +560,7 @@ async def test_streaming_response_mark_as_unseen(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_unarchive(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.unarchive( @@ -568,7 +568,7 @@ async def test_method_unarchive(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchUnarchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_unarchive(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.unarchive( @@ -580,7 +580,7 @@ async def test_raw_response_unarchive(self, async_client: AsyncKnock) -> None: batch = await response.parse() assert_matches_type(BatchUnarchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_unarchive(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.unarchive( diff --git a/tests/api_resources/objects/test_bulk.py b/tests/api_resources/objects/test_bulk.py index 9043d3d6..78e6c780 100644 --- a/tests/api_resources/objects/test_bulk.py +++ b/tests/api_resources/objects/test_bulk.py @@ -17,7 +17,7 @@ class TestBulk: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: bulk = client.objects.bulk.delete( @@ -26,7 +26,7 @@ def test_method_delete(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.objects.bulk.with_raw_response.delete( @@ -39,7 +39,7 @@ def test_raw_response_delete(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.objects.bulk.with_streaming_response.delete( @@ -54,7 +54,7 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -63,7 +63,7 @@ def test_path_params_delete(self, client: Knock) -> None: object_ids=["obj_123", "obj_456", "obj_789"], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_add_subscriptions(self, client: Knock) -> None: bulk = client.objects.bulk.add_subscriptions( @@ -77,7 +77,7 @@ def test_method_add_subscriptions(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_add_subscriptions(self, client: Knock) -> None: response = client.objects.bulk.with_raw_response.add_subscriptions( @@ -95,7 +95,7 @@ def test_raw_response_add_subscriptions(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_add_subscriptions(self, client: Knock) -> None: with client.objects.bulk.with_streaming_response.add_subscriptions( @@ -115,7 +115,7 @@ def test_streaming_response_add_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_add_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -129,7 +129,7 @@ def test_path_params_add_subscriptions(self, client: Knock) -> None: ], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete_subscriptions(self, client: Knock) -> None: bulk = client.objects.bulk.delete_subscriptions( @@ -147,7 +147,7 @@ def test_method_delete_subscriptions(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete_subscriptions(self, client: Knock) -> None: response = client.objects.bulk.with_raw_response.delete_subscriptions( @@ -169,7 +169,7 @@ def test_raw_response_delete_subscriptions(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete_subscriptions(self, client: Knock) -> None: with client.objects.bulk.with_streaming_response.delete_subscriptions( @@ -193,7 +193,7 @@ def test_streaming_response_delete_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -211,7 +211,7 @@ def test_path_params_delete_subscriptions(self, client: Knock) -> None: ], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set(self, client: Knock) -> None: bulk = client.objects.bulk.set( @@ -220,7 +220,7 @@ def test_method_set(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set(self, client: Knock) -> None: response = client.objects.bulk.with_raw_response.set( @@ -233,7 +233,7 @@ def test_raw_response_set(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set(self, client: Knock) -> None: with client.objects.bulk.with_streaming_response.set( @@ -248,7 +248,7 @@ def test_streaming_response_set(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -263,7 +263,7 @@ class TestAsyncBulk: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: bulk = await async_client.objects.bulk.delete( @@ -272,7 +272,7 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.objects.bulk.with_raw_response.delete( @@ -285,7 +285,7 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.objects.bulk.with_streaming_response.delete( @@ -300,7 +300,7 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -309,7 +309,7 @@ async def test_path_params_delete(self, async_client: AsyncKnock) -> None: object_ids=["obj_123", "obj_456", "obj_789"], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_add_subscriptions(self, async_client: AsyncKnock) -> None: bulk = await async_client.objects.bulk.add_subscriptions( @@ -323,7 +323,7 @@ async def test_method_add_subscriptions(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_add_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.objects.bulk.with_raw_response.add_subscriptions( @@ -341,7 +341,7 @@ async def test_raw_response_add_subscriptions(self, async_client: AsyncKnock) -> bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_add_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.objects.bulk.with_streaming_response.add_subscriptions( @@ -361,7 +361,7 @@ async def test_streaming_response_add_subscriptions(self, async_client: AsyncKno assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_add_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -375,7 +375,7 @@ async def test_path_params_add_subscriptions(self, async_client: AsyncKnock) -> ], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete_subscriptions(self, async_client: AsyncKnock) -> None: bulk = await async_client.objects.bulk.delete_subscriptions( @@ -393,7 +393,7 @@ async def test_method_delete_subscriptions(self, async_client: AsyncKnock) -> No ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.objects.bulk.with_raw_response.delete_subscriptions( @@ -415,7 +415,7 @@ async def test_raw_response_delete_subscriptions(self, async_client: AsyncKnock) bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.objects.bulk.with_streaming_response.delete_subscriptions( @@ -439,7 +439,7 @@ async def test_streaming_response_delete_subscriptions(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -457,7 +457,7 @@ async def test_path_params_delete_subscriptions(self, async_client: AsyncKnock) ], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set(self, async_client: AsyncKnock) -> None: bulk = await async_client.objects.bulk.set( @@ -466,7 +466,7 @@ async def test_method_set(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set(self, async_client: AsyncKnock) -> None: response = await async_client.objects.bulk.with_raw_response.set( @@ -479,7 +479,7 @@ async def test_raw_response_set(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: async with async_client.objects.bulk.with_streaming_response.set( @@ -494,7 +494,7 @@ async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): diff --git a/tests/api_resources/providers/test_ms_teams.py b/tests/api_resources/providers/test_ms_teams.py index 671a90e4..1a0f9cb1 100644 --- a/tests/api_resources/providers/test_ms_teams.py +++ b/tests/api_resources/providers/test_ms_teams.py @@ -23,7 +23,7 @@ class TestMsTeams: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_check_auth(self, client: Knock) -> None: ms_team = client.providers.ms_teams.check_auth( @@ -32,7 +32,7 @@ def test_method_check_auth(self, client: Knock) -> None: ) assert_matches_type(MsTeamCheckAuthResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_check_auth(self, client: Knock) -> None: response = client.providers.ms_teams.with_raw_response.check_auth( @@ -45,7 +45,7 @@ def test_raw_response_check_auth(self, client: Knock) -> None: ms_team = response.parse() assert_matches_type(MsTeamCheckAuthResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_check_auth(self, client: Knock) -> None: with client.providers.ms_teams.with_streaming_response.check_auth( @@ -60,7 +60,7 @@ def test_streaming_response_check_auth(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_check_auth(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -69,7 +69,7 @@ def test_path_params_check_auth(self, client: Knock) -> None: ms_teams_tenant_object="ms_teams_tenant_object", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_channels(self, client: Knock) -> None: ms_team = client.providers.ms_teams.list_channels( @@ -79,7 +79,7 @@ def test_method_list_channels(self, client: Knock) -> None: ) assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_channels_with_all_params(self, client: Knock) -> None: ms_team = client.providers.ms_teams.list_channels( @@ -93,7 +93,7 @@ def test_method_list_channels_with_all_params(self, client: Knock) -> None: ) assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_channels(self, client: Knock) -> None: response = client.providers.ms_teams.with_raw_response.list_channels( @@ -107,7 +107,7 @@ def test_raw_response_list_channels(self, client: Knock) -> None: ms_team = response.parse() assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_channels(self, client: Knock) -> None: with client.providers.ms_teams.with_streaming_response.list_channels( @@ -123,7 +123,7 @@ def test_streaming_response_list_channels(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_channels(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -133,7 +133,7 @@ def test_path_params_list_channels(self, client: Knock) -> None: team_id="team_id", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_teams(self, client: Knock) -> None: ms_team = client.providers.ms_teams.list_teams( @@ -142,7 +142,7 @@ def test_method_list_teams(self, client: Knock) -> None: ) assert_matches_type(SyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_teams_with_all_params(self, client: Knock) -> None: ms_team = client.providers.ms_teams.list_teams( @@ -157,7 +157,7 @@ def test_method_list_teams_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_teams(self, client: Knock) -> None: response = client.providers.ms_teams.with_raw_response.list_teams( @@ -170,7 +170,7 @@ def test_raw_response_list_teams(self, client: Knock) -> None: ms_team = response.parse() assert_matches_type(SyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_teams(self, client: Knock) -> None: with client.providers.ms_teams.with_streaming_response.list_teams( @@ -185,7 +185,7 @@ def test_streaming_response_list_teams(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_teams(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -194,7 +194,7 @@ def test_path_params_list_teams(self, client: Knock) -> None: ms_teams_tenant_object="ms_teams_tenant_object", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_revoke_access(self, client: Knock) -> None: ms_team = client.providers.ms_teams.revoke_access( @@ -203,7 +203,7 @@ def test_method_revoke_access(self, client: Knock) -> None: ) assert_matches_type(MsTeamRevokeAccessResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_revoke_access(self, client: Knock) -> None: response = client.providers.ms_teams.with_raw_response.revoke_access( @@ -216,7 +216,7 @@ def test_raw_response_revoke_access(self, client: Knock) -> None: ms_team = response.parse() assert_matches_type(MsTeamRevokeAccessResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_revoke_access(self, client: Knock) -> None: with client.providers.ms_teams.with_streaming_response.revoke_access( @@ -231,7 +231,7 @@ def test_streaming_response_revoke_access(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_revoke_access(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -246,7 +246,7 @@ class TestAsyncMsTeams: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_check_auth(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.check_auth( @@ -255,7 +255,7 @@ async def test_method_check_auth(self, async_client: AsyncKnock) -> None: ) assert_matches_type(MsTeamCheckAuthResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_check_auth(self, async_client: AsyncKnock) -> None: response = await async_client.providers.ms_teams.with_raw_response.check_auth( @@ -268,7 +268,7 @@ async def test_raw_response_check_auth(self, async_client: AsyncKnock) -> None: ms_team = await response.parse() assert_matches_type(MsTeamCheckAuthResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_check_auth(self, async_client: AsyncKnock) -> None: async with async_client.providers.ms_teams.with_streaming_response.check_auth( @@ -283,7 +283,7 @@ async def test_streaming_response_check_auth(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_check_auth(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -292,7 +292,7 @@ async def test_path_params_check_auth(self, async_client: AsyncKnock) -> None: ms_teams_tenant_object="ms_teams_tenant_object", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_channels(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.list_channels( @@ -302,7 +302,7 @@ async def test_method_list_channels(self, async_client: AsyncKnock) -> None: ) assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_channels_with_all_params(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.list_channels( @@ -316,7 +316,7 @@ async def test_method_list_channels_with_all_params(self, async_client: AsyncKno ) assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_channels(self, async_client: AsyncKnock) -> None: response = await async_client.providers.ms_teams.with_raw_response.list_channels( @@ -330,7 +330,7 @@ async def test_raw_response_list_channels(self, async_client: AsyncKnock) -> Non ms_team = await response.parse() assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_channels(self, async_client: AsyncKnock) -> None: async with async_client.providers.ms_teams.with_streaming_response.list_channels( @@ -346,7 +346,7 @@ async def test_streaming_response_list_channels(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_channels(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -356,7 +356,7 @@ async def test_path_params_list_channels(self, async_client: AsyncKnock) -> None team_id="team_id", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_teams(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.list_teams( @@ -365,7 +365,7 @@ async def test_method_list_teams(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_teams_with_all_params(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.list_teams( @@ -380,7 +380,7 @@ async def test_method_list_teams_with_all_params(self, async_client: AsyncKnock) ) assert_matches_type(AsyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_teams(self, async_client: AsyncKnock) -> None: response = await async_client.providers.ms_teams.with_raw_response.list_teams( @@ -393,7 +393,7 @@ async def test_raw_response_list_teams(self, async_client: AsyncKnock) -> None: ms_team = await response.parse() assert_matches_type(AsyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_teams(self, async_client: AsyncKnock) -> None: async with async_client.providers.ms_teams.with_streaming_response.list_teams( @@ -408,7 +408,7 @@ async def test_streaming_response_list_teams(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_teams(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -417,7 +417,7 @@ async def test_path_params_list_teams(self, async_client: AsyncKnock) -> None: ms_teams_tenant_object="ms_teams_tenant_object", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_revoke_access(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.revoke_access( @@ -426,7 +426,7 @@ async def test_method_revoke_access(self, async_client: AsyncKnock) -> None: ) assert_matches_type(MsTeamRevokeAccessResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_revoke_access(self, async_client: AsyncKnock) -> None: response = await async_client.providers.ms_teams.with_raw_response.revoke_access( @@ -439,7 +439,7 @@ async def test_raw_response_revoke_access(self, async_client: AsyncKnock) -> Non ms_team = await response.parse() assert_matches_type(MsTeamRevokeAccessResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_revoke_access(self, async_client: AsyncKnock) -> None: async with async_client.providers.ms_teams.with_streaming_response.revoke_access( @@ -454,7 +454,7 @@ async def test_streaming_response_revoke_access(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_revoke_access(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): diff --git a/tests/api_resources/providers/test_slack.py b/tests/api_resources/providers/test_slack.py index ef64aff4..a0e993d8 100644 --- a/tests/api_resources/providers/test_slack.py +++ b/tests/api_resources/providers/test_slack.py @@ -22,7 +22,7 @@ class TestSlack: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_check_auth(self, client: Knock) -> None: slack = client.providers.slack.check_auth( @@ -31,7 +31,7 @@ def test_method_check_auth(self, client: Knock) -> None: ) assert_matches_type(SlackCheckAuthResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_check_auth(self, client: Knock) -> None: response = client.providers.slack.with_raw_response.check_auth( @@ -44,7 +44,7 @@ def test_raw_response_check_auth(self, client: Knock) -> None: slack = response.parse() assert_matches_type(SlackCheckAuthResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_check_auth(self, client: Knock) -> None: with client.providers.slack.with_streaming_response.check_auth( @@ -59,7 +59,7 @@ def test_streaming_response_check_auth(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_check_auth(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -68,7 +68,7 @@ def test_path_params_check_auth(self, client: Knock) -> None: access_token_object="access_token_object", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_channels(self, client: Knock) -> None: slack = client.providers.slack.list_channels( @@ -77,7 +77,7 @@ def test_method_list_channels(self, client: Knock) -> None: ) assert_matches_type(SyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_channels_with_all_params(self, client: Knock) -> None: slack = client.providers.slack.list_channels( @@ -93,7 +93,7 @@ def test_method_list_channels_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_channels(self, client: Knock) -> None: response = client.providers.slack.with_raw_response.list_channels( @@ -106,7 +106,7 @@ def test_raw_response_list_channels(self, client: Knock) -> None: slack = response.parse() assert_matches_type(SyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_channels(self, client: Knock) -> None: with client.providers.slack.with_streaming_response.list_channels( @@ -121,7 +121,7 @@ def test_streaming_response_list_channels(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_channels(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -130,7 +130,7 @@ def test_path_params_list_channels(self, client: Knock) -> None: access_token_object="access_token_object", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_revoke_access(self, client: Knock) -> None: slack = client.providers.slack.revoke_access( @@ -139,7 +139,7 @@ def test_method_revoke_access(self, client: Knock) -> None: ) assert_matches_type(SlackRevokeAccessResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_revoke_access(self, client: Knock) -> None: response = client.providers.slack.with_raw_response.revoke_access( @@ -152,7 +152,7 @@ def test_raw_response_revoke_access(self, client: Knock) -> None: slack = response.parse() assert_matches_type(SlackRevokeAccessResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_revoke_access(self, client: Knock) -> None: with client.providers.slack.with_streaming_response.revoke_access( @@ -167,7 +167,7 @@ def test_streaming_response_revoke_access(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_revoke_access(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -182,7 +182,7 @@ class TestAsyncSlack: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_check_auth(self, async_client: AsyncKnock) -> None: slack = await async_client.providers.slack.check_auth( @@ -191,7 +191,7 @@ async def test_method_check_auth(self, async_client: AsyncKnock) -> None: ) assert_matches_type(SlackCheckAuthResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_check_auth(self, async_client: AsyncKnock) -> None: response = await async_client.providers.slack.with_raw_response.check_auth( @@ -204,7 +204,7 @@ async def test_raw_response_check_auth(self, async_client: AsyncKnock) -> None: slack = await response.parse() assert_matches_type(SlackCheckAuthResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_check_auth(self, async_client: AsyncKnock) -> None: async with async_client.providers.slack.with_streaming_response.check_auth( @@ -219,7 +219,7 @@ async def test_streaming_response_check_auth(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_check_auth(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -228,7 +228,7 @@ async def test_path_params_check_auth(self, async_client: AsyncKnock) -> None: access_token_object="access_token_object", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_channels(self, async_client: AsyncKnock) -> None: slack = await async_client.providers.slack.list_channels( @@ -237,7 +237,7 @@ async def test_method_list_channels(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_channels_with_all_params(self, async_client: AsyncKnock) -> None: slack = await async_client.providers.slack.list_channels( @@ -253,7 +253,7 @@ async def test_method_list_channels_with_all_params(self, async_client: AsyncKno ) assert_matches_type(AsyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_channels(self, async_client: AsyncKnock) -> None: response = await async_client.providers.slack.with_raw_response.list_channels( @@ -266,7 +266,7 @@ async def test_raw_response_list_channels(self, async_client: AsyncKnock) -> Non slack = await response.parse() assert_matches_type(AsyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_channels(self, async_client: AsyncKnock) -> None: async with async_client.providers.slack.with_streaming_response.list_channels( @@ -281,7 +281,7 @@ async def test_streaming_response_list_channels(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_channels(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -290,7 +290,7 @@ async def test_path_params_list_channels(self, async_client: AsyncKnock) -> None access_token_object="access_token_object", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_revoke_access(self, async_client: AsyncKnock) -> None: slack = await async_client.providers.slack.revoke_access( @@ -299,7 +299,7 @@ async def test_method_revoke_access(self, async_client: AsyncKnock) -> None: ) assert_matches_type(SlackRevokeAccessResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_revoke_access(self, async_client: AsyncKnock) -> None: response = await async_client.providers.slack.with_raw_response.revoke_access( @@ -312,7 +312,7 @@ async def test_raw_response_revoke_access(self, async_client: AsyncKnock) -> Non slack = await response.parse() assert_matches_type(SlackRevokeAccessResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_revoke_access(self, async_client: AsyncKnock) -> None: async with async_client.providers.slack.with_streaming_response.revoke_access( @@ -327,7 +327,7 @@ async def test_streaming_response_revoke_access(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_revoke_access(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): diff --git a/tests/api_resources/schedules/test_bulk.py b/tests/api_resources/schedules/test_bulk.py index c51bf2a2..d2426efc 100644 --- a/tests/api_resources/schedules/test_bulk.py +++ b/tests/api_resources/schedules/test_bulk.py @@ -17,7 +17,7 @@ class TestBulk: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_create(self, client: Knock) -> None: bulk = client.schedules.bulk.create( @@ -25,7 +25,7 @@ def test_method_create(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_create(self, client: Knock) -> None: response = client.schedules.bulk.with_raw_response.create( @@ -37,7 +37,7 @@ def test_raw_response_create(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_create(self, client: Knock) -> None: with client.schedules.bulk.with_streaming_response.create( @@ -57,7 +57,7 @@ class TestAsyncBulk: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_create(self, async_client: AsyncKnock) -> None: bulk = await async_client.schedules.bulk.create( @@ -65,7 +65,7 @@ async def test_method_create(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_create(self, async_client: AsyncKnock) -> None: response = await async_client.schedules.bulk.with_raw_response.create( @@ -77,7 +77,7 @@ async def test_raw_response_create(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_create(self, async_client: AsyncKnock) -> None: async with async_client.schedules.bulk.with_streaming_response.create( diff --git a/tests/api_resources/tenants/test_bulk.py b/tests/api_resources/tenants/test_bulk.py index 03650c1c..22096bea 100644 --- a/tests/api_resources/tenants/test_bulk.py +++ b/tests/api_resources/tenants/test_bulk.py @@ -17,7 +17,7 @@ class TestBulk: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: bulk = client.tenants.bulk.delete( @@ -25,7 +25,7 @@ def test_method_delete(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.tenants.bulk.with_raw_response.delete( @@ -37,7 +37,7 @@ def test_raw_response_delete(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.tenants.bulk.with_streaming_response.delete( @@ -51,7 +51,7 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set(self, client: Knock) -> None: bulk = client.tenants.bulk.set( @@ -59,7 +59,7 @@ def test_method_set(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set(self, client: Knock) -> None: response = client.tenants.bulk.with_raw_response.set( @@ -71,7 +71,7 @@ def test_raw_response_set(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set(self, client: Knock) -> None: with client.tenants.bulk.with_streaming_response.set( @@ -91,7 +91,7 @@ class TestAsyncBulk: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: bulk = await async_client.tenants.bulk.delete( @@ -99,7 +99,7 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.bulk.with_raw_response.delete( @@ -111,7 +111,7 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.tenants.bulk.with_streaming_response.delete( @@ -125,7 +125,7 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set(self, async_client: AsyncKnock) -> None: bulk = await async_client.tenants.bulk.set( @@ -133,7 +133,7 @@ async def test_method_set(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.bulk.with_raw_response.set( @@ -145,7 +145,7 @@ async def test_raw_response_set(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: async with async_client.tenants.bulk.with_streaming_response.set( diff --git a/tests/api_resources/test_audiences.py b/tests/api_resources/test_audiences.py index 09981e0d..26dcb10e 100644 --- a/tests/api_resources/test_audiences.py +++ b/tests/api_resources/test_audiences.py @@ -10,6 +10,7 @@ from knockapi import Knock, AsyncKnock from tests.utils import assert_matches_type from knockapi.types import AudienceListMembersResponse +from knockapi._utils import parse_datetime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -17,21 +18,137 @@ class TestAudiences: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_add_members(self, client: Knock) -> None: audience = client.audiences.add_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) assert audience is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") + @parametrize + def test_method_add_members_with_all_params(self, client: Knock) -> None: + audience = client.audiences.add_members( + key="key", + members=[ + { + "user": { + "id": "dr_sattler", + "avatar": "avatar", + "channel_data": {"97c5837d-c65c-4d54-aa39-080eeb81c69d": {"tokens": ["push_token_123"]}}, + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "email": "ellie@ingen.net", + "locale": "locale", + "name": "Dr. Ellie Sattler", + "phone_number": "phone_number", + "preferences": { + "default": { + "_persistence_strategy": "merge", + "categories": { + "marketing": False, + "transactional": { + "channel_types": { + "chat": True, + "email": False, + "http": True, + "in_app_feed": True, + "push": True, + "sms": { + "conditions": [ + { + "argument": "US", + "operator": "equal_to", + "variable": "recipient.country_code", + } + ] + }, + }, + "channels": {"aef6e715-df82-4ab6-b61e-b743e249f7b6": True}, + "conditions": [ + { + "argument": "frog_genome", + "operator": "contains", + "variable": "specimen.dna_sequence", + } + ], + }, + }, + "channel_types": { + "chat": True, + "email": True, + "http": True, + "in_app_feed": True, + "push": True, + "sms": { + "conditions": [ + { + "argument": "US", + "operator": "equal_to", + "variable": "recipient.country_code", + } + ] + }, + }, + "channels": { + "2f641633-95d3-4555-9222-9f1eb7888a80": { + "conditions": [ + { + "argument": "US", + "operator": "equal_to", + "variable": "recipient.country_code", + } + ] + }, + "aef6e715-df82-4ab6-b61e-b743e249f7b6": True, + }, + "commercial_subscribed": True, + "workflows": { + "dinosaurs-loose": { + "channel_types": { + "chat": True, + "email": True, + "http": True, + "in_app_feed": True, + "push": True, + "sms": { + "conditions": [ + { + "argument": "US", + "operator": "equal_to", + "variable": "recipient.country_code", + } + ] + }, + }, + "channels": {"aef6e715-df82-4ab6-b61e-b743e249f7b6": True}, + "conditions": [ + { + "argument": "frog_genome", + "operator": "contains", + "variable": "specimen.dna_sequence", + } + ], + } + }, + } + }, + "timezone": "America/New_York", + }, + "tenant": "ingen_isla_nublar", + } + ], + create_audience=True, + ) + assert audience is None + + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_add_members(self, client: Knock) -> None: response = client.audiences.with_raw_response.add_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) assert response.is_closed is True @@ -39,12 +156,12 @@ def test_raw_response_add_members(self, client: Knock) -> None: audience = response.parse() assert audience is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_add_members(self, client: Knock) -> None: with client.audiences.with_streaming_response.add_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,16 +171,16 @@ def test_streaming_response_add_members(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_add_members(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): client.audiences.with_raw_response.add_members( key="", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_members(self, client: Knock) -> None: audience = client.audiences.list_members( @@ -71,7 +188,7 @@ def test_method_list_members(self, client: Knock) -> None: ) assert_matches_type(AudienceListMembersResponse, audience, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_members(self, client: Knock) -> None: response = client.audiences.with_raw_response.list_members( @@ -83,7 +200,7 @@ def test_raw_response_list_members(self, client: Knock) -> None: audience = response.parse() assert_matches_type(AudienceListMembersResponse, audience, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_members(self, client: Knock) -> None: with client.audiences.with_streaming_response.list_members( @@ -97,7 +214,7 @@ def test_streaming_response_list_members(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_members(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -105,21 +222,21 @@ def test_path_params_list_members(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_remove_members(self, client: Knock) -> None: audience = client.audiences.remove_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) assert audience is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_remove_members(self, client: Knock) -> None: response = client.audiences.with_raw_response.remove_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) assert response.is_closed is True @@ -127,12 +244,12 @@ def test_raw_response_remove_members(self, client: Knock) -> None: audience = response.parse() assert audience is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_remove_members(self, client: Knock) -> None: with client.audiences.with_streaming_response.remove_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -142,13 +259,13 @@ def test_streaming_response_remove_members(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_remove_members(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): client.audiences.with_raw_response.remove_members( key="", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) @@ -157,21 +274,137 @@ class TestAsyncAudiences: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_add_members(self, async_client: AsyncKnock) -> None: audience = await async_client.audiences.add_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], + ) + assert audience is None + + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") + @parametrize + async def test_method_add_members_with_all_params(self, async_client: AsyncKnock) -> None: + audience = await async_client.audiences.add_members( + key="key", + members=[ + { + "user": { + "id": "dr_sattler", + "avatar": "avatar", + "channel_data": {"97c5837d-c65c-4d54-aa39-080eeb81c69d": {"tokens": ["push_token_123"]}}, + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "email": "ellie@ingen.net", + "locale": "locale", + "name": "Dr. Ellie Sattler", + "phone_number": "phone_number", + "preferences": { + "default": { + "_persistence_strategy": "merge", + "categories": { + "marketing": False, + "transactional": { + "channel_types": { + "chat": True, + "email": False, + "http": True, + "in_app_feed": True, + "push": True, + "sms": { + "conditions": [ + { + "argument": "US", + "operator": "equal_to", + "variable": "recipient.country_code", + } + ] + }, + }, + "channels": {"aef6e715-df82-4ab6-b61e-b743e249f7b6": True}, + "conditions": [ + { + "argument": "frog_genome", + "operator": "contains", + "variable": "specimen.dna_sequence", + } + ], + }, + }, + "channel_types": { + "chat": True, + "email": True, + "http": True, + "in_app_feed": True, + "push": True, + "sms": { + "conditions": [ + { + "argument": "US", + "operator": "equal_to", + "variable": "recipient.country_code", + } + ] + }, + }, + "channels": { + "2f641633-95d3-4555-9222-9f1eb7888a80": { + "conditions": [ + { + "argument": "US", + "operator": "equal_to", + "variable": "recipient.country_code", + } + ] + }, + "aef6e715-df82-4ab6-b61e-b743e249f7b6": True, + }, + "commercial_subscribed": True, + "workflows": { + "dinosaurs-loose": { + "channel_types": { + "chat": True, + "email": True, + "http": True, + "in_app_feed": True, + "push": True, + "sms": { + "conditions": [ + { + "argument": "US", + "operator": "equal_to", + "variable": "recipient.country_code", + } + ] + }, + }, + "channels": {"aef6e715-df82-4ab6-b61e-b743e249f7b6": True}, + "conditions": [ + { + "argument": "frog_genome", + "operator": "contains", + "variable": "specimen.dna_sequence", + } + ], + } + }, + } + }, + "timezone": "America/New_York", + }, + "tenant": "ingen_isla_nublar", + } + ], + create_audience=True, ) assert audience is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_add_members(self, async_client: AsyncKnock) -> None: response = await async_client.audiences.with_raw_response.add_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) assert response.is_closed is True @@ -179,12 +412,12 @@ async def test_raw_response_add_members(self, async_client: AsyncKnock) -> None: audience = await response.parse() assert audience is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_add_members(self, async_client: AsyncKnock) -> None: async with async_client.audiences.with_streaming_response.add_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -194,16 +427,16 @@ async def test_streaming_response_add_members(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_add_members(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): await async_client.audiences.with_raw_response.add_members( key="", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_members(self, async_client: AsyncKnock) -> None: audience = await async_client.audiences.list_members( @@ -211,7 +444,7 @@ async def test_method_list_members(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AudienceListMembersResponse, audience, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_members(self, async_client: AsyncKnock) -> None: response = await async_client.audiences.with_raw_response.list_members( @@ -223,7 +456,7 @@ async def test_raw_response_list_members(self, async_client: AsyncKnock) -> None audience = await response.parse() assert_matches_type(AudienceListMembersResponse, audience, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_members(self, async_client: AsyncKnock) -> None: async with async_client.audiences.with_streaming_response.list_members( @@ -237,7 +470,7 @@ async def test_streaming_response_list_members(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_members(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -245,21 +478,21 @@ async def test_path_params_list_members(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_remove_members(self, async_client: AsyncKnock) -> None: audience = await async_client.audiences.remove_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) assert audience is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_remove_members(self, async_client: AsyncKnock) -> None: response = await async_client.audiences.with_raw_response.remove_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) assert response.is_closed is True @@ -267,12 +500,12 @@ async def test_raw_response_remove_members(self, async_client: AsyncKnock) -> No audience = await response.parse() assert audience is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_remove_members(self, async_client: AsyncKnock) -> None: async with async_client.audiences.with_streaming_response.remove_members( key="key", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -282,11 +515,11 @@ async def test_streaming_response_remove_members(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_remove_members(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): await async_client.audiences.with_raw_response.remove_members( key="", - members=[{"user": {}}], + members=[{"user": {"id": "dr_sattler"}}], ) diff --git a/tests/api_resources/test_bulk_operations.py b/tests/api_resources/test_bulk_operations.py index fccc4e1a..a38e091b 100644 --- a/tests/api_resources/test_bulk_operations.py +++ b/tests/api_resources/test_bulk_operations.py @@ -17,7 +17,7 @@ class TestBulkOperations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get(self, client: Knock) -> None: bulk_operation = client.bulk_operations.get( @@ -25,7 +25,7 @@ def test_method_get(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk_operation, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get(self, client: Knock) -> None: response = client.bulk_operations.with_raw_response.get( @@ -37,7 +37,7 @@ def test_raw_response_get(self, client: Knock) -> None: bulk_operation = response.parse() assert_matches_type(BulkOperation, bulk_operation, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get(self, client: Knock) -> None: with client.bulk_operations.with_streaming_response.get( @@ -51,7 +51,7 @@ def test_streaming_response_get(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -65,7 +65,7 @@ class TestAsyncBulkOperations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get(self, async_client: AsyncKnock) -> None: bulk_operation = await async_client.bulk_operations.get( @@ -73,7 +73,7 @@ async def test_method_get(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk_operation, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get(self, async_client: AsyncKnock) -> None: response = await async_client.bulk_operations.with_raw_response.get( @@ -85,7 +85,7 @@ async def test_raw_response_get(self, async_client: AsyncKnock) -> None: bulk_operation = await response.parse() assert_matches_type(BulkOperation, bulk_operation, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: async with async_client.bulk_operations.with_streaming_response.get( @@ -99,7 +99,7 @@ async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): diff --git a/tests/api_resources/test_messages.py b/tests/api_resources/test_messages.py index cbb2c482..3225f70f 100644 --- a/tests/api_resources/test_messages.py +++ b/tests/api_resources/test_messages.py @@ -24,13 +24,13 @@ class TestMessages: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list(self, client: Knock) -> None: message = client.messages.list() assert_matches_type(SyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_with_all_params(self, client: Knock) -> None: message = client.messages.list( @@ -56,7 +56,7 @@ def test_method_list_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list(self, client: Knock) -> None: response = client.messages.with_raw_response.list() @@ -66,7 +66,7 @@ def test_raw_response_list(self, client: Knock) -> None: message = response.parse() assert_matches_type(SyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list(self, client: Knock) -> None: with client.messages.with_streaming_response.list() as response: @@ -78,7 +78,7 @@ def test_streaming_response_list(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_archive(self, client: Knock) -> None: message = client.messages.archive( @@ -86,7 +86,7 @@ def test_method_archive(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_archive(self, client: Knock) -> None: response = client.messages.with_raw_response.archive( @@ -98,7 +98,7 @@ def test_raw_response_archive(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_archive(self, client: Knock) -> None: with client.messages.with_streaming_response.archive( @@ -112,7 +112,7 @@ def test_streaming_response_archive(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_archive(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -120,7 +120,7 @@ def test_path_params_archive(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get(self, client: Knock) -> None: message = client.messages.get( @@ -128,7 +128,7 @@ def test_method_get(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get(self, client: Knock) -> None: response = client.messages.with_raw_response.get( @@ -140,7 +140,7 @@ def test_raw_response_get(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get(self, client: Knock) -> None: with client.messages.with_streaming_response.get( @@ -154,7 +154,7 @@ def test_streaming_response_get(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -162,7 +162,7 @@ def test_path_params_get(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_content(self, client: Knock) -> None: message = client.messages.get_content( @@ -170,7 +170,7 @@ def test_method_get_content(self, client: Knock) -> None: ) assert_matches_type(MessageGetContentResponse, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_content(self, client: Knock) -> None: response = client.messages.with_raw_response.get_content( @@ -182,7 +182,7 @@ def test_raw_response_get_content(self, client: Knock) -> None: message = response.parse() assert_matches_type(MessageGetContentResponse, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_content(self, client: Knock) -> None: with client.messages.with_streaming_response.get_content( @@ -196,7 +196,7 @@ def test_streaming_response_get_content(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_content(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -204,7 +204,7 @@ def test_path_params_get_content(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_activities(self, client: Knock) -> None: message = client.messages.list_activities( @@ -212,7 +212,7 @@ def test_method_list_activities(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_activities_with_all_params(self, client: Knock) -> None: message = client.messages.list_activities( @@ -224,7 +224,7 @@ def test_method_list_activities_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_activities(self, client: Knock) -> None: response = client.messages.with_raw_response.list_activities( @@ -236,7 +236,7 @@ def test_raw_response_list_activities(self, client: Knock) -> None: message = response.parse() assert_matches_type(SyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_activities(self, client: Knock) -> None: with client.messages.with_streaming_response.list_activities( @@ -250,7 +250,7 @@ def test_streaming_response_list_activities(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_activities(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -258,7 +258,7 @@ def test_path_params_list_activities(self, client: Knock) -> None: message_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_delivery_logs(self, client: Knock) -> None: message = client.messages.list_delivery_logs( @@ -266,7 +266,7 @@ def test_method_list_delivery_logs(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_delivery_logs_with_all_params(self, client: Knock) -> None: message = client.messages.list_delivery_logs( @@ -277,7 +277,7 @@ def test_method_list_delivery_logs_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_delivery_logs(self, client: Knock) -> None: response = client.messages.with_raw_response.list_delivery_logs( @@ -289,7 +289,7 @@ def test_raw_response_list_delivery_logs(self, client: Knock) -> None: message = response.parse() assert_matches_type(SyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_delivery_logs(self, client: Knock) -> None: with client.messages.with_streaming_response.list_delivery_logs( @@ -303,7 +303,7 @@ def test_streaming_response_list_delivery_logs(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_delivery_logs(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -311,7 +311,7 @@ def test_path_params_list_delivery_logs(self, client: Knock) -> None: message_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_events(self, client: Knock) -> None: message = client.messages.list_events( @@ -319,7 +319,7 @@ def test_method_list_events(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_events_with_all_params(self, client: Knock) -> None: message = client.messages.list_events( @@ -330,7 +330,7 @@ def test_method_list_events_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_events(self, client: Knock) -> None: response = client.messages.with_raw_response.list_events( @@ -342,7 +342,7 @@ def test_raw_response_list_events(self, client: Knock) -> None: message = response.parse() assert_matches_type(SyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_events(self, client: Knock) -> None: with client.messages.with_streaming_response.list_events( @@ -356,7 +356,7 @@ def test_streaming_response_list_events(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_events(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -364,7 +364,7 @@ def test_path_params_list_events(self, client: Knock) -> None: message_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_interacted(self, client: Knock) -> None: message = client.messages.mark_as_interacted( @@ -372,7 +372,7 @@ def test_method_mark_as_interacted(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_interacted_with_all_params(self, client: Knock) -> None: message = client.messages.mark_as_interacted( @@ -381,7 +381,7 @@ def test_method_mark_as_interacted_with_all_params(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_interacted(self, client: Knock) -> None: response = client.messages.with_raw_response.mark_as_interacted( @@ -393,7 +393,7 @@ def test_raw_response_mark_as_interacted(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_interacted(self, client: Knock) -> None: with client.messages.with_streaming_response.mark_as_interacted( @@ -407,7 +407,7 @@ def test_streaming_response_mark_as_interacted(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_as_interacted(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -415,7 +415,7 @@ def test_path_params_mark_as_interacted(self, client: Knock) -> None: message_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_read(self, client: Knock) -> None: message = client.messages.mark_as_read( @@ -423,7 +423,7 @@ def test_method_mark_as_read(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_read(self, client: Knock) -> None: response = client.messages.with_raw_response.mark_as_read( @@ -435,7 +435,7 @@ def test_raw_response_mark_as_read(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_read(self, client: Knock) -> None: with client.messages.with_streaming_response.mark_as_read( @@ -449,7 +449,7 @@ def test_streaming_response_mark_as_read(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_as_read(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -457,7 +457,7 @@ def test_path_params_mark_as_read(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_seen(self, client: Knock) -> None: message = client.messages.mark_as_seen( @@ -465,7 +465,7 @@ def test_method_mark_as_seen(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_seen(self, client: Knock) -> None: response = client.messages.with_raw_response.mark_as_seen( @@ -477,7 +477,7 @@ def test_raw_response_mark_as_seen(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_seen(self, client: Knock) -> None: with client.messages.with_streaming_response.mark_as_seen( @@ -491,7 +491,7 @@ def test_streaming_response_mark_as_seen(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_as_seen(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -499,7 +499,7 @@ def test_path_params_mark_as_seen(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_unread(self, client: Knock) -> None: message = client.messages.mark_as_unread( @@ -507,7 +507,7 @@ def test_method_mark_as_unread(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_unread(self, client: Knock) -> None: response = client.messages.with_raw_response.mark_as_unread( @@ -519,7 +519,7 @@ def test_raw_response_mark_as_unread(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_unread(self, client: Knock) -> None: with client.messages.with_streaming_response.mark_as_unread( @@ -533,7 +533,7 @@ def test_streaming_response_mark_as_unread(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_as_unread(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -541,7 +541,7 @@ def test_path_params_mark_as_unread(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_unseen(self, client: Knock) -> None: message = client.messages.mark_as_unseen( @@ -549,7 +549,7 @@ def test_method_mark_as_unseen(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_unseen(self, client: Knock) -> None: response = client.messages.with_raw_response.mark_as_unseen( @@ -561,7 +561,7 @@ def test_raw_response_mark_as_unseen(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_unseen(self, client: Knock) -> None: with client.messages.with_streaming_response.mark_as_unseen( @@ -575,7 +575,7 @@ def test_streaming_response_mark_as_unseen(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_as_unseen(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -583,7 +583,7 @@ def test_path_params_mark_as_unseen(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_unarchive(self, client: Knock) -> None: message = client.messages.unarchive( @@ -591,7 +591,7 @@ def test_method_unarchive(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_unarchive(self, client: Knock) -> None: response = client.messages.with_raw_response.unarchive( @@ -603,7 +603,7 @@ def test_raw_response_unarchive(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_unarchive(self, client: Knock) -> None: with client.messages.with_streaming_response.unarchive( @@ -617,7 +617,7 @@ def test_streaming_response_unarchive(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_unarchive(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -631,13 +631,13 @@ class TestAsyncMessages: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list() assert_matches_type(AsyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list( @@ -663,7 +663,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> No ) assert_matches_type(AsyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.list() @@ -673,7 +673,7 @@ async def test_raw_response_list(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(AsyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.list() as response: @@ -685,7 +685,7 @@ async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_archive(self, async_client: AsyncKnock) -> None: message = await async_client.messages.archive( @@ -693,7 +693,7 @@ async def test_method_archive(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_archive(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.archive( @@ -705,7 +705,7 @@ async def test_raw_response_archive(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_archive(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.archive( @@ -719,7 +719,7 @@ async def test_streaming_response_archive(self, async_client: AsyncKnock) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_archive(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -727,7 +727,7 @@ async def test_path_params_archive(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get(self, async_client: AsyncKnock) -> None: message = await async_client.messages.get( @@ -735,7 +735,7 @@ async def test_method_get(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.get( @@ -747,7 +747,7 @@ async def test_raw_response_get(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.get( @@ -761,7 +761,7 @@ async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -769,7 +769,7 @@ async def test_path_params_get(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_content(self, async_client: AsyncKnock) -> None: message = await async_client.messages.get_content( @@ -777,7 +777,7 @@ async def test_method_get_content(self, async_client: AsyncKnock) -> None: ) assert_matches_type(MessageGetContentResponse, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_content(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.get_content( @@ -789,7 +789,7 @@ async def test_raw_response_get_content(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(MessageGetContentResponse, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_content(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.get_content( @@ -803,7 +803,7 @@ async def test_streaming_response_get_content(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_content(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -811,7 +811,7 @@ async def test_path_params_get_content(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_activities(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_activities( @@ -819,7 +819,7 @@ async def test_method_list_activities(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_activities_with_all_params(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_activities( @@ -831,7 +831,7 @@ async def test_method_list_activities_with_all_params(self, async_client: AsyncK ) assert_matches_type(AsyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_activities(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.list_activities( @@ -843,7 +843,7 @@ async def test_raw_response_list_activities(self, async_client: AsyncKnock) -> N message = await response.parse() assert_matches_type(AsyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_activities(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.list_activities( @@ -857,7 +857,7 @@ async def test_streaming_response_list_activities(self, async_client: AsyncKnock assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_activities(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -865,7 +865,7 @@ async def test_path_params_list_activities(self, async_client: AsyncKnock) -> No message_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_delivery_logs(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_delivery_logs( @@ -873,7 +873,7 @@ async def test_method_list_delivery_logs(self, async_client: AsyncKnock) -> None ) assert_matches_type(AsyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_delivery_logs_with_all_params(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_delivery_logs( @@ -884,7 +884,7 @@ async def test_method_list_delivery_logs_with_all_params(self, async_client: Asy ) assert_matches_type(AsyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_delivery_logs(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.list_delivery_logs( @@ -896,7 +896,7 @@ async def test_raw_response_list_delivery_logs(self, async_client: AsyncKnock) - message = await response.parse() assert_matches_type(AsyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_delivery_logs(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.list_delivery_logs( @@ -910,7 +910,7 @@ async def test_streaming_response_list_delivery_logs(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_delivery_logs(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -918,7 +918,7 @@ async def test_path_params_list_delivery_logs(self, async_client: AsyncKnock) -> message_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_events(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_events( @@ -926,7 +926,7 @@ async def test_method_list_events(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_events_with_all_params(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_events( @@ -937,7 +937,7 @@ async def test_method_list_events_with_all_params(self, async_client: AsyncKnock ) assert_matches_type(AsyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_events(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.list_events( @@ -949,7 +949,7 @@ async def test_raw_response_list_events(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(AsyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_events(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.list_events( @@ -963,7 +963,7 @@ async def test_streaming_response_list_events(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_events(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -971,7 +971,7 @@ async def test_path_params_list_events(self, async_client: AsyncKnock) -> None: message_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_interacted(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_interacted( @@ -979,7 +979,7 @@ async def test_method_mark_as_interacted(self, async_client: AsyncKnock) -> None ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_interacted_with_all_params(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_interacted( @@ -988,7 +988,7 @@ async def test_method_mark_as_interacted_with_all_params(self, async_client: Asy ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_interacted(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.mark_as_interacted( @@ -1000,7 +1000,7 @@ async def test_raw_response_mark_as_interacted(self, async_client: AsyncKnock) - message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_interacted(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.mark_as_interacted( @@ -1014,7 +1014,7 @@ async def test_streaming_response_mark_as_interacted(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_as_interacted(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -1022,7 +1022,7 @@ async def test_path_params_mark_as_interacted(self, async_client: AsyncKnock) -> message_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_read(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_read( @@ -1030,7 +1030,7 @@ async def test_method_mark_as_read(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_read(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.mark_as_read( @@ -1042,7 +1042,7 @@ async def test_raw_response_mark_as_read(self, async_client: AsyncKnock) -> None message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_read(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.mark_as_read( @@ -1056,7 +1056,7 @@ async def test_streaming_response_mark_as_read(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_as_read(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -1064,7 +1064,7 @@ async def test_path_params_mark_as_read(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_seen(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_seen( @@ -1072,7 +1072,7 @@ async def test_method_mark_as_seen(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_seen(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.mark_as_seen( @@ -1084,7 +1084,7 @@ async def test_raw_response_mark_as_seen(self, async_client: AsyncKnock) -> None message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_seen(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.mark_as_seen( @@ -1098,7 +1098,7 @@ async def test_streaming_response_mark_as_seen(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_as_seen(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -1106,7 +1106,7 @@ async def test_path_params_mark_as_seen(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_unread(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_unread( @@ -1114,7 +1114,7 @@ async def test_method_mark_as_unread(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_unread(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.mark_as_unread( @@ -1126,7 +1126,7 @@ async def test_raw_response_mark_as_unread(self, async_client: AsyncKnock) -> No message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_unread(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.mark_as_unread( @@ -1140,7 +1140,7 @@ async def test_streaming_response_mark_as_unread(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_as_unread(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -1148,7 +1148,7 @@ async def test_path_params_mark_as_unread(self, async_client: AsyncKnock) -> Non "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_unseen(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_unseen( @@ -1156,7 +1156,7 @@ async def test_method_mark_as_unseen(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_unseen(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.mark_as_unseen( @@ -1168,7 +1168,7 @@ async def test_raw_response_mark_as_unseen(self, async_client: AsyncKnock) -> No message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_unseen(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.mark_as_unseen( @@ -1182,7 +1182,7 @@ async def test_streaming_response_mark_as_unseen(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_as_unseen(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -1190,7 +1190,7 @@ async def test_path_params_mark_as_unseen(self, async_client: AsyncKnock) -> Non "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_unarchive(self, async_client: AsyncKnock) -> None: message = await async_client.messages.unarchive( @@ -1198,7 +1198,7 @@ async def test_method_unarchive(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_unarchive(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.unarchive( @@ -1210,7 +1210,7 @@ async def test_raw_response_unarchive(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_unarchive(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.unarchive( @@ -1224,7 +1224,7 @@ async def test_streaming_response_unarchive(self, async_client: AsyncKnock) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_unarchive(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): diff --git a/tests/api_resources/test_objects.py b/tests/api_resources/test_objects.py index 79cc891b..b1187ab3 100644 --- a/tests/api_resources/test_objects.py +++ b/tests/api_resources/test_objects.py @@ -30,7 +30,7 @@ class TestObjects: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list(self, client: Knock) -> None: object_ = client.objects.list( @@ -38,7 +38,7 @@ def test_method_list(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_with_all_params(self, client: Knock) -> None: object_ = client.objects.list( @@ -50,7 +50,7 @@ def test_method_list_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list(self, client: Knock) -> None: response = client.objects.with_raw_response.list( @@ -62,7 +62,7 @@ def test_raw_response_list(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(SyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list(self, client: Knock) -> None: with client.objects.with_streaming_response.list( @@ -76,7 +76,7 @@ def test_streaming_response_list(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -84,7 +84,7 @@ def test_path_params_list(self, client: Knock) -> None: collection="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: object_ = client.objects.delete( @@ -93,7 +93,7 @@ def test_method_delete(self, client: Knock) -> None: ) assert object_ is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.objects.with_raw_response.delete( @@ -106,7 +106,7 @@ def test_raw_response_delete(self, client: Knock) -> None: object_ = response.parse() assert object_ is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.objects.with_streaming_response.delete( @@ -121,7 +121,7 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -136,7 +136,7 @@ def test_path_params_delete(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_add_subscriptions(self, client: Knock) -> None: object_ = client.objects.add_subscriptions( @@ -146,7 +146,7 @@ def test_method_add_subscriptions(self, client: Knock) -> None: ) assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_add_subscriptions_with_all_params(self, client: Knock) -> None: object_ = client.objects.add_subscriptions( @@ -157,7 +157,7 @@ def test_method_add_subscriptions_with_all_params(self, client: Knock) -> None: ) assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_add_subscriptions(self, client: Knock) -> None: response = client.objects.with_raw_response.add_subscriptions( @@ -171,7 +171,7 @@ def test_raw_response_add_subscriptions(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_add_subscriptions(self, client: Knock) -> None: with client.objects.with_streaming_response.add_subscriptions( @@ -187,7 +187,7 @@ def test_streaming_response_add_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_add_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -204,7 +204,7 @@ def test_path_params_add_subscriptions(self, client: Knock) -> None: recipients=["user_1", "user_2"], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete_subscriptions(self, client: Knock) -> None: object_ = client.objects.delete_subscriptions( @@ -214,7 +214,7 @@ def test_method_delete_subscriptions(self, client: Knock) -> None: ) assert_matches_type(ObjectDeleteSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete_subscriptions(self, client: Knock) -> None: response = client.objects.with_raw_response.delete_subscriptions( @@ -228,7 +228,7 @@ def test_raw_response_delete_subscriptions(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(ObjectDeleteSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete_subscriptions(self, client: Knock) -> None: with client.objects.with_streaming_response.delete_subscriptions( @@ -244,7 +244,7 @@ def test_streaming_response_delete_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -261,7 +261,7 @@ def test_path_params_delete_subscriptions(self, client: Knock) -> None: recipients=["user_123"], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get(self, client: Knock) -> None: object_ = client.objects.get( @@ -270,7 +270,7 @@ def test_method_get(self, client: Knock) -> None: ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get(self, client: Knock) -> None: response = client.objects.with_raw_response.get( @@ -283,7 +283,7 @@ def test_raw_response_get(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get(self, client: Knock) -> None: with client.objects.with_streaming_response.get( @@ -298,7 +298,7 @@ def test_streaming_response_get(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -313,7 +313,7 @@ def test_path_params_get(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_channel_data(self, client: Knock) -> None: object_ = client.objects.get_channel_data( @@ -323,7 +323,7 @@ def test_method_get_channel_data(self, client: Knock) -> None: ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_channel_data(self, client: Knock) -> None: response = client.objects.with_raw_response.get_channel_data( @@ -337,7 +337,7 @@ def test_raw_response_get_channel_data(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_channel_data(self, client: Knock) -> None: with client.objects.with_streaming_response.get_channel_data( @@ -353,7 +353,7 @@ def test_streaming_response_get_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -377,7 +377,7 @@ def test_path_params_get_channel_data(self, client: Knock) -> None: channel_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_preferences(self, client: Knock) -> None: object_ = client.objects.get_preferences( @@ -387,7 +387,7 @@ def test_method_get_preferences(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_preferences(self, client: Knock) -> None: response = client.objects.with_raw_response.get_preferences( @@ -401,7 +401,7 @@ def test_raw_response_get_preferences(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_preferences(self, client: Knock) -> None: with client.objects.with_streaming_response.get_preferences( @@ -417,7 +417,7 @@ def test_streaming_response_get_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -441,7 +441,7 @@ def test_path_params_get_preferences(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_messages(self, client: Knock) -> None: object_ = client.objects.list_messages( @@ -450,7 +450,7 @@ def test_method_list_messages(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_messages_with_all_params(self, client: Knock) -> None: object_ = client.objects.list_messages( @@ -478,7 +478,7 @@ def test_method_list_messages_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_messages(self, client: Knock) -> None: response = client.objects.with_raw_response.list_messages( @@ -491,7 +491,7 @@ def test_raw_response_list_messages(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(SyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_messages(self, client: Knock) -> None: with client.objects.with_streaming_response.list_messages( @@ -506,7 +506,7 @@ def test_streaming_response_list_messages(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_messages(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -521,7 +521,7 @@ def test_path_params_list_messages(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_preferences(self, client: Knock) -> None: object_ = client.objects.list_preferences( @@ -530,7 +530,7 @@ def test_method_list_preferences(self, client: Knock) -> None: ) assert_matches_type(ObjectListPreferencesResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_preferences(self, client: Knock) -> None: response = client.objects.with_raw_response.list_preferences( @@ -543,7 +543,7 @@ def test_raw_response_list_preferences(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(ObjectListPreferencesResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_preferences(self, client: Knock) -> None: with client.objects.with_streaming_response.list_preferences( @@ -558,7 +558,7 @@ def test_streaming_response_list_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -573,7 +573,7 @@ def test_path_params_list_preferences(self, client: Knock) -> None: object_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_schedules(self, client: Knock) -> None: object_ = client.objects.list_schedules( @@ -582,7 +582,7 @@ def test_method_list_schedules(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_schedules_with_all_params(self, client: Knock) -> None: object_ = client.objects.list_schedules( @@ -596,7 +596,7 @@ def test_method_list_schedules_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_schedules(self, client: Knock) -> None: response = client.objects.with_raw_response.list_schedules( @@ -609,7 +609,7 @@ def test_raw_response_list_schedules(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(SyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_schedules(self, client: Knock) -> None: with client.objects.with_streaming_response.list_schedules( @@ -624,7 +624,7 @@ def test_streaming_response_list_schedules(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_schedules(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -639,7 +639,7 @@ def test_path_params_list_schedules(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_subscriptions(self, client: Knock) -> None: object_ = client.objects.list_subscriptions( @@ -648,7 +648,7 @@ def test_method_list_subscriptions(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_subscriptions_with_all_params(self, client: Knock) -> None: object_ = client.objects.list_subscriptions( @@ -669,7 +669,7 @@ def test_method_list_subscriptions_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_subscriptions(self, client: Knock) -> None: response = client.objects.with_raw_response.list_subscriptions( @@ -682,7 +682,7 @@ def test_raw_response_list_subscriptions(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(SyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_subscriptions(self, client: Knock) -> None: with client.objects.with_streaming_response.list_subscriptions( @@ -697,7 +697,7 @@ def test_streaming_response_list_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -712,7 +712,7 @@ def test_path_params_list_subscriptions(self, client: Knock) -> None: object_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set(self, client: Knock) -> None: object_ = client.objects.set( @@ -721,7 +721,7 @@ def test_method_set(self, client: Knock) -> None: ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_with_all_params(self, client: Knock) -> None: object_ = client.objects.set( @@ -825,7 +825,7 @@ def test_method_set_with_all_params(self, client: Knock) -> None: ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set(self, client: Knock) -> None: response = client.objects.with_raw_response.set( @@ -838,7 +838,7 @@ def test_raw_response_set(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set(self, client: Knock) -> None: with client.objects.with_streaming_response.set( @@ -853,7 +853,7 @@ def test_streaming_response_set(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -868,7 +868,7 @@ def test_path_params_set(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_channel_data(self, client: Knock) -> None: object_ = client.objects.set_channel_data( @@ -879,7 +879,7 @@ def test_method_set_channel_data(self, client: Knock) -> None: ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_channel_data_with_all_params(self, client: Knock) -> None: object_ = client.objects.set_channel_data( @@ -890,7 +890,7 @@ def test_method_set_channel_data_with_all_params(self, client: Knock) -> None: ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set_channel_data(self, client: Knock) -> None: response = client.objects.with_raw_response.set_channel_data( @@ -905,7 +905,7 @@ def test_raw_response_set_channel_data(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set_channel_data(self, client: Knock) -> None: with client.objects.with_streaming_response.set_channel_data( @@ -922,7 +922,7 @@ def test_streaming_response_set_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -949,7 +949,7 @@ def test_path_params_set_channel_data(self, client: Knock) -> None: data={"tokens": ["push_token_1"]}, ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences(self, client: Knock) -> None: object_ = client.objects.set_preferences( @@ -959,7 +959,7 @@ def test_method_set_preferences(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences_with_all_params(self, client: Knock) -> None: object_ = client.objects.set_preferences( @@ -1056,7 +1056,7 @@ def test_method_set_preferences_with_all_params(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set_preferences(self, client: Knock) -> None: response = client.objects.with_raw_response.set_preferences( @@ -1070,7 +1070,7 @@ def test_raw_response_set_preferences(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set_preferences(self, client: Knock) -> None: with client.objects.with_streaming_response.set_preferences( @@ -1086,7 +1086,7 @@ def test_streaming_response_set_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1110,7 +1110,7 @@ def test_path_params_set_preferences(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_unset_channel_data(self, client: Knock) -> None: object_ = client.objects.unset_channel_data( @@ -1120,7 +1120,7 @@ def test_method_unset_channel_data(self, client: Knock) -> None: ) assert object_ is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_unset_channel_data(self, client: Knock) -> None: response = client.objects.with_raw_response.unset_channel_data( @@ -1134,7 +1134,7 @@ def test_raw_response_unset_channel_data(self, client: Knock) -> None: object_ = response.parse() assert object_ is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_unset_channel_data(self, client: Knock) -> None: with client.objects.with_streaming_response.unset_channel_data( @@ -1150,7 +1150,7 @@ def test_streaming_response_unset_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_unset_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1180,7 +1180,7 @@ class TestAsyncObjects: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list( @@ -1188,7 +1188,7 @@ async def test_method_list(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list( @@ -1200,7 +1200,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> No ) assert_matches_type(AsyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.list( @@ -1212,7 +1212,7 @@ async def test_raw_response_list(self, async_client: AsyncKnock) -> None: object_ = await response.parse() assert_matches_type(AsyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.list( @@ -1226,7 +1226,7 @@ async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1234,7 +1234,7 @@ async def test_path_params_list(self, async_client: AsyncKnock) -> None: collection="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.delete( @@ -1243,7 +1243,7 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert object_ is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.delete( @@ -1256,7 +1256,7 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: object_ = await response.parse() assert object_ is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.delete( @@ -1271,7 +1271,7 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1286,7 +1286,7 @@ async def test_path_params_delete(self, async_client: AsyncKnock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_add_subscriptions(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.add_subscriptions( @@ -1296,7 +1296,7 @@ async def test_method_add_subscriptions(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_add_subscriptions_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.add_subscriptions( @@ -1307,7 +1307,7 @@ async def test_method_add_subscriptions_with_all_params(self, async_client: Asyn ) assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_add_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.add_subscriptions( @@ -1321,7 +1321,7 @@ async def test_raw_response_add_subscriptions(self, async_client: AsyncKnock) -> object_ = await response.parse() assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_add_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.add_subscriptions( @@ -1337,7 +1337,7 @@ async def test_streaming_response_add_subscriptions(self, async_client: AsyncKno assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_add_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1354,7 +1354,7 @@ async def test_path_params_add_subscriptions(self, async_client: AsyncKnock) -> recipients=["user_1", "user_2"], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete_subscriptions(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.delete_subscriptions( @@ -1364,7 +1364,7 @@ async def test_method_delete_subscriptions(self, async_client: AsyncKnock) -> No ) assert_matches_type(ObjectDeleteSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.delete_subscriptions( @@ -1378,7 +1378,7 @@ async def test_raw_response_delete_subscriptions(self, async_client: AsyncKnock) object_ = await response.parse() assert_matches_type(ObjectDeleteSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.delete_subscriptions( @@ -1394,7 +1394,7 @@ async def test_streaming_response_delete_subscriptions(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1411,7 +1411,7 @@ async def test_path_params_delete_subscriptions(self, async_client: AsyncKnock) recipients=["user_123"], ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.get( @@ -1420,7 +1420,7 @@ async def test_method_get(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.get( @@ -1433,7 +1433,7 @@ async def test_raw_response_get(self, async_client: AsyncKnock) -> None: object_ = await response.parse() assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.get( @@ -1448,7 +1448,7 @@ async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1463,7 +1463,7 @@ async def test_path_params_get(self, async_client: AsyncKnock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_channel_data(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.get_channel_data( @@ -1473,7 +1473,7 @@ async def test_method_get_channel_data(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.get_channel_data( @@ -1487,7 +1487,7 @@ async def test_raw_response_get_channel_data(self, async_client: AsyncKnock) -> object_ = await response.parse() assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.get_channel_data( @@ -1503,7 +1503,7 @@ async def test_streaming_response_get_channel_data(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1527,7 +1527,7 @@ async def test_path_params_get_channel_data(self, async_client: AsyncKnock) -> N channel_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_preferences(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.get_preferences( @@ -1537,7 +1537,7 @@ async def test_method_get_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.get_preferences( @@ -1551,7 +1551,7 @@ async def test_raw_response_get_preferences(self, async_client: AsyncKnock) -> N object_ = await response.parse() assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_preferences(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.get_preferences( @@ -1567,7 +1567,7 @@ async def test_streaming_response_get_preferences(self, async_client: AsyncKnock assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1591,7 +1591,7 @@ async def test_path_params_get_preferences(self, async_client: AsyncKnock) -> No id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_messages(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_messages( @@ -1600,7 +1600,7 @@ async def test_method_list_messages(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_messages_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_messages( @@ -1628,7 +1628,7 @@ async def test_method_list_messages_with_all_params(self, async_client: AsyncKno ) assert_matches_type(AsyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_messages(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.list_messages( @@ -1641,7 +1641,7 @@ async def test_raw_response_list_messages(self, async_client: AsyncKnock) -> Non object_ = await response.parse() assert_matches_type(AsyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_messages(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.list_messages( @@ -1656,7 +1656,7 @@ async def test_streaming_response_list_messages(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_messages(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1671,7 +1671,7 @@ async def test_path_params_list_messages(self, async_client: AsyncKnock) -> None id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_preferences(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_preferences( @@ -1680,7 +1680,7 @@ async def test_method_list_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ObjectListPreferencesResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.list_preferences( @@ -1693,7 +1693,7 @@ async def test_raw_response_list_preferences(self, async_client: AsyncKnock) -> object_ = await response.parse() assert_matches_type(ObjectListPreferencesResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_preferences(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.list_preferences( @@ -1708,7 +1708,7 @@ async def test_streaming_response_list_preferences(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1723,7 +1723,7 @@ async def test_path_params_list_preferences(self, async_client: AsyncKnock) -> N object_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_schedules(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_schedules( @@ -1732,7 +1732,7 @@ async def test_method_list_schedules(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_schedules_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_schedules( @@ -1746,7 +1746,7 @@ async def test_method_list_schedules_with_all_params(self, async_client: AsyncKn ) assert_matches_type(AsyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_schedules(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.list_schedules( @@ -1759,7 +1759,7 @@ async def test_raw_response_list_schedules(self, async_client: AsyncKnock) -> No object_ = await response.parse() assert_matches_type(AsyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_schedules(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.list_schedules( @@ -1774,7 +1774,7 @@ async def test_streaming_response_list_schedules(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_schedules(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1789,7 +1789,7 @@ async def test_path_params_list_schedules(self, async_client: AsyncKnock) -> Non id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_subscriptions(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_subscriptions( @@ -1798,7 +1798,7 @@ async def test_method_list_subscriptions(self, async_client: AsyncKnock) -> None ) assert_matches_type(AsyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_subscriptions_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_subscriptions( @@ -1819,7 +1819,7 @@ async def test_method_list_subscriptions_with_all_params(self, async_client: Asy ) assert_matches_type(AsyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.list_subscriptions( @@ -1832,7 +1832,7 @@ async def test_raw_response_list_subscriptions(self, async_client: AsyncKnock) - object_ = await response.parse() assert_matches_type(AsyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.list_subscriptions( @@ -1847,7 +1847,7 @@ async def test_streaming_response_list_subscriptions(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1862,7 +1862,7 @@ async def test_path_params_list_subscriptions(self, async_client: AsyncKnock) -> object_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set( @@ -1871,7 +1871,7 @@ async def test_method_set(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set( @@ -1975,7 +1975,7 @@ async def test_method_set_with_all_params(self, async_client: AsyncKnock) -> Non ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.set( @@ -1988,7 +1988,7 @@ async def test_raw_response_set(self, async_client: AsyncKnock) -> None: object_ = await response.parse() assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.set( @@ -2003,7 +2003,7 @@ async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -2018,7 +2018,7 @@ async def test_path_params_set(self, async_client: AsyncKnock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_channel_data(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set_channel_data( @@ -2029,7 +2029,7 @@ async def test_method_set_channel_data(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_channel_data_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set_channel_data( @@ -2040,7 +2040,7 @@ async def test_method_set_channel_data_with_all_params(self, async_client: Async ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.set_channel_data( @@ -2055,7 +2055,7 @@ async def test_raw_response_set_channel_data(self, async_client: AsyncKnock) -> object_ = await response.parse() assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.set_channel_data( @@ -2072,7 +2072,7 @@ async def test_streaming_response_set_channel_data(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -2099,7 +2099,7 @@ async def test_path_params_set_channel_data(self, async_client: AsyncKnock) -> N data={"tokens": ["push_token_1"]}, ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set_preferences( @@ -2109,7 +2109,7 @@ async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set_preferences( @@ -2206,7 +2206,7 @@ async def test_method_set_preferences_with_all_params(self, async_client: AsyncK ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.set_preferences( @@ -2220,7 +2220,7 @@ async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> N object_ = await response.parse() assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set_preferences(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.set_preferences( @@ -2236,7 +2236,7 @@ async def test_streaming_response_set_preferences(self, async_client: AsyncKnock assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -2260,7 +2260,7 @@ async def test_path_params_set_preferences(self, async_client: AsyncKnock) -> No id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_unset_channel_data(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.unset_channel_data( @@ -2270,7 +2270,7 @@ async def test_method_unset_channel_data(self, async_client: AsyncKnock) -> None ) assert object_ is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_unset_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.unset_channel_data( @@ -2284,7 +2284,7 @@ async def test_raw_response_unset_channel_data(self, async_client: AsyncKnock) - object_ = await response.parse() assert object_ is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_unset_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.unset_channel_data( @@ -2300,7 +2300,7 @@ async def test_streaming_response_unset_channel_data(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_unset_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): diff --git a/tests/api_resources/test_schedules.py b/tests/api_resources/test_schedules.py index f1caed6a..743d9f74 100644 --- a/tests/api_resources/test_schedules.py +++ b/tests/api_resources/test_schedules.py @@ -24,7 +24,7 @@ class TestSchedules: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_create(self, client: Knock) -> None: schedule = client.schedules.create( @@ -33,7 +33,7 @@ def test_method_create(self, client: Knock) -> None: ) assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_create_with_all_params(self, client: Knock) -> None: schedule = client.schedules.create( @@ -159,7 +159,7 @@ def test_method_create_with_all_params(self, client: Knock) -> None: ) assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_create(self, client: Knock) -> None: response = client.schedules.with_raw_response.create( @@ -172,7 +172,7 @@ def test_raw_response_create(self, client: Knock) -> None: schedule = response.parse() assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_create(self, client: Knock) -> None: with client.schedules.with_streaming_response.create( @@ -187,7 +187,7 @@ def test_streaming_response_create(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update(self, client: Knock) -> None: schedule = client.schedules.update( @@ -195,7 +195,7 @@ def test_method_update(self, client: Knock) -> None: ) assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update_with_all_params(self, client: Knock) -> None: schedule = client.schedules.update( @@ -219,7 +219,7 @@ def test_method_update_with_all_params(self, client: Knock) -> None: ) assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_update(self, client: Knock) -> None: response = client.schedules.with_raw_response.update( @@ -231,7 +231,7 @@ def test_raw_response_update(self, client: Knock) -> None: schedule = response.parse() assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_update(self, client: Knock) -> None: with client.schedules.with_streaming_response.update( @@ -245,7 +245,7 @@ def test_streaming_response_update(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list(self, client: Knock) -> None: schedule = client.schedules.list( @@ -253,7 +253,7 @@ def test_method_list(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_with_all_params(self, client: Knock) -> None: schedule = client.schedules.list( @@ -266,7 +266,7 @@ def test_method_list_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list(self, client: Knock) -> None: response = client.schedules.with_raw_response.list( @@ -278,7 +278,7 @@ def test_raw_response_list(self, client: Knock) -> None: schedule = response.parse() assert_matches_type(SyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list(self, client: Knock) -> None: with client.schedules.with_streaming_response.list( @@ -292,7 +292,7 @@ def test_streaming_response_list(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: schedule = client.schedules.delete( @@ -300,7 +300,7 @@ def test_method_delete(self, client: Knock) -> None: ) assert_matches_type(ScheduleDeleteResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.schedules.with_raw_response.delete( @@ -312,7 +312,7 @@ def test_raw_response_delete(self, client: Knock) -> None: schedule = response.parse() assert_matches_type(ScheduleDeleteResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.schedules.with_streaming_response.delete( @@ -332,7 +332,7 @@ class TestAsyncSchedules: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_create(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.create( @@ -341,7 +341,7 @@ async def test_method_create(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.create( @@ -467,7 +467,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncKnock) -> ) assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_create(self, async_client: AsyncKnock) -> None: response = await async_client.schedules.with_raw_response.create( @@ -480,7 +480,7 @@ async def test_raw_response_create(self, async_client: AsyncKnock) -> None: schedule = await response.parse() assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_create(self, async_client: AsyncKnock) -> None: async with async_client.schedules.with_streaming_response.create( @@ -495,7 +495,7 @@ async def test_streaming_response_create(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.update( @@ -503,7 +503,7 @@ async def test_method_update(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.update( @@ -527,7 +527,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncKnock) -> ) assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_update(self, async_client: AsyncKnock) -> None: response = await async_client.schedules.with_raw_response.update( @@ -539,7 +539,7 @@ async def test_raw_response_update(self, async_client: AsyncKnock) -> None: schedule = await response.parse() assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_update(self, async_client: AsyncKnock) -> None: async with async_client.schedules.with_streaming_response.update( @@ -553,7 +553,7 @@ async def test_streaming_response_update(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.list( @@ -561,7 +561,7 @@ async def test_method_list(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.list( @@ -574,7 +574,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> No ) assert_matches_type(AsyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list(self, async_client: AsyncKnock) -> None: response = await async_client.schedules.with_raw_response.list( @@ -586,7 +586,7 @@ async def test_raw_response_list(self, async_client: AsyncKnock) -> None: schedule = await response.parse() assert_matches_type(AsyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: async with async_client.schedules.with_streaming_response.list( @@ -600,7 +600,7 @@ async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.delete( @@ -608,7 +608,7 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ScheduleDeleteResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.schedules.with_raw_response.delete( @@ -620,7 +620,7 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: schedule = await response.parse() assert_matches_type(ScheduleDeleteResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.schedules.with_streaming_response.delete( diff --git a/tests/api_resources/test_tenants.py b/tests/api_resources/test_tenants.py index a9febeb3..796aa18a 100644 --- a/tests/api_resources/test_tenants.py +++ b/tests/api_resources/test_tenants.py @@ -18,13 +18,13 @@ class TestTenants: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list(self, client: Knock) -> None: tenant = client.tenants.list() assert_matches_type(SyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_with_all_params(self, client: Knock) -> None: tenant = client.tenants.list( @@ -36,7 +36,7 @@ def test_method_list_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list(self, client: Knock) -> None: response = client.tenants.with_raw_response.list() @@ -46,7 +46,7 @@ def test_raw_response_list(self, client: Knock) -> None: tenant = response.parse() assert_matches_type(SyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list(self, client: Knock) -> None: with client.tenants.with_streaming_response.list() as response: @@ -58,7 +58,7 @@ def test_streaming_response_list(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: tenant = client.tenants.delete( @@ -66,7 +66,7 @@ def test_method_delete(self, client: Knock) -> None: ) assert tenant is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.tenants.with_raw_response.delete( @@ -78,7 +78,7 @@ def test_raw_response_delete(self, client: Knock) -> None: tenant = response.parse() assert tenant is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.tenants.with_streaming_response.delete( @@ -92,7 +92,7 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_delete(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get(self, client: Knock) -> None: tenant = client.tenants.get( @@ -108,7 +108,7 @@ def test_method_get(self, client: Knock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_with_all_params(self, client: Knock) -> None: tenant = client.tenants.get( @@ -117,7 +117,7 @@ def test_method_get_with_all_params(self, client: Knock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get(self, client: Knock) -> None: response = client.tenants.with_raw_response.get( @@ -129,7 +129,7 @@ def test_raw_response_get(self, client: Knock) -> None: tenant = response.parse() assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get(self, client: Knock) -> None: with client.tenants.with_streaming_response.get( @@ -143,7 +143,7 @@ def test_streaming_response_get(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -151,7 +151,7 @@ def test_path_params_get(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set(self, client: Knock) -> None: tenant = client.tenants.set( @@ -159,7 +159,7 @@ def test_method_set(self, client: Knock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_with_all_params(self, client: Knock) -> None: tenant = client.tenants.set( @@ -267,7 +267,7 @@ def test_method_set_with_all_params(self, client: Knock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set(self, client: Knock) -> None: response = client.tenants.with_raw_response.set( @@ -279,7 +279,7 @@ def test_raw_response_set(self, client: Knock) -> None: tenant = response.parse() assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set(self, client: Knock) -> None: with client.tenants.with_streaming_response.set( @@ -293,7 +293,7 @@ def test_streaming_response_set(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -307,13 +307,13 @@ class TestAsyncTenants: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.list() assert_matches_type(AsyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.list( @@ -325,7 +325,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> No ) assert_matches_type(AsyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.with_raw_response.list() @@ -335,7 +335,7 @@ async def test_raw_response_list(self, async_client: AsyncKnock) -> None: tenant = await response.parse() assert_matches_type(AsyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: async with async_client.tenants.with_streaming_response.list() as response: @@ -347,7 +347,7 @@ async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.delete( @@ -355,7 +355,7 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert tenant is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.with_raw_response.delete( @@ -367,7 +367,7 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: tenant = await response.parse() assert tenant is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.tenants.with_streaming_response.delete( @@ -381,7 +381,7 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -389,7 +389,7 @@ async def test_path_params_delete(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.get( @@ -397,7 +397,7 @@ async def test_method_get(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_with_all_params(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.get( @@ -406,7 +406,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncKnock) -> Non ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.with_raw_response.get( @@ -418,7 +418,7 @@ async def test_raw_response_get(self, async_client: AsyncKnock) -> None: tenant = await response.parse() assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: async with async_client.tenants.with_streaming_response.get( @@ -432,7 +432,7 @@ async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -440,7 +440,7 @@ async def test_path_params_get(self, async_client: AsyncKnock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.set( @@ -448,7 +448,7 @@ async def test_method_set(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_with_all_params(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.set( @@ -556,7 +556,7 @@ async def test_method_set_with_all_params(self, async_client: AsyncKnock) -> Non ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.with_raw_response.set( @@ -568,7 +568,7 @@ async def test_raw_response_set(self, async_client: AsyncKnock) -> None: tenant = await response.parse() assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: async with async_client.tenants.with_streaming_response.set( @@ -582,7 +582,7 @@ async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index 88e10075..6992c081 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -29,7 +29,7 @@ class TestUsers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update(self, client: Knock) -> None: user = client.users.update( @@ -37,7 +37,7 @@ def test_method_update(self, client: Knock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update_with_all_params(self, client: Knock) -> None: user = client.users.update( @@ -144,7 +144,7 @@ def test_method_update_with_all_params(self, client: Knock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_update(self, client: Knock) -> None: response = client.users.with_raw_response.update( @@ -156,7 +156,7 @@ def test_raw_response_update(self, client: Knock) -> None: user = response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_update(self, client: Knock) -> None: with client.users.with_streaming_response.update( @@ -170,7 +170,7 @@ def test_streaming_response_update(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_update(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -178,13 +178,13 @@ def test_path_params_update(self, client: Knock) -> None: user_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list(self, client: Knock) -> None: user = client.users.list() assert_matches_type(SyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_with_all_params(self, client: Knock) -> None: user = client.users.list( @@ -195,7 +195,7 @@ def test_method_list_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list(self, client: Knock) -> None: response = client.users.with_raw_response.list() @@ -205,7 +205,7 @@ def test_raw_response_list(self, client: Knock) -> None: user = response.parse() assert_matches_type(SyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list(self, client: Knock) -> None: with client.users.with_streaming_response.list() as response: @@ -217,7 +217,7 @@ def test_streaming_response_list(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: user = client.users.delete( @@ -225,7 +225,7 @@ def test_method_delete(self, client: Knock) -> None: ) assert user is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.users.with_raw_response.delete( @@ -237,7 +237,7 @@ def test_raw_response_delete(self, client: Knock) -> None: user = response.parse() assert user is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.users.with_streaming_response.delete( @@ -251,7 +251,7 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -259,7 +259,7 @@ def test_path_params_delete(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get(self, client: Knock) -> None: user = client.users.get( @@ -267,7 +267,7 @@ def test_method_get(self, client: Knock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get(self, client: Knock) -> None: response = client.users.with_raw_response.get( @@ -279,7 +279,7 @@ def test_raw_response_get(self, client: Knock) -> None: user = response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get(self, client: Knock) -> None: with client.users.with_streaming_response.get( @@ -293,7 +293,7 @@ def test_streaming_response_get(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -301,7 +301,7 @@ def test_path_params_get(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_channel_data(self, client: Knock) -> None: user = client.users.get_channel_data( @@ -310,7 +310,7 @@ def test_method_get_channel_data(self, client: Knock) -> None: ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_channel_data(self, client: Knock) -> None: response = client.users.with_raw_response.get_channel_data( @@ -323,7 +323,7 @@ def test_raw_response_get_channel_data(self, client: Knock) -> None: user = response.parse() assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_channel_data(self, client: Knock) -> None: with client.users.with_streaming_response.get_channel_data( @@ -338,7 +338,7 @@ def test_streaming_response_get_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -353,7 +353,7 @@ def test_path_params_get_channel_data(self, client: Knock) -> None: channel_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_preferences(self, client: Knock) -> None: user = client.users.get_preferences( @@ -362,7 +362,7 @@ def test_method_get_preferences(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_preferences_with_all_params(self, client: Knock) -> None: user = client.users.get_preferences( @@ -372,7 +372,7 @@ def test_method_get_preferences_with_all_params(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_preferences(self, client: Knock) -> None: response = client.users.with_raw_response.get_preferences( @@ -385,7 +385,7 @@ def test_raw_response_get_preferences(self, client: Knock) -> None: user = response.parse() assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_preferences(self, client: Knock) -> None: with client.users.with_streaming_response.get_preferences( @@ -400,7 +400,7 @@ def test_streaming_response_get_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -415,7 +415,7 @@ def test_path_params_get_preferences(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_messages(self, client: Knock) -> None: user = client.users.list_messages( @@ -423,7 +423,7 @@ def test_method_list_messages(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_messages_with_all_params(self, client: Knock) -> None: user = client.users.list_messages( @@ -450,7 +450,7 @@ def test_method_list_messages_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_messages(self, client: Knock) -> None: response = client.users.with_raw_response.list_messages( @@ -462,7 +462,7 @@ def test_raw_response_list_messages(self, client: Knock) -> None: user = response.parse() assert_matches_type(SyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_messages(self, client: Knock) -> None: with client.users.with_streaming_response.list_messages( @@ -476,7 +476,7 @@ def test_streaming_response_list_messages(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_messages(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -484,7 +484,7 @@ def test_path_params_list_messages(self, client: Knock) -> None: user_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_preferences(self, client: Knock) -> None: user = client.users.list_preferences( @@ -492,7 +492,7 @@ def test_method_list_preferences(self, client: Knock) -> None: ) assert_matches_type(UserListPreferencesResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_preferences(self, client: Knock) -> None: response = client.users.with_raw_response.list_preferences( @@ -504,7 +504,7 @@ def test_raw_response_list_preferences(self, client: Knock) -> None: user = response.parse() assert_matches_type(UserListPreferencesResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_preferences(self, client: Knock) -> None: with client.users.with_streaming_response.list_preferences( @@ -518,7 +518,7 @@ def test_streaming_response_list_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -526,7 +526,7 @@ def test_path_params_list_preferences(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_schedules(self, client: Knock) -> None: user = client.users.list_schedules( @@ -534,7 +534,7 @@ def test_method_list_schedules(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_schedules_with_all_params(self, client: Knock) -> None: user = client.users.list_schedules( @@ -547,7 +547,7 @@ def test_method_list_schedules_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_schedules(self, client: Knock) -> None: response = client.users.with_raw_response.list_schedules( @@ -559,7 +559,7 @@ def test_raw_response_list_schedules(self, client: Knock) -> None: user = response.parse() assert_matches_type(SyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_schedules(self, client: Knock) -> None: with client.users.with_streaming_response.list_schedules( @@ -573,7 +573,7 @@ def test_streaming_response_list_schedules(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_schedules(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -581,7 +581,7 @@ def test_path_params_list_schedules(self, client: Knock) -> None: user_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_subscriptions(self, client: Knock) -> None: user = client.users.list_subscriptions( @@ -589,7 +589,7 @@ def test_method_list_subscriptions(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_subscriptions_with_all_params(self, client: Knock) -> None: user = client.users.list_subscriptions( @@ -602,7 +602,7 @@ def test_method_list_subscriptions_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_subscriptions(self, client: Knock) -> None: response = client.users.with_raw_response.list_subscriptions( @@ -614,7 +614,7 @@ def test_raw_response_list_subscriptions(self, client: Knock) -> None: user = response.parse() assert_matches_type(SyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_subscriptions(self, client: Knock) -> None: with client.users.with_streaming_response.list_subscriptions( @@ -628,7 +628,7 @@ def test_streaming_response_list_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -636,7 +636,7 @@ def test_path_params_list_subscriptions(self, client: Knock) -> None: user_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_merge(self, client: Knock) -> None: user = client.users.merge( @@ -645,7 +645,7 @@ def test_method_merge(self, client: Knock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_merge(self, client: Knock) -> None: response = client.users.with_raw_response.merge( @@ -658,7 +658,7 @@ def test_raw_response_merge(self, client: Knock) -> None: user = response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_merge(self, client: Knock) -> None: with client.users.with_streaming_response.merge( @@ -673,7 +673,7 @@ def test_streaming_response_merge(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_merge(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -682,7 +682,7 @@ def test_path_params_merge(self, client: Knock) -> None: from_user_id="user_1", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_channel_data(self, client: Knock) -> None: user = client.users.set_channel_data( @@ -692,7 +692,7 @@ def test_method_set_channel_data(self, client: Knock) -> None: ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_channel_data_with_all_params(self, client: Knock) -> None: user = client.users.set_channel_data( @@ -702,7 +702,7 @@ def test_method_set_channel_data_with_all_params(self, client: Knock) -> None: ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set_channel_data(self, client: Knock) -> None: response = client.users.with_raw_response.set_channel_data( @@ -716,7 +716,7 @@ def test_raw_response_set_channel_data(self, client: Knock) -> None: user = response.parse() assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set_channel_data(self, client: Knock) -> None: with client.users.with_streaming_response.set_channel_data( @@ -732,7 +732,7 @@ def test_streaming_response_set_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -749,7 +749,7 @@ def test_path_params_set_channel_data(self, client: Knock) -> None: data={"tokens": ["push_token_1"]}, ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences(self, client: Knock) -> None: user = client.users.set_preferences( @@ -758,7 +758,7 @@ def test_method_set_preferences(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences_with_all_params(self, client: Knock) -> None: user = client.users.set_preferences( @@ -854,7 +854,7 @@ def test_method_set_preferences_with_all_params(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set_preferences(self, client: Knock) -> None: response = client.users.with_raw_response.set_preferences( @@ -867,7 +867,7 @@ def test_raw_response_set_preferences(self, client: Knock) -> None: user = response.parse() assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set_preferences(self, client: Knock) -> None: with client.users.with_streaming_response.set_preferences( @@ -882,7 +882,7 @@ def test_streaming_response_set_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -897,7 +897,7 @@ def test_path_params_set_preferences(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_unset_channel_data(self, client: Knock) -> None: user = client.users.unset_channel_data( @@ -906,7 +906,7 @@ def test_method_unset_channel_data(self, client: Knock) -> None: ) assert user is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_unset_channel_data(self, client: Knock) -> None: response = client.users.with_raw_response.unset_channel_data( @@ -919,7 +919,7 @@ def test_raw_response_unset_channel_data(self, client: Knock) -> None: user = response.parse() assert user is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_unset_channel_data(self, client: Knock) -> None: with client.users.with_streaming_response.unset_channel_data( @@ -934,7 +934,7 @@ def test_streaming_response_unset_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_unset_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -955,7 +955,7 @@ class TestAsyncUsers: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update(self, async_client: AsyncKnock) -> None: user = await async_client.users.update( @@ -963,7 +963,7 @@ async def test_method_update(self, async_client: AsyncKnock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.update( @@ -1070,7 +1070,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncKnock) -> ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_update(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.update( @@ -1082,7 +1082,7 @@ async def test_raw_response_update(self, async_client: AsyncKnock) -> None: user = await response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_update(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.update( @@ -1096,7 +1096,7 @@ async def test_streaming_response_update(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_update(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1104,13 +1104,13 @@ async def test_path_params_update(self, async_client: AsyncKnock) -> None: user_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list(self, async_client: AsyncKnock) -> None: user = await async_client.users.list() assert_matches_type(AsyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.list( @@ -1121,7 +1121,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> No ) assert_matches_type(AsyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.list() @@ -1131,7 +1131,7 @@ async def test_raw_response_list(self, async_client: AsyncKnock) -> None: user = await response.parse() assert_matches_type(AsyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.list() as response: @@ -1143,7 +1143,7 @@ async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: user = await async_client.users.delete( @@ -1151,7 +1151,7 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert user is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.delete( @@ -1163,7 +1163,7 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: user = await response.parse() assert user is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.delete( @@ -1177,7 +1177,7 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1185,7 +1185,7 @@ async def test_path_params_delete(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get(self, async_client: AsyncKnock) -> None: user = await async_client.users.get( @@ -1193,7 +1193,7 @@ async def test_method_get(self, async_client: AsyncKnock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.get( @@ -1205,7 +1205,7 @@ async def test_raw_response_get(self, async_client: AsyncKnock) -> None: user = await response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.get( @@ -1219,7 +1219,7 @@ async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1227,7 +1227,7 @@ async def test_path_params_get(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_channel_data(self, async_client: AsyncKnock) -> None: user = await async_client.users.get_channel_data( @@ -1236,7 +1236,7 @@ async def test_method_get_channel_data(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.get_channel_data( @@ -1249,7 +1249,7 @@ async def test_raw_response_get_channel_data(self, async_client: AsyncKnock) -> user = await response.parse() assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.get_channel_data( @@ -1264,7 +1264,7 @@ async def test_streaming_response_get_channel_data(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1279,7 +1279,7 @@ async def test_path_params_get_channel_data(self, async_client: AsyncKnock) -> N channel_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_preferences(self, async_client: AsyncKnock) -> None: user = await async_client.users.get_preferences( @@ -1288,7 +1288,7 @@ async def test_method_get_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_preferences_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.get_preferences( @@ -1298,7 +1298,7 @@ async def test_method_get_preferences_with_all_params(self, async_client: AsyncK ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.get_preferences( @@ -1311,7 +1311,7 @@ async def test_raw_response_get_preferences(self, async_client: AsyncKnock) -> N user = await response.parse() assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_preferences(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.get_preferences( @@ -1326,7 +1326,7 @@ async def test_streaming_response_get_preferences(self, async_client: AsyncKnock assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1341,7 +1341,7 @@ async def test_path_params_get_preferences(self, async_client: AsyncKnock) -> No id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_messages(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_messages( @@ -1349,7 +1349,7 @@ async def test_method_list_messages(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_messages_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_messages( @@ -1376,7 +1376,7 @@ async def test_method_list_messages_with_all_params(self, async_client: AsyncKno ) assert_matches_type(AsyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_messages(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.list_messages( @@ -1388,7 +1388,7 @@ async def test_raw_response_list_messages(self, async_client: AsyncKnock) -> Non user = await response.parse() assert_matches_type(AsyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_messages(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.list_messages( @@ -1402,7 +1402,7 @@ async def test_streaming_response_list_messages(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_messages(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1410,7 +1410,7 @@ async def test_path_params_list_messages(self, async_client: AsyncKnock) -> None user_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_preferences(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_preferences( @@ -1418,7 +1418,7 @@ async def test_method_list_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(UserListPreferencesResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.list_preferences( @@ -1430,7 +1430,7 @@ async def test_raw_response_list_preferences(self, async_client: AsyncKnock) -> user = await response.parse() assert_matches_type(UserListPreferencesResponse, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_preferences(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.list_preferences( @@ -1444,7 +1444,7 @@ async def test_streaming_response_list_preferences(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1452,7 +1452,7 @@ async def test_path_params_list_preferences(self, async_client: AsyncKnock) -> N "", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_schedules(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_schedules( @@ -1460,7 +1460,7 @@ async def test_method_list_schedules(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_schedules_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_schedules( @@ -1473,7 +1473,7 @@ async def test_method_list_schedules_with_all_params(self, async_client: AsyncKn ) assert_matches_type(AsyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_schedules(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.list_schedules( @@ -1485,7 +1485,7 @@ async def test_raw_response_list_schedules(self, async_client: AsyncKnock) -> No user = await response.parse() assert_matches_type(AsyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_schedules(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.list_schedules( @@ -1499,7 +1499,7 @@ async def test_streaming_response_list_schedules(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_schedules(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1507,7 +1507,7 @@ async def test_path_params_list_schedules(self, async_client: AsyncKnock) -> Non user_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_subscriptions(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_subscriptions( @@ -1515,7 +1515,7 @@ async def test_method_list_subscriptions(self, async_client: AsyncKnock) -> None ) assert_matches_type(AsyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_subscriptions_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_subscriptions( @@ -1528,7 +1528,7 @@ async def test_method_list_subscriptions_with_all_params(self, async_client: Asy ) assert_matches_type(AsyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.list_subscriptions( @@ -1540,7 +1540,7 @@ async def test_raw_response_list_subscriptions(self, async_client: AsyncKnock) - user = await response.parse() assert_matches_type(AsyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.list_subscriptions( @@ -1554,7 +1554,7 @@ async def test_streaming_response_list_subscriptions(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1562,7 +1562,7 @@ async def test_path_params_list_subscriptions(self, async_client: AsyncKnock) -> user_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_merge(self, async_client: AsyncKnock) -> None: user = await async_client.users.merge( @@ -1571,7 +1571,7 @@ async def test_method_merge(self, async_client: AsyncKnock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_merge(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.merge( @@ -1584,7 +1584,7 @@ async def test_raw_response_merge(self, async_client: AsyncKnock) -> None: user = await response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_merge(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.merge( @@ -1599,7 +1599,7 @@ async def test_streaming_response_merge(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_merge(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1608,7 +1608,7 @@ async def test_path_params_merge(self, async_client: AsyncKnock) -> None: from_user_id="user_1", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_channel_data(self, async_client: AsyncKnock) -> None: user = await async_client.users.set_channel_data( @@ -1618,7 +1618,7 @@ async def test_method_set_channel_data(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_channel_data_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.set_channel_data( @@ -1628,7 +1628,7 @@ async def test_method_set_channel_data_with_all_params(self, async_client: Async ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.set_channel_data( @@ -1642,7 +1642,7 @@ async def test_raw_response_set_channel_data(self, async_client: AsyncKnock) -> user = await response.parse() assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.set_channel_data( @@ -1658,7 +1658,7 @@ async def test_streaming_response_set_channel_data(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1675,7 +1675,7 @@ async def test_path_params_set_channel_data(self, async_client: AsyncKnock) -> N data={"tokens": ["push_token_1"]}, ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: user = await async_client.users.set_preferences( @@ -1684,7 +1684,7 @@ async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.set_preferences( @@ -1780,7 +1780,7 @@ async def test_method_set_preferences_with_all_params(self, async_client: AsyncK ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.set_preferences( @@ -1793,7 +1793,7 @@ async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> N user = await response.parse() assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set_preferences(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.set_preferences( @@ -1808,7 +1808,7 @@ async def test_streaming_response_set_preferences(self, async_client: AsyncKnock assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1823,7 +1823,7 @@ async def test_path_params_set_preferences(self, async_client: AsyncKnock) -> No id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_unset_channel_data(self, async_client: AsyncKnock) -> None: user = await async_client.users.unset_channel_data( @@ -1832,7 +1832,7 @@ async def test_method_unset_channel_data(self, async_client: AsyncKnock) -> None ) assert user is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_unset_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.unset_channel_data( @@ -1845,7 +1845,7 @@ async def test_raw_response_unset_channel_data(self, async_client: AsyncKnock) - user = await response.parse() assert user is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_unset_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.unset_channel_data( @@ -1860,7 +1860,7 @@ async def test_streaming_response_unset_channel_data(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_unset_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): diff --git a/tests/api_resources/test_workflows.py b/tests/api_resources/test_workflows.py index 99f23ee7..3c175307 100644 --- a/tests/api_resources/test_workflows.py +++ b/tests/api_resources/test_workflows.py @@ -19,7 +19,7 @@ class TestWorkflows: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_cancel(self, client: Knock) -> None: workflow = client.workflows.cancel( @@ -28,7 +28,7 @@ def test_method_cancel(self, client: Knock) -> None: ) assert workflow is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_cancel_with_all_params(self, client: Knock) -> None: workflow = client.workflows.cancel( @@ -38,7 +38,7 @@ def test_method_cancel_with_all_params(self, client: Knock) -> None: ) assert workflow is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_cancel(self, client: Knock) -> None: response = client.workflows.with_raw_response.cancel( @@ -51,7 +51,7 @@ def test_raw_response_cancel(self, client: Knock) -> None: workflow = response.parse() assert workflow is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_cancel(self, client: Knock) -> None: with client.workflows.with_streaming_response.cancel( @@ -66,7 +66,7 @@ def test_streaming_response_cancel(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_cancel(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -75,7 +75,7 @@ def test_path_params_cancel(self, client: Knock) -> None: cancellation_key="cancel-workflow-123", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_trigger(self, client: Knock) -> None: workflow = client.workflows.trigger( @@ -84,7 +84,7 @@ def test_method_trigger(self, client: Knock) -> None: ) assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_trigger_with_all_params(self, client: Knock) -> None: workflow = client.workflows.trigger( @@ -104,7 +104,7 @@ def test_method_trigger_with_all_params(self, client: Knock) -> None: ) assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_trigger(self, client: Knock) -> None: response = client.workflows.with_raw_response.trigger( @@ -117,7 +117,7 @@ def test_raw_response_trigger(self, client: Knock) -> None: workflow = response.parse() assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_trigger(self, client: Knock) -> None: with client.workflows.with_streaming_response.trigger( @@ -132,7 +132,7 @@ def test_streaming_response_trigger(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_trigger(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -147,7 +147,7 @@ class TestAsyncWorkflows: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_cancel(self, async_client: AsyncKnock) -> None: workflow = await async_client.workflows.cancel( @@ -156,7 +156,7 @@ async def test_method_cancel(self, async_client: AsyncKnock) -> None: ) assert workflow is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_cancel_with_all_params(self, async_client: AsyncKnock) -> None: workflow = await async_client.workflows.cancel( @@ -166,7 +166,7 @@ async def test_method_cancel_with_all_params(self, async_client: AsyncKnock) -> ) assert workflow is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_cancel(self, async_client: AsyncKnock) -> None: response = await async_client.workflows.with_raw_response.cancel( @@ -179,7 +179,7 @@ async def test_raw_response_cancel(self, async_client: AsyncKnock) -> None: workflow = await response.parse() assert workflow is None - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_cancel(self, async_client: AsyncKnock) -> None: async with async_client.workflows.with_streaming_response.cancel( @@ -194,7 +194,7 @@ async def test_streaming_response_cancel(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_cancel(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -203,7 +203,7 @@ async def test_path_params_cancel(self, async_client: AsyncKnock) -> None: cancellation_key="cancel-workflow-123", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_trigger(self, async_client: AsyncKnock) -> None: workflow = await async_client.workflows.trigger( @@ -212,7 +212,7 @@ async def test_method_trigger(self, async_client: AsyncKnock) -> None: ) assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_trigger_with_all_params(self, async_client: AsyncKnock) -> None: workflow = await async_client.workflows.trigger( @@ -232,7 +232,7 @@ async def test_method_trigger_with_all_params(self, async_client: AsyncKnock) -> ) assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_trigger(self, async_client: AsyncKnock) -> None: response = await async_client.workflows.with_raw_response.trigger( @@ -245,7 +245,7 @@ async def test_raw_response_trigger(self, async_client: AsyncKnock) -> None: workflow = await response.parse() assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_trigger(self, async_client: AsyncKnock) -> None: async with async_client.workflows.with_streaming_response.trigger( @@ -260,7 +260,7 @@ async def test_streaming_response_trigger(self, async_client: AsyncKnock) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_trigger(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): diff --git a/tests/api_resources/users/test_bulk.py b/tests/api_resources/users/test_bulk.py index 1990b98b..d7acf43f 100644 --- a/tests/api_resources/users/test_bulk.py +++ b/tests/api_resources/users/test_bulk.py @@ -17,7 +17,7 @@ class TestBulk: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: bulk = client.users.bulk.delete( @@ -25,7 +25,7 @@ def test_method_delete(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.users.bulk.with_raw_response.delete( @@ -37,7 +37,7 @@ def test_raw_response_delete(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.users.bulk.with_streaming_response.delete( @@ -51,7 +51,7 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_identify(self, client: Knock) -> None: bulk = client.users.bulk.identify( @@ -59,7 +59,7 @@ def test_method_identify(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_identify(self, client: Knock) -> None: response = client.users.bulk.with_raw_response.identify( @@ -71,7 +71,7 @@ def test_raw_response_identify(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_identify(self, client: Knock) -> None: with client.users.bulk.with_streaming_response.identify( @@ -85,7 +85,7 @@ def test_streaming_response_identify(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences(self, client: Knock) -> None: bulk = client.users.bulk.set_preferences( @@ -94,7 +94,7 @@ def test_method_set_preferences(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences_with_all_params(self, client: Knock) -> None: bulk = client.users.bulk.set_preferences( @@ -191,7 +191,7 @@ def test_method_set_preferences_with_all_params(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set_preferences(self, client: Knock) -> None: response = client.users.bulk.with_raw_response.set_preferences( @@ -204,7 +204,7 @@ def test_raw_response_set_preferences(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set_preferences(self, client: Knock) -> None: with client.users.bulk.with_streaming_response.set_preferences( @@ -225,7 +225,7 @@ class TestAsyncBulk: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: bulk = await async_client.users.bulk.delete( @@ -233,7 +233,7 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.users.bulk.with_raw_response.delete( @@ -245,7 +245,7 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.users.bulk.with_streaming_response.delete( @@ -259,7 +259,7 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_identify(self, async_client: AsyncKnock) -> None: bulk = await async_client.users.bulk.identify( @@ -267,7 +267,7 @@ async def test_method_identify(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_identify(self, async_client: AsyncKnock) -> None: response = await async_client.users.bulk.with_raw_response.identify( @@ -279,7 +279,7 @@ async def test_raw_response_identify(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_identify(self, async_client: AsyncKnock) -> None: async with async_client.users.bulk.with_streaming_response.identify( @@ -293,7 +293,7 @@ async def test_streaming_response_identify(self, async_client: AsyncKnock) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: bulk = await async_client.users.bulk.set_preferences( @@ -302,7 +302,7 @@ async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences_with_all_params(self, async_client: AsyncKnock) -> None: bulk = await async_client.users.bulk.set_preferences( @@ -399,7 +399,7 @@ async def test_method_set_preferences_with_all_params(self, async_client: AsyncK ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.users.bulk.with_raw_response.set_preferences( @@ -412,7 +412,7 @@ async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> N bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set_preferences(self, async_client: AsyncKnock) -> None: async with async_client.users.bulk.with_streaming_response.set_preferences( diff --git a/tests/api_resources/users/test_feeds.py b/tests/api_resources/users/test_feeds.py index 7f1988dc..84b97f6a 100644 --- a/tests/api_resources/users/test_feeds.py +++ b/tests/api_resources/users/test_feeds.py @@ -18,7 +18,7 @@ class TestFeeds: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_settings(self, client: Knock) -> None: feed = client.users.feeds.get_settings( @@ -27,7 +27,7 @@ def test_method_get_settings(self, client: Knock) -> None: ) assert_matches_type(FeedGetSettingsResponse, feed, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_settings(self, client: Knock) -> None: response = client.users.feeds.with_raw_response.get_settings( @@ -40,7 +40,7 @@ def test_raw_response_get_settings(self, client: Knock) -> None: feed = response.parse() assert_matches_type(FeedGetSettingsResponse, feed, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_settings(self, client: Knock) -> None: with client.users.feeds.with_streaming_response.get_settings( @@ -55,7 +55,7 @@ def test_streaming_response_get_settings(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_settings(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -70,7 +70,7 @@ def test_path_params_get_settings(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_items(self, client: Knock) -> None: feed = client.users.feeds.list_items( @@ -79,7 +79,7 @@ def test_method_list_items(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_items_with_all_params(self, client: Knock) -> None: feed = client.users.feeds.list_items( @@ -88,8 +88,16 @@ def test_method_list_items_with_all_params(self, client: Knock) -> None: after="after", archived="exclude", before="before", + exclude="exclude", has_tenant=True, + inserted_at={ + "gt": "gt", + "gte": "gte", + "lt": "lt", + "lte": "lte", + }, locale="locale", + mode="compact", page_size=0, source="source", status="unread", @@ -99,7 +107,7 @@ def test_method_list_items_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_items(self, client: Knock) -> None: response = client.users.feeds.with_raw_response.list_items( @@ -112,7 +120,7 @@ def test_raw_response_list_items(self, client: Knock) -> None: feed = response.parse() assert_matches_type(SyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_items(self, client: Knock) -> None: with client.users.feeds.with_streaming_response.list_items( @@ -127,7 +135,7 @@ def test_streaming_response_list_items(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_items(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -148,7 +156,7 @@ class TestAsyncFeeds: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_settings(self, async_client: AsyncKnock) -> None: feed = await async_client.users.feeds.get_settings( @@ -157,7 +165,7 @@ async def test_method_get_settings(self, async_client: AsyncKnock) -> None: ) assert_matches_type(FeedGetSettingsResponse, feed, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_settings(self, async_client: AsyncKnock) -> None: response = await async_client.users.feeds.with_raw_response.get_settings( @@ -170,7 +178,7 @@ async def test_raw_response_get_settings(self, async_client: AsyncKnock) -> None feed = await response.parse() assert_matches_type(FeedGetSettingsResponse, feed, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_settings(self, async_client: AsyncKnock) -> None: async with async_client.users.feeds.with_streaming_response.get_settings( @@ -185,7 +193,7 @@ async def test_streaming_response_get_settings(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_settings(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -200,7 +208,7 @@ async def test_path_params_get_settings(self, async_client: AsyncKnock) -> None: id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_items(self, async_client: AsyncKnock) -> None: feed = await async_client.users.feeds.list_items( @@ -209,7 +217,7 @@ async def test_method_list_items(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_items_with_all_params(self, async_client: AsyncKnock) -> None: feed = await async_client.users.feeds.list_items( @@ -218,8 +226,16 @@ async def test_method_list_items_with_all_params(self, async_client: AsyncKnock) after="after", archived="exclude", before="before", + exclude="exclude", has_tenant=True, + inserted_at={ + "gt": "gt", + "gte": "gte", + "lt": "lt", + "lte": "lte", + }, locale="locale", + mode="compact", page_size=0, source="source", status="unread", @@ -229,7 +245,7 @@ async def test_method_list_items_with_all_params(self, async_client: AsyncKnock) ) assert_matches_type(AsyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_items(self, async_client: AsyncKnock) -> None: response = await async_client.users.feeds.with_raw_response.list_items( @@ -242,7 +258,7 @@ async def test_raw_response_list_items(self, async_client: AsyncKnock) -> None: feed = await response.parse() assert_matches_type(AsyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_items(self, async_client: AsyncKnock) -> None: async with async_client.users.feeds.with_streaming_response.list_items( @@ -257,7 +273,7 @@ async def test_streaming_response_list_items(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_items(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): diff --git a/tests/api_resources/users/test_guides.py b/tests/api_resources/users/test_guides.py index 3ce19f75..d8c95e8c 100644 --- a/tests/api_resources/users/test_guides.py +++ b/tests/api_resources/users/test_guides.py @@ -22,7 +22,7 @@ class TestGuides: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_channel(self, client: Knock) -> None: guide = client.users.guides.get_channel( @@ -31,7 +31,7 @@ def test_method_get_channel(self, client: Knock) -> None: ) assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_channel_with_all_params(self, client: Knock) -> None: guide = client.users.guides.get_channel( @@ -43,7 +43,7 @@ def test_method_get_channel_with_all_params(self, client: Knock) -> None: ) assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_channel(self, client: Knock) -> None: response = client.users.guides.with_raw_response.get_channel( @@ -56,7 +56,7 @@ def test_raw_response_get_channel(self, client: Knock) -> None: guide = response.parse() assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_channel(self, client: Knock) -> None: with client.users.guides.with_streaming_response.get_channel( @@ -71,7 +71,7 @@ def test_streaming_response_get_channel(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_channel(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -86,7 +86,7 @@ def test_path_params_get_channel(self, client: Knock) -> None: channel_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_archived(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_archived( @@ -99,7 +99,7 @@ def test_method_mark_message_as_archived(self, client: Knock) -> None: ) assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_archived_with_all_params(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_archived( @@ -128,7 +128,7 @@ def test_method_mark_message_as_archived_with_all_params(self, client: Knock) -> ) assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_message_as_archived(self, client: Knock) -> None: response = client.users.guides.with_raw_response.mark_message_as_archived( @@ -145,7 +145,7 @@ def test_raw_response_mark_message_as_archived(self, client: Knock) -> None: guide = response.parse() assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_message_as_archived(self, client: Knock) -> None: with client.users.guides.with_streaming_response.mark_message_as_archived( @@ -164,7 +164,7 @@ def test_streaming_response_mark_message_as_archived(self, client: Knock) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_message_as_archived(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -187,7 +187,7 @@ def test_path_params_mark_message_as_archived(self, client: Knock) -> None: guide_step_ref="lab_tours", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_interacted(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_interacted( @@ -200,7 +200,7 @@ def test_method_mark_message_as_interacted(self, client: Knock) -> None: ) assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_interacted_with_all_params(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_interacted( @@ -229,7 +229,7 @@ def test_method_mark_message_as_interacted_with_all_params(self, client: Knock) ) assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_message_as_interacted(self, client: Knock) -> None: response = client.users.guides.with_raw_response.mark_message_as_interacted( @@ -246,7 +246,7 @@ def test_raw_response_mark_message_as_interacted(self, client: Knock) -> None: guide = response.parse() assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_message_as_interacted(self, client: Knock) -> None: with client.users.guides.with_streaming_response.mark_message_as_interacted( @@ -265,7 +265,7 @@ def test_streaming_response_mark_message_as_interacted(self, client: Knock) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_message_as_interacted(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -288,7 +288,7 @@ def test_path_params_mark_message_as_interacted(self, client: Knock) -> None: guide_step_ref="lab_tours", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_seen(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_seen( @@ -301,7 +301,7 @@ def test_method_mark_message_as_seen(self, client: Knock) -> None: ) assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_seen_with_all_params(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_seen( @@ -330,7 +330,7 @@ def test_method_mark_message_as_seen_with_all_params(self, client: Knock) -> Non ) assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_message_as_seen(self, client: Knock) -> None: response = client.users.guides.with_raw_response.mark_message_as_seen( @@ -347,7 +347,7 @@ def test_raw_response_mark_message_as_seen(self, client: Knock) -> None: guide = response.parse() assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_message_as_seen(self, client: Knock) -> None: with client.users.guides.with_streaming_response.mark_message_as_seen( @@ -366,7 +366,7 @@ def test_streaming_response_mark_message_as_seen(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_message_as_seen(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -395,7 +395,7 @@ class TestAsyncGuides: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_channel(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.get_channel( @@ -404,7 +404,7 @@ async def test_method_get_channel(self, async_client: AsyncKnock) -> None: ) assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_channel_with_all_params(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.get_channel( @@ -416,7 +416,7 @@ async def test_method_get_channel_with_all_params(self, async_client: AsyncKnock ) assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_channel(self, async_client: AsyncKnock) -> None: response = await async_client.users.guides.with_raw_response.get_channel( @@ -429,7 +429,7 @@ async def test_raw_response_get_channel(self, async_client: AsyncKnock) -> None: guide = await response.parse() assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_channel(self, async_client: AsyncKnock) -> None: async with async_client.users.guides.with_streaming_response.get_channel( @@ -444,7 +444,7 @@ async def test_streaming_response_get_channel(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_channel(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -459,7 +459,7 @@ async def test_path_params_get_channel(self, async_client: AsyncKnock) -> None: channel_id="", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_archived(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_archived( @@ -472,7 +472,7 @@ async def test_method_mark_message_as_archived(self, async_client: AsyncKnock) - ) assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_archived_with_all_params(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_archived( @@ -501,7 +501,7 @@ async def test_method_mark_message_as_archived_with_all_params(self, async_clien ) assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_message_as_archived(self, async_client: AsyncKnock) -> None: response = await async_client.users.guides.with_raw_response.mark_message_as_archived( @@ -518,7 +518,7 @@ async def test_raw_response_mark_message_as_archived(self, async_client: AsyncKn guide = await response.parse() assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_message_as_archived(self, async_client: AsyncKnock) -> None: async with async_client.users.guides.with_streaming_response.mark_message_as_archived( @@ -537,7 +537,7 @@ async def test_streaming_response_mark_message_as_archived(self, async_client: A assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_message_as_archived(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -560,7 +560,7 @@ async def test_path_params_mark_message_as_archived(self, async_client: AsyncKno guide_step_ref="lab_tours", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_interacted(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_interacted( @@ -573,7 +573,7 @@ async def test_method_mark_message_as_interacted(self, async_client: AsyncKnock) ) assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_interacted_with_all_params(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_interacted( @@ -602,7 +602,7 @@ async def test_method_mark_message_as_interacted_with_all_params(self, async_cli ) assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_message_as_interacted(self, async_client: AsyncKnock) -> None: response = await async_client.users.guides.with_raw_response.mark_message_as_interacted( @@ -619,7 +619,7 @@ async def test_raw_response_mark_message_as_interacted(self, async_client: Async guide = await response.parse() assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_message_as_interacted(self, async_client: AsyncKnock) -> None: async with async_client.users.guides.with_streaming_response.mark_message_as_interacted( @@ -638,7 +638,7 @@ async def test_streaming_response_mark_message_as_interacted(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_message_as_interacted(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -661,7 +661,7 @@ async def test_path_params_mark_message_as_interacted(self, async_client: AsyncK guide_step_ref="lab_tours", ) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_seen(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_seen( @@ -674,7 +674,7 @@ async def test_method_mark_message_as_seen(self, async_client: AsyncKnock) -> No ) assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_seen_with_all_params(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_seen( @@ -703,7 +703,7 @@ async def test_method_mark_message_as_seen_with_all_params(self, async_client: A ) assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_message_as_seen(self, async_client: AsyncKnock) -> None: response = await async_client.users.guides.with_raw_response.mark_message_as_seen( @@ -720,7 +720,7 @@ async def test_raw_response_mark_message_as_seen(self, async_client: AsyncKnock) guide = await response.parse() assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_message_as_seen(self, async_client: AsyncKnock) -> None: async with async_client.users.guides.with_streaming_response.mark_message_as_seen( @@ -739,7 +739,7 @@ async def test_streaming_response_mark_message_as_seen(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism doesn't support callbacks yet") + @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_message_as_seen(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): diff --git a/tests/test_client.py b/tests/test_client.py index 771e511c..495ff74d 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -8,10 +8,11 @@ import json import asyncio import inspect +import dataclasses import tracemalloc -from typing import Any, Union, cast +from typing import Any, Union, TypeVar, Callable, Iterable, Iterator, Optional, Coroutine, cast from unittest import mock -from typing_extensions import Literal +from typing_extensions import Literal, AsyncIterator, override import httpx import pytest @@ -36,6 +37,7 @@ from .utils import update_env +T = TypeVar("T") base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = "My API Key" @@ -50,6 +52,57 @@ def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float: return 0.1 +def mirror_request_content(request: httpx.Request) -> httpx.Response: + return httpx.Response(200, content=request.content) + + +# note: we can't use the httpx.MockTransport class as it consumes the request +# body itself, which means we can't test that the body is read lazily +class MockTransport(httpx.BaseTransport, httpx.AsyncBaseTransport): + def __init__( + self, + handler: Callable[[httpx.Request], httpx.Response] + | Callable[[httpx.Request], Coroutine[Any, Any, httpx.Response]], + ) -> None: + self.handler = handler + + @override + def handle_request( + self, + request: httpx.Request, + ) -> httpx.Response: + assert not inspect.iscoroutinefunction(self.handler), "handler must not be a coroutine function" + assert inspect.isfunction(self.handler), "handler must be a function" + return self.handler(request) + + @override + async def handle_async_request( + self, + request: httpx.Request, + ) -> httpx.Response: + assert inspect.iscoroutinefunction(self.handler), "handler must be a coroutine function" + return await self.handler(request) + + +@dataclasses.dataclass +class Counter: + value: int = 0 + + +def _make_sync_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> Iterator[T]: + for item in iterable: + if counter: + counter.value += 1 + yield item + + +async def _make_async_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> AsyncIterator[T]: + for item in iterable: + if counter: + counter.value += 1 + yield item + + def _get_open_connections(client: Knock | AsyncKnock) -> int: transport = client._client._transport assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) @@ -500,6 +553,70 @@ def test_multipart_repeating_array(self, client: Knock) -> None: b"", ] + @pytest.mark.respx(base_url=base_url) + def test_binary_content_upload(self, respx_mock: MockRouter, client: Knock) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + response = client.post( + "/upload", + content=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + + def test_binary_content_upload_with_iterator(self) -> None: + file_content = b"Hello, this is a test file." + counter = Counter() + iterator = _make_sync_iterator([file_content], counter=counter) + + def mock_handler(request: httpx.Request) -> httpx.Response: + assert counter.value == 0, "the request body should not have been read" + return httpx.Response(200, content=request.read()) + + with Knock( + base_url=base_url, + api_key=api_key, + _strict_response_validation=True, + http_client=httpx.Client(transport=MockTransport(handler=mock_handler)), + ) as client: + response = client.post( + "/upload", + content=iterator, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + assert counter.value == 1 + + @pytest.mark.respx(base_url=base_url) + def test_binary_content_upload_with_body_is_deprecated(self, respx_mock: MockRouter, client: Knock) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + with pytest.deprecated_call( + match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead." + ): + response = client.post( + "/upload", + body=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + @pytest.mark.respx(base_url=base_url) def test_basic_union_response(self, respx_mock: MockRouter, client: Knock) -> None: class Model1(BaseModel): @@ -1348,6 +1465,72 @@ def test_multipart_repeating_array(self, async_client: AsyncKnock) -> None: b"", ] + @pytest.mark.respx(base_url=base_url) + async def test_binary_content_upload(self, respx_mock: MockRouter, async_client: AsyncKnock) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + response = await async_client.post( + "/upload", + content=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + + async def test_binary_content_upload_with_asynciterator(self) -> None: + file_content = b"Hello, this is a test file." + counter = Counter() + iterator = _make_async_iterator([file_content], counter=counter) + + async def mock_handler(request: httpx.Request) -> httpx.Response: + assert counter.value == 0, "the request body should not have been read" + return httpx.Response(200, content=await request.aread()) + + async with AsyncKnock( + base_url=base_url, + api_key=api_key, + _strict_response_validation=True, + http_client=httpx.AsyncClient(transport=MockTransport(handler=mock_handler)), + ) as client: + response = await client.post( + "/upload", + content=iterator, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + assert counter.value == 1 + + @pytest.mark.respx(base_url=base_url) + async def test_binary_content_upload_with_body_is_deprecated( + self, respx_mock: MockRouter, async_client: AsyncKnock + ) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + with pytest.deprecated_call( + match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead." + ): + response = await async_client.post( + "/upload", + body=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + @pytest.mark.respx(base_url=base_url) async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncKnock) -> None: class Model1(BaseModel): diff --git a/tests/test_utils/test_json.py b/tests/test_utils/test_json.py new file mode 100644 index 00000000..c46db523 --- /dev/null +++ b/tests/test_utils/test_json.py @@ -0,0 +1,126 @@ +from __future__ import annotations + +import datetime +from typing import Union + +import pydantic + +from knockapi import _compat +from knockapi._utils._json import openapi_dumps + + +class TestOpenapiDumps: + def test_basic(self) -> None: + data = {"key": "value", "number": 42} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"key":"value","number":42}' + + def test_datetime_serialization(self) -> None: + dt = datetime.datetime(2023, 1, 1, 12, 0, 0) + data = {"datetime": dt} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"datetime":"2023-01-01T12:00:00"}' + + def test_pydantic_model_serialization(self) -> None: + class User(pydantic.BaseModel): + first_name: str + last_name: str + age: int + + model_instance = User(first_name="John", last_name="Kramer", age=83) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"first_name":"John","last_name":"Kramer","age":83}}' + + def test_pydantic_model_with_default_values(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + score: int = 0 + + model_instance = User(name="Alice") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Alice"}}' + + def test_pydantic_model_with_default_values_overridden(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + + model_instance = User(name="Bob", role="admin", active=False) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Bob","role":"admin","active":false}}' + + def test_pydantic_model_with_alias(self) -> None: + class User(pydantic.BaseModel): + first_name: str = pydantic.Field(alias="firstName") + last_name: str = pydantic.Field(alias="lastName") + + model_instance = User(firstName="John", lastName="Doe") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"firstName":"John","lastName":"Doe"}}' + + def test_pydantic_model_with_alias_and_default(self) -> None: + class User(pydantic.BaseModel): + user_name: str = pydantic.Field(alias="userName") + user_role: str = pydantic.Field(default="member", alias="userRole") + is_active: bool = pydantic.Field(default=True, alias="isActive") + + model_instance = User(userName="charlie") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"charlie"}}' + + model_with_overrides = User(userName="diana", userRole="admin", isActive=False) + data = {"model": model_with_overrides} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"diana","userRole":"admin","isActive":false}}' + + def test_pydantic_model_with_nested_models_and_defaults(self) -> None: + class Address(pydantic.BaseModel): + street: str + city: str = "Unknown" + + class User(pydantic.BaseModel): + name: str + address: Address + verified: bool = False + + if _compat.PYDANTIC_V1: + # to handle forward references in Pydantic v1 + User.update_forward_refs(**locals()) # type: ignore[reportDeprecated] + + address = Address(street="123 Main St") + user = User(name="Diana", address=address) + data = {"user": user} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"user":{"name":"Diana","address":{"street":"123 Main St"}}}' + + address_with_city = Address(street="456 Oak Ave", city="Boston") + user_verified = User(name="Eve", address=address_with_city, verified=True) + data = {"user": user_verified} + json_bytes = openapi_dumps(data) + assert ( + json_bytes == b'{"user":{"name":"Eve","address":{"street":"456 Oak Ave","city":"Boston"},"verified":true}}' + ) + + def test_pydantic_model_with_optional_fields(self) -> None: + class User(pydantic.BaseModel): + name: str + email: Union[str, None] + phone: Union[str, None] + + model_with_none = User(name="Eve", email=None, phone=None) + data = {"model": model_with_none} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Eve","email":null,"phone":null}}' + + model_with_values = User(name="Frank", email="frank@example.com", phone=None) + data = {"model": model_with_values} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Frank","email":"frank@example.com","phone":null}}'