StatefulSetSpec.fromJson constructor
Creates a StatefulSetSpec from JSON data.
Implementation
factory StatefulSetSpec.fromJson(Map<String, dynamic> json) {
final tempMinReadySecondsJson = json['minReadySeconds'];
final tempOrdinalsJson = json['ordinals'];
final tempPersistentVolumeClaimRetentionPolicyJson =
json['persistentVolumeClaimRetentionPolicy'];
final tempPodManagementPolicyJson = json['podManagementPolicy'];
final tempReplicasJson = json['replicas'];
final tempRevisionHistoryLimitJson = json['revisionHistoryLimit'];
final tempSelectorJson = json['selector'];
final tempServiceNameJson = json['serviceName'];
final tempTemplateJson = json['template'];
final tempUpdateStrategyJson = json['updateStrategy'];
final tempVolumeClaimTemplatesJson = json['volumeClaimTemplates'];
final int? tempMinReadySeconds = tempMinReadySecondsJson;
final StatefulSetOrdinals? tempOrdinals = tempOrdinalsJson != null
? StatefulSetOrdinals.fromJson(tempOrdinalsJson)
: null;
final StatefulSetPersistentVolumeClaimRetentionPolicy?
tempPersistentVolumeClaimRetentionPolicy =
tempPersistentVolumeClaimRetentionPolicyJson != null
? StatefulSetPersistentVolumeClaimRetentionPolicy.fromJson(
tempPersistentVolumeClaimRetentionPolicyJson)
: null;
final String? tempPodManagementPolicy = tempPodManagementPolicyJson;
final int? tempReplicas = tempReplicasJson;
final int? tempRevisionHistoryLimit = tempRevisionHistoryLimitJson;
final LabelSelector tempSelector = LabelSelector.fromJson(tempSelectorJson);
final String tempServiceName = tempServiceNameJson;
final PodTemplateSpec tempTemplate =
PodTemplateSpec.fromJson(tempTemplateJson);
final StatefulSetUpdateStrategy? tempUpdateStrategy =
tempUpdateStrategyJson != null
? StatefulSetUpdateStrategy.fromJson(tempUpdateStrategyJson)
: null;
final List<PersistentVolumeClaim>? tempVolumeClaimTemplates =
tempVolumeClaimTemplatesJson != null
? List<dynamic>.from(tempVolumeClaimTemplatesJson)
.map(
(e) => PersistentVolumeClaim.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
return StatefulSetSpec(
minReadySeconds: tempMinReadySeconds,
ordinals: tempOrdinals,
persistentVolumeClaimRetentionPolicy:
tempPersistentVolumeClaimRetentionPolicy,
podManagementPolicy: tempPodManagementPolicy,
replicas: tempReplicas,
revisionHistoryLimit: tempRevisionHistoryLimit,
selector: tempSelector,
serviceName: tempServiceName,
template: tempTemplate,
updateStrategy: tempUpdateStrategy,
volumeClaimTemplates: tempVolumeClaimTemplates,
);
}