|
33 | 33 | SyntheticsTestRequest.JSON_PROPERTY_DNS_SERVER_PORT, |
34 | 34 | SyntheticsTestRequest.JSON_PROPERTY_FILES, |
35 | 35 | SyntheticsTestRequest.JSON_PROPERTY_FOLLOW_REDIRECTS, |
| 36 | + SyntheticsTestRequest.JSON_PROPERTY_FORM, |
36 | 37 | SyntheticsTestRequest.JSON_PROPERTY_HEADERS, |
37 | 38 | SyntheticsTestRequest.JSON_PROPERTY_HOST, |
38 | 39 | SyntheticsTestRequest.JSON_PROPERTY_HTTP_VERSION, |
@@ -94,6 +95,9 @@ public class SyntheticsTestRequest { |
94 | 95 | public static final String JSON_PROPERTY_FOLLOW_REDIRECTS = "follow_redirects"; |
95 | 96 | private Boolean followRedirects; |
96 | 97 |
|
| 98 | + public static final String JSON_PROPERTY_FORM = "form"; |
| 99 | + private Map<String, String> form = null; |
| 100 | + |
97 | 101 | public static final String JSON_PROPERTY_HEADERS = "headers"; |
98 | 102 | private Map<String, String> headers = null; |
99 | 103 |
|
@@ -414,7 +418,8 @@ public SyntheticsTestRequest addFilesItem(SyntheticsTestRequestBodyFile filesIte |
414 | 418 | } |
415 | 419 |
|
416 | 420 | /** |
417 | | - * Files to be used as part of the request in the test. |
| 421 | + * Files to be used as part of the request in the test. Only valid if <code>bodyType</code> is |
| 422 | + * <code>multipart/form-data</code>. |
418 | 423 | * |
419 | 424 | * @return files |
420 | 425 | */ |
@@ -450,6 +455,36 @@ public void setFollowRedirects(Boolean followRedirects) { |
450 | 455 | this.followRedirects = followRedirects; |
451 | 456 | } |
452 | 457 |
|
| 458 | + public SyntheticsTestRequest form(Map<String, String> form) { |
| 459 | + this.form = form; |
| 460 | + return this; |
| 461 | + } |
| 462 | + |
| 463 | + public SyntheticsTestRequest putFormItem(String key, String formItem) { |
| 464 | + if (this.form == null) { |
| 465 | + this.form = new HashMap<>(); |
| 466 | + } |
| 467 | + this.form.put(key, formItem); |
| 468 | + return this; |
| 469 | + } |
| 470 | + |
| 471 | + /** |
| 472 | + * Form to be used as part of the request in the test. Only valid if <code>bodyType</code> is |
| 473 | + * <code>multipart/form-data</code>. |
| 474 | + * |
| 475 | + * @return form |
| 476 | + */ |
| 477 | + @jakarta.annotation.Nullable |
| 478 | + @JsonProperty(JSON_PROPERTY_FORM) |
| 479 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 480 | + public Map<String, String> getForm() { |
| 481 | + return form; |
| 482 | + } |
| 483 | + |
| 484 | + public void setForm(Map<String, String> form) { |
| 485 | + this.form = form; |
| 486 | + } |
| 487 | + |
453 | 488 | public SyntheticsTestRequest headers(Map<String, String> headers) { |
454 | 489 | this.headers = headers; |
455 | 490 | return this; |
@@ -903,6 +938,7 @@ public boolean equals(Object o) { |
903 | 938 | && Objects.equals(this.dnsServerPort, syntheticsTestRequest.dnsServerPort) |
904 | 939 | && Objects.equals(this.files, syntheticsTestRequest.files) |
905 | 940 | && Objects.equals(this.followRedirects, syntheticsTestRequest.followRedirects) |
| 941 | + && Objects.equals(this.form, syntheticsTestRequest.form) |
906 | 942 | && Objects.equals(this.headers, syntheticsTestRequest.headers) |
907 | 943 | && Objects.equals(this.host, syntheticsTestRequest.host) |
908 | 944 | && Objects.equals(this.httpVersion, syntheticsTestRequest.httpVersion) |
@@ -939,6 +975,7 @@ public int hashCode() { |
939 | 975 | dnsServerPort, |
940 | 976 | files, |
941 | 977 | followRedirects, |
| 978 | + form, |
942 | 979 | headers, |
943 | 980 | host, |
944 | 981 | httpVersion, |
@@ -980,6 +1017,7 @@ public String toString() { |
980 | 1017 | sb.append(" dnsServerPort: ").append(toIndentedString(dnsServerPort)).append("\n"); |
981 | 1018 | sb.append(" files: ").append(toIndentedString(files)).append("\n"); |
982 | 1019 | sb.append(" followRedirects: ").append(toIndentedString(followRedirects)).append("\n"); |
| 1020 | + sb.append(" form: ").append(toIndentedString(form)).append("\n"); |
983 | 1021 | sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); |
984 | 1022 | sb.append(" host: ").append(toIndentedString(host)).append("\n"); |
985 | 1023 | sb.append(" httpVersion: ").append(toIndentedString(httpVersion)).append("\n"); |
|
0 commit comments