package gov.cms.qpp.conversion.api.services;


import java.io.InputStream;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;

/**
 * Interface to store an {@link InputStream} in S3.
 */
public interface StorageService {

	/**
	 * Stores the {@link InputStream} as an object in the S3 bucket.
	 *
	 * @param keyName The requested key name for the object.
	 * @param inStream The {@link InputStream} to write out to an object in S3.
	 * @param size The size of the {@link InputStream}.
	 * @return A {@link CompletableFuture} that will eventually contain the S3 object key.
	 */
	CompletableFuture<String> store(String keyName, Supplier<InputStream> inStream, long size);

	/**
	 * Retrieve a CPC+ file by file id
	 *
	 * @param fileId Id of the file
	 * @return file to be returned
	 */
	InputStream getFileByLocationId(String fileId);

	/**
	 * Retrieve the CPC+ API to NPI Validation file from S3
	 *
	 * @return file used for cpc+ validation.
	 */
	InputStream getCpcPlusValidationFile();

	/**
	 * Retrieve the APM entity list.
	 * The purpose is for easier manipulation of the apm entity list in all live environments.
	 * The static list will still be present with default testing data.
	 *
	 * @return file used for apm entity validation
	 */
	InputStream getApmValidationFile(String fileName);
}
