ServiceAccountList.fromJson constructor

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

Creates a ServiceAccountList from JSON data.

Implementation

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

  final String? tempApiVersion = tempApiVersionJson;

  final List<ServiceAccount> tempItems = List<dynamic>.from(tempItemsJson)
      .map(
        (e) => ServiceAccount.fromJson(
          Map<String, dynamic>.from(e),
        ),
      )
      .toList();

  final String? tempKind = tempKindJson;
  final ListMeta? tempMetadata =
      tempMetadataJson != null ? ListMeta.fromJson(tempMetadataJson) : null;

  return ServiceAccountList(
    apiVersion: tempApiVersion,
    items: tempItems,
    kind: tempKind,
    metadata: tempMetadata,
  );
}