|
| 1 | +# Copyright 2023 Deepgram SDK contributors. All Rights Reserved. |
| 2 | +# Use of this source code is governed by a MIT license that can be found in the LICENSE file. |
| 3 | +# SPDX-License-Identifier: MIT |
| 4 | + |
| 5 | +from dataclasses import dataclass |
| 6 | +from dataclasses_json import dataclass_json |
| 7 | +from datetime import datetime |
| 8 | +from typing import TypedDict, List, Optional |
| 9 | + |
| 10 | +# Input |
| 11 | + |
| 12 | + |
| 13 | +@dataclass_json |
| 14 | +@dataclass |
| 15 | +class ProjectOptions: |
| 16 | + name: Optional[str] = "" |
| 17 | + |
| 18 | + def __getitem__(self, key): |
| 19 | + _dict = self.to_dict() |
| 20 | + return _dict[key] |
| 21 | + |
| 22 | + |
| 23 | +@dataclass_json |
| 24 | +@dataclass |
| 25 | +class KeyOptions: |
| 26 | + comment: Optional[str] = "" |
| 27 | + time_to_live_in_seconds: Optional[int] = 0 |
| 28 | + expiration_date: Optional[str] = "" |
| 29 | + scopes: Optional[List[str]] = None |
| 30 | + tags: Optional[List[str]] = None |
| 31 | + |
| 32 | + def __getitem__(self, key): |
| 33 | + _dict = self.to_dict() |
| 34 | + if _dict["scopes"] is not None: |
| 35 | + _dict["scopes"] = [str(scopes) for scopes in _dict["scopes"]] |
| 36 | + if _dict["tags"] is not None: |
| 37 | + _dict["tags"] = [str(tags) for tags in _dict["tags"]] |
| 38 | + return _dict[key] |
| 39 | + |
| 40 | + |
| 41 | +@dataclass_json |
| 42 | +@dataclass |
| 43 | +class ScopeOptions: |
| 44 | + scope: Optional[str] = "" |
| 45 | + |
| 46 | + def __getitem__(self, key): |
| 47 | + _dict = self.to_dict() |
| 48 | + return _dict[key] |
| 49 | + |
| 50 | + |
| 51 | +@dataclass_json |
| 52 | +@dataclass |
| 53 | +class InviteOptions: |
| 54 | + email: Optional[str] = "" |
| 55 | + scope: Optional[str] = "" |
| 56 | + |
| 57 | + def __getitem__(self, key): |
| 58 | + _dict = self.to_dict() |
| 59 | + return _dict[key] |
| 60 | + |
| 61 | + |
| 62 | +@dataclass_json |
| 63 | +@dataclass |
| 64 | +class UsageRequestOptions: |
| 65 | + start: Optional[str] = "" |
| 66 | + end: Optional[str] = "" |
| 67 | + limit: Optional[int] = 0 |
| 68 | + status: Optional[str] = "" |
| 69 | + |
| 70 | + def __getitem__(self, key): |
| 71 | + _dict = self.to_dict() |
| 72 | + return _dict[key] |
| 73 | + |
| 74 | + |
| 75 | +@dataclass_json |
| 76 | +@dataclass |
| 77 | +class UsageSummaryOptions: |
| 78 | + start: Optional[str] = "" |
| 79 | + end: Optional[str] = "" |
| 80 | + accessor: Optional[str] = "" |
| 81 | + tag: Optional[str] = "" |
| 82 | + method: Optional[str] = "" |
| 83 | + model: Optional[str] = "" |
| 84 | + multichannel: Optional[bool] = False |
| 85 | + interim_results: Optional[bool] = False |
| 86 | + punctuate: Optional[bool] = False |
| 87 | + ner: Optional[bool] = False |
| 88 | + utterances: Optional[bool] = False |
| 89 | + replace: Optional[bool] = False |
| 90 | + profanity_filter: Optional[bool] = False |
| 91 | + keywords: Optional[bool] = False |
| 92 | + detect_topics: Optional[bool] = False |
| 93 | + diarize: Optional[bool] = False |
| 94 | + search: Optional[bool] = False |
| 95 | + redact: Optional[bool] = False |
| 96 | + alternatives: Optional[bool] = False |
| 97 | + numerals: Optional[bool] = False |
| 98 | + smart_format: Optional[bool] = False |
| 99 | + |
| 100 | + def __getitem__(self, key): |
| 101 | + _dict = self.to_dict() |
| 102 | + return _dict[key] |
| 103 | + |
| 104 | + |
| 105 | +@dataclass_json |
| 106 | +@dataclass |
| 107 | +class UsageFieldsOptions: |
| 108 | + start: Optional[str] = "" |
| 109 | + end: Optional[str] = "" |
| 110 | + |
| 111 | + def __getitem__(self, key): |
| 112 | + _dict = self.to_dict() |
| 113 | + if _dict["details"] is not None: |
| 114 | + _dict["details"] = Details.from_dict(_dict["details"]) |
| 115 | + return _dict[key] |
0 commit comments