Skip to content

Commit 427c885

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[SYNTH-13257] allow setting httpVersion on a step of multi api test (#2214)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent af96237 commit 427c885

12 files changed

+70
-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.6",
7-
"regenerated": "2024-03-13 14:23:18.791575",
8-
"spec_repo_commit": "113614d8"
7+
"regenerated": "2024-03-13 18:09:01.243635",
8+
"spec_repo_commit": "29884c34"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-03-13 14:23:18.816599",
13-
"spec_repo_commit": "113614d8"
12+
"regenerated": "2024-03-13 18:09:01.260148",
13+
"spec_repo_commit": "29884c34"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15826,6 +15826,8 @@ components:
1582615826
host:
1582715827
description: Host name to perform the test with.
1582815828
type: string
15829+
httpVersion:
15830+
$ref: '#/components/schemas/SyntheticsTestOptionsHTTPVersion'
1582915831
message:
1583015832
description: Message to send for UDP or WebSocket tests.
1583115833
type: string

examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.datadog.api.client.v1.model.SyntheticsTestCallType;
2121
import com.datadog.api.client.v1.model.SyntheticsTestDetailsSubType;
2222
import com.datadog.api.client.v1.model.SyntheticsTestOptions;
23+
import com.datadog.api.client.v1.model.SyntheticsTestOptionsHTTPVersion;
2324
import com.datadog.api.client.v1.model.SyntheticsTestOptionsRetry;
2425
import com.datadog.api.client.v1.model.SyntheticsTestRequest;
2526
import com.datadog.api.client.v1.model.SyntheticsVariableParser;
@@ -72,7 +73,8 @@ public static void main(String[] args) {
7273
new SyntheticsTestRequest()
7374
.method("GET")
7475
.timeout(10.0)
75-
.url("https://datadoghq.com"))
76+
.url("https://datadoghq.com")
77+
.httpVersion(SyntheticsTestOptionsHTTPVersion.HTTP2))
7678
.retry(new SyntheticsTestOptionsRetry().count(5L).interval(1000.0))
7779
.subtype(SyntheticsAPIStepSubtype.HTTP),
7880
new SyntheticsAPIStep()

examples/v1/synthetics/UpdateBrowserTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public static void main(String[] args) {
6464
new SyntheticsTestRequestCertificate()
6565
.cert(new SyntheticsTestRequestCertificateItem())
6666
.key(new SyntheticsTestRequestCertificateItem()))
67+
.httpVersion(SyntheticsTestOptionsHTTPVersion.HTTP1)
6768
.proxy(new SyntheticsTestRequestProxy().url("https://example.com"))
6869
.service("Greeter")
6970
.url("https://example.com"))

src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRequest.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
SyntheticsTestRequest.JSON_PROPERTY_FOLLOW_REDIRECTS,
3535
SyntheticsTestRequest.JSON_PROPERTY_HEADERS,
3636
SyntheticsTestRequest.JSON_PROPERTY_HOST,
37+
SyntheticsTestRequest.JSON_PROPERTY_HTTP_VERSION,
3738
SyntheticsTestRequest.JSON_PROPERTY_MESSAGE,
3839
SyntheticsTestRequest.JSON_PROPERTY_METADATA,
3940
SyntheticsTestRequest.JSON_PROPERTY_METHOD,
@@ -95,6 +96,9 @@ public class SyntheticsTestRequest {
9596
public static final String JSON_PROPERTY_HOST = "host";
9697
private String host;
9798

99+
public static final String JSON_PROPERTY_HTTP_VERSION = "httpVersion";
100+
private SyntheticsTestOptionsHTTPVersion httpVersion;
101+
98102
public static final String JSON_PROPERTY_MESSAGE = "message";
99103
private String message;
100104

@@ -459,6 +463,31 @@ public void setHost(String host) {
459463
this.host = host;
460464
}
461465

466+
public SyntheticsTestRequest httpVersion(SyntheticsTestOptionsHTTPVersion httpVersion) {
467+
this.httpVersion = httpVersion;
468+
this.unparsed |= !httpVersion.isValid();
469+
return this;
470+
}
471+
472+
/**
473+
* HTTP version to use for a Synthetic test.
474+
*
475+
* @return httpVersion
476+
*/
477+
@jakarta.annotation.Nullable
478+
@JsonProperty(JSON_PROPERTY_HTTP_VERSION)
479+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
480+
public SyntheticsTestOptionsHTTPVersion getHttpVersion() {
481+
return httpVersion;
482+
}
483+
484+
public void setHttpVersion(SyntheticsTestOptionsHTTPVersion httpVersion) {
485+
if (!httpVersion.isValid()) {
486+
this.unparsed = true;
487+
}
488+
this.httpVersion = httpVersion;
489+
}
490+
462491
public SyntheticsTestRequest message(String message) {
463492
this.message = message;
464493
return this;
@@ -837,6 +866,7 @@ public boolean equals(Object o) {
837866
&& Objects.equals(this.followRedirects, syntheticsTestRequest.followRedirects)
838867
&& Objects.equals(this.headers, syntheticsTestRequest.headers)
839868
&& Objects.equals(this.host, syntheticsTestRequest.host)
869+
&& Objects.equals(this.httpVersion, syntheticsTestRequest.httpVersion)
840870
&& Objects.equals(this.message, syntheticsTestRequest.message)
841871
&& Objects.equals(this.metadata, syntheticsTestRequest.metadata)
842872
&& Objects.equals(this.method, syntheticsTestRequest.method)
@@ -871,6 +901,7 @@ public int hashCode() {
871901
followRedirects,
872902
headers,
873903
host,
904+
httpVersion,
874905
message,
875906
metadata,
876907
method,
@@ -910,6 +941,7 @@ public String toString() {
910941
sb.append(" followRedirects: ").append(toIndentedString(followRedirects)).append("\n");
911942
sb.append(" headers: ").append(toIndentedString(headers)).append("\n");
912943
sb.append(" host: ").append(toIndentedString(host)).append("\n");
944+
sb.append(" httpVersion: ").append(toIndentedString(httpVersion)).append("\n");
913945
sb.append(" message: ").append(toIndentedString(message)).append("\n");
914946
sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
915947
sb.append(" method: ").append(toIndentedString(method)).append("\n");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-02-14T09:56:55.385Z
1+
2024-03-13T08:48:00.559Z

0 commit comments

Comments
 (0)