classWorkloadAdmission(BaseModel):""" WorkloadAdmission """# noqa: E501cluster_queue:StrictStr=Field(alias="clusterQueue")pod_set_assignments:list[Any]=Field(alias="podSetAssignments")__properties:ClassVar[list[str]]=["clusterQueue","podSetAssignments"]model_config=ConfigDict(populate_by_name=True,validate_assignment=True,protected_namespaces=(),)defto_str(self)->str:"""Returns the string representation of the model using alias"""returnpprint.pformat(self.model_dump(by_alias=True))defto_json(self)->str:"""Returns the JSON representation of the model using alias"""# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) insteadreturnjson.dumps(self.to_dict())@classmethoddeffrom_json(cls,json_str:str)->Self|None:"""Create an instance of WorkloadAdmission from a JSON string"""returncls.from_dict(json.loads(json_str))defto_dict(self)->dict[str,Any]:"""Return the dictionary representation of the model using alias. This has the following differences from calling pydantic's `self.model_dump(by_alias=True)`: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. """excluded_fields:set[str]=set()_dict=self.model_dump(by_alias=True,exclude=excluded_fields,exclude_none=True,)return_dict@classmethoddeffrom_dict(cls,obj:dict[str,Any]|None)->Self|None:"""Create an instance of WorkloadAdmission from a dict"""ifobjisNone:returnNoneifnotisinstance(obj,dict):returncls.model_validate(obj)_obj=cls.model_validate({"clusterQueue":obj.get("clusterQueue"),"podSetAssignments":obj.get("podSetAssignments"),})return_obj
defto_json(self)->str:"""Returns the JSON representation of the model using alias"""# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) insteadreturnjson.dumps(self.to_dict())
@classmethoddeffrom_json(cls,json_str:str)->Self|None:"""Create an instance of WorkloadAdmission from a JSON string"""returncls.from_dict(json.loads(json_str))
defto_dict(self)->dict[str,Any]:"""Return the dictionary representation of the model using alias. This has the following differences from calling pydantic's `self.model_dump(by_alias=True)`: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. """excluded_fields:set[str]=set()_dict=self.model_dump(by_alias=True,exclude=excluded_fields,exclude_none=True,)return_dict
@classmethoddeffrom_dict(cls,obj:dict[str,Any]|None)->Self|None:"""Create an instance of WorkloadAdmission from a dict"""ifobjisNone:returnNoneifnotisinstance(obj,dict):returncls.model_validate(obj)_obj=cls.model_validate({"clusterQueue":obj.get("clusterQueue"),"podSetAssignments":obj.get("podSetAssignments"),})return_obj