Service.fromJson constructor
Creates a Service from JSON data.
Implementation
factory Service.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 ServiceSpec? tempSpec =
tempSpecJson != null ? ServiceSpec.fromJson(tempSpecJson) : null;
final ServiceStatus? tempStatus =
tempStatusJson != null ? ServiceStatus.fromJson(tempStatusJson) : null;
return Service(
apiVersion: tempApiVersion,
kind: tempKind,
metadata: tempMetadata,
spec: tempSpec,
status: tempStatus,
);
}