Skip to content

Commit

Permalink
Release 0.0.46
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Apr 19, 2024
1 parent 5edd25f commit 6df93fb
Show file tree
Hide file tree
Showing 20 changed files with 244 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "vocode-api"
version = "0.0.45"
version = "0.0.46"
description = ""
readme = "README.md"
authors = []
Expand Down
16 changes: 16 additions & 0 deletions src/vocode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
CallStage,
CallStageOutcome,
CallStatus,
CallTelephonyMetadata,
CallTelephonyMetadata_TelephonyMetadataTwilio,
CallTelephonyMetadata_TelephonyMetadataVonage,
CallTelephonyProvider,
CollectField,
CreateCallAgentParams,
Expand Down Expand Up @@ -218,6 +221,9 @@
NormalizedCallStage,
NormalizedCallStageOutcome,
NormalizedCallTelephonyAccountConnection,
NormalizedCallTelephonyMetadata,
NormalizedCallTelephonyMetadata_TelephonyMetadataTwilio,
NormalizedCallTelephonyMetadata_TelephonyMetadataVonage,
NormalizedCallTelephonyProvider,
NormalizedPhoneNumber,
NormalizedPhoneNumberTelephonyAccountConnection,
Expand Down Expand Up @@ -311,6 +317,7 @@
TwilioAccountConnectionUpdateParams,
TwilioAccountConnectionUpdateParamsCredentials,
TwilioCredentials,
TwilioTelephonyMetadata,
Undefined,
Usage,
ValidationError,
Expand All @@ -337,6 +344,7 @@
VoiceUpdateParamsRequest_VoiceElevenLabs,
VoiceUpdateParamsRequest_VoicePlayHt,
VoiceUpdateParamsRequest_VoiceRime,
VonageTelephonyMetadata,
Webhook,
WebhookPage,
WebhookParams,
Expand Down Expand Up @@ -528,6 +536,9 @@
"CallStage",
"CallStageOutcome",
"CallStatus",
"CallTelephonyMetadata",
"CallTelephonyMetadata_TelephonyMetadataTwilio",
"CallTelephonyMetadata_TelephonyMetadataVonage",
"CallTelephonyProvider",
"CollectField",
"CreateCallAgentParams",
Expand Down Expand Up @@ -626,6 +637,9 @@
"NormalizedCallStage",
"NormalizedCallStageOutcome",
"NormalizedCallTelephonyAccountConnection",
"NormalizedCallTelephonyMetadata",
"NormalizedCallTelephonyMetadata_TelephonyMetadataTwilio",
"NormalizedCallTelephonyMetadata_TelephonyMetadataVonage",
"NormalizedCallTelephonyProvider",
"NormalizedPhoneNumber",
"NormalizedPhoneNumberTelephonyAccountConnection",
Expand Down Expand Up @@ -719,6 +733,7 @@
"TwilioAccountConnectionUpdateParams",
"TwilioAccountConnectionUpdateParamsCredentials",
"TwilioCredentials",
"TwilioTelephonyMetadata",
"Undefined",
"UnprocessableEntityError",
"UpdateNumberRequestExampleContext",
Expand Down Expand Up @@ -751,6 +766,7 @@
"VoiceUpdateParamsRequest_VoiceElevenLabs",
"VoiceUpdateParamsRequest_VoicePlayHt",
"VoiceUpdateParamsRequest_VoiceRime",
"VonageTelephonyMetadata",
"Webhook",
"WebhookPage",
"WebhookParams",
Expand Down
2 changes: 1 addition & 1 deletion src/vocode/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "vocode-api",
"X-Fern-SDK-Version": "0.0.45",
"X-Fern-SDK-Version": "0.0.46",
}
headers["Authorization"] = f"Bearer {self._get_token()}"
return headers
Expand Down
72 changes: 60 additions & 12 deletions src/vocode/resources/account_connections/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,23 +136,47 @@ def update_account_connection(
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def add_to_steering_pool(self, *, id: str, phone_number: typing.Optional[str] = OMIT) -> typing.Any:
def add_to_steering_pool(self, *, id: str, phone_number: str) -> typing.Any:
"""
Parameters:
- id: str.
- phone_number: typing.Optional[str].
- phone_number: str.
"""
_request: typing.Dict[str, typing.Any] = {}
if phone_number is not OMIT:
_request["phone_number"] = phone_number
_response = self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", "v1/account_connections/add_to_steering_pool"
),
params=remove_none_from_dict({"id": id}),
json=jsonable_encoder(_request),
json=jsonable_encoder({"phone_number": phone_number}),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def remove_from_steering_pool(self, *, id: str, phone_number: str) -> typing.Any:
"""
Parameters:
- id: str.
- phone_number: str.
"""
_response = self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", "v1/account_connections/remove_from_steering_pool"
),
params=remove_none_from_dict({"id": id}),
json=jsonable_encoder({"phone_number": phone_number}),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -281,23 +305,47 @@ async def update_account_connection(
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def add_to_steering_pool(self, *, id: str, phone_number: typing.Optional[str] = OMIT) -> typing.Any:
async def add_to_steering_pool(self, *, id: str, phone_number: str) -> typing.Any:
"""
Parameters:
- id: str.
- phone_number: typing.Optional[str].
- phone_number: str.
"""
_request: typing.Dict[str, typing.Any] = {}
if phone_number is not OMIT:
_request["phone_number"] = phone_number
_response = await self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", "v1/account_connections/add_to_steering_pool"
),
params=remove_none_from_dict({"id": id}),
json=jsonable_encoder(_request),
json=jsonable_encoder({"phone_number": phone_number}),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def remove_from_steering_pool(self, *, id: str, phone_number: str) -> typing.Any:
"""
Parameters:
- id: str.
- phone_number: str.
"""
_response = await self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", "v1/account_connections/remove_from_steering_pool"
),
params=remove_none_from_dict({"id": id}),
json=jsonable_encoder({"phone_number": phone_number}),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down
20 changes: 20 additions & 0 deletions src/vocode/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@
from .call_stage import CallStage
from .call_stage_outcome import CallStageOutcome
from .call_status import CallStatus
from .call_telephony_metadata import (
CallTelephonyMetadata,
CallTelephonyMetadata_TelephonyMetadataTwilio,
CallTelephonyMetadata_TelephonyMetadataVonage,
)
from .call_telephony_provider import CallTelephonyProvider
from .collect_field import CollectField
from .create_call_agent_params import CreateCallAgentParams
Expand Down Expand Up @@ -273,6 +278,11 @@
from .normalized_call_stage import NormalizedCallStage
from .normalized_call_stage_outcome import NormalizedCallStageOutcome
from .normalized_call_telephony_account_connection import NormalizedCallTelephonyAccountConnection
from .normalized_call_telephony_metadata import (
NormalizedCallTelephonyMetadata,
NormalizedCallTelephonyMetadata_TelephonyMetadataTwilio,
NormalizedCallTelephonyMetadata_TelephonyMetadataVonage,
)
from .normalized_call_telephony_provider import NormalizedCallTelephonyProvider
from .normalized_phone_number import NormalizedPhoneNumber
from .normalized_phone_number_telephony_account_connection import NormalizedPhoneNumberTelephonyAccountConnection
Expand Down Expand Up @@ -378,6 +388,7 @@
from .twilio_account_connection_update_params import TwilioAccountConnectionUpdateParams
from .twilio_account_connection_update_params_credentials import TwilioAccountConnectionUpdateParamsCredentials
from .twilio_credentials import TwilioCredentials
from .twilio_telephony_metadata import TwilioTelephonyMetadata
from .undefined import Undefined
from .usage import Usage
from .validation_error import ValidationError
Expand Down Expand Up @@ -412,6 +423,7 @@
VoiceUpdateParamsRequest_VoicePlayHt,
VoiceUpdateParamsRequest_VoiceRime,
)
from .vonage_telephony_metadata import VonageTelephonyMetadata
from .webhook import Webhook
from .webhook_page import WebhookPage
from .webhook_params import WebhookParams
Expand Down Expand Up @@ -542,6 +554,9 @@
"CallStage",
"CallStageOutcome",
"CallStatus",
"CallTelephonyMetadata",
"CallTelephonyMetadata_TelephonyMetadataTwilio",
"CallTelephonyMetadata_TelephonyMetadataVonage",
"CallTelephonyProvider",
"CollectField",
"CreateCallAgentParams",
Expand Down Expand Up @@ -638,6 +653,9 @@
"NormalizedCallStage",
"NormalizedCallStageOutcome",
"NormalizedCallTelephonyAccountConnection",
"NormalizedCallTelephonyMetadata",
"NormalizedCallTelephonyMetadata_TelephonyMetadataTwilio",
"NormalizedCallTelephonyMetadata_TelephonyMetadataVonage",
"NormalizedCallTelephonyProvider",
"NormalizedPhoneNumber",
"NormalizedPhoneNumberTelephonyAccountConnection",
Expand Down Expand Up @@ -731,6 +749,7 @@
"TwilioAccountConnectionUpdateParams",
"TwilioAccountConnectionUpdateParamsCredentials",
"TwilioCredentials",
"TwilioTelephonyMetadata",
"Undefined",
"Usage",
"ValidationError",
Expand All @@ -757,6 +776,7 @@
"VoiceUpdateParamsRequest_VoiceElevenLabs",
"VoiceUpdateParamsRequest_VoicePlayHt",
"VoiceUpdateParamsRequest_VoiceRime",
"VonageTelephonyMetadata",
"Webhook",
"WebhookPage",
"WebhookParams",
Expand Down
2 changes: 2 additions & 0 deletions src/vocode/types/account_connection_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class AccountConnectionPage(pydantic.BaseModel):
page: int
size: int
has_more: bool
total: int
total_is_estimated: bool

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
2 changes: 2 additions & 0 deletions src/vocode/types/action_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class ActionPage(pydantic.BaseModel):
page: int
size: int
has_more: bool
total: int
total_is_estimated: bool

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
2 changes: 2 additions & 0 deletions src/vocode/types/agent_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class AgentPage(pydantic.BaseModel):
page: int
size: int
has_more: bool
total: int
total_is_estimated: bool

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
2 changes: 2 additions & 0 deletions src/vocode/types/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .call_stage import CallStage
from .call_stage_outcome import CallStageOutcome
from .call_status import CallStatus
from .call_telephony_metadata import CallTelephonyMetadata
from .call_telephony_provider import CallTelephonyProvider
from .twilio_account_connection import TwilioAccountConnection

Expand All @@ -31,6 +32,7 @@ class Call(pydantic.BaseModel):
telephony_id: typing.Optional[str]
stage: typing.Optional[CallStage]
stage_outcome: typing.Optional[CallStageOutcome]
telephony_metadata: typing.Optional[CallTelephonyMetadata]
to_number: str
from_number: str
agent: Agent
Expand Down
2 changes: 2 additions & 0 deletions src/vocode/types/call_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class CallPage(pydantic.BaseModel):
page: int
size: int
has_more: bool
total: int
total_is_estimated: bool

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
33 changes: 33 additions & 0 deletions src/vocode/types/call_telephony_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations

import typing

import typing_extensions

from .twilio_telephony_metadata import TwilioTelephonyMetadata
from .vonage_telephony_metadata import VonageTelephonyMetadata


class CallTelephonyMetadata_TelephonyMetadataVonage(VonageTelephonyMetadata):
type: typing_extensions.Literal["telephony_metadata_vonage"]

class Config:
frozen = True
smart_union = True
allow_population_by_field_name = True


class CallTelephonyMetadata_TelephonyMetadataTwilio(TwilioTelephonyMetadata):
type: typing_extensions.Literal["telephony_metadata_twilio"]

class Config:
frozen = True
smart_union = True
allow_population_by_field_name = True


CallTelephonyMetadata = typing.Union[
CallTelephonyMetadata_TelephonyMetadataVonage, CallTelephonyMetadata_TelephonyMetadataTwilio
]
2 changes: 2 additions & 0 deletions src/vocode/types/normalized_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .normalized_call_stage import NormalizedCallStage
from .normalized_call_stage_outcome import NormalizedCallStageOutcome
from .normalized_call_telephony_account_connection import NormalizedCallTelephonyAccountConnection
from .normalized_call_telephony_metadata import NormalizedCallTelephonyMetadata
from .normalized_call_telephony_provider import NormalizedCallTelephonyProvider

try:
Expand All @@ -30,6 +31,7 @@ class NormalizedCall(pydantic.BaseModel):
telephony_id: typing.Optional[str]
stage: typing.Optional[NormalizedCallStage]
stage_outcome: typing.Optional[NormalizedCallStageOutcome]
telephony_metadata: typing.Optional[NormalizedCallTelephonyMetadata]
to_number: str
from_number: str
agent: str
Expand Down
Loading

0 comments on commit 6df93fb

Please sign in to comment.