diff --git a/README.md b/README.md index 33ff2fa4..140c6f48 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/). ## Documentation -The REST API documentation can be found on [docs.usebrainbase.xyz](https://docs.usebrainbase.xyz). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.usebrainbase.com](https://docs.usebrainbase.com). The full API of this library can be found in [api.md](api.md). ## Installation diff --git a/SECURITY.md b/SECURITY.md index 752bd79a..239b8f29 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -20,7 +20,7 @@ or products provided by Brainbase please follow the respective company's securit ### Brainbase Terms and Policies -Please contact dev@brainbase.com for any questions or concerns regarding security of our services. +Please contact dev-feedback@brainbase.com for any questions or concerns regarding security of our services. --- diff --git a/api.md b/api.md index 2022bf88..ecd4ff83 100644 --- a/api.md +++ b/api.md @@ -26,19 +26,14 @@ Methods: Types: ```python -from brainbase.types.workers.deployments import ( - VoiceCreateResponse, - VoiceRetrieveResponse, - VoiceUpdateResponse, - VoiceListResponse, -) +from brainbase.types.workers.deployments import VoiceDeployment, VoiceListResponse ``` Methods: -- client.workers.deployments.voice.create(worker_id, \*\*params) -> VoiceCreateResponse -- client.workers.deployments.voice.retrieve(deployment_id, \*, worker_id) -> VoiceRetrieveResponse -- client.workers.deployments.voice.update(deployment_id, \*, worker_id, \*\*params) -> VoiceUpdateResponse +- client.workers.deployments.voice.create(worker_id, \*\*params) -> VoiceDeployment +- client.workers.deployments.voice.retrieve(deployment_id, \*, worker_id) -> VoiceDeployment +- client.workers.deployments.voice.update(deployment_id, \*, worker_id, \*\*params) -> VoiceDeployment - client.workers.deployments.voice.list(worker_id) -> VoiceListResponse - client.workers.deployments.voice.delete(deployment_id, \*, worker_id) -> None diff --git a/pyproject.toml b/pyproject.toml index ac778a61..6ea60816 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "The official Python library for the brainbase API" dynamic = ["readme"] license = "Apache-2.0" authors = [ -{ name = "Brainbase", email = "dev@brainbase.com" }, +{ name = "Brainbase", email = "dev-feedback@brainbase.com" }, ] dependencies = [ "httpx>=0.23.0, <1", diff --git a/src/brainbase/resources/workers/deployments/voice.py b/src/brainbase/resources/workers/deployments/voice.py index 241c6123..13442359 100644 --- a/src/brainbase/resources/workers/deployments/voice.py +++ b/src/brainbase/resources/workers/deployments/voice.py @@ -19,10 +19,8 @@ ) from ...._base_client import make_request_options from ....types.workers.deployments import voice_create_params, voice_update_params +from ....types.workers.deployments.voice_deployment import VoiceDeployment from ....types.workers.deployments.voice_list_response import VoiceListResponse -from ....types.workers.deployments.voice_create_response import VoiceCreateResponse -from ....types.workers.deployments.voice_update_response import VoiceUpdateResponse -from ....types.workers.deployments.voice_retrieve_response import VoiceRetrieveResponse __all__ = ["VoiceResource", "AsyncVoiceResource"] @@ -61,7 +59,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VoiceCreateResponse: + ) -> VoiceDeployment: """ Create a new voice deployment @@ -98,7 +96,7 @@ def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=VoiceCreateResponse, + cast_to=VoiceDeployment, ) def retrieve( @@ -112,7 +110,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VoiceRetrieveResponse: + ) -> VoiceDeployment: """ Get a single voice deployment @@ -134,7 +132,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=VoiceRetrieveResponse, + cast_to=VoiceDeployment, ) def update( @@ -152,7 +150,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VoiceUpdateResponse: + ) -> VoiceDeployment: """ Update a voice deployment @@ -191,7 +189,7 @@ def update( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=VoiceUpdateResponse, + cast_to=VoiceDeployment, ) def list( @@ -299,7 +297,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VoiceCreateResponse: + ) -> VoiceDeployment: """ Create a new voice deployment @@ -336,7 +334,7 @@ async def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=VoiceCreateResponse, + cast_to=VoiceDeployment, ) async def retrieve( @@ -350,7 +348,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VoiceRetrieveResponse: + ) -> VoiceDeployment: """ Get a single voice deployment @@ -372,7 +370,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=VoiceRetrieveResponse, + cast_to=VoiceDeployment, ) async def update( @@ -390,7 +388,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VoiceUpdateResponse: + ) -> VoiceDeployment: """ Update a voice deployment @@ -429,7 +427,7 @@ async def update( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=VoiceUpdateResponse, + cast_to=VoiceDeployment, ) async def list( diff --git a/src/brainbase/types/workers/deployments/__init__.py b/src/brainbase/types/workers/deployments/__init__.py index dbdb876a..e5947326 100644 --- a/src/brainbase/types/workers/deployments/__init__.py +++ b/src/brainbase/types/workers/deployments/__init__.py @@ -2,9 +2,7 @@ from __future__ import annotations +from .voice_deployment import VoiceDeployment as VoiceDeployment from .voice_create_params import VoiceCreateParams as VoiceCreateParams from .voice_list_response import VoiceListResponse as VoiceListResponse from .voice_update_params import VoiceUpdateParams as VoiceUpdateParams -from .voice_create_response import VoiceCreateResponse as VoiceCreateResponse -from .voice_update_response import VoiceUpdateResponse as VoiceUpdateResponse -from .voice_retrieve_response import VoiceRetrieveResponse as VoiceRetrieveResponse diff --git a/src/brainbase/types/workers/deployments/voice_create_response.py b/src/brainbase/types/workers/deployments/voice_deployment.py similarity index 88% rename from src/brainbase/types/workers/deployments/voice_create_response.py rename to src/brainbase/types/workers/deployments/voice_deployment.py index 2c9a7960..61ea6936 100644 --- a/src/brainbase/types/workers/deployments/voice_create_response.py +++ b/src/brainbase/types/workers/deployments/voice_deployment.py @@ -6,10 +6,10 @@ from ...._models import BaseModel -__all__ = ["VoiceCreateResponse"] +__all__ = ["VoiceDeployment"] -class VoiceCreateResponse(BaseModel): +class VoiceDeployment(BaseModel): id: str delegate_aux_deployments_id: Optional[str] = FieldInfo(alias="delegate_aux_deploymentsId", default=None) diff --git a/src/brainbase/types/workers/deployments/voice_list_response.py b/src/brainbase/types/workers/deployments/voice_list_response.py index d54f167d..d714d5dc 100644 --- a/src/brainbase/types/workers/deployments/voice_list_response.py +++ b/src/brainbase/types/workers/deployments/voice_list_response.py @@ -1,25 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from typing_extensions import TypeAlias -from pydantic import Field as FieldInfo +from .voice_deployment import VoiceDeployment -from ...._models import BaseModel +__all__ = ["VoiceListResponse"] -__all__ = ["VoiceListResponse", "VoiceListResponseItem"] - - -class VoiceListResponseItem(BaseModel): - id: str - - delegate_aux_deployments_id: Optional[str] = FieldInfo(alias="delegate_aux_deploymentsId", default=None) - - phone_number: Optional[str] = FieldInfo(alias="phoneNumber", default=None) - - voice_id: Optional[str] = FieldInfo(alias="voiceId", default=None) - - voice_provider: Optional[str] = FieldInfo(alias="voiceProvider", default=None) - - -VoiceListResponse: TypeAlias = List[VoiceListResponseItem] +VoiceListResponse: TypeAlias = List[VoiceDeployment] diff --git a/src/brainbase/types/workers/deployments/voice_retrieve_response.py b/src/brainbase/types/workers/deployments/voice_retrieve_response.py deleted file mode 100644 index 15fc4abe..00000000 --- a/src/brainbase/types/workers/deployments/voice_retrieve_response.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = ["VoiceRetrieveResponse"] - - -class VoiceRetrieveResponse(BaseModel): - id: str - - delegate_aux_deployments_id: Optional[str] = FieldInfo(alias="delegate_aux_deploymentsId", default=None) - - phone_number: Optional[str] = FieldInfo(alias="phoneNumber", default=None) - - voice_id: Optional[str] = FieldInfo(alias="voiceId", default=None) - - voice_provider: Optional[str] = FieldInfo(alias="voiceProvider", default=None) diff --git a/src/brainbase/types/workers/deployments/voice_update_response.py b/src/brainbase/types/workers/deployments/voice_update_response.py deleted file mode 100644 index 67d8460f..00000000 --- a/src/brainbase/types/workers/deployments/voice_update_response.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = ["VoiceUpdateResponse"] - - -class VoiceUpdateResponse(BaseModel): - id: str - - delegate_aux_deployments_id: Optional[str] = FieldInfo(alias="delegate_aux_deploymentsId", default=None) - - phone_number: Optional[str] = FieldInfo(alias="phoneNumber", default=None) - - voice_id: Optional[str] = FieldInfo(alias="voiceId", default=None) - - voice_provider: Optional[str] = FieldInfo(alias="voiceProvider", default=None) diff --git a/tests/api_resources/workers/deployments/test_voice.py b/tests/api_resources/workers/deployments/test_voice.py index 7bdabc59..4724244e 100644 --- a/tests/api_resources/workers/deployments/test_voice.py +++ b/tests/api_resources/workers/deployments/test_voice.py @@ -10,10 +10,8 @@ from brainbase import Brainbase, AsyncBrainbase from tests.utils import assert_matches_type from brainbase.types.workers.deployments import ( + VoiceDeployment, VoiceListResponse, - VoiceCreateResponse, - VoiceUpdateResponse, - VoiceRetrieveResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +27,7 @@ def test_method_create(self, client: Brainbase) -> None: worker_id="workerId", name="name", ) - assert_matches_type(VoiceCreateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +39,7 @@ def test_method_create_with_all_params(self, client: Brainbase) -> None: voice_id="voiceId", voice_provider="voiceProvider", ) - assert_matches_type(VoiceCreateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -54,7 +52,7 @@ def test_raw_response_create(self, client: Brainbase) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = response.parse() - assert_matches_type(VoiceCreateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -67,7 +65,7 @@ def test_streaming_response_create(self, client: Brainbase) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = response.parse() - assert_matches_type(VoiceCreateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -87,7 +85,7 @@ def test_method_retrieve(self, client: Brainbase) -> None: deployment_id="deploymentId", worker_id="workerId", ) - assert_matches_type(VoiceRetrieveResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +98,7 @@ def test_raw_response_retrieve(self, client: Brainbase) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = response.parse() - assert_matches_type(VoiceRetrieveResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -113,7 +111,7 @@ def test_streaming_response_retrieve(self, client: Brainbase) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = response.parse() - assert_matches_type(VoiceRetrieveResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -140,7 +138,7 @@ def test_method_update(self, client: Brainbase) -> None: worker_id="workerId", name="name", ) - assert_matches_type(VoiceUpdateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -153,7 +151,7 @@ def test_method_update_with_all_params(self, client: Brainbase) -> None: voice_id="voiceId", voice_provider="voiceProvider", ) - assert_matches_type(VoiceUpdateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -167,7 +165,7 @@ def test_raw_response_update(self, client: Brainbase) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = response.parse() - assert_matches_type(VoiceUpdateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -181,7 +179,7 @@ def test_streaming_response_update(self, client: Brainbase) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = response.parse() - assert_matches_type(VoiceUpdateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -307,7 +305,7 @@ async def test_method_create(self, async_client: AsyncBrainbase) -> None: worker_id="workerId", name="name", ) - assert_matches_type(VoiceCreateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -319,7 +317,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrainbase) voice_id="voiceId", voice_provider="voiceProvider", ) - assert_matches_type(VoiceCreateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -332,7 +330,7 @@ async def test_raw_response_create(self, async_client: AsyncBrainbase) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = await response.parse() - assert_matches_type(VoiceCreateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -345,7 +343,7 @@ async def test_streaming_response_create(self, async_client: AsyncBrainbase) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = await response.parse() - assert_matches_type(VoiceCreateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -365,7 +363,7 @@ async def test_method_retrieve(self, async_client: AsyncBrainbase) -> None: deployment_id="deploymentId", worker_id="workerId", ) - assert_matches_type(VoiceRetrieveResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -378,7 +376,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncBrainbase) -> None assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = await response.parse() - assert_matches_type(VoiceRetrieveResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -391,7 +389,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncBrainbase) - assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = await response.parse() - assert_matches_type(VoiceRetrieveResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -418,7 +416,7 @@ async def test_method_update(self, async_client: AsyncBrainbase) -> None: worker_id="workerId", name="name", ) - assert_matches_type(VoiceUpdateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -431,7 +429,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncBrainbase) voice_id="voiceId", voice_provider="voiceProvider", ) - assert_matches_type(VoiceUpdateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -445,7 +443,7 @@ async def test_raw_response_update(self, async_client: AsyncBrainbase) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = await response.parse() - assert_matches_type(VoiceUpdateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) @pytest.mark.skip() @parametrize @@ -459,7 +457,7 @@ async def test_streaming_response_update(self, async_client: AsyncBrainbase) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" voice = await response.parse() - assert_matches_type(VoiceUpdateResponse, voice, path=["response"]) + assert_matches_type(VoiceDeployment, voice, path=["response"]) assert cast(Any, response.is_closed) is True