Skip to content

Commit 810b4dc

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9bc9bbd9 of spec repo
1 parent 5c41f57 commit 810b4dc

16 files changed

+43
-31
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.2",
7-
"regenerated": "2022-07-11 17:47:08.655838",
8-
"spec_repo_commit": "0b076011"
7+
"regenerated": "2022-07-13 04:44:34.886031",
8+
"spec_repo_commit": "9bc9bbd9"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-07-11 17:47:08.668314",
13-
"spec_repo_commit": "0b076011"
12+
"regenerated": "2022-07-13 04:44:34.898305",
13+
"spec_repo_commit": "9bc9bbd9"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4166,6 +4166,9 @@ components:
41664166
points:
41674167
- timestamp: 1475317847
41684168
value: 0.7
4169+
resources:
4170+
- name: dummyhost
4171+
type: host
41694172
items:
41704173
$ref: '#/components/schemas/MetricSeries'
41714174
type: array
@@ -4193,12 +4196,15 @@ components:
41934196
type: object
41944197
MetricResource:
41954198
description: Metric resource.
4199+
example:
4200+
name: dummyhost
4201+
type: host
41964202
properties:
41974203
name:
4198-
description: The name of the metric.
4204+
description: The name of the resource.
41994205
type: string
42004206
type:
4201-
description: The type of metric.
4207+
description: The type of the resource.
42024208
type: string
42034209
type: object
42044210
MetricSeries:
@@ -4252,6 +4258,7 @@ components:
42524258
required:
42534259
- metric
42544260
- points
4261+
- resources
42554262
type: object
42564263
MetricTagConfiguration:
42574264
description: Object for a single metric tag configuration.
@@ -12097,7 +12104,7 @@ paths:
1209712104
metrics directly to the Datadog API without using DogStatsD, expect:\n\n-
1209812105
64 bits for the timestamp\n- 64 bits for the value\n- 20 bytes for the metric
1209912106
names\n- 50 bytes for the timeseries\n- The full payload is approximately
12100-
100 bytes."
12107+
100 bytes.\n\nHost name is one of the resources in the Resources field."
1210112108
operationId: SubmitMetrics
1210212109
parameters:
1210312110
- description: HTTP header used to compress the media-type.

examples/v2/metrics/SubmitMetrics.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.datadog.api.client.v2.model.MetricIntakeType;
77
import com.datadog.api.client.v2.model.MetricPayload;
88
import com.datadog.api.client.v2.model.MetricPoint;
9+
import com.datadog.api.client.v2.model.MetricResource;
910
import com.datadog.api.client.v2.model.MetricSeries;
1011
import java.time.OffsetDateTime;
1112
import java.util.Collections;
@@ -26,7 +27,10 @@ public static void main(String[] args) {
2627
Collections.singletonList(
2728
new MetricPoint()
2829
.timestamp(OffsetDateTime.now().toInstant().getEpochSecond())
29-
.value(0.7)))));
30+
.value(0.7)))
31+
.resources(
32+
Collections.singletonList(
33+
new MetricResource().name("dummyhost").type("host")))));
3034

3135
try {
3236
IntakePayloadAccepted result = apiInstance.submitMetrics(body);

src/main/java/com/datadog/api/client/v2/api/MetricsApi.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,8 @@ public CompletableFuture<IntakePayloadAccepted> submitMetricsAsync(
17181718
* <li>The full payload is approximately 100 bytes.
17191719
* </ul>
17201720
*
1721+
* <p>Host name is one of the resources in the Resources field.
1722+
*
17211723
* @param body (required)
17221724
* @param parameters Optional parameters for the request.
17231725
* @return ApiResponse&lt;IntakePayloadAccepted&gt;

src/main/java/com/datadog/api/client/v2/model/MetricResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public MetricResource name(String name) {
3030
}
3131

3232
/**
33-
* The name of the metric.
33+
* The name of the resource.
3434
*
3535
* @return name
3636
*/
@@ -51,7 +51,7 @@ public MetricResource type(String type) {
5151
}
5252

5353
/**
54-
* The type of metric.
54+
* The type of the resource.
5555
*
5656
* @return type
5757
*/

src/main/java/com/datadog/api/client/v2/model/MetricSeries.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class MetricSeries {
4848
private List<MetricPoint> points = new ArrayList<>();
4949

5050
public static final String JSON_PROPERTY_RESOURCES = "resources";
51-
private List<MetricResource> resources = null;
51+
private List<MetricResource> resources = new ArrayList<>();
5252

5353
public static final String JSON_PROPERTY_SOURCE_TYPE_NAME = "source_type_name";
5454
private String sourceTypeName;
@@ -67,9 +67,12 @@ public MetricSeries() {}
6767
@JsonCreator
6868
public MetricSeries(
6969
@JsonProperty(required = true, value = JSON_PROPERTY_METRIC) String metric,
70-
@JsonProperty(required = true, value = JSON_PROPERTY_POINTS) List<MetricPoint> points) {
70+
@JsonProperty(required = true, value = JSON_PROPERTY_POINTS) List<MetricPoint> points,
71+
@JsonProperty(required = true, value = JSON_PROPERTY_RESOURCES)
72+
List<MetricResource> resources) {
7173
this.metric = metric;
7274
this.points = points;
75+
this.resources = resources;
7376
}
7477

7578
public MetricSeries interval(Long interval) {
@@ -175,9 +178,6 @@ public MetricSeries resources(List<MetricResource> resources) {
175178
}
176179

177180
public MetricSeries addResourcesItem(MetricResource resourcesItem) {
178-
if (this.resources == null) {
179-
this.resources = new ArrayList<>();
180-
}
181181
this.resources.add(resourcesItem);
182182
this.unparsed |= resourcesItem.unparsed;
183183
return this;
@@ -188,9 +188,8 @@ public MetricSeries addResourcesItem(MetricResource resourcesItem) {
188188
*
189189
* @return resources
190190
*/
191-
@javax.annotation.Nullable
192191
@JsonProperty(JSON_PROPERTY_RESOURCES)
193-
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
192+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
194193
public List<MetricResource> getResources() {
195194
return resources;
196195
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-03-29T08:59:44.790Z
1+
2022-03-28T15:06:36.041Z

src/test/resources/cassettes/features/v2/Aggregate_RUM_events_returns_OK_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"secure": true
1313
},
1414
"httpResponse": {
15-
"body": "{\"meta\":{\"status\":\"done\",\"request_id\":\"pddv1ChZiX1d1RWNfM1JuaURhSkJ6elFsRHpnIi0KHQJFlSKZaC6T1BR15cquEEJdzvJ8iKfJO5Kr37vkEgyJYfau6iiq_M5ftbo\",\"elapsed\":0},\"data\":{\"buckets\":[]}}\n",
15+
"body": "{\"meta\":{\"status\":\"done\",\"request_id\":\"pddv1ChZyS2R0R2cwbFNTR3dXWHE0T1V4SkV3IiwKHO-LyxpZr85euhVxgr_zcJZpbjq-uQVUzkFlD0ISDPnlZXRCg4-gaoMc2w\",\"elapsed\":0},\"data\":{\"buckets\":[]}}\n",
1616
"headers": {
1717
"Content-Type": [
1818
"application/json"

src/test/resources/cassettes/features/v2/Grant_permission_to_a_role_returns_OK_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"timeToLive": {
5454
"unlimited": true
5555
},
56-
"id": "ab2c08c1-60c7-9278-3246-d650bb89216c"
56+
"id": "ab2c08c1-60c7-9278-3246-d650bb89216e"
5757
},
5858
{
5959
"httpRequest": {

src/test/resources/cassettes/features/v2/List_permissions_for_a_role_returns_OK_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"timeToLive": {
5454
"unlimited": true
5555
},
56-
"id": "ab2c08c1-60c7-9278-3246-d650bb892170"
56+
"id": "ab2c08c1-60c7-9278-3246-d650bb892171"
5757
},
5858
{
5959
"httpRequest": {

0 commit comments

Comments
 (0)