Scale.fromJson constructor

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

Creates a Scale from JSON data.

Implementation

factory Scale.fromJson(Map<String, dynamic> json) {
  final tempApiVersionJson = json['apiVersion'];
  final tempKindJson = json['kind'];
  final tempMetadataJson = json['metadata'];
  final tempSpecJson = json['spec'];
  final tempStatusJson = json['status'];

  final String? tempApiVersion = tempApiVersionJson;
  final String? tempKind = tempKindJson;
  final ObjectMeta? tempMetadata =
      tempMetadataJson != null ? ObjectMeta.fromJson(tempMetadataJson) : null;
  final ScaleSpec? tempSpec =
      tempSpecJson != null ? ScaleSpec.fromJson(tempSpecJson) : null;
  final ScaleStatus? tempStatus =
      tempStatusJson != null ? ScaleStatus.fromJson(tempStatusJson) : null;

  return Scale(
    apiVersion: tempApiVersion,
    kind: tempKind,
    metadata: tempMetadata,
    spec: tempSpec,
    status: tempStatus,
  );
}