Status.fromJson constructor

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

Creates a Status from JSON data.

Implementation

factory Status.fromJson(Map<String, dynamic> json) {
  final tempApiVersionJson = json['apiVersion'];
  final tempCodeJson = json['code'];
  final tempDetailsJson = json['details'];
  final tempKindJson = json['kind'];
  final tempMessageJson = json['message'];
  final tempMetadataJson = json['metadata'];
  final tempReasonJson = json['reason'];
  final tempStatusJson = json['status'];

  final String? tempApiVersion = tempApiVersionJson;
  final int? tempCode = tempCodeJson;
  final StatusDetails? tempDetails = tempDetailsJson != null
      ? StatusDetails.fromJson(tempDetailsJson)
      : null;
  final String? tempKind = tempKindJson;
  final String? tempMessage = tempMessageJson;
  final ListMeta? tempMetadata =
      tempMetadataJson != null ? ListMeta.fromJson(tempMetadataJson) : null;
  final String? tempReason = tempReasonJson;
  final String? tempStatus = tempStatusJson;

  return Status(
    apiVersion: tempApiVersion,
    code: tempCode,
    details: tempDetails,
    kind: tempKind,
    message: tempMessage,
    metadata: tempMetadata,
    reason: tempReason,
    status: tempStatus,
  );
}