Skip to content

Commit 7a629a7

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add form field for multipart/form-data HTTP API tests (#698)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 5f45401 commit 7a629a7

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
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": "2025-06-13 12:53:01.523234",
8-
"spec_repo_commit": "a4fc362f"
7+
"regenerated": "2025-06-13 13:39:04.873734",
8+
"spec_repo_commit": "9757e1ea"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-13 12:53:01.538990",
13-
"spec_repo_commit": "a4fc362f"
12+
"regenerated": "2025-06-13 13:39:04.889553",
13+
"spec_repo_commit": "9757e1ea"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17207,13 +17207,21 @@ components:
1720717207
description: DNS server port to use for DNS tests.
1720817208
type: string
1720917209
files:
17210-
description: Files to be used as part of the request in the test.
17210+
description: Files to be used as part of the request in the test. Only valid
17211+
if `bodyType` is `multipart/form-data`.
1721117212
items:
1721217213
$ref: '#/components/schemas/SyntheticsTestRequestBodyFile'
1721317214
type: array
1721417215
follow_redirects:
1721517216
description: Specifies whether or not the request follows redirects.
1721617217
type: boolean
17218+
form:
17219+
additionalProperties:
17220+
description: A single form entry.
17221+
type: string
17222+
description: Form to be used as part of the request in the test. Only valid
17223+
if `bodyType` is `multipart/form-data`.
17224+
type: object
1721717225
headers:
1721817226
$ref: '#/components/schemas/SyntheticsTestHeaders'
1721917227
host:

src/datadogV1/model/model_synthetics_test_request.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ pub struct SyntheticsTestRequest {
4747
/// DNS server port to use for DNS tests.
4848
#[serde(rename = "dnsServerPort")]
4949
pub dns_server_port: Option<String>,
50-
/// Files to be used as part of the request in the test.
50+
/// Files to be used as part of the request in the test. Only valid if `bodyType` is `multipart/form-data`.
5151
#[serde(rename = "files")]
5252
pub files: Option<Vec<crate::datadogV1::model::SyntheticsTestRequestBodyFile>>,
5353
/// Specifies whether or not the request follows redirects.
5454
#[serde(rename = "follow_redirects")]
5555
pub follow_redirects: Option<bool>,
56+
/// Form to be used as part of the request in the test. Only valid if `bodyType` is `multipart/form-data`.
57+
#[serde(rename = "form")]
58+
pub form: Option<std::collections::BTreeMap<String, String>>,
5659
/// Headers to include when performing the test.
5760
#[serde(rename = "headers")]
5861
pub headers: Option<std::collections::BTreeMap<String, String>>,
@@ -133,6 +136,7 @@ impl SyntheticsTestRequest {
133136
dns_server_port: None,
134137
files: None,
135138
follow_redirects: None,
139+
form: None,
136140
headers: None,
137141
host: None,
138142
http_version: None,
@@ -235,6 +239,11 @@ impl SyntheticsTestRequest {
235239
self
236240
}
237241

242+
pub fn form(mut self, value: std::collections::BTreeMap<String, String>) -> Self {
243+
self.form = Some(value);
244+
self
245+
}
246+
238247
pub fn headers(mut self, value: std::collections::BTreeMap<String, String>) -> Self {
239248
self.headers = Some(value);
240249
self
@@ -378,6 +387,7 @@ impl<'de> Deserialize<'de> for SyntheticsTestRequest {
378387
let mut files: Option<Vec<crate::datadogV1::model::SyntheticsTestRequestBodyFile>> =
379388
None;
380389
let mut follow_redirects: Option<bool> = None;
390+
let mut form: Option<std::collections::BTreeMap<String, String>> = None;
381391
let mut headers: Option<std::collections::BTreeMap<String, String>> = None;
382392
let mut host: Option<String> = None;
383393
let mut http_version: Option<
@@ -522,6 +532,12 @@ impl<'de> Deserialize<'de> for SyntheticsTestRequest {
522532
follow_redirects =
523533
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
524534
}
535+
"form" => {
536+
if v.is_null() {
537+
continue;
538+
}
539+
form = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
540+
}
525541
"headers" => {
526542
if v.is_null() {
527543
continue;
@@ -675,6 +691,7 @@ impl<'de> Deserialize<'de> for SyntheticsTestRequest {
675691
dns_server_port,
676692
files,
677693
follow_redirects,
694+
form,
678695
headers,
679696
host,
680697
http_version,

0 commit comments

Comments
 (0)