|
| 1 | +""" |
| 2 | +start_recording.py |
| 3 | +
|
| 4 | +Bandwidth's StartRecording BXML verb |
| 5 | +
|
| 6 | +@copyright Bandwidth INC |
| 7 | +""" |
| 8 | +from ..terminal_verb import TerminalVerb |
| 9 | + |
| 10 | + |
| 11 | +class StartRecording(TerminalVerb): |
| 12 | + |
| 13 | + def __init__( |
| 14 | + self, recording_available_url: str = None, |
| 15 | + recording_available_method: str = None, |
| 16 | + transcribe: str = None, transcription_available_url: str = None, |
| 17 | + transcription_available_method: str = None, username: str=None, |
| 18 | + password: str=None, tag: str=None, |
| 19 | + file_format: str = None, multi_channel: str = None |
| 20 | + ): |
| 21 | + """Initialize a <StartRecording> verb |
| 22 | +
|
| 23 | + Args: |
| 24 | + recording_available_url (str, optional): URL to send the Recording Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None. |
| 25 | + recording_available_method (str, optional): The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default value is POST. |
| 26 | + transcribe (str, optional): A boolean value to indicate that recording should be transcribed. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. Default is false. Defaults to None. |
| 27 | + transcription_available_url (str, optional): URL to send the Transcription Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None. |
| 28 | + transcription_available_method (str, optional): The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default value is POST. Defaults to None. |
| 29 | + username (str, optional): The username to send in the HTTP request to recordCompleteUrl, recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None. |
| 30 | + password (str, optional): The password to send in the HTTP request to recordCompleteUrl, recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None. |
| 31 | + tag (str, optional): A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or <Tag> verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None. |
| 32 | + file_format (str, optional): The audio format that the recording will be saved as: mp3 or wav. Default value is wav. Defaults to None. max_duration (str, optional): Maximum length of recording (in seconds). Max 10800 (3 hours). Default value is 60. Defaults to None. |
| 33 | + multi_channel (str, optional): A boolean value indicating whether or not the recording file should separate each side of the call into its own audio channel. Default value is false. |
| 34 | +
|
| 35 | + """ |
| 36 | + self.recording_available_url = recording_available_url |
| 37 | + self.recording_available_method = recording_available_method |
| 38 | + self.transcribe = transcribe |
| 39 | + self.transcription_available_url = transcription_available_url |
| 40 | + self.transcription_available_method = transcription_available_method |
| 41 | + self.username = username |
| 42 | + self.password = password |
| 43 | + self.tag = tag |
| 44 | + self.file_format = file_format |
| 45 | + self.multi_channel = multi_channel |
| 46 | + super().__init__(tag="StartRecording", content=None) |
| 47 | + |
| 48 | + @property |
| 49 | + def _attributes(self): |
| 50 | + return { |
| 51 | + "recordingAvailableUrl": self.recording_available_url, |
| 52 | + "recordingAvailableMethod": self.recording_available_method, |
| 53 | + "transcribe": self.transcribe, |
| 54 | + "transcriptionAvailableUrl": self.transcription_available_url, |
| 55 | + "transcriptionAvailableMethod": self.transcription_available_method, |
| 56 | + "username": self.username, |
| 57 | + "password": self.password, |
| 58 | + "tag": self.tag, |
| 59 | + "fileFormat": self.file_format, |
| 60 | + "multiChannel": self.multi_channel |
| 61 | + } |
0 commit comments