|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | + |
| 3 | +""" |
| 4 | +bandwidth |
| 5 | +
|
| 6 | +This file was automatically generated by APIMATIC v3.0 ( |
| 7 | + https://www.apimatic.io ). |
| 8 | +""" |
| 9 | +from bandwidth.voice.models.diversion import Diversion |
| 10 | +from bandwidth.voice.models.transcription import Transcription |
| 11 | + |
| 12 | + |
| 13 | +class CallCallback(object): |
| 14 | + |
| 15 | + """Implementation of the 'CallCallback' model. |
| 16 | +
|
| 17 | + This object represents all possible fields that may be included in |
| 18 | + callbacks related to call events, including events that come from BXML |
| 19 | + verbs |
| 20 | +
|
| 21 | + Attributes: |
| 22 | + event_type (string): TODO: type description here. |
| 23 | + event_time (string): TODO: type description here. |
| 24 | + account_id (string): TODO: type description here. |
| 25 | + application_id (string): TODO: type description here. |
| 26 | + mfrom (string): TODO: type description here. |
| 27 | + to (string): TODO: type description here. |
| 28 | + direction (string): TODO: type description here. |
| 29 | + call_id (string): TODO: type description here. |
| 30 | + call_url (string): TODO: type description here. |
| 31 | + start_time (string): TODO: type description here. |
| 32 | + answer_time (string): TODO: type description here. |
| 33 | + transfer_caller_id (string): TODO: type description here. |
| 34 | + transfer_to (string): TODO: type description here. |
| 35 | + cause (string): TODO: type description here. |
| 36 | + error_message (string): TODO: type description here. |
| 37 | + error_id (string): TODO: type description here. |
| 38 | + end_time (string): TODO: type description here. |
| 39 | + digit (string): TODO: type description here. |
| 40 | + parent_call_id (string): TODO: type description here. |
| 41 | + recording_id (string): TODO: type description here. |
| 42 | + duration (string): TODO: type description here. |
| 43 | + file_format (string): TODO: type description here. |
| 44 | + media_url (string): TODO: type description here. |
| 45 | + tag (string): TODO: type description here. |
| 46 | + channels (int): TODO: type description here. |
| 47 | + status (string): TODO: type description here. |
| 48 | + digits (string): TODO: type description here. |
| 49 | + terminating_digit (string): TODO: type description here. |
| 50 | + transcription (Transcription): TODO: type description here. |
| 51 | + diversion (Diversion): TODO: type description here. |
| 52 | +
|
| 53 | + """ |
| 54 | + |
| 55 | + # Create a mapping from Model property names to API property names |
| 56 | + _names = { |
| 57 | + "event_type": 'eventType', |
| 58 | + "event_time": 'eventTime', |
| 59 | + "account_id": 'accountId', |
| 60 | + "application_id": 'applicationId', |
| 61 | + "mfrom": 'from', |
| 62 | + "to": 'to', |
| 63 | + "direction": 'direction', |
| 64 | + "call_id": 'callId', |
| 65 | + "call_url": 'callUrl', |
| 66 | + "start_time": 'startTime', |
| 67 | + "answer_time": 'answerTime', |
| 68 | + "transfer_caller_id": 'transferCallerId', |
| 69 | + "transfer_to": 'transferTo', |
| 70 | + "cause": 'cause', |
| 71 | + "error_message": 'errorMessage', |
| 72 | + "error_id": 'errorId', |
| 73 | + "end_time": 'endTime', |
| 74 | + "digit": 'digit', |
| 75 | + "parent_call_id": 'parentCallId', |
| 76 | + "recording_id": 'recordingId', |
| 77 | + "duration": 'duration', |
| 78 | + "file_format": 'fileFormat', |
| 79 | + "media_url": 'mediaUrl', |
| 80 | + "tag": 'tag', |
| 81 | + "channels": 'channels', |
| 82 | + "status": 'status', |
| 83 | + "digits": 'digits', |
| 84 | + "terminating_digit": 'terminatingDigit', |
| 85 | + "transcription": 'transcription', |
| 86 | + "diversion": 'diversion' |
| 87 | + } |
| 88 | + |
| 89 | + def __init__(self, |
| 90 | + event_type=None, |
| 91 | + event_time=None, |
| 92 | + account_id=None, |
| 93 | + application_id=None, |
| 94 | + mfrom=None, |
| 95 | + to=None, |
| 96 | + direction=None, |
| 97 | + call_id=None, |
| 98 | + call_url=None, |
| 99 | + start_time=None, |
| 100 | + answer_time=None, |
| 101 | + transfer_caller_id=None, |
| 102 | + transfer_to=None, |
| 103 | + cause=None, |
| 104 | + error_message=None, |
| 105 | + error_id=None, |
| 106 | + end_time=None, |
| 107 | + digit=None, |
| 108 | + parent_call_id=None, |
| 109 | + recording_id=None, |
| 110 | + duration=None, |
| 111 | + file_format=None, |
| 112 | + media_url=None, |
| 113 | + tag=None, |
| 114 | + channels=None, |
| 115 | + status=None, |
| 116 | + digits=None, |
| 117 | + terminating_digit=None, |
| 118 | + transcription=None, |
| 119 | + diversion=None): |
| 120 | + """Constructor for the CallCallback class""" |
| 121 | + |
| 122 | + # Initialize members of the class |
| 123 | + self.event_type = event_type |
| 124 | + self.event_time = event_time |
| 125 | + self.account_id = account_id |
| 126 | + self.application_id = application_id |
| 127 | + self.mfrom = mfrom |
| 128 | + self.to = to |
| 129 | + self.direction = direction |
| 130 | + self.call_id = call_id |
| 131 | + self.call_url = call_url |
| 132 | + self.start_time = start_time |
| 133 | + self.answer_time = answer_time |
| 134 | + self.transfer_caller_id = transfer_caller_id |
| 135 | + self.transfer_to = transfer_to |
| 136 | + self.cause = cause |
| 137 | + self.error_message = error_message |
| 138 | + self.error_id = error_id |
| 139 | + self.end_time = end_time |
| 140 | + self.digit = digit |
| 141 | + self.parent_call_id = parent_call_id |
| 142 | + self.recording_id = recording_id |
| 143 | + self.duration = duration |
| 144 | + self.file_format = file_format |
| 145 | + self.media_url = media_url |
| 146 | + self.tag = tag |
| 147 | + self.channels = channels |
| 148 | + self.status = status |
| 149 | + self.digits = digits |
| 150 | + self.terminating_digit = terminating_digit |
| 151 | + self.transcription = transcription |
| 152 | + self.diversion = diversion |
| 153 | + |
| 154 | + @classmethod |
| 155 | + def from_dictionary(cls, |
| 156 | + dictionary): |
| 157 | + """Creates an instance of this model from a dictionary |
| 158 | +
|
| 159 | + Args: |
| 160 | + dictionary (dictionary): A dictionary representation of the object |
| 161 | + as obtained from the deserialization of the server's response. The |
| 162 | + keys MUST match property names in the API description. |
| 163 | +
|
| 164 | + Returns: |
| 165 | + object: An instance of this structure class. |
| 166 | +
|
| 167 | + """ |
| 168 | + if dictionary is None: |
| 169 | + return None |
| 170 | + |
| 171 | + # Extract variables from the dictionary |
| 172 | + event_type = dictionary.get('eventType') |
| 173 | + event_time = dictionary.get('eventTime') |
| 174 | + account_id = dictionary.get('accountId') |
| 175 | + application_id = dictionary.get('applicationId') |
| 176 | + mfrom = dictionary.get('from') |
| 177 | + to = dictionary.get('to') |
| 178 | + direction = dictionary.get('direction') |
| 179 | + call_id = dictionary.get('callId') |
| 180 | + call_url = dictionary.get('callUrl') |
| 181 | + start_time = dictionary.get('startTime') |
| 182 | + answer_time = dictionary.get('answerTime') |
| 183 | + transfer_caller_id = dictionary.get('transferCallerId') |
| 184 | + transfer_to = dictionary.get('transferTo') |
| 185 | + cause = dictionary.get('cause') |
| 186 | + error_message = dictionary.get('errorMessage') |
| 187 | + error_id = dictionary.get('errorId') |
| 188 | + end_time = dictionary.get('endTime') |
| 189 | + digit = dictionary.get('digit') |
| 190 | + parent_call_id = dictionary.get('parentCallId') |
| 191 | + recording_id = dictionary.get('recordingId') |
| 192 | + duration = dictionary.get('duration') |
| 193 | + file_format = dictionary.get('fileFormat') |
| 194 | + media_url = dictionary.get('mediaUrl') |
| 195 | + tag = dictionary.get('tag') |
| 196 | + channels = dictionary.get('channels') |
| 197 | + status = dictionary.get('status') |
| 198 | + digits = dictionary.get('digits') |
| 199 | + terminating_digit = dictionary.get('terminatingDigit') |
| 200 | + transcription = Transcription.from_dictionary(dictionary.get('transcription')) if dictionary.get('transcription') else None |
| 201 | + diversion = Diversion.from_dictionary(dictionary.get('diversion')) if dictionary.get('diversion') else None |
| 202 | + |
| 203 | + # Return an object of this model |
| 204 | + return cls(event_type, |
| 205 | + event_time, |
| 206 | + account_id, |
| 207 | + application_id, |
| 208 | + mfrom, |
| 209 | + to, |
| 210 | + direction, |
| 211 | + call_id, |
| 212 | + call_url, |
| 213 | + start_time, |
| 214 | + answer_time, |
| 215 | + transfer_caller_id, |
| 216 | + transfer_to, |
| 217 | + cause, |
| 218 | + error_message, |
| 219 | + error_id, |
| 220 | + end_time, |
| 221 | + digit, |
| 222 | + parent_call_id, |
| 223 | + recording_id, |
| 224 | + duration, |
| 225 | + file_format, |
| 226 | + media_url, |
| 227 | + tag, |
| 228 | + channels, |
| 229 | + status, |
| 230 | + digits, |
| 231 | + terminating_digit, |
| 232 | + transcription, |
| 233 | + diversion) |
0 commit comments