toJson method
Converts a PriorityClass instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempApiVersion = apiVersion;
final tempDescription = description;
final tempGlobalDefault = globalDefault;
final tempKind = kind;
final tempMetadata = metadata;
final tempPreemptionPolicy = preemptionPolicy;
final tempValue = value;
if (tempApiVersion != null) {
jsonData['apiVersion'] = tempApiVersion;
}
if (tempDescription != null) {
jsonData['description'] = tempDescription;
}
if (tempGlobalDefault != null) {
jsonData['globalDefault'] = tempGlobalDefault;
}
if (tempKind != null) {
jsonData['kind'] = tempKind;
}
if (tempMetadata != null) {
jsonData['metadata'] = tempMetadata.toJson();
}
if (tempPreemptionPolicy != null) {
jsonData['preemptionPolicy'] = tempPreemptionPolicy;
}
jsonData['value'] = tempValue;
return jsonData;
}