Skip to content

Commit a11c076

Browse files
committed
Add AudioStream PerCL command
1 parent e251156 commit a11c076

19 files changed

Lines changed: 672 additions & 5 deletions

.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ docs/AnsweredBy.md
1111
docs/ApplicationList.md
1212
docs/ApplicationRequest.md
1313
docs/ApplicationResult.md
14+
docs/AudioStream.md
15+
docs/AudioStreamWebhook.md
1416
docs/AvailableNumber.md
1517
docs/AvailableNumberList.md
1618
docs/BargeInReason.md
@@ -177,6 +179,8 @@ freeclimb/models/answered_by.py
177179
freeclimb/models/application_list.py
178180
freeclimb/models/application_request.py
179181
freeclimb/models/application_result.py
182+
freeclimb/models/audio_stream.py
183+
freeclimb/models/audio_stream_webhook.py
180184
freeclimb/models/available_number.py
181185
freeclimb/models/available_number_list.py
182186
freeclimb/models/barge_in_reason.py
@@ -341,6 +345,8 @@ test/test_answered_by.py
341345
test/test_application_list.py
342346
test/test_application_request.py
343347
test/test_application_result.py
348+
test/test_audio_stream.py
349+
test/test_audio_stream_webhook.py
344350
test/test_available_number.py
345351
test/test_available_number_list.py
346352
test/test_barge_in_reason.py

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ Class | Method | HTTP request | Description
199199
- [ApplicationList](docs/ApplicationList.md)
200200
- [ApplicationRequest](docs/ApplicationRequest.md)
201201
- [ApplicationResult](docs/ApplicationResult.md)
202+
- [AudioStream](docs/AudioStream.md)
203+
- [AudioStreamWebhook](docs/AudioStreamWebhook.md)
202204
- [AvailableNumber](docs/AvailableNumber.md)
203205
- [AvailableNumberList](docs/AvailableNumberList.md)
204206
- [BargeInReason](docs/BargeInReason.md)

docs/AudioStream.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# AudioStream
2+
3+
The `AudioStream` command transfers control of the call to a gRPC session. Upon completion of the gRPC session, if the actionUrl is specified, control can be returned to percl usage or the call will simply be hung up if the actionUrl is not specified.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**location** | **str** | The gRPC server location that will receive the grpc stream as a uri and must be port 80 or 443. |
10+
**action_url** | **str** | A request is made to this URL when the gRPC session is concluded. The PerCL script returned in response to the actionUrl will be executed on the call. | [optional]
11+
**content_type** | **str** | The type and sample rate of the audio being received over the channel must match the environmental sample rate. | [optional]
12+
**meta_data** | **List[str]** | An arbitrary array of strings passed through FC to the GRPC server can be used to pass state or other information about the call. | [optional]
13+
**privacy_mode** | **bool** | Enables audio redaction with full call recording while gRPC session is running and blocks logging of any DTMFs received by FreeClimb. | [optional]
14+
15+
## Example
16+
17+
```python
18+
from freeclimb.models.audio_stream import AudioStream
19+
20+
# TODO update the JSON string below
21+
json = "{}"
22+
# create an instance of AudioStream from a JSON string
23+
audio_stream_instance = AudioStream.from_json(json)
24+
# print the JSON string representation of the object
25+
print(AudioStream.to_json())
26+
27+
# convert the object into a dict
28+
audio_stream_dict = audio_stream_instance.to_dict()
29+
# create an instance of AudioStream from a dict
30+
audio_stream_from_dict = AudioStream.from_dict(audio_stream_dict)
31+
```
32+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
33+
34+

docs/AudioStreamWebhook.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# AudioStreamWebhook
2+
3+
A gRPC session has ended for this Call its actionUrl is being invoked. A PerCL response is expected — unless the URL is invoked due to the participant hanging up.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**request_type** | **str** | Context or reason why this request is being made. Will be audioStream - gRPC session for this Call has ended and its actionUrl is being invoked. | [optional]
10+
**call_id** | **str** | Unique ID for this Call, generated by FreeClimb. This is the call leg which ended its gRPC session. | [optional]
11+
**account_id** | **str** | Account ID associated with your account. | [optional]
12+
**var_from** | **str** | Phone number of the party that initiated the Call (in E.164 format). | [optional]
13+
**to** | **str** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional]
14+
**call_status** | [**CallStatus**](CallStatus.md) | | [optional]
15+
**direction** | [**CallDirection**](CallDirection.md) | | [optional]
16+
**conference_id** | **str** | This is only populated if request pertains to a Conference. Otherwise, it is set to null. | [optional]
17+
**queue_id** | **str** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional]
18+
19+
## Example
20+
21+
```python
22+
from freeclimb.models.audio_stream_webhook import AudioStreamWebhook
23+
24+
# TODO update the JSON string below
25+
json = "{}"
26+
# create an instance of AudioStreamWebhook from a JSON string
27+
audio_stream_webhook_instance = AudioStreamWebhook.from_json(json)
28+
# print the JSON string representation of the object
29+
print(AudioStreamWebhook.to_json())
30+
31+
# convert the object into a dict
32+
audio_stream_webhook_dict = audio_stream_webhook_instance.to_dict()
33+
# create an instance of AudioStreamWebhook from a dict
34+
audio_stream_webhook_from_dict = AudioStreamWebhook.from_dict(audio_stream_webhook_dict)
35+
```
36+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
37+
38+

docs/ConferenceResult.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Name | Type | Description | Notes
1212
**conference_id** | **str** | A string that uniquely identifies this Conference resource. | [optional]
1313
**account_id** | **str** | ID of the account that created this Conference. | [optional]
1414
**alias** | **str** | A description for this Conference. | [optional]
15-
**play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional]
15+
**play_beep** | [**PlayBeep**](PlayBeep.md) | Setting that controls when a beep is played. One of: always, never, entryOnly, exitOnly. Defaults to always. | [optional]
1616
**record** | **bool** | Flag indicating whether recording is enabled for this Conference. | [optional]
1717
**status** | [**ConferenceStatus**](ConferenceStatus.md) | | [optional]
1818
**wait_url** | **str** | URL referencing the audio file to be used as default wait music for the Conference when it is in the populated state. | [optional]

docs/RequestType.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

3030
* `ADDTOQUEUENOTIFICATION` (value: `'addToQueueNotification'`)
3131

32+
* `AUDIOSTREAM` (value: `'audioStream'`)
33+
3234
* `REMOVEFROMQUEUENOTIFICATION` (value: `'removeFromQueueNotification'`)
3335

3436
* `CALLSTATUS` (value: `'callStatus'`)

freeclimb/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
ApplicationRequest as ApplicationRequest,
5050
)
5151
from freeclimb.models.application_result import ApplicationResult as ApplicationResult
52+
from freeclimb.models.audio_stream import AudioStream as AudioStream
53+
from freeclimb.models.audio_stream_webhook import (
54+
AudioStreamWebhook as AudioStreamWebhook,
55+
)
5256
from freeclimb.models.available_number import AvailableNumber as AvailableNumber
5357
from freeclimb.models.available_number_list import (
5458
AvailableNumberList as AvailableNumberList,

freeclimb/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
ApplicationRequest as ApplicationRequest,
3333
)
3434
from freeclimb.models.application_result import ApplicationResult as ApplicationResult
35+
from freeclimb.models.audio_stream import AudioStream as AudioStream
36+
from freeclimb.models.audio_stream_webhook import (
37+
AudioStreamWebhook as AudioStreamWebhook,
38+
)
3539
from freeclimb.models.available_number import AvailableNumber as AvailableNumber
3640
from freeclimb.models.available_number_list import (
3741
AvailableNumberList as AvailableNumberList,

freeclimb/models/audio_stream.py

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# coding: utf-8
2+
3+
"""
4+
FreeClimb API
5+
6+
FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
7+
8+
The version of the OpenAPI document: 1.0.0
9+
Contact: support@freeclimb.com
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
from __future__ import annotations
17+
import pprint
18+
import re # noqa: F401
19+
import json
20+
21+
from pydantic import ConfigDict, Field, StrictBool, StrictStr
22+
from typing import Any, ClassVar, Dict, List, Optional
23+
from freeclimb.models.percl_command import PerclCommand
24+
from pydantic import StrictStr
25+
from typing import Optional, Set
26+
from typing_extensions import Self
27+
28+
29+
class AudioStream(
30+
PerclCommand,
31+
populate_by_name=True,
32+
validate_assignment=True,
33+
protected_namespaces=(),
34+
):
35+
"""
36+
The `AudioStream` command transfers control of the call to a gRPC session. Upon completion of the gRPC session, if the actionUrl is specified, control can be returned to percl usage or the call will simply be hung up if the actionUrl is not specified.
37+
""" # noqa: E501
38+
39+
location: StrictStr = Field(
40+
description="The gRPC server location that will receive the grpc stream as a uri and must be port 80 or 443."
41+
)
42+
action_url: Optional[StrictStr] = Field(
43+
default=None,
44+
description="A request is made to this URL when the gRPC session is concluded. The PerCL script returned in response to the actionUrl will be executed on the call.",
45+
alias="actionUrl",
46+
)
47+
content_type: Optional[StrictStr] = Field(
48+
default=None,
49+
description="The type and sample rate of the audio being received over the channel must match the environmental sample rate.",
50+
alias="contentType",
51+
)
52+
meta_data: Optional[List[StrictStr]] = Field(
53+
default=None,
54+
description="An arbitrary array of strings passed through FC to the GRPC server can be used to pass state or other information about the call.",
55+
alias="metaData",
56+
)
57+
privacy_mode: Optional[StrictBool] = Field(
58+
default=None,
59+
description="Enables audio redaction with full call recording while gRPC session is running and blocks logging of any DTMFs received by FreeClimb.",
60+
alias="privacyMode",
61+
)
62+
command: StrictStr = "AudioStream"
63+
64+
__properties: ClassVar[List[str]] = [
65+
"command",
66+
"location",
67+
"actionUrl",
68+
"contentType",
69+
"metaData",
70+
"privacyMode",
71+
]
72+
73+
def to_str(self) -> str:
74+
"""Returns the string representation of the model using alias"""
75+
return pprint.pformat(self.model_dump(by_alias=True))
76+
77+
def to_json(self) -> str:
78+
"""Returns the JSON representation of the model using alias"""
79+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
80+
return json.dumps(self.to_dict())
81+
82+
@classmethod
83+
def from_json(cls, json_str: str) -> Optional[Self]:
84+
"""Create an instance of AudioStream from a JSON string"""
85+
return cls.from_dict(json.loads(json_str))
86+
87+
def to_dict(self) -> Dict[str, Any]:
88+
"""Return the dictionary representation of the model using alias.
89+
90+
This has the following differences from calling pydantic's
91+
`self.model_dump(by_alias=True)`:
92+
93+
* `None` is only added to the output dict for nullable fields that
94+
were set at model initialization. Other fields with value `None`
95+
are ignored.
96+
"""
97+
excluded_fields: Set[str] = set([])
98+
99+
_dict = self.model_dump(
100+
by_alias=True,
101+
exclude=excluded_fields,
102+
exclude_none=True,
103+
)
104+
return _dict
105+
106+
@classmethod
107+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
108+
"""Create an instance of AudioStream from a dict"""
109+
if obj is None:
110+
return None
111+
112+
if not isinstance(obj, dict):
113+
return cls.model_validate(obj)
114+
115+
_obj = cls.model_validate(
116+
{
117+
"command": obj.get("command"),
118+
"location": obj.get("location"),
119+
"actionUrl": obj.get("actionUrl"),
120+
"contentType": obj.get("contentType"),
121+
"metaData": obj.get("metaData"),
122+
"privacyMode": obj.get("privacyMode"),
123+
}
124+
)
125+
return _obj

0 commit comments

Comments
 (0)