Skip to content

Commit 6df93fb

Browse files
committed
Release 0.0.46
1 parent 5edd25f commit 6df93fb

20 files changed

+244
-14
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "vocode-api"
3-
version = "0.0.45"
3+
version = "0.0.46"
44
description = ""
55
readme = "README.md"
66
authors = []

src/vocode/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@
122122
CallStage,
123123
CallStageOutcome,
124124
CallStatus,
125+
CallTelephonyMetadata,
126+
CallTelephonyMetadata_TelephonyMetadataTwilio,
127+
CallTelephonyMetadata_TelephonyMetadataVonage,
125128
CallTelephonyProvider,
126129
CollectField,
127130
CreateCallAgentParams,
@@ -218,6 +221,9 @@
218221
NormalizedCallStage,
219222
NormalizedCallStageOutcome,
220223
NormalizedCallTelephonyAccountConnection,
224+
NormalizedCallTelephonyMetadata,
225+
NormalizedCallTelephonyMetadata_TelephonyMetadataTwilio,
226+
NormalizedCallTelephonyMetadata_TelephonyMetadataVonage,
221227
NormalizedCallTelephonyProvider,
222228
NormalizedPhoneNumber,
223229
NormalizedPhoneNumberTelephonyAccountConnection,
@@ -311,6 +317,7 @@
311317
TwilioAccountConnectionUpdateParams,
312318
TwilioAccountConnectionUpdateParamsCredentials,
313319
TwilioCredentials,
320+
TwilioTelephonyMetadata,
314321
Undefined,
315322
Usage,
316323
ValidationError,
@@ -337,6 +344,7 @@
337344
VoiceUpdateParamsRequest_VoiceElevenLabs,
338345
VoiceUpdateParamsRequest_VoicePlayHt,
339346
VoiceUpdateParamsRequest_VoiceRime,
347+
VonageTelephonyMetadata,
340348
Webhook,
341349
WebhookPage,
342350
WebhookParams,
@@ -528,6 +536,9 @@
528536
"CallStage",
529537
"CallStageOutcome",
530538
"CallStatus",
539+
"CallTelephonyMetadata",
540+
"CallTelephonyMetadata_TelephonyMetadataTwilio",
541+
"CallTelephonyMetadata_TelephonyMetadataVonage",
531542
"CallTelephonyProvider",
532543
"CollectField",
533544
"CreateCallAgentParams",
@@ -626,6 +637,9 @@
626637
"NormalizedCallStage",
627638
"NormalizedCallStageOutcome",
628639
"NormalizedCallTelephonyAccountConnection",
640+
"NormalizedCallTelephonyMetadata",
641+
"NormalizedCallTelephonyMetadata_TelephonyMetadataTwilio",
642+
"NormalizedCallTelephonyMetadata_TelephonyMetadataVonage",
629643
"NormalizedCallTelephonyProvider",
630644
"NormalizedPhoneNumber",
631645
"NormalizedPhoneNumberTelephonyAccountConnection",
@@ -719,6 +733,7 @@
719733
"TwilioAccountConnectionUpdateParams",
720734
"TwilioAccountConnectionUpdateParamsCredentials",
721735
"TwilioCredentials",
736+
"TwilioTelephonyMetadata",
722737
"Undefined",
723738
"UnprocessableEntityError",
724739
"UpdateNumberRequestExampleContext",
@@ -751,6 +766,7 @@
751766
"VoiceUpdateParamsRequest_VoiceElevenLabs",
752767
"VoiceUpdateParamsRequest_VoicePlayHt",
753768
"VoiceUpdateParamsRequest_VoiceRime",
769+
"VonageTelephonyMetadata",
754770
"Webhook",
755771
"WebhookPage",
756772
"WebhookParams",

src/vocode/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1414
headers: typing.Dict[str, str] = {
1515
"X-Fern-Language": "Python",
1616
"X-Fern-SDK-Name": "vocode-api",
17-
"X-Fern-SDK-Version": "0.0.45",
17+
"X-Fern-SDK-Version": "0.0.46",
1818
}
1919
headers["Authorization"] = f"Bearer {self._get_token()}"
2020
return headers

src/vocode/resources/account_connections/client.py

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,23 +136,47 @@ def update_account_connection(
136136
raise ApiError(status_code=_response.status_code, body=_response.text)
137137
raise ApiError(status_code=_response.status_code, body=_response_json)
138138

139-
def add_to_steering_pool(self, *, id: str, phone_number: typing.Optional[str] = OMIT) -> typing.Any:
139+
def add_to_steering_pool(self, *, id: str, phone_number: str) -> typing.Any:
140140
"""
141141
Parameters:
142142
- id: str.
143143
144-
- phone_number: typing.Optional[str].
144+
- phone_number: str.
145145
"""
146-
_request: typing.Dict[str, typing.Any] = {}
147-
if phone_number is not OMIT:
148-
_request["phone_number"] = phone_number
149146
_response = self._client_wrapper.httpx_client.request(
150147
"POST",
151148
urllib.parse.urljoin(
152149
f"{self._client_wrapper.get_base_url()}/", "v1/account_connections/add_to_steering_pool"
153150
),
154151
params=remove_none_from_dict({"id": id}),
155-
json=jsonable_encoder(_request),
152+
json=jsonable_encoder({"phone_number": phone_number}),
153+
headers=self._client_wrapper.get_headers(),
154+
timeout=60,
155+
)
156+
if 200 <= _response.status_code < 300:
157+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
158+
if _response.status_code == 422:
159+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
160+
try:
161+
_response_json = _response.json()
162+
except JSONDecodeError:
163+
raise ApiError(status_code=_response.status_code, body=_response.text)
164+
raise ApiError(status_code=_response.status_code, body=_response_json)
165+
166+
def remove_from_steering_pool(self, *, id: str, phone_number: str) -> typing.Any:
167+
"""
168+
Parameters:
169+
- id: str.
170+
171+
- phone_number: str.
172+
"""
173+
_response = self._client_wrapper.httpx_client.request(
174+
"POST",
175+
urllib.parse.urljoin(
176+
f"{self._client_wrapper.get_base_url()}/", "v1/account_connections/remove_from_steering_pool"
177+
),
178+
params=remove_none_from_dict({"id": id}),
179+
json=jsonable_encoder({"phone_number": phone_number}),
156180
headers=self._client_wrapper.get_headers(),
157181
timeout=60,
158182
)
@@ -281,23 +305,47 @@ async def update_account_connection(
281305
raise ApiError(status_code=_response.status_code, body=_response.text)
282306
raise ApiError(status_code=_response.status_code, body=_response_json)
283307

284-
async def add_to_steering_pool(self, *, id: str, phone_number: typing.Optional[str] = OMIT) -> typing.Any:
308+
async def add_to_steering_pool(self, *, id: str, phone_number: str) -> typing.Any:
285309
"""
286310
Parameters:
287311
- id: str.
288312
289-
- phone_number: typing.Optional[str].
313+
- phone_number: str.
290314
"""
291-
_request: typing.Dict[str, typing.Any] = {}
292-
if phone_number is not OMIT:
293-
_request["phone_number"] = phone_number
294315
_response = await self._client_wrapper.httpx_client.request(
295316
"POST",
296317
urllib.parse.urljoin(
297318
f"{self._client_wrapper.get_base_url()}/", "v1/account_connections/add_to_steering_pool"
298319
),
299320
params=remove_none_from_dict({"id": id}),
300-
json=jsonable_encoder(_request),
321+
json=jsonable_encoder({"phone_number": phone_number}),
322+
headers=self._client_wrapper.get_headers(),
323+
timeout=60,
324+
)
325+
if 200 <= _response.status_code < 300:
326+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
327+
if _response.status_code == 422:
328+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
329+
try:
330+
_response_json = _response.json()
331+
except JSONDecodeError:
332+
raise ApiError(status_code=_response.status_code, body=_response.text)
333+
raise ApiError(status_code=_response.status_code, body=_response_json)
334+
335+
async def remove_from_steering_pool(self, *, id: str, phone_number: str) -> typing.Any:
336+
"""
337+
Parameters:
338+
- id: str.
339+
340+
- phone_number: str.
341+
"""
342+
_response = await self._client_wrapper.httpx_client.request(
343+
"POST",
344+
urllib.parse.urljoin(
345+
f"{self._client_wrapper.get_base_url()}/", "v1/account_connections/remove_from_steering_pool"
346+
),
347+
params=remove_none_from_dict({"id": id}),
348+
json=jsonable_encoder({"phone_number": phone_number}),
301349
headers=self._client_wrapper.get_headers(),
302350
timeout=60,
303351
)

src/vocode/types/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@
151151
from .call_stage import CallStage
152152
from .call_stage_outcome import CallStageOutcome
153153
from .call_status import CallStatus
154+
from .call_telephony_metadata import (
155+
CallTelephonyMetadata,
156+
CallTelephonyMetadata_TelephonyMetadataTwilio,
157+
CallTelephonyMetadata_TelephonyMetadataVonage,
158+
)
154159
from .call_telephony_provider import CallTelephonyProvider
155160
from .collect_field import CollectField
156161
from .create_call_agent_params import CreateCallAgentParams
@@ -273,6 +278,11 @@
273278
from .normalized_call_stage import NormalizedCallStage
274279
from .normalized_call_stage_outcome import NormalizedCallStageOutcome
275280
from .normalized_call_telephony_account_connection import NormalizedCallTelephonyAccountConnection
281+
from .normalized_call_telephony_metadata import (
282+
NormalizedCallTelephonyMetadata,
283+
NormalizedCallTelephonyMetadata_TelephonyMetadataTwilio,
284+
NormalizedCallTelephonyMetadata_TelephonyMetadataVonage,
285+
)
276286
from .normalized_call_telephony_provider import NormalizedCallTelephonyProvider
277287
from .normalized_phone_number import NormalizedPhoneNumber
278288
from .normalized_phone_number_telephony_account_connection import NormalizedPhoneNumberTelephonyAccountConnection
@@ -378,6 +388,7 @@
378388
from .twilio_account_connection_update_params import TwilioAccountConnectionUpdateParams
379389
from .twilio_account_connection_update_params_credentials import TwilioAccountConnectionUpdateParamsCredentials
380390
from .twilio_credentials import TwilioCredentials
391+
from .twilio_telephony_metadata import TwilioTelephonyMetadata
381392
from .undefined import Undefined
382393
from .usage import Usage
383394
from .validation_error import ValidationError
@@ -412,6 +423,7 @@
412423
VoiceUpdateParamsRequest_VoicePlayHt,
413424
VoiceUpdateParamsRequest_VoiceRime,
414425
)
426+
from .vonage_telephony_metadata import VonageTelephonyMetadata
415427
from .webhook import Webhook
416428
from .webhook_page import WebhookPage
417429
from .webhook_params import WebhookParams
@@ -542,6 +554,9 @@
542554
"CallStage",
543555
"CallStageOutcome",
544556
"CallStatus",
557+
"CallTelephonyMetadata",
558+
"CallTelephonyMetadata_TelephonyMetadataTwilio",
559+
"CallTelephonyMetadata_TelephonyMetadataVonage",
545560
"CallTelephonyProvider",
546561
"CollectField",
547562
"CreateCallAgentParams",
@@ -638,6 +653,9 @@
638653
"NormalizedCallStage",
639654
"NormalizedCallStageOutcome",
640655
"NormalizedCallTelephonyAccountConnection",
656+
"NormalizedCallTelephonyMetadata",
657+
"NormalizedCallTelephonyMetadata_TelephonyMetadataTwilio",
658+
"NormalizedCallTelephonyMetadata_TelephonyMetadataVonage",
641659
"NormalizedCallTelephonyProvider",
642660
"NormalizedPhoneNumber",
643661
"NormalizedPhoneNumberTelephonyAccountConnection",
@@ -731,6 +749,7 @@
731749
"TwilioAccountConnectionUpdateParams",
732750
"TwilioAccountConnectionUpdateParamsCredentials",
733751
"TwilioCredentials",
752+
"TwilioTelephonyMetadata",
734753
"Undefined",
735754
"Usage",
736755
"ValidationError",
@@ -757,6 +776,7 @@
757776
"VoiceUpdateParamsRequest_VoiceElevenLabs",
758777
"VoiceUpdateParamsRequest_VoicePlayHt",
759778
"VoiceUpdateParamsRequest_VoiceRime",
779+
"VonageTelephonyMetadata",
760780
"Webhook",
761781
"WebhookPage",
762782
"WebhookParams",

src/vocode/types/account_connection_page.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class AccountConnectionPage(pydantic.BaseModel):
1717
page: int
1818
size: int
1919
has_more: bool
20+
total: int
21+
total_is_estimated: bool
2022

2123
def json(self, **kwargs: typing.Any) -> str:
2224
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}

src/vocode/types/action_page.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class ActionPage(pydantic.BaseModel):
1717
page: int
1818
size: int
1919
has_more: bool
20+
total: int
21+
total_is_estimated: bool
2022

2123
def json(self, **kwargs: typing.Any) -> str:
2224
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}

src/vocode/types/agent_page.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class AgentPage(pydantic.BaseModel):
1717
page: int
1818
size: int
1919
has_more: bool
20+
total: int
21+
total_is_estimated: bool
2022

2123
def json(self, **kwargs: typing.Any) -> str:
2224
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}

src/vocode/types/call.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .call_stage import CallStage
1111
from .call_stage_outcome import CallStageOutcome
1212
from .call_status import CallStatus
13+
from .call_telephony_metadata import CallTelephonyMetadata
1314
from .call_telephony_provider import CallTelephonyProvider
1415
from .twilio_account_connection import TwilioAccountConnection
1516

@@ -31,6 +32,7 @@ class Call(pydantic.BaseModel):
3132
telephony_id: typing.Optional[str]
3233
stage: typing.Optional[CallStage]
3334
stage_outcome: typing.Optional[CallStageOutcome]
35+
telephony_metadata: typing.Optional[CallTelephonyMetadata]
3436
to_number: str
3537
from_number: str
3638
agent: Agent

src/vocode/types/call_page.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class CallPage(pydantic.BaseModel):
1717
page: int
1818
size: int
1919
has_more: bool
20+
total: int
21+
total_is_estimated: bool
2022

2123
def json(self, **kwargs: typing.Any) -> str:
2224
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from __future__ import annotations
4+
5+
import typing
6+
7+
import typing_extensions
8+
9+
from .twilio_telephony_metadata import TwilioTelephonyMetadata
10+
from .vonage_telephony_metadata import VonageTelephonyMetadata
11+
12+
13+
class CallTelephonyMetadata_TelephonyMetadataVonage(VonageTelephonyMetadata):
14+
type: typing_extensions.Literal["telephony_metadata_vonage"]
15+
16+
class Config:
17+
frozen = True
18+
smart_union = True
19+
allow_population_by_field_name = True
20+
21+
22+
class CallTelephonyMetadata_TelephonyMetadataTwilio(TwilioTelephonyMetadata):
23+
type: typing_extensions.Literal["telephony_metadata_twilio"]
24+
25+
class Config:
26+
frozen = True
27+
smart_union = True
28+
allow_population_by_field_name = True
29+
30+
31+
CallTelephonyMetadata = typing.Union[
32+
CallTelephonyMetadata_TelephonyMetadataVonage, CallTelephonyMetadata_TelephonyMetadataTwilio
33+
]

src/vocode/types/normalized_call.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .normalized_call_stage import NormalizedCallStage
1111
from .normalized_call_stage_outcome import NormalizedCallStageOutcome
1212
from .normalized_call_telephony_account_connection import NormalizedCallTelephonyAccountConnection
13+
from .normalized_call_telephony_metadata import NormalizedCallTelephonyMetadata
1314
from .normalized_call_telephony_provider import NormalizedCallTelephonyProvider
1415

1516
try:
@@ -30,6 +31,7 @@ class NormalizedCall(pydantic.BaseModel):
3031
telephony_id: typing.Optional[str]
3132
stage: typing.Optional[NormalizedCallStage]
3233
stage_outcome: typing.Optional[NormalizedCallStageOutcome]
34+
telephony_metadata: typing.Optional[NormalizedCallTelephonyMetadata]
3335
to_number: str
3436
from_number: str
3537
agent: str

0 commit comments

Comments
 (0)