-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DX-2203 Voice, Answering Machine Detection (#29)
* New deploy * Remove DS Store * Version bump to 12 This is breaking due to the change from `pai` to `stirShaken` * Add test for answering machine detection * Remove pause between creating and getting call * Improve test and correct spacing * Add import statement * fix syntax * Improve test coverage * add lxml to requirements.txt * Remove Doc directory * update test to use `mfrom` * Remove perpetually failing test * Update test to accommodate breaking change Testing with a bad statement to fail the test * Correct planned failure * Update __init__.py * remove apimatic tests * Update api_tests.py Co-authored-by: DX-Bandwidth <[email protected]>
- Loading branch information
1 parent
3e76ff2
commit 9a8f09a
Showing
23 changed files
with
863 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
bandwidth | ||
This file was automatically generated by APIMATIC v3.0 ( | ||
https://www.apimatic.io ). | ||
""" | ||
from bandwidth.voice.models.diversion import Diversion | ||
from bandwidth.voice.models.transcription import Transcription | ||
|
||
|
||
class CallCallback(object): | ||
|
||
"""Implementation of the 'CallCallback' model. | ||
This object represents all possible fields that may be included in | ||
callbacks related to call events, including events that come from BXML | ||
verbs | ||
Attributes: | ||
event_type (string): TODO: type description here. | ||
event_time (string): TODO: type description here. | ||
account_id (string): TODO: type description here. | ||
application_id (string): TODO: type description here. | ||
mfrom (string): TODO: type description here. | ||
to (string): TODO: type description here. | ||
direction (string): TODO: type description here. | ||
call_id (string): TODO: type description here. | ||
call_url (string): TODO: type description here. | ||
start_time (string): TODO: type description here. | ||
answer_time (string): TODO: type description here. | ||
transfer_caller_id (string): TODO: type description here. | ||
transfer_to (string): TODO: type description here. | ||
cause (string): TODO: type description here. | ||
error_message (string): TODO: type description here. | ||
error_id (string): TODO: type description here. | ||
end_time (string): TODO: type description here. | ||
digit (string): TODO: type description here. | ||
parent_call_id (string): TODO: type description here. | ||
recording_id (string): TODO: type description here. | ||
duration (string): TODO: type description here. | ||
file_format (string): TODO: type description here. | ||
media_url (string): TODO: type description here. | ||
tag (string): TODO: type description here. | ||
channels (int): TODO: type description here. | ||
status (string): TODO: type description here. | ||
digits (string): TODO: type description here. | ||
terminating_digit (string): TODO: type description here. | ||
transcription (Transcription): TODO: type description here. | ||
diversion (Diversion): TODO: type description here. | ||
""" | ||
|
||
# Create a mapping from Model property names to API property names | ||
_names = { | ||
"event_type": 'eventType', | ||
"event_time": 'eventTime', | ||
"account_id": 'accountId', | ||
"application_id": 'applicationId', | ||
"mfrom": 'from', | ||
"to": 'to', | ||
"direction": 'direction', | ||
"call_id": 'callId', | ||
"call_url": 'callUrl', | ||
"start_time": 'startTime', | ||
"answer_time": 'answerTime', | ||
"transfer_caller_id": 'transferCallerId', | ||
"transfer_to": 'transferTo', | ||
"cause": 'cause', | ||
"error_message": 'errorMessage', | ||
"error_id": 'errorId', | ||
"end_time": 'endTime', | ||
"digit": 'digit', | ||
"parent_call_id": 'parentCallId', | ||
"recording_id": 'recordingId', | ||
"duration": 'duration', | ||
"file_format": 'fileFormat', | ||
"media_url": 'mediaUrl', | ||
"tag": 'tag', | ||
"channels": 'channels', | ||
"status": 'status', | ||
"digits": 'digits', | ||
"terminating_digit": 'terminatingDigit', | ||
"transcription": 'transcription', | ||
"diversion": 'diversion' | ||
} | ||
|
||
def __init__(self, | ||
event_type=None, | ||
event_time=None, | ||
account_id=None, | ||
application_id=None, | ||
mfrom=None, | ||
to=None, | ||
direction=None, | ||
call_id=None, | ||
call_url=None, | ||
start_time=None, | ||
answer_time=None, | ||
transfer_caller_id=None, | ||
transfer_to=None, | ||
cause=None, | ||
error_message=None, | ||
error_id=None, | ||
end_time=None, | ||
digit=None, | ||
parent_call_id=None, | ||
recording_id=None, | ||
duration=None, | ||
file_format=None, | ||
media_url=None, | ||
tag=None, | ||
channels=None, | ||
status=None, | ||
digits=None, | ||
terminating_digit=None, | ||
transcription=None, | ||
diversion=None): | ||
"""Constructor for the CallCallback class""" | ||
|
||
# Initialize members of the class | ||
self.event_type = event_type | ||
self.event_time = event_time | ||
self.account_id = account_id | ||
self.application_id = application_id | ||
self.mfrom = mfrom | ||
self.to = to | ||
self.direction = direction | ||
self.call_id = call_id | ||
self.call_url = call_url | ||
self.start_time = start_time | ||
self.answer_time = answer_time | ||
self.transfer_caller_id = transfer_caller_id | ||
self.transfer_to = transfer_to | ||
self.cause = cause | ||
self.error_message = error_message | ||
self.error_id = error_id | ||
self.end_time = end_time | ||
self.digit = digit | ||
self.parent_call_id = parent_call_id | ||
self.recording_id = recording_id | ||
self.duration = duration | ||
self.file_format = file_format | ||
self.media_url = media_url | ||
self.tag = tag | ||
self.channels = channels | ||
self.status = status | ||
self.digits = digits | ||
self.terminating_digit = terminating_digit | ||
self.transcription = transcription | ||
self.diversion = diversion | ||
|
||
@classmethod | ||
def from_dictionary(cls, | ||
dictionary): | ||
"""Creates an instance of this model from a dictionary | ||
Args: | ||
dictionary (dictionary): A dictionary representation of the object | ||
as obtained from the deserialization of the server's response. The | ||
keys MUST match property names in the API description. | ||
Returns: | ||
object: An instance of this structure class. | ||
""" | ||
if dictionary is None: | ||
return None | ||
|
||
# Extract variables from the dictionary | ||
event_type = dictionary.get('eventType') | ||
event_time = dictionary.get('eventTime') | ||
account_id = dictionary.get('accountId') | ||
application_id = dictionary.get('applicationId') | ||
mfrom = dictionary.get('from') | ||
to = dictionary.get('to') | ||
direction = dictionary.get('direction') | ||
call_id = dictionary.get('callId') | ||
call_url = dictionary.get('callUrl') | ||
start_time = dictionary.get('startTime') | ||
answer_time = dictionary.get('answerTime') | ||
transfer_caller_id = dictionary.get('transferCallerId') | ||
transfer_to = dictionary.get('transferTo') | ||
cause = dictionary.get('cause') | ||
error_message = dictionary.get('errorMessage') | ||
error_id = dictionary.get('errorId') | ||
end_time = dictionary.get('endTime') | ||
digit = dictionary.get('digit') | ||
parent_call_id = dictionary.get('parentCallId') | ||
recording_id = dictionary.get('recordingId') | ||
duration = dictionary.get('duration') | ||
file_format = dictionary.get('fileFormat') | ||
media_url = dictionary.get('mediaUrl') | ||
tag = dictionary.get('tag') | ||
channels = dictionary.get('channels') | ||
status = dictionary.get('status') | ||
digits = dictionary.get('digits') | ||
terminating_digit = dictionary.get('terminatingDigit') | ||
transcription = Transcription.from_dictionary(dictionary.get('transcription')) if dictionary.get('transcription') else None | ||
diversion = Diversion.from_dictionary(dictionary.get('diversion')) if dictionary.get('diversion') else None | ||
|
||
# Return an object of this model | ||
return cls(event_type, | ||
event_time, | ||
account_id, | ||
application_id, | ||
mfrom, | ||
to, | ||
direction, | ||
call_id, | ||
call_url, | ||
start_time, | ||
answer_time, | ||
transfer_caller_id, | ||
transfer_to, | ||
cause, | ||
error_message, | ||
error_id, | ||
end_time, | ||
digit, | ||
parent_call_id, | ||
recording_id, | ||
duration, | ||
file_format, | ||
media_url, | ||
tag, | ||
channels, | ||
status, | ||
digits, | ||
terminating_digit, | ||
transcription, | ||
diversion) |
Oops, something went wrong.