ServicePort.fromJson constructor

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

Creates a ServicePort from JSON data.

Implementation

factory ServicePort.fromJson(Map<String, dynamic> json) {
  final tempAppProtocolJson = json['appProtocol'];
  final tempNameJson = json['name'];
  final tempNodePortJson = json['nodePort'];
  final tempPortJson = json['port'];
  final tempProtocolJson = json['protocol'];
  final tempTargetPortJson = json['targetPort'];

  final String? tempAppProtocol = tempAppProtocolJson;
  final String? tempName = tempNameJson;
  final int? tempNodePort = tempNodePortJson;
  final int tempPort = tempPortJson;
  final String? tempProtocol = tempProtocolJson;
  final IntOrString? tempTargetPort =
      tempTargetPortJson != null ? IntOrString(tempTargetPortJson) : null;

  return ServicePort(
    appProtocol: tempAppProtocol,
    name: tempName,
    nodePort: tempNodePort,
    port: tempPort,
    protocol: tempProtocol,
    targetPort: tempTargetPort,
  );
}