ExecutionSetSubscriptionsParams.fromJson constructor

ExecutionSetSubscriptionsParams.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json
)

Implementation

factory ExecutionSetSubscriptionsParams.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    List<ExecutionService> subscriptions;
    if (json.containsKey('subscriptions')) {
      subscriptions = jsonDecoder.decodeList(
          '$jsonPath.subscriptions',
          json['subscriptions'],
          (String jsonPath, Object? json) =>
              ExecutionService.fromJson(jsonDecoder, jsonPath, json));
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'subscriptions');
    }
    return ExecutionSetSubscriptionsParams(subscriptions);
  } else {
    throw jsonDecoder.mismatch(
        jsonPath, 'execution.setSubscriptions params', json);
  }
}