All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yodlee.sdk.api.validators.DocumentsValidator Maven / Gradle / Ivy

There is a newer version: 1.0.29.beta1
Show newest version
/**
 * Copyright (c) 2019 Yodlee, Inc. All Rights Reserved.
 *
 * Licensed under the MIT License. See LICENSE file in the project root for license information.
 */
package com.yodlee.sdk.api.validators;

import java.util.Date;
import java.util.List;
import com.yodlee.api.model.documents.enums.DocType;
import com.yodlee.api.model.validator.Problem;
import com.yodlee.sdk.api.DocumentsApi;
import com.yodlee.sdk.api.exception.ApiException;

public class DocumentsValidator {

	private DocumentsValidator() {}

	public static void validateGetDocuments(DocumentsApi documentsApi, String methodName, String keyword,
			Long accountId, DocType docType, Date fromDate, Date toDate) throws ApiException {
		Class[] argTypes = new Class[] {String.class, Long.class, DocType.class, Date.class, Date.class};
		Object[] argValues = new Object[] {keyword, accountId, docType, fromDate, toDate};
		List methodProblems = ApiValidator.validate(documentsApi, methodName, argTypes, argValues);
		List contextProblems = ApiValidator.validateUserContext(documentsApi);
		ApiValidator.collectProblems(methodProblems, contextProblems);
	}

	public static void validateDeleteOrDownloadDocument(DocumentsApi documentsApi, String methodName, String documentId)
			throws ApiException {
		Class[] argTypes = new Class[] {String.class};
		Object[] argValues = new Object[] {documentId};
		List methodProblems = ApiValidator.validate(documentsApi, methodName, argTypes, argValues);
		List contextProblems = ApiValidator.validateUserContext(documentsApi);
		ApiValidator.collectProblems(methodProblems, contextProblems);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy