-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDataApi.java
More file actions
executable file
·41 lines (35 loc) · 906 Bytes
/
DataApi.java
File metadata and controls
executable file
·41 lines (35 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.coscale.sdk.client.data;
import java.io.IOException;
import com.coscale.sdk.client.ApiClient;
import com.coscale.sdk.client.commons.Msg;
import com.fasterxml.jackson.core.type.TypeReference;
/**
* CoScale API client used to insert data.
*
* @author cristi
*
*/
public class DataApi {
/** ApiClient used to make HTTP requests */
private final ApiClient api;
/**
* DataApi contructor.
*
* @param api
* ApiClient.
*/
public DataApi(ApiClient api) {
this.api = api;
}
/**
* Insert data into the data-store
*
* @param data
* @return Msg containing the api response.
* @throws IOException
*/
public Msg insert(String subjectId, DataInsert data) throws IOException {
return api.callWithAuth("POST", "/data/" + subjectId + '/', data, new TypeReference<Msg>() {
});
}
}