| 1 | # coding: utf-8 |
| 2 | |
| 3 | """ |
| 4 | Continue Hub IDE API |
| 5 | |
| 6 | API for Continue IDE to fetch assistants and other related information. These endpoints are primarily used by the Continue IDE extensions for VS Code and JetBrains. |
| 7 | |
| 8 | The version of the OpenAPI document: 1.0.0 |
| 9 | Generated by OpenAPI Generator (https://openapi-generator.tech) |
| 10 | |
| 11 | Do not edit the class manually. |
| 12 | """ # noqa: E501 |
| 13 | |
| 14 | |
| 15 | from __future__ import annotations |
| 16 | import pprint |
| 17 | import re # noqa: F401 |
| 18 | import json |
| 19 | |
| 20 | from pydantic import BaseModel, ConfigDict, StrictStr |
| 21 | from typing import Any, ClassVar, Dict, List, Optional |
| 22 | from typing import Optional, Set |
| 23 | from typing_extensions import Self |
| 24 | |
| 25 | class GetAssistant404Response(BaseModel): |
| 26 | """ |
| 27 | GetAssistant404Response |
| 28 | """ # noqa: E501 |
| 29 | message: Optional[StrictStr] = None |
| 30 | __properties: ClassVar[List[str]] = ["message"] |
| 31 | |
| 32 | model_config = ConfigDict( |
| 33 | populate_by_name=True, |
| 34 | validate_assignment=True, |
| 35 | protected_namespaces=(), |
| 36 | ) |
| 37 | |
| 38 | |
| 39 | def to_str(self) -> str: |
| 40 | """Returns the string representation of the model using alias""" |
| 41 | return pprint.pformat(self.model_dump(by_alias=True)) |
| 42 | |
| 43 | def to_json(self) -> str: |
| 44 | """Returns the JSON representation of the model using alias""" |
| 45 | # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead |
| 46 | return json.dumps(self.to_dict()) |
| 47 | |
| 48 | @classmethod |
| 49 | def from_json(cls, json_str: str) -> Optional[Self]: |
| 50 | """Create an instance of GetAssistant404Response from a JSON string""" |
| 51 | return cls.from_dict(json.loads(json_str)) |
| 52 | |
| 53 | def to_dict(self) -> Dict[str, Any]: |
| 54 | """Return the dictionary representation of the model using alias. |
| 55 | |
| 56 | This has the following differences from calling pydantic's |
| 57 | `self.model_dump(by_alias=True)`: |
| 58 | |
| 59 | * `None` is only added to the output dict for nullable fields that |
| 60 | were set at model initialization. Other fields with value `None` |
| 61 | are ignored. |
| 62 | """ |
| 63 | excluded_fields: Set[str] = set([ |
| 64 | ]) |
| 65 | |
| 66 | _dict = self.model_dump( |
| 67 | by_alias=True, |
| 68 | exclude=excluded_fields, |
| 69 | exclude_none=True, |
| 70 | ) |
| 71 | return _dict |
| 72 | |
| 73 | @classmethod |
| 74 | def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: |
| 75 | """Create an instance of GetAssistant404Response from a dict""" |
| 76 | if obj is None: |
| 77 | return None |
| 78 | |
| 79 | if not isinstance(obj, dict): |
| 80 | return cls.model_validate(obj) |
| 81 | |
| 82 | _obj = cls.model_validate({ |
| 83 | "message": obj.get("message") |
| 84 | }) |
| 85 | return _obj |
| 86 | |
| 87 | |