use of com.haleconnect.api.project.v0_1.ApiClient in project hale by halestudio.
the class BucketServiceHelper method getApiClient.
/**
* @param resolver the base path resolver
* @param apiKey JWT for authentication
* @return ApiClient for the bucket service
*/
public static ApiClient getApiClient(BasePathResolver resolver, String apiKey) {
ApiClient apiClient = new ApiClient();
ApiClientHelper.setApiClientProperties(apiClient, HaleConnectServices.BUCKET_SERVICE, resolver, apiKey);
return apiClient;
}
use of com.haleconnect.api.project.v0_1.ApiClient in project hale by halestudio.
the class ProjectServiceHelper method getApiClient.
/**
* @param resolver the base path resolver
* @param apiKey JWT for authentication
* @return ApiClient for the project store
*/
public static ApiClient getApiClient(BasePathResolver resolver, String apiKey) {
ApiClient apiClient = new ApiClient();
ApiClientHelper.setApiClientProperties(apiClient, HaleConnectServices.BUCKET_SERVICE, resolver, apiKey);
return apiClient;
}
use of com.haleconnect.api.project.v0_1.ApiClient in project hale by halestudio.
the class ProjectStoreHelper method getApiClient.
/**
* @param resolver the base path resolver
* @param apiKey JWT for authentication
* @return ApiClient for the project store
*/
public static ApiClient getApiClient(BasePathResolver resolver, String apiKey) {
ApiClient apiClient = new ApiClient();
ApiClientHelper.setApiClientProperties(apiClient, HaleConnectServices.PROJECT_STORE, resolver, apiKey);
return apiClient;
}
use of com.haleconnect.api.project.v0_1.ApiClient in project hale by halestudio.
the class ProjectStoreHelper method executePlainTextCallWithFeedback.
/**
* Execute a REST call with the content type <code>text/plain; charset=utf-8
* </code>
*
* @param method HTTP method (POST, PUT)
* @param path REST path (without base path)
* @param body The plain text bdoy
* @param basePath The REST base path
* @param apiKey The API key
* @return the feedback
* @throws HaleConnectException thrown on any API error
*/
public static Feedback executePlainTextCallWithFeedback(String method, String path, String body, BasePathResolver basePath, String apiKey) throws HaleConnectException {
ApiClient apiClient = ProjectStoreHelper.getApiClient(basePath, apiKey);
OkHttpClient httpClient = apiClient.getHttpClient();
String url = apiClient.buildUrl(path, null);
Request.Builder reqBuilder = new Request.Builder().url(url);
Map<String, String> headerParams = new HashMap<String, String>();
apiClient.updateParamsForAuth(new String[] { "bearer" }, null, headerParams);
apiClient.processHeaderParams(headerParams, reqBuilder);
RequestBody reqBody = RequestBody.create(MediaType.parse("text/plain; charset=utf-8"), body);
Request request = reqBuilder.method(method, reqBody).build();
Call call = httpClient.newCall(request);
Feedback feedback;
try {
ApiResponse<Feedback> resp = apiClient.execute(call, new TypeToken<Feedback>() {
}.getType());
feedback = resp.getData();
} catch (com.haleconnect.api.projectstore.v1.ApiException e) {
throw new HaleConnectException(e.getMessage(), e);
}
return feedback;
}
use of com.haleconnect.api.project.v0_1.ApiClient in project hale by halestudio.
the class UserServiceHelper method getApiClient.
/**
* @param resolver the base path resolver
* @param apiKey JWT for authentication
* @return ApiClient for the user service
*/
public static ApiClient getApiClient(BasePathResolver resolver, String apiKey) {
ApiClient apiClient = new ApiClient();
ApiClientHelper.setApiClientProperties(apiClient, HaleConnectServices.USER_SERVICE, resolver, apiKey);
return apiClient;
}
Aggregations