VolumeProjection.fromJson constructor

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

Creates a VolumeProjection from JSON data.

Implementation

factory VolumeProjection.fromJson(Map<String, dynamic> json) {
  final tempConfigMapJson = json['configMap'];
  final tempDownwardAPIJson = json['downwardAPI'];
  final tempSecretJson = json['secret'];
  final tempServiceAccountTokenJson = json['serviceAccountToken'];

  final ConfigMapProjection? tempConfigMap = tempConfigMapJson != null
      ? ConfigMapProjection.fromJson(tempConfigMapJson)
      : null;
  final DownwardAPIProjection? tempDownwardAPI = tempDownwardAPIJson != null
      ? DownwardAPIProjection.fromJson(tempDownwardAPIJson)
      : null;
  final SecretProjection? tempSecret = tempSecretJson != null
      ? SecretProjection.fromJson(tempSecretJson)
      : null;
  final ServiceAccountTokenProjection? tempServiceAccountToken =
      tempServiceAccountTokenJson != null
          ? ServiceAccountTokenProjection.fromJson(
              tempServiceAccountTokenJson)
          : null;

  return VolumeProjection(
    configMap: tempConfigMap,
    downwardAPI: tempDownwardAPI,
    secret: tempSecret,
    serviceAccountToken: tempServiceAccountToken,
  );
}