|
| 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