From 0f8fe4edb73297709d2ce50c57a8359f63791208 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 20 Nov 2024 20:16:01 +0000 Subject: [PATCH] Regenerate client from commit ebf27b5e of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 34 +------- .../synthetics/CreateSyntheticsAPITest.java | 3 +- .../CreateSyntheticsBrowserTest.java | 3 +- ...reateSyntheticsBrowserTest_2932742688.java | 3 +- ...CreateSyntheticsBrowserTest_397420811.java | 3 +- examples/v1/synthetics/TriggerCITests.java | 4 +- examples/v1/synthetics/UpdateBrowserTest.java | 3 +- .../v1/model/SyntheticsBatchResult.java | 12 +-- .../api/client/v1/model/SyntheticsCITest.java | 11 ++- .../api/client/v1/model/SyntheticsDevice.java | 15 ++-- .../client/v1/model/SyntheticsDeviceID.java | 84 ------------------- .../v1/model/SyntheticsTestOptions.java | 11 ++- .../SyntheticsTriggerCITestRunResult.java | 12 +-- .../api/client/v1/api/synthetics.feature | 8 +- 15 files changed, 39 insertions(+), 175 deletions(-) delete mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsDeviceID.java diff --git a/.apigentools-info b/.apigentools-info index 7b261859448..e479caec58d 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-19 21:12:12.431997", - "spec_repo_commit": "2e48953d" + "regenerated": "2024-11-20 20:14:20.566230", + "spec_repo_commit": "ebf27b5e" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-19 21:12:12.451025", - "spec_repo_commit": "2e48953d" + "regenerated": "2024-11-20 20:14:20.584628", + "spec_repo_commit": "ebf27b5e" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3fc72f00b1d..4dc36090def 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -15178,34 +15178,8 @@ components: type: object SyntheticsDeviceID: description: The device ID. - enum: - - laptop_large - - tablet - - mobile_small - - chrome.laptop_large - - chrome.tablet - - chrome.mobile_small - - firefox.laptop_large - - firefox.tablet - - firefox.mobile_small - - edge.laptop_large - - edge.tablet - - edge.mobile_small example: chrome.laptop_large type: string - x-enum-varnames: - - LAPTOP_LARGE - - TABLET - - MOBILE_SMALL - - CHROME_LAPTOP_LARGE - - CHROME_TABLET - - CHROME_MOBILE_SMALL - - FIREFOX_LAPTOP_LARGE - - FIREFOX_TABLET - - FIREFOX_MOBILE_SMALL - - EDGE_LAPTOP_LARGE - - EDGE_TABLET - - EDGE_MOBILE_SMALL SyntheticsFetchUptimesPayload: description: Object containing IDs of Synthetic tests and a timeframe. properties: @@ -15508,10 +15482,6 @@ components: $ref: '#/components/schemas/SyntheticsLocation' type: array type: object - SyntheticsMobileDeviceID: - description: The device ID. - example: synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16 - type: string SyntheticsMobileStep: description: The steps used in a Synthetic mobile test. properties: @@ -15787,7 +15757,7 @@ components: device_ids: description: Array with the different device IDs used to run the test. items: - $ref: '#/components/schemas/SyntheticsMobileDeviceID' + $ref: '#/components/schemas/SyntheticsDeviceID' type: array message: description: Notification message associated with the test. @@ -15876,7 +15846,7 @@ components: example: - synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16 items: - $ref: '#/components/schemas/SyntheticsMobileDeviceID' + $ref: '#/components/schemas/SyntheticsDeviceID' type: array disableAutoAcceptAlert: description: A boolean to disable auto accepting alerts. diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest.java b/examples/v1/synthetics/CreateSyntheticsAPITest.java index bf2f6e0afb0..13c330cafa9 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest.java +++ b/examples/v1/synthetics/CreateSyntheticsAPITest.java @@ -11,7 +11,6 @@ import com.datadog.api.client.v1.model.SyntheticsAssertionTarget; import com.datadog.api.client.v1.model.SyntheticsAssertionType; import com.datadog.api.client.v1.model.SyntheticsBrowserTestRumSettings; -import com.datadog.api.client.v1.model.SyntheticsDeviceID; import com.datadog.api.client.v1.model.SyntheticsTestCiOptions; import com.datadog.api.client.v1.model.SyntheticsTestDetailsSubType; import com.datadog.api.client.v1.model.SyntheticsTestExecutionRule; @@ -52,7 +51,7 @@ public static void main(String[] args) { .ci( new SyntheticsTestCiOptions() .executionRule(SyntheticsTestExecutionRule.BLOCKING)) - .deviceIds(Collections.singletonList(SyntheticsDeviceID.CHROME_LAPTOP_LARGE)) + .deviceIds(Collections.singletonList("chrome.laptop_large")) .httpVersion(SyntheticsTestOptionsHTTPVersion.HTTP1) .monitorOptions( new SyntheticsTestOptionsMonitorOptions() diff --git a/examples/v1/synthetics/CreateSyntheticsBrowserTest.java b/examples/v1/synthetics/CreateSyntheticsBrowserTest.java index 01a7a524af2..c42919f92cc 100644 --- a/examples/v1/synthetics/CreateSyntheticsBrowserTest.java +++ b/examples/v1/synthetics/CreateSyntheticsBrowserTest.java @@ -10,7 +10,6 @@ import com.datadog.api.client.v1.model.SyntheticsBrowserVariableType; import com.datadog.api.client.v1.model.SyntheticsConfigVariable; import com.datadog.api.client.v1.model.SyntheticsConfigVariableType; -import com.datadog.api.client.v1.model.SyntheticsDeviceID; import com.datadog.api.client.v1.model.SyntheticsStep; import com.datadog.api.client.v1.model.SyntheticsStepType; import com.datadog.api.client.v1.model.SyntheticsTestOptions; @@ -52,7 +51,7 @@ public static void main(String[] args) { new SyntheticsTestOptions() .acceptSelfSigned(false) .allowInsecure(true) - .deviceIds(Collections.singletonList(SyntheticsDeviceID.CHROME_LAPTOP_LARGE)) + .deviceIds(Collections.singletonList("chrome.laptop_large")) .disableCors(true) .followRedirects(true) .minFailureDuration(10L) diff --git a/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.java b/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.java index e290ab25d29..f6960acb197 100644 --- a/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.java +++ b/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.java @@ -9,7 +9,6 @@ import com.datadog.api.client.v1.model.SyntheticsBrowserTestType; import com.datadog.api.client.v1.model.SyntheticsConfigVariable; import com.datadog.api.client.v1.model.SyntheticsConfigVariableType; -import com.datadog.api.client.v1.model.SyntheticsDeviceID; import com.datadog.api.client.v1.model.SyntheticsStep; import com.datadog.api.client.v1.model.SyntheticsStepType; import com.datadog.api.client.v1.model.SyntheticsTestCiOptions; @@ -48,7 +47,7 @@ public static void main(String[] args) { new SyntheticsTestOptions() .acceptSelfSigned(false) .allowInsecure(true) - .deviceIds(Collections.singletonList(SyntheticsDeviceID.TABLET)) + .deviceIds(Collections.singletonList("tablet")) .disableCors(true) .followRedirects(true) .minFailureDuration(10L) diff --git a/examples/v1/synthetics/CreateSyntheticsBrowserTest_397420811.java b/examples/v1/synthetics/CreateSyntheticsBrowserTest_397420811.java index 70abfdbb55d..0cd7dabb1e0 100644 --- a/examples/v1/synthetics/CreateSyntheticsBrowserTest_397420811.java +++ b/examples/v1/synthetics/CreateSyntheticsBrowserTest_397420811.java @@ -9,7 +9,6 @@ import com.datadog.api.client.v1.model.SyntheticsBrowserTestType; import com.datadog.api.client.v1.model.SyntheticsConfigVariable; import com.datadog.api.client.v1.model.SyntheticsConfigVariableType; -import com.datadog.api.client.v1.model.SyntheticsDeviceID; import com.datadog.api.client.v1.model.SyntheticsStep; import com.datadog.api.client.v1.model.SyntheticsStepType; import com.datadog.api.client.v1.model.SyntheticsTestOptions; @@ -45,7 +44,7 @@ public static void main(String[] args) { new SyntheticsTestOptions() .acceptSelfSigned(false) .allowInsecure(true) - .deviceIds(Collections.singletonList(SyntheticsDeviceID.TABLET)) + .deviceIds(Collections.singletonList("tablet")) .disableCors(true) .followRedirects(true) .minFailureDuration(10L) diff --git a/examples/v1/synthetics/TriggerCITests.java b/examples/v1/synthetics/TriggerCITests.java index 805ab258286..6b552cf222c 100644 --- a/examples/v1/synthetics/TriggerCITests.java +++ b/examples/v1/synthetics/TriggerCITests.java @@ -13,7 +13,6 @@ import com.datadog.api.client.v1.model.SyntheticsCIBatchMetadataProvider; import com.datadog.api.client.v1.model.SyntheticsCITest; import com.datadog.api.client.v1.model.SyntheticsCITestBody; -import com.datadog.api.client.v1.model.SyntheticsDeviceID; import com.datadog.api.client.v1.model.SyntheticsTestOptionsRetry; import com.datadog.api.client.v1.model.SyntheticsTriggerCITestsResponse; import java.util.Collections; @@ -34,8 +33,7 @@ public static void main(String[] args) { .password("PaSSw0RD!") .type(SyntheticsBasicAuthWebType.WEB) .username("my_username"))) - .deviceIds( - Collections.singletonList(SyntheticsDeviceID.CHROME_LAPTOP_LARGE)) + .deviceIds(Collections.singletonList("chrome.laptop_large")) .locations(Collections.singletonList("aws:eu-west-3")) .metadata( new SyntheticsCIBatchMetadata() diff --git a/examples/v1/synthetics/UpdateBrowserTest.java b/examples/v1/synthetics/UpdateBrowserTest.java index e20e7905ec4..692c5590594 100644 --- a/examples/v1/synthetics/UpdateBrowserTest.java +++ b/examples/v1/synthetics/UpdateBrowserTest.java @@ -14,7 +14,6 @@ import com.datadog.api.client.v1.model.SyntheticsBrowserVariableType; import com.datadog.api.client.v1.model.SyntheticsConfigVariable; import com.datadog.api.client.v1.model.SyntheticsConfigVariableType; -import com.datadog.api.client.v1.model.SyntheticsDeviceID; import com.datadog.api.client.v1.model.SyntheticsStep; import com.datadog.api.client.v1.model.SyntheticsStepType; import com.datadog.api.client.v1.model.SyntheticsTestCallType; @@ -84,7 +83,7 @@ public static void main(String[] args) { .ci( new SyntheticsTestCiOptions() .executionRule(SyntheticsTestExecutionRule.BLOCKING)) - .deviceIds(Collections.singletonList(SyntheticsDeviceID.CHROME_LAPTOP_LARGE)) + .deviceIds(Collections.singletonList("chrome.laptop_large")) .httpVersion(SyntheticsTestOptionsHTTPVersion.HTTP1) .monitorOptions( new SyntheticsTestOptionsMonitorOptions() diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsBatchResult.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsBatchResult.java index 552fba99c80..0f4ead1ea03 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsBatchResult.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsBatchResult.java @@ -34,7 +34,7 @@ public class SyntheticsBatchResult { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DEVICE = "device"; - private SyntheticsDeviceID device; + private String device; public static final String JSON_PROPERTY_DURATION = "duration"; private Double duration; @@ -63,9 +63,8 @@ public class SyntheticsBatchResult { public static final String JSON_PROPERTY_TEST_TYPE = "test_type"; private SyntheticsTestDetailsType testType; - public SyntheticsBatchResult device(SyntheticsDeviceID device) { + public SyntheticsBatchResult device(String device) { this.device = device; - this.unparsed |= !device.isValid(); return this; } @@ -77,14 +76,11 @@ public SyntheticsBatchResult device(SyntheticsDeviceID device) { @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEVICE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SyntheticsDeviceID getDevice() { + public String getDevice() { return device; } - public void setDevice(SyntheticsDeviceID device) { - if (!device.isValid()) { - this.unparsed = true; - } + public void setDevice(String device) { this.device = device; } diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsCITest.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsCITest.java index a12f0f72e76..f6032ff8894 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsCITest.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsCITest.java @@ -57,7 +57,7 @@ public class SyntheticsCITest { private String cookies; public static final String JSON_PROPERTY_DEVICE_IDS = "deviceIds"; - private List deviceIds = null; + private List deviceIds = null; public static final String JSON_PROPERTY_FOLLOW_REDIRECTS = "followRedirects"; private Boolean followRedirects; @@ -197,17 +197,16 @@ public void setCookies(String cookies) { this.cookies = cookies; } - public SyntheticsCITest deviceIds(List deviceIds) { + public SyntheticsCITest deviceIds(List deviceIds) { this.deviceIds = deviceIds; return this; } - public SyntheticsCITest addDeviceIdsItem(SyntheticsDeviceID deviceIdsItem) { + public SyntheticsCITest addDeviceIdsItem(String deviceIdsItem) { if (this.deviceIds == null) { this.deviceIds = new ArrayList<>(); } this.deviceIds.add(deviceIdsItem); - this.unparsed |= !deviceIdsItem.isValid(); return this; } @@ -219,11 +218,11 @@ public SyntheticsCITest addDeviceIdsItem(SyntheticsDeviceID deviceIdsItem) { @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEVICE_IDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getDeviceIds() { + public List getDeviceIds() { return deviceIds; } - public void setDeviceIds(List deviceIds) { + public void setDeviceIds(List deviceIds) { this.deviceIds = deviceIds; } diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsDevice.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsDevice.java index c434c7f50ee..a9e2b125cb5 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsDevice.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsDevice.java @@ -33,7 +33,7 @@ public class SyntheticsDevice { private Long height; public static final String JSON_PROPERTY_ID = "id"; - private SyntheticsDeviceID id; + private String id; public static final String JSON_PROPERTY_IS_MOBILE = "isMobile"; private Boolean isMobile; @@ -49,12 +49,11 @@ public SyntheticsDevice() {} @JsonCreator public SyntheticsDevice( @JsonProperty(required = true, value = JSON_PROPERTY_HEIGHT) Long height, - @JsonProperty(required = true, value = JSON_PROPERTY_ID) SyntheticsDeviceID id, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, @JsonProperty(required = true, value = JSON_PROPERTY_WIDTH) Long width) { this.height = height; this.id = id; - this.unparsed |= !id.isValid(); this.name = name; this.width = width; } @@ -79,9 +78,8 @@ public void setHeight(Long height) { this.height = height; } - public SyntheticsDevice id(SyntheticsDeviceID id) { + public SyntheticsDevice id(String id) { this.id = id; - this.unparsed |= !id.isValid(); return this; } @@ -92,14 +90,11 @@ public SyntheticsDevice id(SyntheticsDeviceID id) { */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public SyntheticsDeviceID getId() { + public String getId() { return id; } - public void setId(SyntheticsDeviceID id) { - if (!id.isValid()) { - this.unparsed = true; - } + public void setId(String id) { this.id = id; } diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsDeviceID.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsDeviceID.java deleted file mode 100644 index 5d09d2c7d9a..00000000000 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsDeviceID.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v1.model; - -import com.datadog.api.client.ModelEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** The device ID. */ -@JsonSerialize(using = SyntheticsDeviceID.SyntheticsDeviceIDSerializer.class) -public class SyntheticsDeviceID extends ModelEnum { - - private static final Set allowedValues = - new HashSet( - Arrays.asList( - "laptop_large", - "tablet", - "mobile_small", - "chrome.laptop_large", - "chrome.tablet", - "chrome.mobile_small", - "firefox.laptop_large", - "firefox.tablet", - "firefox.mobile_small", - "edge.laptop_large", - "edge.tablet", - "edge.mobile_small")); - - public static final SyntheticsDeviceID LAPTOP_LARGE = new SyntheticsDeviceID("laptop_large"); - public static final SyntheticsDeviceID TABLET = new SyntheticsDeviceID("tablet"); - public static final SyntheticsDeviceID MOBILE_SMALL = new SyntheticsDeviceID("mobile_small"); - public static final SyntheticsDeviceID CHROME_LAPTOP_LARGE = - new SyntheticsDeviceID("chrome.laptop_large"); - public static final SyntheticsDeviceID CHROME_TABLET = new SyntheticsDeviceID("chrome.tablet"); - public static final SyntheticsDeviceID CHROME_MOBILE_SMALL = - new SyntheticsDeviceID("chrome.mobile_small"); - public static final SyntheticsDeviceID FIREFOX_LAPTOP_LARGE = - new SyntheticsDeviceID("firefox.laptop_large"); - public static final SyntheticsDeviceID FIREFOX_TABLET = new SyntheticsDeviceID("firefox.tablet"); - public static final SyntheticsDeviceID FIREFOX_MOBILE_SMALL = - new SyntheticsDeviceID("firefox.mobile_small"); - public static final SyntheticsDeviceID EDGE_LAPTOP_LARGE = - new SyntheticsDeviceID("edge.laptop_large"); - public static final SyntheticsDeviceID EDGE_TABLET = new SyntheticsDeviceID("edge.tablet"); - public static final SyntheticsDeviceID EDGE_MOBILE_SMALL = - new SyntheticsDeviceID("edge.mobile_small"); - - SyntheticsDeviceID(String value) { - super(value, allowedValues); - } - - public static class SyntheticsDeviceIDSerializer extends StdSerializer { - public SyntheticsDeviceIDSerializer(Class t) { - super(t); - } - - public SyntheticsDeviceIDSerializer() { - this(null); - } - - @Override - public void serialize(SyntheticsDeviceID value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static SyntheticsDeviceID fromValue(String value) { - return new SyntheticsDeviceID(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptions.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptions.java index a15b2d47d94..98a1c1ee956 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptions.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptions.java @@ -63,7 +63,7 @@ public class SyntheticsTestOptions { private SyntheticsTestCiOptions ci; public static final String JSON_PROPERTY_DEVICE_IDS = "device_ids"; - private List deviceIds = null; + private List deviceIds = null; public static final String JSON_PROPERTY_DISABLE_CORS = "disableCors"; private Boolean disableCors; @@ -208,17 +208,16 @@ public void setCi(SyntheticsTestCiOptions ci) { this.ci = ci; } - public SyntheticsTestOptions deviceIds(List deviceIds) { + public SyntheticsTestOptions deviceIds(List deviceIds) { this.deviceIds = deviceIds; return this; } - public SyntheticsTestOptions addDeviceIdsItem(SyntheticsDeviceID deviceIdsItem) { + public SyntheticsTestOptions addDeviceIdsItem(String deviceIdsItem) { if (this.deviceIds == null) { this.deviceIds = new ArrayList<>(); } this.deviceIds.add(deviceIdsItem); - this.unparsed |= !deviceIdsItem.isValid(); return this; } @@ -230,11 +229,11 @@ public SyntheticsTestOptions addDeviceIdsItem(SyntheticsDeviceID deviceIdsItem) @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEVICE_IDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getDeviceIds() { + public List getDeviceIds() { return deviceIds; } - public void setDeviceIds(List deviceIds) { + public void setDeviceIds(List deviceIds) { this.deviceIds = deviceIds; } diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTriggerCITestRunResult.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTriggerCITestRunResult.java index 840ae545a8b..366ac4caa83 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTriggerCITestRunResult.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTriggerCITestRunResult.java @@ -28,7 +28,7 @@ public class SyntheticsTriggerCITestRunResult { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DEVICE = "device"; - private SyntheticsDeviceID device; + private String device; public static final String JSON_PROPERTY_LOCATION = "location"; private Long location; @@ -39,9 +39,8 @@ public class SyntheticsTriggerCITestRunResult { public static final String JSON_PROPERTY_RESULT_ID = "result_id"; private String resultId; - public SyntheticsTriggerCITestRunResult device(SyntheticsDeviceID device) { + public SyntheticsTriggerCITestRunResult device(String device) { this.device = device; - this.unparsed |= !device.isValid(); return this; } @@ -53,14 +52,11 @@ public SyntheticsTriggerCITestRunResult device(SyntheticsDeviceID device) { @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEVICE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SyntheticsDeviceID getDevice() { + public String getDevice() { return device; } - public void setDevice(SyntheticsDeviceID device) { - if (!device.isValid()) { - this.unparsed = true; - } + public void setDevice(String device) { this.device = device; } diff --git a/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature b/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature index fb90d094941..bb3c4ad9b85 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature @@ -128,7 +128,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-ct Scenario: Create a mobile test returns "- JSON format is wrong" response Given new "CreateSyntheticsMobileTest" request - And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} + And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["chrome.laptop_large"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -147,7 +147,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-ct Scenario: Create a mobile test returns "Test quota is reached" response Given new "CreateSyntheticsMobileTest" request - And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} + And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["chrome.laptop_large"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} When the request is sent Then the response status is 402 Test quota is reached @@ -361,7 +361,7 @@ Feature: Synthetics Scenario: Edit a Mobile test returns "- JSON format is wrong" response Given new "UpdateMobileTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} + And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["chrome.laptop_large"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -369,7 +369,7 @@ Feature: Synthetics Scenario: Edit a Mobile test returns "- Synthetic Monitoring is not activated for the user" response Given new "UpdateMobileTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} + And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["chrome.laptop_large"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user