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

com.yodlee.sdk.api.validators.AuthValidator 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.List;
import com.yodlee.api.model.auth.request.ApiKeyRequest;
import com.yodlee.api.model.validator.Problem;
import com.yodlee.sdk.api.AbstractApi;
import com.yodlee.sdk.api.AuthApi;
import com.yodlee.sdk.api.exception.ApiException;

public class AuthValidator {

	private AuthValidator() {}

	public static void validateGenerateApiKey(AbstractApi authApi, String methodName, ApiKeyRequest apiKeyRequest)
			throws ApiException {
		Class[] argTypes = new Class[] {ApiKeyRequest.class};
		Object[] argValues = new Object[] {apiKeyRequest};
		List methodProblems = ApiValidator.validate(authApi, methodName, argTypes, argValues);
		List modelProblems = ApiValidator.validate(apiKeyRequest);
		List contextProblems = ApiValidator.validateCobrandContext(authApi);
		ApiValidator.collectProblems(methodProblems, modelProblems, contextProblems);
	}

	public static void validateContext(AuthApi authApi) throws ApiException {
		List contextProblems = ApiValidator.validateCobrandContext(authApi);
		ApiValidator.collectProblems(contextProblems);
	}

	public static void validateDeleteApiKey(AuthApi authApi, String methodName, String key) throws ApiException {
		Class[] argTypes = new Class[] {String.class};
		Object[] argValues = new Object[] {key};
		List methodProblems = ApiValidator.validate(authApi, methodName, argTypes, argValues);
		List contextProblems = ApiValidator.validateCobrandContext(authApi);
		ApiValidator.collectProblems(methodProblems, contextProblems);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy