isValidNamespaces function

ErrorObject? isValidNamespaces(
  1. SessionNamespaces? input,
  2. String method
)

Implementation

ErrorObject? isValidNamespaces(
  SessionNamespaces? input,
  String method,
) {
  ErrorObject? error;
  if (input?.isNotEmpty ?? false) {
    final validActionsError = isValidNamespaceActions(input!, method);
    if (validActionsError != null) {
      error = validActionsError;
    }
    final validAccountsError = isValidNamespaceAccounts(input, method);
    if (validAccountsError != null) {
      error = validAccountsError;
    }
  } else {
    error = getInternalError(
      InternalErrorKey.MISSING_OR_INVALID,
      context: '$method, namespaces should be an object with data',
    );
  }

  return error;
}