|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + Platform External API |
| 5 | +
|
| 6 | + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) |
| 7 | +
|
| 8 | + The version of the OpenAPI document: 0.1.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 SetupUserResponse(BaseModel): |
| 26 | + """ |
| 27 | + SetupUserResponse |
| 28 | + """ # noqa: E501 |
| 29 | + created_workos_organization_id: Optional[StrictStr] |
| 30 | + __properties: ClassVar[List[str]] = ["created_workos_organization_id"] |
| 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 SetupUserResponse 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 | + # set to None if created_workos_organization_id (nullable) is None |
| 72 | + # and model_fields_set contains the field |
| 73 | + if self.created_workos_organization_id is None and "created_workos_organization_id" in self.model_fields_set: |
| 74 | + _dict['created_workos_organization_id'] = None |
| 75 | + |
| 76 | + return _dict |
| 77 | + |
| 78 | + @classmethod |
| 79 | + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: |
| 80 | + """Create an instance of SetupUserResponse from a dict""" |
| 81 | + if obj is None: |
| 82 | + return None |
| 83 | + |
| 84 | + if not isinstance(obj, dict): |
| 85 | + return cls.model_validate(obj) |
| 86 | + |
| 87 | + _obj = cls.model_validate({ |
| 88 | + "created_workos_organization_id": obj.get("created_workos_organization_id") |
| 89 | + }) |
| 90 | + return _obj |
| 91 | + |
| 92 | + |
0 commit comments