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

Request for interactive assay baseline.

Attributes: name (str): pipeline_id (int): pipeline_name (str): active (bool): status (str): iopath (str): baseline (Union[AssaysRunInteractiveBaselineJsonBodyBaselineType0, AssaysRunInteractiveBaselineJsonBodyBaselineType1, AssaysRunInteractiveBaselineJsonBodyBaselineType2]): window (AssaysRunInteractiveBaselineJsonBodyWindow): Assay window. summarizer (Union[AssaysRunInteractiveBaselineJsonBodySummarizerType0, AssaysRunInteractiveBaselineJsonBodySummarizerType1]): 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]):

AssaysRunInteractiveBaselineJsonBody( 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_baseline_json_body_baseline_type_0.AssaysRunInteractiveBaselineJsonBodyBaselineType0, wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_baseline_json_body_baseline_type_1.AssaysRunInteractiveBaselineJsonBodyBaselineType1, wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_baseline_json_body_baseline_type_2.AssaysRunInteractiveBaselineJsonBodyBaselineType2], window: wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_baseline_json_body_window.AssaysRunInteractiveBaselineJsonBodyWindow, summarizer: Union[wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_baseline_json_body_summarizer_type_0.AssaysRunInteractiveBaselineJsonBodySummarizerType0, wallaroo.wallaroo_ml_ops_api_client.models.assays_run_interactive_baseline_json_body_summarizer_type_1.AssaysRunInteractiveBaselineJsonBodySummarizerType1], 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 AssaysRunInteractiveBaselineJsonBody.

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