|
34 | 34 | SyntheticsTestRequest.JSON_PROPERTY_DNS_SERVER_PORT, |
35 | 35 | SyntheticsTestRequest.JSON_PROPERTY_FILES, |
36 | 36 | SyntheticsTestRequest.JSON_PROPERTY_FOLLOW_REDIRECTS, |
| 37 | + SyntheticsTestRequest.JSON_PROPERTY_FORM, |
37 | 38 | SyntheticsTestRequest.JSON_PROPERTY_HEADERS, |
38 | 39 | SyntheticsTestRequest.JSON_PROPERTY_HOST, |
39 | 40 | SyntheticsTestRequest.JSON_PROPERTY_HTTP_VERSION, |
@@ -100,6 +101,9 @@ public class SyntheticsTestRequest { |
100 | 101 | public static final String JSON_PROPERTY_FOLLOW_REDIRECTS = "follow_redirects"; |
101 | 102 | private Boolean followRedirects; |
102 | 103 |
|
| 104 | + public static final String JSON_PROPERTY_FORM = "form"; |
| 105 | + private Map<String, String> form = null; |
| 106 | + |
103 | 107 | public static final String JSON_PROPERTY_HEADERS = "headers"; |
104 | 108 | private Map<String, String> headers = null; |
105 | 109 |
|
@@ -444,7 +448,8 @@ public SyntheticsTestRequest addFilesItem(SyntheticsTestRequestBodyFile filesIte |
444 | 448 | } |
445 | 449 |
|
446 | 450 | /** |
447 | | - * Files to be used as part of the request in the test. |
| 451 | + * Files to be used as part of the request in the test. Only valid if <code>bodyType</code> is |
| 452 | + * <code>multipart/form-data</code>. |
448 | 453 | * |
449 | 454 | * @return files |
450 | 455 | */ |
@@ -480,6 +485,36 @@ public void setFollowRedirects(Boolean followRedirects) { |
480 | 485 | this.followRedirects = followRedirects; |
481 | 486 | } |
482 | 487 |
|
| 488 | + public SyntheticsTestRequest form(Map<String, String> form) { |
| 489 | + this.form = form; |
| 490 | + return this; |
| 491 | + } |
| 492 | + |
| 493 | + public SyntheticsTestRequest putFormItem(String key, String formItem) { |
| 494 | + if (this.form == null) { |
| 495 | + this.form = new HashMap<>(); |
| 496 | + } |
| 497 | + this.form.put(key, formItem); |
| 498 | + return this; |
| 499 | + } |
| 500 | + |
| 501 | + /** |
| 502 | + * Form to be used as part of the request in the test. Only valid if <code>bodyType</code> is |
| 503 | + * <code>multipart/form-data</code>. |
| 504 | + * |
| 505 | + * @return form |
| 506 | + */ |
| 507 | + @jakarta.annotation.Nullable |
| 508 | + @JsonProperty(JSON_PROPERTY_FORM) |
| 509 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 510 | + public Map<String, String> getForm() { |
| 511 | + return form; |
| 512 | + } |
| 513 | + |
| 514 | + public void setForm(Map<String, String> form) { |
| 515 | + this.form = form; |
| 516 | + } |
| 517 | + |
483 | 518 | public SyntheticsTestRequest headers(Map<String, String> headers) { |
484 | 519 | this.headers = headers; |
485 | 520 | return this; |
@@ -956,6 +991,7 @@ public boolean equals(Object o) { |
956 | 991 | && Objects.equals(this.dnsServerPort, syntheticsTestRequest.dnsServerPort) |
957 | 992 | && Objects.equals(this.files, syntheticsTestRequest.files) |
958 | 993 | && Objects.equals(this.followRedirects, syntheticsTestRequest.followRedirects) |
| 994 | + && Objects.equals(this.form, syntheticsTestRequest.form) |
959 | 995 | && Objects.equals(this.headers, syntheticsTestRequest.headers) |
960 | 996 | && Objects.equals(this.host, syntheticsTestRequest.host) |
961 | 997 | && Objects.equals(this.httpVersion, syntheticsTestRequest.httpVersion) |
@@ -994,6 +1030,7 @@ public int hashCode() { |
994 | 1030 | dnsServerPort, |
995 | 1031 | files, |
996 | 1032 | followRedirects, |
| 1033 | + form, |
997 | 1034 | headers, |
998 | 1035 | host, |
999 | 1036 | httpVersion, |
@@ -1039,6 +1076,7 @@ public String toString() { |
1039 | 1076 | sb.append(" dnsServerPort: ").append(toIndentedString(dnsServerPort)).append("\n"); |
1040 | 1077 | sb.append(" files: ").append(toIndentedString(files)).append("\n"); |
1041 | 1078 | sb.append(" followRedirects: ").append(toIndentedString(followRedirects)).append("\n"); |
| 1079 | + sb.append(" form: ").append(toIndentedString(form)).append("\n"); |
1042 | 1080 | sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); |
1043 | 1081 | sb.append(" host: ").append(toIndentedString(host)).append("\n"); |
1044 | 1082 | sb.append(" httpVersion: ").append(toIndentedString(httpVersion)).append("\n"); |
|
0 commit comments