File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 "inputSpec" : " public_accessa/api/v1.3/docs/cb-v1.3-openapi-3.0.1.yaml" ,
77 "outputDir" : " ." ,
88 "validateSpec" : false ,
9+ "templateDir" : " templates" ,
910 "additionalProperties" : {
1011 "packageName" : " cloudbeds_pms_v1_3" ,
1112 "projectName" : " Cloudbeds PMS V1.3" ,
1213 "packageVersion" : " 1.8.0" ,
1314 "packageDescription" : " OpenAPI client for Cloudbeds PMS v1.3 API." ,
1415 "generateSourceCodeOnly" : true ,
15- "packageUrl" : " https://github.com/cloudbeds/cloudbeds-api-python/tree/release/v1"
16+ "packageUrl" : " https://github.com/cloudbeds/cloudbeds-api-python/tree/release/v1" ,
17+ "enumUnknownDefaultCase" : true
1618 },
1719 "files" : {
1820 "README_onlypackage.mustache" : {
Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+ import json
3+ from enum import Enum
4+ { {#vendorExtensions.x-py-other-imports} }
5+ { {{.} }}
6+ { {/vendorExtensions.x-py-other-imports} }
7+ from typing_extensions import Self
8+
9+
10+ class { {classname} }({ {vendorExtensions.x-py-enum-type} }, Enum):
11+ """
12+ { {{description} }}{ {^description} }{ {{classname} }}{ {/description} }
13+ """
14+
15+ """
16+ allowed enum values
17+ """
18+ { {#allowableValues} }
19+ { {#enumVars} }
20+ { {{name} }} = { {{value} }}
21+ { {/enumVars} }
22+
23+ @classmethod
24+ def from_json(cls, json_str: str) -> Self:
25+ """Create an instance of { {classname} } from a JSON string"""
26+ return cls(json.loads(json_str))
27+
28+ { {#enumUnknownDefaultCase} }
29+ @classmethod
30+ def _missing_(cls, value):
31+ """Handle unknown enum values by returning the unknown default case."""
32+ return cls.UNKNOWN_DEFAULT_OPEN_API
33+ { {/enumUnknownDefaultCase} }
34+ { {/allowableValues} }
You can’t perform that action at this time.
0 commit comments