LimitRange.fromJson constructor

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

Creates a LimitRange from JSON data.

Implementation

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

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

  return LimitRange(
    apiVersion: tempApiVersion,
    kind: tempKind,
    metadata: tempMetadata,
    spec: tempSpec,
  );
}