PriorityClass.fromJson constructor

PriorityClass.fromJson(
  1. Map<String, dynamic> json
)

Creates a PriorityClass from JSON data.

Implementation

factory PriorityClass.fromJson(Map<String, dynamic> json) {
  final tempApiVersionJson = json['apiVersion'];
  final tempDescriptionJson = json['description'];
  final tempGlobalDefaultJson = json['globalDefault'];
  final tempKindJson = json['kind'];
  final tempMetadataJson = json['metadata'];
  final tempPreemptionPolicyJson = json['preemptionPolicy'];
  final tempValueJson = json['value'];

  final String? tempApiVersion = tempApiVersionJson;
  final String? tempDescription = tempDescriptionJson;
  final bool? tempGlobalDefault = tempGlobalDefaultJson;
  final String? tempKind = tempKindJson;
  final ObjectMeta? tempMetadata =
      tempMetadataJson != null ? ObjectMeta.fromJson(tempMetadataJson) : null;
  final String? tempPreemptionPolicy = tempPreemptionPolicyJson;
  final int tempValue = tempValueJson;

  return PriorityClass(
    apiVersion: tempApiVersion,
    description: tempDescription,
    globalDefault: tempGlobalDefault,
    kind: tempKind,
    metadata: tempMetadata,
    preemptionPolicy: tempPreemptionPolicy,
    value: tempValue,
  );
}