|
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 | | - |
10 | | - |
11 | | -class MachineDetectionRequest(object): |
12 | | - |
13 | | - """Implementation of the 'MachineDetectionRequest' model. |
14 | | -
|
15 | | - TODO: type model description here. |
16 | | -
|
17 | | - Attributes: |
18 | | - mode (ModeEnum): The machine detection mode. If set to 'async', the |
19 | | - detection result will be sent in a 'machineDetectionComplete' |
20 | | - callback. If set to 'sync', the 'answer' callback will wait for |
21 | | - the machine detection to complete and will include its result. |
22 | | - Default is 'async'. |
23 | | - detection_timeout (float): Total amount of time (in seconds) before |
24 | | - giving up. |
25 | | - silence_timeout (float): If no speech is detected in this period, a |
26 | | - callback with a 'silence' result is sent. Default is 10 seconds. |
27 | | - speech_threshold (float): When speech has ended and a result couldn't |
28 | | - be determined based on the audio content itself, this value is |
29 | | - used to determine if the speaker is a machine based on the speech |
30 | | - duration. If the length of the speech detected is greater than or |
31 | | - equal to this threshold, the result will be 'answering-machine'. |
32 | | - If the length of speech detected is below this threshold, the |
33 | | - result will be 'human'. Default is 10 seconds. |
34 | | - speech_end_threshold (float): Amount of silence (in seconds) before |
35 | | - assuming the callee has finished speaking. |
36 | | - delay_result (bool): If set to 'true' and if an answering machine is |
37 | | - detected, the 'answering-machine' callback will be delayed until |
38 | | - the machine is done speaking or until the 'detectionTimeout' is |
39 | | - exceeded. If false, the 'answering-machine' result is sent |
40 | | - immediately. Default is 'false'. |
41 | | - callback_url (string): The URL to send the 'machineDetectionComplete' |
42 | | - callback when the detection is completed. Only for 'async' mode. |
43 | | - callback_method (CallbackMethodEnum): TODO: type description here. |
44 | | - fallback_url (string): TODO: type description here. |
45 | | - fallback_method (FallbackMethodEnum): TODO: type description here. |
46 | | - username (string): TODO: type description here. |
47 | | - password (string): TODO: type description here. |
48 | | - fallback_username (string): TODO: type description here. |
49 | | - fallback_password (string): TODO: type description here. |
50 | | -
|
51 | | - """ |
52 | | - |
53 | | - # Create a mapping from Model property names to API property names |
54 | | - _names = { |
55 | | - "mode": 'mode', |
56 | | - "detection_timeout": 'detectionTimeout', |
57 | | - "silence_timeout": 'silenceTimeout', |
58 | | - "speech_threshold": 'speechThreshold', |
59 | | - "speech_end_threshold": 'speechEndThreshold', |
60 | | - "delay_result": 'delayResult', |
61 | | - "callback_url": 'callbackUrl', |
62 | | - "callback_method": 'callbackMethod', |
63 | | - "fallback_url": 'fallbackUrl', |
64 | | - "fallback_method": 'fallbackMethod', |
65 | | - "username": 'username', |
66 | | - "password": 'password', |
67 | | - "fallback_username": 'fallbackUsername', |
68 | | - "fallback_password": 'fallbackPassword' |
69 | | - } |
70 | | - |
71 | | - def __init__(self, |
72 | | - mode=None, |
73 | | - detection_timeout=None, |
74 | | - silence_timeout=None, |
75 | | - speech_threshold=None, |
76 | | - speech_end_threshold=None, |
77 | | - delay_result=None, |
78 | | - callback_url=None, |
79 | | - callback_method=None, |
80 | | - fallback_url=None, |
81 | | - fallback_method=None, |
82 | | - username=None, |
83 | | - password=None, |
84 | | - fallback_username=None, |
85 | | - fallback_password=None): |
86 | | - """Constructor for the MachineDetectionRequest class""" |
87 | | - |
88 | | - # Initialize members of the class |
89 | | - self.mode = mode |
90 | | - self.detection_timeout = detection_timeout |
91 | | - self.silence_timeout = silence_timeout |
92 | | - self.speech_threshold = speech_threshold |
93 | | - self.speech_end_threshold = speech_end_threshold |
94 | | - self.delay_result = delay_result |
95 | | - self.callback_url = callback_url |
96 | | - self.callback_method = callback_method |
97 | | - self.fallback_url = fallback_url |
98 | | - self.fallback_method = fallback_method |
99 | | - self.username = username |
100 | | - self.password = password |
101 | | - self.fallback_username = fallback_username |
102 | | - self.fallback_password = fallback_password |
103 | | - |
104 | | - @classmethod |
105 | | - def from_dictionary(cls, |
106 | | - dictionary): |
107 | | - """Creates an instance of this model from a dictionary |
108 | | -
|
109 | | - Args: |
110 | | - dictionary (dictionary): A dictionary representation of the object |
111 | | - as obtained from the deserialization of the server's response. The |
112 | | - keys MUST match property names in the API description. |
113 | | -
|
114 | | - Returns: |
115 | | - object: An instance of this structure class. |
116 | | -
|
117 | | - """ |
118 | | - if dictionary is None: |
119 | | - return None |
120 | | - |
121 | | - # Extract variables from the dictionary |
122 | | - mode = dictionary.get('mode') |
123 | | - detection_timeout = dictionary.get('detectionTimeout') |
124 | | - silence_timeout = dictionary.get('silenceTimeout') |
125 | | - speech_threshold = dictionary.get('speechThreshold') |
126 | | - speech_end_threshold = dictionary.get('speechEndThreshold') |
127 | | - delay_result = dictionary.get('delayResult') |
128 | | - callback_url = dictionary.get('callbackUrl') |
129 | | - callback_method = dictionary.get('callbackMethod') |
130 | | - fallback_url = dictionary.get('fallbackUrl') |
131 | | - fallback_method = dictionary.get('fallbackMethod') |
132 | | - username = dictionary.get('username') |
133 | | - password = dictionary.get('password') |
134 | | - fallback_username = dictionary.get('fallbackUsername') |
135 | | - fallback_password = dictionary.get('fallbackPassword') |
136 | | - |
137 | | - # Return an object of this model |
138 | | - return cls(mode, |
139 | | - detection_timeout, |
140 | | - silence_timeout, |
141 | | - speech_threshold, |
142 | | - speech_end_threshold, |
143 | | - delay_result, |
144 | | - callback_url, |
145 | | - callback_method, |
146 | | - fallback_url, |
147 | | - fallback_method, |
148 | | - username, |
149 | | - password, |
150 | | - fallback_username, |
151 | | - fallback_password) |
| 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 | + |
| 10 | + |
| 11 | +class MachineDetectionConfiguration(object): |
| 12 | + |
| 13 | + """Implementation of the 'MachineDetectionRequest' model. |
| 14 | +
|
| 15 | + TODO: type model description here. |
| 16 | +
|
| 17 | + Attributes: |
| 18 | + mode (ModeEnum): The machine detection mode. If set to 'async', the |
| 19 | + detection result will be sent in a 'machineDetectionComplete' |
| 20 | + callback. If set to 'sync', the 'answer' callback will wait for |
| 21 | + the machine detection to complete and will include its result. |
| 22 | + Default is 'async'. |
| 23 | + detection_timeout (float): Total amount of time (in seconds) before |
| 24 | + giving up. |
| 25 | + silence_timeout (float): If no speech is detected in this period, a |
| 26 | + callback with a 'silence' result is sent. Default is 10 seconds. |
| 27 | + speech_threshold (float): When speech has ended and a result couldn't |
| 28 | + be determined based on the audio content itself, this value is |
| 29 | + used to determine if the speaker is a machine based on the speech |
| 30 | + duration. If the length of the speech detected is greater than or |
| 31 | + equal to this threshold, the result will be 'answering-machine'. |
| 32 | + If the length of speech detected is below this threshold, the |
| 33 | + result will be 'human'. Default is 10 seconds. |
| 34 | + speech_end_threshold (float): Amount of silence (in seconds) before |
| 35 | + assuming the callee has finished speaking. |
| 36 | + delay_result (bool): If set to 'true' and if an answering machine is |
| 37 | + detected, the 'answering-machine' callback will be delayed until |
| 38 | + the machine is done speaking or until the 'detectionTimeout' is |
| 39 | + exceeded. If false, the 'answering-machine' result is sent |
| 40 | + immediately. Default is 'false'. |
| 41 | + callback_url (string): The URL to send the 'machineDetectionComplete' |
| 42 | + callback when the detection is completed. Only for 'async' mode. |
| 43 | + callback_method (CallbackMethodEnum): TODO: type description here. |
| 44 | + fallback_url (string): TODO: type description here. |
| 45 | + fallback_method (FallbackMethodEnum): TODO: type description here. |
| 46 | + username (string): TODO: type description here. |
| 47 | + password (string): TODO: type description here. |
| 48 | + fallback_username (string): TODO: type description here. |
| 49 | + fallback_password (string): TODO: type description here. |
| 50 | +
|
| 51 | + """ |
| 52 | + |
| 53 | + # Create a mapping from Model property names to API property names |
| 54 | + _names = { |
| 55 | + "mode": 'mode', |
| 56 | + "detection_timeout": 'detectionTimeout', |
| 57 | + "silence_timeout": 'silenceTimeout', |
| 58 | + "speech_threshold": 'speechThreshold', |
| 59 | + "speech_end_threshold": 'speechEndThreshold', |
| 60 | + "delay_result": 'delayResult', |
| 61 | + "callback_url": 'callbackUrl', |
| 62 | + "callback_method": 'callbackMethod', |
| 63 | + "fallback_url": 'fallbackUrl', |
| 64 | + "fallback_method": 'fallbackMethod', |
| 65 | + "username": 'username', |
| 66 | + "password": 'password', |
| 67 | + "fallback_username": 'fallbackUsername', |
| 68 | + "fallback_password": 'fallbackPassword' |
| 69 | + } |
| 70 | + |
| 71 | + def __init__(self, |
| 72 | + mode=None, |
| 73 | + detection_timeout=None, |
| 74 | + silence_timeout=None, |
| 75 | + speech_threshold=None, |
| 76 | + speech_end_threshold=None, |
| 77 | + delay_result=None, |
| 78 | + callback_url=None, |
| 79 | + callback_method=None, |
| 80 | + fallback_url=None, |
| 81 | + fallback_method=None, |
| 82 | + username=None, |
| 83 | + password=None, |
| 84 | + fallback_username=None, |
| 85 | + fallback_password=None): |
| 86 | + """Constructor for the MachineDetectionRequest class""" |
| 87 | + |
| 88 | + # Initialize members of the class |
| 89 | + self.mode = mode |
| 90 | + self.detection_timeout = detection_timeout |
| 91 | + self.silence_timeout = silence_timeout |
| 92 | + self.speech_threshold = speech_threshold |
| 93 | + self.speech_end_threshold = speech_end_threshold |
| 94 | + self.delay_result = delay_result |
| 95 | + self.callback_url = callback_url |
| 96 | + self.callback_method = callback_method |
| 97 | + self.fallback_url = fallback_url |
| 98 | + self.fallback_method = fallback_method |
| 99 | + self.username = username |
| 100 | + self.password = password |
| 101 | + self.fallback_username = fallback_username |
| 102 | + self.fallback_password = fallback_password |
| 103 | + |
| 104 | + @classmethod |
| 105 | + def from_dictionary(cls, |
| 106 | + dictionary): |
| 107 | + """Creates an instance of this model from a dictionary |
| 108 | +
|
| 109 | + Args: |
| 110 | + dictionary (dictionary): A dictionary representation of the object |
| 111 | + as obtained from the deserialization of the server's response. The |
| 112 | + keys MUST match property names in the API description. |
| 113 | +
|
| 114 | + Returns: |
| 115 | + object: An instance of this structure class. |
| 116 | +
|
| 117 | + """ |
| 118 | + if dictionary is None: |
| 119 | + return None |
| 120 | + |
| 121 | + # Extract variables from the dictionary |
| 122 | + mode = dictionary.get('mode') |
| 123 | + detection_timeout = dictionary.get('detectionTimeout') |
| 124 | + silence_timeout = dictionary.get('silenceTimeout') |
| 125 | + speech_threshold = dictionary.get('speechThreshold') |
| 126 | + speech_end_threshold = dictionary.get('speechEndThreshold') |
| 127 | + delay_result = dictionary.get('delayResult') |
| 128 | + callback_url = dictionary.get('callbackUrl') |
| 129 | + callback_method = dictionary.get('callbackMethod') |
| 130 | + fallback_url = dictionary.get('fallbackUrl') |
| 131 | + fallback_method = dictionary.get('fallbackMethod') |
| 132 | + username = dictionary.get('username') |
| 133 | + password = dictionary.get('password') |
| 134 | + fallback_username = dictionary.get('fallbackUsername') |
| 135 | + fallback_password = dictionary.get('fallbackPassword') |
| 136 | + |
| 137 | + # Return an object of this model |
| 138 | + return cls(mode, |
| 139 | + detection_timeout, |
| 140 | + silence_timeout, |
| 141 | + speech_threshold, |
| 142 | + speech_end_threshold, |
| 143 | + delay_result, |
| 144 | + callback_url, |
| 145 | + callback_method, |
| 146 | + fallback_url, |
| 147 | + fallback_method, |
| 148 | + username, |
| 149 | + password, |
| 150 | + fallback_username, |
| 151 | + fallback_password) |
0 commit comments