com.checkout.reports.ReportsClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checkout-sdk-java Show documentation
Show all versions of checkout-sdk-java Show documentation
Checkout SDK for Java https://checkout.com
package com.checkout.reports;
import com.checkout.AbstractClient;
import com.checkout.ApiClient;
import com.checkout.CheckoutConfiguration;
import com.checkout.ContentResponse;
import com.checkout.SdkAuthorizationType;
import java.util.concurrent.CompletableFuture;
public class ReportsClientImpl extends AbstractClient implements ReportsClient {
private static final String REPORTS_PATH = "reports";
private static final String FILES_PATH = "files";
public ReportsClientImpl(final ApiClient apiClient, final CheckoutConfiguration configuration) {
super(apiClient, configuration, SdkAuthorizationType.SECRET_KEY_OR_OAUTH);
}
@Override
public CompletableFuture getAllReports(final ReportsQuery query) {
return apiClient.queryAsync(REPORTS_PATH, sdkAuthorization(), query, ReportsResponse.class);
}
@Override
public CompletableFuture getReportDetails(final String reportId) {
return apiClient.getAsync(buildPath(REPORTS_PATH, reportId), sdkAuthorization(), ReportDetailsResponse.class);
}
@Override
public CompletableFuture getReportFile(final String reportId, final String fileId) {
return apiClient.queryCsvContentAsync(
buildPath(REPORTS_PATH, reportId, FILES_PATH, fileId),
sdkAuthorization(),
null,
null);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy