wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_json_body

  1import datetime
  2from typing import Any, Dict, List, Type, TypeVar, Union
  3
  4import attr
  5from dateutil.parser import isoparse
  6
  7from ..models.assays_run_interactive_json_body_baseline_type_0 import \
  8    AssaysRunInteractiveJsonBodyBaselineType0
  9from ..models.assays_run_interactive_json_body_baseline_type_1 import \
 10    AssaysRunInteractiveJsonBodyBaselineType1
 11from ..models.assays_run_interactive_json_body_baseline_type_2 import \
 12    AssaysRunInteractiveJsonBodyBaselineType2
 13from ..models.assays_run_interactive_json_body_summarizer_type_0 import \
 14    AssaysRunInteractiveJsonBodySummarizerType0
 15from ..models.assays_run_interactive_json_body_summarizer_type_1 import \
 16    AssaysRunInteractiveJsonBodySummarizerType1
 17from ..models.assays_run_interactive_json_body_window import \
 18    AssaysRunInteractiveJsonBodyWindow
 19from ..types import UNSET, Unset
 20
 21T = TypeVar("T", bound="AssaysRunInteractiveJsonBody")
 22
 23@attr.s(auto_attribs=True)
 24class AssaysRunInteractiveJsonBody:
 25    """ Request to run an assay interactively.
 26
 27    Attributes:
 28        name (str):
 29        pipeline_id (int):
 30        pipeline_name (str):
 31        active (bool):
 32        status (str):
 33        iopath (str):
 34        baseline (Union[AssaysRunInteractiveJsonBodyBaselineType0, AssaysRunInteractiveJsonBodyBaselineType1,
 35            AssaysRunInteractiveJsonBodyBaselineType2]):
 36        window (AssaysRunInteractiveJsonBodyWindow):  Assay window.
 37        summarizer (Union[AssaysRunInteractiveJsonBodySummarizerType0, AssaysRunInteractiveJsonBodySummarizerType1]):
 38        alert_threshold (float):
 39        created_at (datetime.datetime):
 40        workspace_id (int):
 41        id (Union[Unset, None, int]):
 42        warning_threshold (Union[Unset, None, float]):
 43        last_window_start (Union[Unset, None, datetime.datetime]):
 44        run_until (Union[Unset, None, datetime.datetime]):
 45        last_run (Union[Unset, None, datetime.datetime]):
 46    """
 47
 48    name: str
 49    pipeline_id: int
 50    pipeline_name: str
 51    active: bool
 52    status: str
 53    iopath: str
 54    baseline: Union[AssaysRunInteractiveJsonBodyBaselineType0, AssaysRunInteractiveJsonBodyBaselineType1, AssaysRunInteractiveJsonBodyBaselineType2]
 55    window: AssaysRunInteractiveJsonBodyWindow
 56    summarizer: Union[AssaysRunInteractiveJsonBodySummarizerType0, AssaysRunInteractiveJsonBodySummarizerType1]
 57    alert_threshold: float
 58    created_at: datetime.datetime
 59    workspace_id: int
 60    id: Union[Unset, None, int] = UNSET
 61    warning_threshold: Union[Unset, None, float] = UNSET
 62    last_window_start: Union[Unset, None, datetime.datetime] = UNSET
 63    run_until: Union[Unset, None, datetime.datetime] = UNSET
 64    last_run: Union[Unset, None, datetime.datetime] = UNSET
 65    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
 66
 67
 68    def to_dict(self) -> Dict[str, Any]:
 69        name = self.name
 70        pipeline_id = self.pipeline_id
 71        pipeline_name = self.pipeline_name
 72        active = self.active
 73        status = self.status
 74        iopath = self.iopath
 75        baseline: Dict[str, Any]
 76
 77        if isinstance(self.baseline, AssaysRunInteractiveJsonBodyBaselineType0):
 78            baseline = self.baseline.to_dict()
 79
 80        elif isinstance(self.baseline, AssaysRunInteractiveJsonBodyBaselineType1):
 81            baseline = self.baseline.to_dict()
 82
 83        else:
 84            baseline = self.baseline.to_dict()
 85
 86
 87
 88        window = self.window.to_dict()
 89
 90        summarizer: Dict[str, Any]
 91
 92        if isinstance(self.summarizer, AssaysRunInteractiveJsonBodySummarizerType0):
 93            summarizer = self.summarizer.to_dict()
 94
 95        else:
 96            summarizer = self.summarizer.to_dict()
 97
 98
 99
100        alert_threshold = self.alert_threshold
101        created_at = self.created_at.isoformat()
102
103        workspace_id = self.workspace_id
104        id = self.id
105        warning_threshold = self.warning_threshold
106        last_window_start: Union[Unset, None, str] = UNSET
107        if not isinstance(self.last_window_start, Unset):
108            last_window_start = self.last_window_start.isoformat() if self.last_window_start else None
109
110        run_until: Union[Unset, None, str] = UNSET
111        if not isinstance(self.run_until, Unset):
112            run_until = self.run_until.isoformat() if self.run_until else None
113
114        last_run: Union[Unset, None, str] = UNSET
115        if not isinstance(self.last_run, Unset):
116            last_run = self.last_run.isoformat() if self.last_run else None
117
118
119        field_dict: Dict[str, Any] = {}
120        field_dict.update(self.additional_properties)
121        field_dict.update({
122            "name": name,
123            "pipeline_id": pipeline_id,
124            "pipeline_name": pipeline_name,
125            "active": active,
126            "status": status,
127            "iopath": iopath,
128            "baseline": baseline,
129            "window": window,
130            "summarizer": summarizer,
131            "alert_threshold": alert_threshold,
132            "created_at": created_at,
133            "workspace_id": workspace_id,
134        })
135        if id is not UNSET:
136            field_dict["id"] = id
137        if warning_threshold is not UNSET:
138            field_dict["warning_threshold"] = warning_threshold
139        if last_window_start is not UNSET:
140            field_dict["last_window_start"] = last_window_start
141        if run_until is not UNSET:
142            field_dict["run_until"] = run_until
143        if last_run is not UNSET:
144            field_dict["last_run"] = last_run
145
146        return field_dict
147
148
149
150    @classmethod
151    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
152        d = src_dict.copy()
153        name = d.pop("name")
154
155        pipeline_id = d.pop("pipeline_id")
156
157        pipeline_name = d.pop("pipeline_name")
158
159        active = d.pop("active")
160
161        status = d.pop("status")
162
163        iopath = d.pop("iopath")
164
165        def _parse_baseline(data: object) -> Union[AssaysRunInteractiveJsonBodyBaselineType0, AssaysRunInteractiveJsonBodyBaselineType1, AssaysRunInteractiveJsonBodyBaselineType2]:
166            try:
167                if not isinstance(data, dict):
168                    raise TypeError()
169                baseline_type_0 = AssaysRunInteractiveJsonBodyBaselineType0.from_dict(data)
170
171
172
173                return baseline_type_0
174            except: # noqa: E722
175                pass
176            try:
177                if not isinstance(data, dict):
178                    raise TypeError()
179                baseline_type_1 = AssaysRunInteractiveJsonBodyBaselineType1.from_dict(data)
180
181
182
183                return baseline_type_1
184            except: # noqa: E722
185                pass
186            if not isinstance(data, dict):
187                raise TypeError()
188            baseline_type_2 = AssaysRunInteractiveJsonBodyBaselineType2.from_dict(data)
189
190
191
192            return baseline_type_2
193
194        baseline = _parse_baseline(d.pop("baseline"))
195
196
197        window = AssaysRunInteractiveJsonBodyWindow.from_dict(d.pop("window"))
198
199
200
201
202        def _parse_summarizer(data: object) -> Union[AssaysRunInteractiveJsonBodySummarizerType0, AssaysRunInteractiveJsonBodySummarizerType1]:
203            try:
204                if not isinstance(data, dict):
205                    raise TypeError()
206                summarizer_type_0 = AssaysRunInteractiveJsonBodySummarizerType0.from_dict(data)
207
208
209
210                return summarizer_type_0
211            except: # noqa: E722
212                pass
213            if not isinstance(data, dict):
214                raise TypeError()
215            summarizer_type_1 = AssaysRunInteractiveJsonBodySummarizerType1.from_dict(data)
216
217
218
219            return summarizer_type_1
220
221        summarizer = _parse_summarizer(d.pop("summarizer"))
222
223
224        alert_threshold = d.pop("alert_threshold")
225
226        created_at = isoparse(d.pop("created_at"))
227
228
229
230
231        workspace_id = d.pop("workspace_id")
232
233        id = d.pop("id", UNSET)
234
235        warning_threshold = d.pop("warning_threshold", UNSET)
236
237        _last_window_start = d.pop("last_window_start", UNSET)
238        last_window_start: Union[Unset, None, datetime.datetime]
239        if _last_window_start is None:
240            last_window_start = None
241        elif isinstance(_last_window_start,  Unset):
242            last_window_start = UNSET
243        else:
244            last_window_start = isoparse(_last_window_start)
245
246
247
248
249        _run_until = d.pop("run_until", UNSET)
250        run_until: Union[Unset, None, datetime.datetime]
251        if _run_until is None:
252            run_until = None
253        elif isinstance(_run_until,  Unset):
254            run_until = UNSET
255        else:
256            run_until = isoparse(_run_until)
257
258
259
260
261        _last_run = d.pop("last_run", UNSET)
262        last_run: Union[Unset, None, datetime.datetime]
263        if _last_run is None:
264            last_run = None
265        elif isinstance(_last_run,  Unset):
266            last_run = UNSET
267        else:
268            last_run = isoparse(_last_run)
269
270
271
272
273        assays_run_interactive_json_body = cls(
274            name=name,
275            pipeline_id=pipeline_id,
276            pipeline_name=pipeline_name,
277            active=active,
278            status=status,
279            iopath=iopath,
280            baseline=baseline,
281            window=window,
282            summarizer=summarizer,
283            alert_threshold=alert_threshold,
284            created_at=created_at,
285            workspace_id=workspace_id,
286            id=id,
287            warning_threshold=warning_threshold,
288            last_window_start=last_window_start,
289            run_until=run_until,
290            last_run=last_run,
291        )
292
293        assays_run_interactive_json_body.additional_properties = d
294        return assays_run_interactive_json_body
295
296    @property
297    def additional_keys(self) -> List[str]:
298        return list(self.additional_properties.keys())
299
300    def __getitem__(self, key: str) -> Any:
301        return self.additional_properties[key]
302
303    def __setitem__(self, key: str, value: Any) -> None:
304        self.additional_properties[key] = value
305
306    def __delitem__(self, key: str) -> None:
307        del self.additional_properties[key]
308
309    def __contains__(self, key: str) -> bool:
310        return key in self.additional_properties
@attr.s(auto_attribs=True)
class AssaysRunInteractiveJsonBody:
 24@attr.s(auto_attribs=True)
 25class AssaysRunInteractiveJsonBody:
 26    """ Request to run an assay interactively.
 27
 28    Attributes:
 29        name (str):
 30        pipeline_id (int):
 31        pipeline_name (str):
 32        active (bool):
 33        status (str):
 34        iopath (str):
 35        baseline (Union[AssaysRunInteractiveJsonBodyBaselineType0, AssaysRunInteractiveJsonBodyBaselineType1,
 36            AssaysRunInteractiveJsonBodyBaselineType2]):
 37        window (AssaysRunInteractiveJsonBodyWindow):  Assay window.
 38        summarizer (Union[AssaysRunInteractiveJsonBodySummarizerType0, AssaysRunInteractiveJsonBodySummarizerType1]):
 39        alert_threshold (float):
 40        created_at (datetime.datetime):
 41        workspace_id (int):
 42        id (Union[Unset, None, int]):
 43        warning_threshold (Union[Unset, None, float]):
 44        last_window_start (Union[Unset, None, datetime.datetime]):
 45        run_until (Union[Unset, None, datetime.datetime]):
 46        last_run (Union[Unset, None, datetime.datetime]):
 47    """
 48
 49    name: str
 50    pipeline_id: int
 51    pipeline_name: str
 52    active: bool
 53    status: str
 54    iopath: str
 55    baseline: Union[AssaysRunInteractiveJsonBodyBaselineType0, AssaysRunInteractiveJsonBodyBaselineType1, AssaysRunInteractiveJsonBodyBaselineType2]
 56    window: AssaysRunInteractiveJsonBodyWindow
 57    summarizer: Union[AssaysRunInteractiveJsonBodySummarizerType0, AssaysRunInteractiveJsonBodySummarizerType1]
 58    alert_threshold: float
 59    created_at: datetime.datetime
 60    workspace_id: int
 61    id: Union[Unset, None, int] = UNSET
 62    warning_threshold: Union[Unset, None, float] = UNSET
 63    last_window_start: Union[Unset, None, datetime.datetime] = UNSET
 64    run_until: Union[Unset, None, datetime.datetime] = UNSET
 65    last_run: Union[Unset, None, datetime.datetime] = UNSET
 66    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
 67
 68
 69    def to_dict(self) -> Dict[str, Any]:
 70        name = self.name
 71        pipeline_id = self.pipeline_id
 72        pipeline_name = self.pipeline_name
 73        active = self.active
 74        status = self.status
 75        iopath = self.iopath
 76        baseline: Dict[str, Any]
 77
 78        if isinstance(self.baseline, AssaysRunInteractiveJsonBodyBaselineType0):
 79            baseline = self.baseline.to_dict()
 80
 81        elif isinstance(self.baseline, AssaysRunInteractiveJsonBodyBaselineType1):
 82            baseline = self.baseline.to_dict()
 83
 84        else:
 85            baseline = self.baseline.to_dict()
 86
 87
 88
 89        window = self.window.to_dict()
 90
 91        summarizer: Dict[str, Any]
 92
 93        if isinstance(self.summarizer, AssaysRunInteractiveJsonBodySummarizerType0):
 94            summarizer = self.summarizer.to_dict()
 95
 96        else:
 97            summarizer = self.summarizer.to_dict()
 98
 99
100
101        alert_threshold = self.alert_threshold
102        created_at = self.created_at.isoformat()
103
104        workspace_id = self.workspace_id
105        id = self.id
106        warning_threshold = self.warning_threshold
107        last_window_start: Union[Unset, None, str] = UNSET
108        if not isinstance(self.last_window_start, Unset):
109            last_window_start = self.last_window_start.isoformat() if self.last_window_start else None
110
111        run_until: Union[Unset, None, str] = UNSET
112        if not isinstance(self.run_until, Unset):
113            run_until = self.run_until.isoformat() if self.run_until else None
114
115        last_run: Union[Unset, None, str] = UNSET
116        if not isinstance(self.last_run, Unset):
117            last_run = self.last_run.isoformat() if self.last_run else None
118
119
120        field_dict: Dict[str, Any] = {}
121        field_dict.update(self.additional_properties)
122        field_dict.update({
123            "name": name,
124            "pipeline_id": pipeline_id,
125            "pipeline_name": pipeline_name,
126            "active": active,
127            "status": status,
128            "iopath": iopath,
129            "baseline": baseline,
130            "window": window,
131            "summarizer": summarizer,
132            "alert_threshold": alert_threshold,
133            "created_at": created_at,
134            "workspace_id": workspace_id,
135        })
136        if id is not UNSET:
137            field_dict["id"] = id
138        if warning_threshold is not UNSET:
139            field_dict["warning_threshold"] = warning_threshold
140        if last_window_start is not UNSET:
141            field_dict["last_window_start"] = last_window_start
142        if run_until is not UNSET:
143            field_dict["run_until"] = run_until
144        if last_run is not UNSET:
145            field_dict["last_run"] = last_run
146
147        return field_dict
148
149
150
151    @classmethod
152    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
153        d = src_dict.copy()
154        name = d.pop("name")
155
156        pipeline_id = d.pop("pipeline_id")
157
158        pipeline_name = d.pop("pipeline_name")
159
160        active = d.pop("active")
161
162        status = d.pop("status")
163
164        iopath = d.pop("iopath")
165
166        def _parse_baseline(data: object) -> Union[AssaysRunInteractiveJsonBodyBaselineType0, AssaysRunInteractiveJsonBodyBaselineType1, AssaysRunInteractiveJsonBodyBaselineType2]:
167            try:
168                if not isinstance(data, dict):
169                    raise TypeError()
170                baseline_type_0 = AssaysRunInteractiveJsonBodyBaselineType0.from_dict(data)
171
172
173
174                return baseline_type_0
175            except: # noqa: E722
176                pass
177            try:
178                if not isinstance(data, dict):
179                    raise TypeError()
180                baseline_type_1 = AssaysRunInteractiveJsonBodyBaselineType1.from_dict(data)
181
182
183
184                return baseline_type_1
185            except: # noqa: E722
186                pass
187            if not isinstance(data, dict):
188                raise TypeError()
189            baseline_type_2 = AssaysRunInteractiveJsonBodyBaselineType2.from_dict(data)
190
191
192
193            return baseline_type_2
194
195        baseline = _parse_baseline(d.pop("baseline"))
196
197
198        window = AssaysRunInteractiveJsonBodyWindow.from_dict(d.pop("window"))
199
200
201
202
203        def _parse_summarizer(data: object) -> Union[AssaysRunInteractiveJsonBodySummarizerType0, AssaysRunInteractiveJsonBodySummarizerType1]:
204            try:
205                if not isinstance(data, dict):
206                    raise TypeError()
207                summarizer_type_0 = AssaysRunInteractiveJsonBodySummarizerType0.from_dict(data)
208
209
210
211                return summarizer_type_0
212            except: # noqa: E722
213                pass
214            if not isinstance(data, dict):
215                raise TypeError()
216            summarizer_type_1 = AssaysRunInteractiveJsonBodySummarizerType1.from_dict(data)
217
218
219
220            return summarizer_type_1
221
222        summarizer = _parse_summarizer(d.pop("summarizer"))
223
224
225        alert_threshold = d.pop("alert_threshold")
226
227        created_at = isoparse(d.pop("created_at"))
228
229
230
231
232        workspace_id = d.pop("workspace_id")
233
234        id = d.pop("id", UNSET)
235
236        warning_threshold = d.pop("warning_threshold", UNSET)
237
238        _last_window_start = d.pop("last_window_start", UNSET)
239        last_window_start: Union[Unset, None, datetime.datetime]
240        if _last_window_start is None:
241            last_window_start = None
242        elif isinstance(_last_window_start,  Unset):
243            last_window_start = UNSET
244        else:
245            last_window_start = isoparse(_last_window_start)
246
247
248
249
250        _run_until = d.pop("run_until", UNSET)
251        run_until: Union[Unset, None, datetime.datetime]
252        if _run_until is None:
253            run_until = None
254        elif isinstance(_run_until,  Unset):
255            run_until = UNSET
256        else:
257            run_until = isoparse(_run_until)
258
259
260
261
262        _last_run = d.pop("last_run", UNSET)
263        last_run: Union[Unset, None, datetime.datetime]
264        if _last_run is None:
265            last_run = None
266        elif isinstance(_last_run,  Unset):
267            last_run = UNSET
268        else:
269            last_run = isoparse(_last_run)
270
271
272
273
274        assays_run_interactive_json_body = cls(
275            name=name,
276            pipeline_id=pipeline_id,
277            pipeline_name=pipeline_name,
278            active=active,
279            status=status,
280            iopath=iopath,
281            baseline=baseline,
282            window=window,
283            summarizer=summarizer,
284            alert_threshold=alert_threshold,
285            created_at=created_at,
286            workspace_id=workspace_id,
287            id=id,
288            warning_threshold=warning_threshold,
289            last_window_start=last_window_start,
290            run_until=run_until,
291            last_run=last_run,
292        )
293
294        assays_run_interactive_json_body.additional_properties = d
295        return assays_run_interactive_json_body
296
297    @property
298    def additional_keys(self) -> List[str]:
299        return list(self.additional_properties.keys())
300
301    def __getitem__(self, key: str) -> Any:
302        return self.additional_properties[key]
303
304    def __setitem__(self, key: str, value: Any) -> None:
305        self.additional_properties[key] = value
306
307    def __delitem__(self, key: str) -> None:
308        del self.additional_properties[key]
309
310    def __contains__(self, key: str) -> bool:
311        return key in self.additional_properties

Request to run an assay interactively.

Attributes: name (str): pipeline_id (int): pipeline_name (str): active (bool): status (str): iopath (str): baseline (Union[AssaysRunInteractiveJsonBodyBaselineType0, AssaysRunInteractiveJsonBodyBaselineType1, AssaysRunInteractiveJsonBodyBaselineType2]): window (AssaysRunInteractiveJsonBodyWindow): Assay window. summarizer (Union[AssaysRunInteractiveJsonBodySummarizerType0, AssaysRunInteractiveJsonBodySummarizerType1]): alert_threshold (float): created_at (datetime.datetime): workspace_id (int): id (Union[Unset, None, int]): warning_threshold (Union[Unset, None, float]): last_window_start (Union[Unset, None, datetime.datetime]): run_until (Union[Unset, None, datetime.datetime]): last_run (Union[Unset, None, datetime.datetime]):

AssaysRunInteractiveJsonBody( name: str, pipeline_id: int, pipeline_name: str, active: bool, status: str, iopath: str, baseline: Union[wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_json_body_baseline_type_0.AssaysRunInteractiveJsonBodyBaselineType0, wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_json_body_baseline_type_1.AssaysRunInteractiveJsonBodyBaselineType1, wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_json_body_baseline_type_2.AssaysRunInteractiveJsonBodyBaselineType2], window: wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_json_body_window.AssaysRunInteractiveJsonBodyWindow, summarizer: Union[wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_json_body_summarizer_type_0.AssaysRunInteractiveJsonBodySummarizerType0, wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_json_body_summarizer_type_1.AssaysRunInteractiveJsonBodySummarizerType1], alert_threshold: float, created_at: datetime.datetime, workspace_id: int, id: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, int] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, warning_threshold: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, float] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, last_window_start: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, datetime.datetime] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, run_until: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, datetime.datetime] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, last_run: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, datetime.datetime] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>)
 2def __init__(self, name, pipeline_id, pipeline_name, active, status, iopath, baseline, window, summarizer, alert_threshold, created_at, workspace_id, id=attr_dict['id'].default, warning_threshold=attr_dict['warning_threshold'].default, last_window_start=attr_dict['last_window_start'].default, run_until=attr_dict['run_until'].default, last_run=attr_dict['last_run'].default):
 3    self.name = name
 4    self.pipeline_id = pipeline_id
 5    self.pipeline_name = pipeline_name
 6    self.active = active
 7    self.status = status
 8    self.iopath = iopath
 9    self.baseline = baseline
10    self.window = window
11    self.summarizer = summarizer
12    self.alert_threshold = alert_threshold
13    self.created_at = created_at
14    self.workspace_id = workspace_id
15    self.id = id
16    self.warning_threshold = warning_threshold
17    self.last_window_start = last_window_start
18    self.run_until = run_until
19    self.last_run = last_run
20    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class AssaysRunInteractiveJsonBody.

def to_dict(self) -> Dict[str, Any]:
 69    def to_dict(self) -> Dict[str, Any]:
 70        name = self.name
 71        pipeline_id = self.pipeline_id
 72        pipeline_name = self.pipeline_name
 73        active = self.active
 74        status = self.status
 75        iopath = self.iopath
 76        baseline: Dict[str, Any]
 77
 78        if isinstance(self.baseline, AssaysRunInteractiveJsonBodyBaselineType0):
 79            baseline = self.baseline.to_dict()
 80
 81        elif isinstance(self.baseline, AssaysRunInteractiveJsonBodyBaselineType1):
 82            baseline = self.baseline.to_dict()
 83
 84        else:
 85            baseline = self.baseline.to_dict()
 86
 87
 88
 89        window = self.window.to_dict()
 90
 91        summarizer: Dict[str, Any]
 92
 93        if isinstance(self.summarizer, AssaysRunInteractiveJsonBodySummarizerType0):
 94            summarizer = self.summarizer.to_dict()
 95
 96        else:
 97            summarizer = self.summarizer.to_dict()
 98
 99
100
101        alert_threshold = self.alert_threshold
102        created_at = self.created_at.isoformat()
103
104        workspace_id = self.workspace_id
105        id = self.id
106        warning_threshold = self.warning_threshold
107        last_window_start: Union[Unset, None, str] = UNSET
108        if not isinstance(self.last_window_start, Unset):
109            last_window_start = self.last_window_start.isoformat() if self.last_window_start else None
110
111        run_until: Union[Unset, None, str] = UNSET
112        if not isinstance(self.run_until, Unset):
113            run_until = self.run_until.isoformat() if self.run_until else None
114
115        last_run: Union[Unset, None, str] = UNSET
116        if not isinstance(self.last_run, Unset):
117            last_run = self.last_run.isoformat() if self.last_run else None
118
119
120        field_dict: Dict[str, Any] = {}
121        field_dict.update(self.additional_properties)
122        field_dict.update({
123            "name": name,
124            "pipeline_id": pipeline_id,
125            "pipeline_name": pipeline_name,
126            "active": active,
127            "status": status,
128            "iopath": iopath,
129            "baseline": baseline,
130            "window": window,
131            "summarizer": summarizer,
132            "alert_threshold": alert_threshold,
133            "created_at": created_at,
134            "workspace_id": workspace_id,
135        })
136        if id is not UNSET:
137            field_dict["id"] = id
138        if warning_threshold is not UNSET:
139            field_dict["warning_threshold"] = warning_threshold
140        if last_window_start is not UNSET:
141            field_dict["last_window_start"] = last_window_start
142        if run_until is not UNSET:
143            field_dict["run_until"] = run_until
144        if last_run is not UNSET:
145            field_dict["last_run"] = last_run
146
147        return field_dict
@classmethod
def from_dict(cls: Type[~T], src_dict: Dict[str, Any]) -> ~T:
151    @classmethod
152    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
153        d = src_dict.copy()
154        name = d.pop("name")
155
156        pipeline_id = d.pop("pipeline_id")
157
158        pipeline_name = d.pop("pipeline_name")
159
160        active = d.pop("active")
161
162        status = d.pop("status")
163
164        iopath = d.pop("iopath")
165
166        def _parse_baseline(data: object) -> Union[AssaysRunInteractiveJsonBodyBaselineType0, AssaysRunInteractiveJsonBodyBaselineType1, AssaysRunInteractiveJsonBodyBaselineType2]:
167            try:
168                if not isinstance(data, dict):
169                    raise TypeError()
170                baseline_type_0 = AssaysRunInteractiveJsonBodyBaselineType0.from_dict(data)
171
172
173
174                return baseline_type_0
175            except: # noqa: E722
176                pass
177            try:
178                if not isinstance(data, dict):
179                    raise TypeError()
180                baseline_type_1 = AssaysRunInteractiveJsonBodyBaselineType1.from_dict(data)
181
182
183
184                return baseline_type_1
185            except: # noqa: E722
186                pass
187            if not isinstance(data, dict):
188                raise TypeError()
189            baseline_type_2 = AssaysRunInteractiveJsonBodyBaselineType2.from_dict(data)
190
191
192
193            return baseline_type_2
194
195        baseline = _parse_baseline(d.pop("baseline"))
196
197
198        window = AssaysRunInteractiveJsonBodyWindow.from_dict(d.pop("window"))
199
200
201
202
203        def _parse_summarizer(data: object) -> Union[AssaysRunInteractiveJsonBodySummarizerType0, AssaysRunInteractiveJsonBodySummarizerType1]:
204            try:
205                if not isinstance(data, dict):
206                    raise TypeError()
207                summarizer_type_0 = AssaysRunInteractiveJsonBodySummarizerType0.from_dict(data)
208
209
210
211                return summarizer_type_0
212            except: # noqa: E722
213                pass
214            if not isinstance(data, dict):
215                raise TypeError()
216            summarizer_type_1 = AssaysRunInteractiveJsonBodySummarizerType1.from_dict(data)
217
218
219
220            return summarizer_type_1
221
222        summarizer = _parse_summarizer(d.pop("summarizer"))
223
224
225        alert_threshold = d.pop("alert_threshold")
226
227        created_at = isoparse(d.pop("created_at"))
228
229
230
231
232        workspace_id = d.pop("workspace_id")
233
234        id = d.pop("id", UNSET)
235
236        warning_threshold = d.pop("warning_threshold", UNSET)
237
238        _last_window_start = d.pop("last_window_start", UNSET)
239        last_window_start: Union[Unset, None, datetime.datetime]
240        if _last_window_start is None:
241            last_window_start = None
242        elif isinstance(_last_window_start,  Unset):
243            last_window_start = UNSET
244        else:
245            last_window_start = isoparse(_last_window_start)
246
247
248
249
250        _run_until = d.pop("run_until", UNSET)
251        run_until: Union[Unset, None, datetime.datetime]
252        if _run_until is None:
253            run_until = None
254        elif isinstance(_run_until,  Unset):
255            run_until = UNSET
256        else:
257            run_until = isoparse(_run_until)
258
259
260
261
262        _last_run = d.pop("last_run", UNSET)
263        last_run: Union[Unset, None, datetime.datetime]
264        if _last_run is None:
265            last_run = None
266        elif isinstance(_last_run,  Unset):
267            last_run = UNSET
268        else:
269            last_run = isoparse(_last_run)
270
271
272
273
274        assays_run_interactive_json_body = cls(
275            name=name,
276            pipeline_id=pipeline_id,
277            pipeline_name=pipeline_name,
278            active=active,
279            status=status,
280            iopath=iopath,
281            baseline=baseline,
282            window=window,
283            summarizer=summarizer,
284            alert_threshold=alert_threshold,
285            created_at=created_at,
286            workspace_id=workspace_id,
287            id=id,
288            warning_threshold=warning_threshold,
289            last_window_start=last_window_start,
290            run_until=run_until,
291            last_run=last_run,
292        )
293
294        assays_run_interactive_json_body.additional_properties = d
295        return assays_run_interactive_json_body
additional_keys: List[str]