RolloutPlanWave.fromJson constructor

RolloutPlanWave.fromJson(
  1. Object? j
)

Implementation

factory RolloutPlanWave.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return RolloutPlanWave(
    displayName: switch (json['displayName']) {
      null => null,
      Object $1 => decodeString($1),
    },
    number: switch (json['number']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    orchestrationOptions: switch (json['orchestrationOptions']) {
      null => null,
      Object $1 => RolloutPlanWaveOrchestrationOptions.fromJson($1),
    },
    selectors: switch (json['selectors']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) RolloutPlanWaveSelector.fromJson(i),
      ],
      _ => throw const FormatException('"selectors" is not a list'),
    },
    validation: switch (json['validation']) {
      null => null,
      Object $1 => RolloutPlanWaveValidation.fromJson($1),
    },
  );
}