use of org.broadinstitute.dsde.workbench.client.sam.ApiClient in project terra-workspace-manager by DataBiosphere.
the class SamClientUtils method buildSamClient.
private static ApiClient buildSamClient(@Nullable AccessToken accessToken, ServerSpecification server) {
if (Strings.isNullOrEmpty(server.samUri)) {
throw new IllegalArgumentException("Sam URI cannot be empty");
}
// build the client object
ApiClient apiClient = new ApiClient();
apiClient.setBasePath(server.samUri);
if (accessToken != null) {
apiClient.setAccessToken(accessToken.getTokenValue());
}
return apiClient;
}
use of org.broadinstitute.dsde.workbench.client.sam.ApiClient in project terra-workspace-manager by DataBiosphere.
the class SamService method getApiClient.
private ApiClient getApiClient(String accessToken) {
// OkHttpClient objects manage their own thread pools, so it's much more performant to share one
// across requests.
ApiClient apiClient = new ApiClient().setHttpClient(commonHttpClient).setBasePath(samConfig.getBasePath());
apiClient.setAccessToken(accessToken);
return apiClient;
}
use of org.broadinstitute.dsde.workbench.client.sam.ApiClient in project terra-workspace-manager by DataBiosphere.
the class PrivateResourceCleanupServiceTest method buildGroupApi.
private GroupApi buildGroupApi(AuthenticatedUserRequest userRequest) {
// Each ApiClient manages its own threadpool. If we start using this method from more than a
// handful of tests, we should refactor this to share the ApiClient object across tests.
ApiClient apiClient = new ApiClient().setBasePath(samConfiguration.getBasePath());
apiClient.setAccessToken(userRequest.getRequiredToken());
return new GroupApi(apiClient);
}
use of org.broadinstitute.dsde.workbench.client.sam.ApiClient in project jade-data-repo by DataBiosphere.
the class SamIam method getApiClient.
private ApiClient getApiClient(String accessToken) {
ApiClient apiClient = new ApiClient();
apiClient.setAccessToken(accessToken);
// only logs an error in sam
apiClient.setUserAgent("OpenAPI-Generator/1.0.0 java");
return apiClient.setBasePath(samConfig.getBasePath());
}