Skip to content

Commit d60301f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-specamarshall-dd
authored
Regenerate client from commit 8413651 of spec repo (#3101)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: Andrew Marshall <[email protected]>
1 parent 2e35725 commit d60301f

File tree

100 files changed

+10909
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+10909
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 890 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Bulk write datastore items returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
6+
import com.datadog.api.client.v2.model.BulkPutAppsDatastoreItemsRequest;
7+
import com.datadog.api.client.v2.model.BulkPutAppsDatastoreItemsRequestData;
8+
import com.datadog.api.client.v2.model.BulkPutAppsDatastoreItemsRequestDataAttributes;
9+
import com.datadog.api.client.v2.model.DatastoreItemsDataType;
10+
import com.datadog.api.client.v2.model.PutAppsDatastoreItemResponseArray;
11+
import java.util.Arrays;
12+
import java.util.Map;
13+
14+
public class Example {
15+
public static void main(String[] args) {
16+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
17+
ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient);
18+
19+
// there is a valid "datastore" in the system
20+
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");
21+
22+
BulkPutAppsDatastoreItemsRequest body =
23+
new BulkPutAppsDatastoreItemsRequest()
24+
.data(
25+
new BulkPutAppsDatastoreItemsRequestData()
26+
.attributes(
27+
new BulkPutAppsDatastoreItemsRequestDataAttributes()
28+
.values(
29+
Arrays.asList(
30+
Map.ofEntries(
31+
Map.entry("id", "cust_3141"),
32+
Map.entry("name", "Johnathan")),
33+
Map.ofEntries(
34+
Map.entry("id", "cust_3142"), Map.entry("name", "Mary")))))
35+
.type(DatastoreItemsDataType.ITEMS));
36+
37+
try {
38+
PutAppsDatastoreItemResponseArray result =
39+
apiInstance.bulkWriteDatastoreItems(DATASTORE_DATA_ID, body);
40+
System.out.println(result);
41+
} catch (ApiException e) {
42+
System.err.println("Exception when calling ActionsDatastoresApi#bulkWriteDatastoreItems");
43+
System.err.println("Status code: " + e.getCode());
44+
System.err.println("Reason: " + e.getResponseBody());
45+
System.err.println("Response headers: " + e.getResponseHeaders());
46+
e.printStackTrace();
47+
}
48+
}
49+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Create datastore returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
6+
import com.datadog.api.client.v2.model.CreateAppsDatastoreRequest;
7+
import com.datadog.api.client.v2.model.CreateAppsDatastoreRequestData;
8+
import com.datadog.api.client.v2.model.CreateAppsDatastoreRequestDataAttributes;
9+
import com.datadog.api.client.v2.model.CreateAppsDatastoreResponse;
10+
import com.datadog.api.client.v2.model.DatastoreDataType;
11+
12+
public class Example {
13+
public static void main(String[] args) {
14+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient);
16+
17+
CreateAppsDatastoreRequest body =
18+
new CreateAppsDatastoreRequest()
19+
.data(
20+
new CreateAppsDatastoreRequestData()
21+
.attributes(
22+
new CreateAppsDatastoreRequestDataAttributes()
23+
.name("datastore-name")
24+
.primaryColumnName("primaryKey"))
25+
.type(DatastoreDataType.DATASTORES));
26+
27+
try {
28+
CreateAppsDatastoreResponse result = apiInstance.createDatastore(body);
29+
System.out.println(result);
30+
} catch (ApiException e) {
31+
System.err.println("Exception when calling ActionsDatastoresApi#createDatastore");
32+
System.err.println("Status code: " + e.getCode());
33+
System.err.println("Reason: " + e.getResponseBody());
34+
System.err.println("Response headers: " + e.getResponseHeaders());
35+
e.printStackTrace();
36+
}
37+
}
38+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Delete datastore returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
6+
7+
public class Example {
8+
public static void main(String[] args) {
9+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
10+
ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient);
11+
12+
// there is a valid "datastore" in the system
13+
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");
14+
15+
try {
16+
apiInstance.deleteDatastore(DATASTORE_DATA_ID);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling ActionsDatastoresApi#deleteDatastore");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Delete datastore item returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
6+
import com.datadog.api.client.v2.model.DatastoreItemsDataType;
7+
import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemRequest;
8+
import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemRequestData;
9+
import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemRequestDataAttributes;
10+
import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemResponse;
11+
12+
public class Example {
13+
public static void main(String[] args) {
14+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient);
16+
17+
// there is a valid "datastore" in the system
18+
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");
19+
20+
DeleteAppsDatastoreItemRequest body =
21+
new DeleteAppsDatastoreItemRequest()
22+
.data(
23+
new DeleteAppsDatastoreItemRequestData()
24+
.attributes(
25+
new DeleteAppsDatastoreItemRequestDataAttributes().itemKey("test-key"))
26+
.type(DatastoreItemsDataType.ITEMS));
27+
28+
try {
29+
DeleteAppsDatastoreItemResponse result =
30+
apiInstance.deleteDatastoreItem(DATASTORE_DATA_ID, body);
31+
System.out.println(result);
32+
} catch (ApiException e) {
33+
System.err.println("Exception when calling ActionsDatastoresApi#deleteDatastoreItem");
34+
System.err.println("Status code: " + e.getCode());
35+
System.err.println("Reason: " + e.getResponseBody());
36+
System.err.println("Response headers: " + e.getResponseHeaders());
37+
e.printStackTrace();
38+
}
39+
}
40+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Get datastore returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
6+
import com.datadog.api.client.v2.model.Datastore;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient);
12+
13+
// there is a valid "datastore" in the system
14+
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");
15+
16+
try {
17+
Datastore result = apiInstance.getDatastore(DATASTORE_DATA_ID);
18+
System.out.println(result);
19+
} catch (ApiException e) {
20+
System.err.println("Exception when calling ActionsDatastoresApi#getDatastore");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// List datastore items returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
6+
import com.datadog.api.client.v2.model.ItemApiPayloadArray;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient);
12+
13+
// there is a valid "datastore" in the system
14+
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");
15+
16+
try {
17+
ItemApiPayloadArray result = apiInstance.listDatastoreItems(DATASTORE_DATA_ID);
18+
System.out.println(result);
19+
} catch (ApiException e) {
20+
System.err.println("Exception when calling ActionsDatastoresApi#listDatastoreItems");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// List datastores returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
6+
import com.datadog.api.client.v2.model.DatastoreArray;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient);
12+
13+
try {
14+
DatastoreArray result = apiInstance.listDatastores();
15+
System.out.println(result);
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling ActionsDatastoresApi#listDatastores");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Update datastore returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
6+
import com.datadog.api.client.v2.model.Datastore;
7+
import com.datadog.api.client.v2.model.DatastoreDataType;
8+
import com.datadog.api.client.v2.model.UpdateAppsDatastoreRequest;
9+
import com.datadog.api.client.v2.model.UpdateAppsDatastoreRequestData;
10+
import com.datadog.api.client.v2.model.UpdateAppsDatastoreRequestDataAttributes;
11+
12+
public class Example {
13+
public static void main(String[] args) {
14+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient);
16+
17+
// there is a valid "datastore" in the system
18+
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");
19+
20+
UpdateAppsDatastoreRequest body =
21+
new UpdateAppsDatastoreRequest()
22+
.data(
23+
new UpdateAppsDatastoreRequestData()
24+
.attributes(new UpdateAppsDatastoreRequestDataAttributes().name("updated name"))
25+
.type(DatastoreDataType.DATASTORES)
26+
.id(DATASTORE_DATA_ID));
27+
28+
try {
29+
Datastore result = apiInstance.updateDatastore(DATASTORE_DATA_ID, body);
30+
System.out.println(result);
31+
} catch (ApiException e) {
32+
System.err.println("Exception when calling ActionsDatastoresApi#updateDatastore");
33+
System.err.println("Status code: " + e.getCode());
34+
System.err.println("Reason: " + e.getResponseBody());
35+
System.err.println("Response headers: " + e.getResponseHeaders());
36+
e.printStackTrace();
37+
}
38+
}
39+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Update datastore item returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ActionsDatastoresApi;
6+
import com.datadog.api.client.v2.model.ItemApiPayload;
7+
import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequest;
8+
import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestData;
9+
import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestDataAttributes;
10+
import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestDataAttributesItemChanges;
11+
import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestDataType;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient);
17+
18+
// there is a valid "datastore" in the system
19+
String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID");
20+
21+
UpdateAppsDatastoreItemRequest body =
22+
new UpdateAppsDatastoreItemRequest()
23+
.data(
24+
new UpdateAppsDatastoreItemRequestData()
25+
.attributes(
26+
new UpdateAppsDatastoreItemRequestDataAttributes()
27+
.itemChanges(
28+
new UpdateAppsDatastoreItemRequestDataAttributesItemChanges())
29+
.itemKey("test-key"))
30+
.type(UpdateAppsDatastoreItemRequestDataType.ITEMS));
31+
32+
try {
33+
ItemApiPayload result = apiInstance.updateDatastoreItem(DATASTORE_DATA_ID, body);
34+
System.out.println(result);
35+
} catch (ApiException e) {
36+
System.err.println("Exception when calling ActionsDatastoresApi#updateDatastoreItem");
37+
System.err.println("Status code: " + e.getCode());
38+
System.err.println("Reason: " + e.getResponseBody());
39+
System.err.println("Response headers: " + e.getResponseHeaders());
40+
e.printStackTrace();
41+
}
42+
}
43+
}

0 commit comments

Comments
 (0)