Probe.fromJson constructor
Creates a Probe from JSON data.
Implementation
factory Probe.fromJson(Map<String, dynamic> json) {
final tempExecJson = json['exec'];
final tempFailureThresholdJson = json['failureThreshold'];
final tempGrpcJson = json['grpc'];
final tempHttpGetJson = json['httpGet'];
final tempInitialDelaySecondsJson = json['initialDelaySeconds'];
final tempPeriodSecondsJson = json['periodSeconds'];
final tempSuccessThresholdJson = json['successThreshold'];
final tempTcpSocketJson = json['tcpSocket'];
final tempTerminationGracePeriodSecondsJson =
json['terminationGracePeriodSeconds'];
final tempTimeoutSecondsJson = json['timeoutSeconds'];
final ExecAction? tempExec =
tempExecJson != null ? ExecAction.fromJson(tempExecJson) : null;
final int? tempFailureThreshold = tempFailureThresholdJson;
final GRPCAction? tempGrpc =
tempGrpcJson != null ? GRPCAction.fromJson(tempGrpcJson) : null;
final HTTPGetAction? tempHttpGet = tempHttpGetJson != null
? HTTPGetAction.fromJson(tempHttpGetJson)
: null;
final int? tempInitialDelaySeconds = tempInitialDelaySecondsJson;
final int? tempPeriodSeconds = tempPeriodSecondsJson;
final int? tempSuccessThreshold = tempSuccessThresholdJson;
final TCPSocketAction? tempTcpSocket = tempTcpSocketJson != null
? TCPSocketAction.fromJson(tempTcpSocketJson)
: null;
final int? tempTerminationGracePeriodSeconds =
tempTerminationGracePeriodSecondsJson;
final int? tempTimeoutSeconds = tempTimeoutSecondsJson;
return Probe(
exec: tempExec,
failureThreshold: tempFailureThreshold,
grpc: tempGrpc,
httpGet: tempHttpGet,
initialDelaySeconds: tempInitialDelaySeconds,
periodSeconds: tempPeriodSeconds,
successThreshold: tempSuccessThreshold,
tcpSocket: tempTcpSocket,
terminationGracePeriodSeconds: tempTerminationGracePeriodSeconds,
timeoutSeconds: tempTimeoutSeconds,
);
}