From 5cd63bf54ea0fffab40deb9bad814ba7870bf9c4 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 28 Oct 2024 10:24:51 +0000 Subject: [PATCH] Regenerate client from commit 2e09a3ec of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 363 +++++++++---- .../synthetics/CreateSyntheticsAPITest.java | 6 +- examples/v1/synthetics/UpdateBrowserTest.java | 6 +- .../client/v1/model/SyntheticsMobileStep.java | 36 +- .../v1/model/SyntheticsMobileStepParams.java | 504 ++++++++++++++++++ .../SyntheticsMobileStepParamsDirection.java | 65 +++ .../SyntheticsMobileStepParamsElement.java | 348 ++++++++++++ ...icsMobileStepParamsElementContextType.java | 65 +++ ...ileStepParamsElementRelativePosition.java} | 83 ++- ...icsMobileStepParamsElementUserLocator.java | 189 +++++++ ...pParamsElementUserLocatorValuesItems.java} | 88 ++- ...ramsElementUserLocatorValuesItemsType.java | 75 +++ ...heticsMobileStepParamsPositionsItems.java} | 81 +-- ...> SyntheticsMobileStepParamsVariable.java} | 91 ++-- .../client/v1/model/SyntheticsMobileTest.java | 2 +- .../SyntheticsMobileTestBindingItemsRole.java | 62 --- .../v1/model/SyntheticsMobileTestConfig.java | 19 +- .../v1/model/SyntheticsMobileTestOptions.java | 73 +-- ...heticsMobileTestOptionsMonitorOptions.java | 246 --------- ...sMonitorOptionsNotificationPresetName.java | 74 --- ...yntheticsMobileTestsMobileApplication.java | 24 +- .../v1/model/SyntheticsTestCiOptions.java | 14 +- .../SyntheticsTestOptionsMonitorOptions.java | 105 +++- ...sMonitorOptionsNotificationPresetName.java | 69 +++ .../SyntheticsTestOptionsScheduling.java | 23 +- ...theticsTestOptionsSchedulingTimeframe.java | 22 +- ...ntheticsTestRestrictionPolicyBinding.java} | 61 +-- ...sTestRestrictionPolicyBindingRelation.java | 65 +++ .../api/client/v1/api/synthetics.feature | 28 +- 30 files changed, 2176 insertions(+), 719 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParams.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsDirection.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElement.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementContextType.java rename src/main/java/com/datadog/api/client/v1/model/{SyntheticsMobileTestInitialApplicationArguments.java => SyntheticsMobileStepParamsElementRelativePosition.java} (59%) create mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocator.java rename src/main/java/com/datadog/api/client/v1/model/{SyntheticsMobileTestBinding.java => SyntheticsMobileStepParamsElementUserLocatorValuesItems.java} (53%) create mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocatorValuesItemsType.java rename src/main/java/com/datadog/api/client/v1/model/{SyntheticsMobileTestInitialApplicationArgumentsPropertyNames.java => SyntheticsMobileStepParamsPositionsItems.java} (62%) rename src/main/java/com/datadog/api/client/v1/model/{SyntheticsMobileTestCiOptions.java => SyntheticsMobileStepParamsVariable.java} (57%) delete mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestBindingItemsRole.java delete mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptionsMonitorOptions.java delete mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsMonitorOptionsNotificationPresetName.java rename src/main/java/com/datadog/api/client/v1/model/{SyntheticsMobileTestBindingItems.java => SyntheticsTestRestrictionPolicyBinding.java} (66%) create mode 100644 src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRestrictionPolicyBindingRelation.java diff --git a/.apigentools-info b/.apigentools-info index 1ca11f17b2f..b8c726af87d 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-25 20:17:07.550224", - "spec_repo_commit": "849ce45c" + "regenerated": "2024-10-28 10:23:18.137086", + "spec_repo_commit": "2e09a3ec" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-25 20:17:07.568875", - "spec_repo_commit": "849ce45c" + "regenerated": "2024-10-28 10:23:18.155851", + "spec_repo_commit": "2e09a3ec" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index f1b3d1b0d6d..da8a645285d 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -15491,14 +15491,14 @@ components: type: boolean name: description: The name of the step. + example: '' maxLength: 1500 type: string noScreenshot: description: A boolean set to not take a screenshot for the step. type: boolean params: - description: The parameters of the mobile step. - type: object + $ref: '#/components/schemas/SyntheticsMobileStepParams' publicId: description: The public ID of the step. example: pub-lic-id0 @@ -15509,6 +15509,188 @@ components: type: integer type: $ref: '#/components/schemas/SyntheticsMobileStepType' + required: + - name + - params + - type + type: object + SyntheticsMobileStepParams: + description: The parameters of a mobile step. + properties: + check: + $ref: '#/components/schemas/SyntheticsCheckType' + delay: + description: Number of milliseconds to wait between inputs in a `typeText` + step type. + format: int64 + maximum: 5000 + minimum: 0 + type: integer + direction: + $ref: '#/components/schemas/SyntheticsMobileStepParamsDirection' + element: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElement' + enable: + description: Boolean to change the state of the wifi for a `toggleWiFi` + step type. + type: boolean + maxScrolls: + description: Maximum number of scrolls to do for a `scrollToElement` step + type. + format: int64 + type: integer + positions: + $ref: '#/components/schemas/SyntheticsMobileStepParamsPositions' + subtestPublicId: + description: Public ID of the test to be played as part of a `playSubTest` + step type. + type: string + value: + description: Values used in the step. Used in multiple step types. + type: string + variable: + $ref: '#/components/schemas/SyntheticsMobileStepParamsVariable' + withEnter: + description: Boolean to indicate if `Enter` should be pressed at the end + of the `typeText` step type. + type: boolean + x: + description: Amount to scroll by on the `x` axis for a `scroll` step type. + format: int64 + type: integer + y: + description: Amount to scroll by on the `y` axis for a `scroll` step type. + format: int64 + type: integer + type: object + SyntheticsMobileStepParamsDirection: + description: The direction of the scroll for a `scrollToElement` step type. + enum: + - up + - down + - left + - right + type: string + x-enum-varnames: + - UP + - DOWN + - LEFT + - RIGHT + SyntheticsMobileStepParamsElement: + description: Information about the element used for a step. + properties: + context: + description: Context of the element. + type: string + contextType: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElementContextType' + elementDescription: + description: Description of the element. + type: string + multiLocator: + description: Multi-locator to find the element. + type: object + relativePosition: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElementRelativePosition' + textContent: + description: Text content of the element. + type: string + userLocator: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElementUserLocator' + viewName: + description: Name of the view of the element. + type: string + type: object + SyntheticsMobileStepParamsElementContextType: + description: Type of the context that the element is in. + enum: + - native + - web + type: string + x-enum-varnames: + - NATIVE + - WEB + SyntheticsMobileStepParamsElementRelativePosition: + description: Position of the action relative to the element. + properties: + x: + description: The `relativePosition` on the `x` axis for the element. + format: int64 + type: integer + y: + description: The `relativePosition` on the `y` axis for the element. + format: int64 + type: integer + type: object + SyntheticsMobileStepParamsElementUserLocator: + description: User locator to find the element. + properties: + failTestOnCannotLocate: + description: Whether if the the test should fail if the element cannot be + found. + type: boolean + values: + description: Values of the user locator. + items: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElementUserLocatorValuesItems' + type: array + type: object + SyntheticsMobileStepParamsElementUserLocatorValuesItems: + description: A single user locator object. + properties: + type: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElementUserLocatorValuesItemsType' + value: + description: Value of a user locator. + type: string + type: object + SyntheticsMobileStepParamsElementUserLocatorValuesItemsType: + description: Type of a user locator. + enum: + - accessibility-id + - id + - ios-predicate-string + - ios-class-chain + - xpath + type: string + x-enum-varnames: + - ACCESSIBILITY_ID + - ID + - IOS_PREDICATE_STRING + - IOS_CLASS_CHAIN + - XPATH + SyntheticsMobileStepParamsPositions: + description: List of positions for the `flick` step type. The maximum is 10 + flicks per step + items: + $ref: '#/components/schemas/SyntheticsMobileStepParamsPositionsItems' + type: array + SyntheticsMobileStepParamsPositionsItems: + description: A description of a single position for a `flick` step type. + properties: + x: + description: The `x` position for the flick. + format: int64 + type: integer + y: + description: The `y` position for the flick. + format: int64 + type: integer + type: object + SyntheticsMobileStepParamsVariable: + description: Variable object for `extractVariable` step type. + properties: + example: + description: An example for the variable. + example: '' + type: string + name: + description: The variable name. + example: VAR_NAME + type: string + required: + - name + - example type: object SyntheticsMobileStepType: description: Step type used in your mobile Synthetic test. @@ -15556,7 +15738,7 @@ components: config: $ref: '#/components/schemas/SyntheticsMobileTestConfig' device_ids: - description: The `SyntheticsMobileTest` `device_ids`. + description: Array with the different device IDs used to run the test. items: $ref: '#/components/schemas/SyntheticsMobileDeviceID' type: array @@ -15604,44 +15786,6 @@ components: - options - type type: object - SyntheticsMobileTestBinding: - description: Objects describing the binding used for a mobile test. - properties: - items: - $ref: '#/components/schemas/SyntheticsMobileTestBindingItems' - type: object - SyntheticsMobileTestBindingItems: - description: Object describing the binding used for a mobile test. - properties: - principals: - $ref: '#/components/schemas/SyntheticsMobileTestBindingPrincipals' - role: - $ref: '#/components/schemas/SyntheticsMobileTestBindingItemsRole' - type: object - SyntheticsMobileTestBindingItemsRole: - description: The definition of `SyntheticsMobileTestBindingItemsRole` object. - enum: - - editor - - viewer - type: string - x-enum-varnames: - - EDITOR - - VIEWER - SyntheticsMobileTestBindingPrincipals: - description: List of principals for a mobile test binding. - items: - description: A principal for a mobile test binding. - maxLength: 1500 - type: string - type: array - SyntheticsMobileTestCiOptions: - description: CI/CD options for a Synthetic test. - properties: - executionRule: - $ref: '#/components/schemas/SyntheticsTestExecutionRule' - required: - - executionRule - type: object SyntheticsMobileTestConfig: description: Configuration object for a Synthetic mobile test. properties: @@ -15654,34 +15798,27 @@ components: type: array type: object SyntheticsMobileTestInitialApplicationArguments: + additionalProperties: + description: A single application argument. + type: string description: Initial application arguments for a mobile test. - properties: - propertyNames: - $ref: '#/components/schemas/SyntheticsMobileTestInitialApplicationArgumentsPropertyNames' - type: object - SyntheticsMobileTestInitialApplicationArgumentsPropertyNames: - description: Name of the property. - properties: - pattern: - description: The `propertyNames` `pattern`. - example: ^(?!_dd).*$ - type: string type: object SyntheticsMobileTestOptions: description: Object describing the extra options for a Synthetic test. properties: allowApplicationCrash: - description: The `SyntheticsMobileTestOptions` `allowApplicationCrash`. + description: A boolean to set if an application crash would mark the test + as failed. type: boolean bindings: description: Array of bindings used for the mobile test. items: - $ref: '#/components/schemas/SyntheticsMobileTestBinding' + $ref: '#/components/schemas/SyntheticsTestRestrictionPolicyBinding' type: array ci: - $ref: '#/components/schemas/SyntheticsMobileTestCiOptions' + $ref: '#/components/schemas/SyntheticsTestCiOptions' defaultStepTimeout: - description: The `SyntheticsMobileTestOptions` `defaultStepTimeout`. + description: The default timeout for steps in the test (in seconds). format: int32 maximum: 300 minimum: 1 @@ -15689,11 +15826,13 @@ components: device_ids: description: For mobile test, array with the different device IDs used to run the test. + example: + - synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16 items: $ref: '#/components/schemas/SyntheticsMobileDeviceID' type: array disableAutoAcceptAlert: - description: The `SyntheticsMobileTestOptions` `disableAutoAcceptAlert`. + description: A boolean to disable auto accepting alerts. type: boolean min_failure_duration: description: Minimum amount of time in failure required to trigger an alert. @@ -15708,7 +15847,7 @@ components: all monitor dashboard widgets and SLOs. type: string monitor_options: - $ref: '#/components/schemas/SyntheticsMobileTestOptionsMonitorOptions' + $ref: '#/components/schemas/SyntheticsTestOptionsMonitorOptions' monitor_priority: description: Integer from 1 (high) to 5 (low) indicating alert severity. format: int32 @@ -15716,7 +15855,7 @@ components: minimum: 1 type: integer noScreenshot: - description: The `SyntheticsMobileTestOptions` `noScreenshot`. + description: A boolean set to not take a screenshot for the step. type: boolean restricted_roles: $ref: '#/components/schemas/SyntheticsRestrictedRoles' @@ -15726,54 +15865,22 @@ components: $ref: '#/components/schemas/SyntheticsTestOptionsScheduling' tick_every: description: The frequency at which to run the Synthetic test (in seconds). + example: 300 format: int64 maximum: 604800 minimum: 300 type: integer verbosity: - description: The `SyntheticsMobileTestOptions` `verbosity`. + description: The level of verbosity for the mobile test. format: int32 maximum: 5 minimum: 0 type: integer + required: + - device_ids + - tick_every + - mobileApplication type: object - SyntheticsMobileTestOptionsMonitorOptions: - description: 'Object containing the options for a mobile Synthetic test as a - monitor - - (for example, renotification).' - properties: - escalation_message: - description: Message to include in the escalation notification. - type: string - notification_preset_name: - $ref: '#/components/schemas/SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName' - renotify_interval: - description: 'Time interval before renotifying if the test is still failing - - (in minutes).' - format: int64 - minimum: 0 - type: integer - renotify_occurrences: - description: The `SyntheticsMobileTestOptionsMonitorOptions` `renotify_occurrences`. - format: int64 - type: integer - type: object - SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName: - description: The definition of `SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName` - object. - enum: - - show_all - - hide_all - - hide_query - - hide_handles - type: string - x-enum-varnames: - - SHOW_ALL - - HIDE_ALL - - HIDE_QUERY - - HIDE_HANDLES SyntheticsMobileTestType: default: mobile description: Type of the Synthetic test, `mobile`. @@ -15788,14 +15895,20 @@ components: properties: applicationId: description: Application ID of the mobile application. + example: 00000000-0000-0000-0000-aaaaaaaaaaaa maxLength: 1500 type: string referenceId: description: Reference ID of the mobile application. + example: 00000000-0000-0000-0000-aaaaaaaaaaab maxLength: 1500 type: string referenceType: $ref: '#/components/schemas/SyntheticsMobileTestsMobileApplicationReferenceType' + required: + - applicationId + - referenceId + - referenceType type: object SyntheticsMobileTestsMobileApplicationReferenceType: description: Reference type for the mobile application for a mobile synthetics @@ -15803,6 +15916,7 @@ components: enum: - latest - version + example: latest type: string x-enum-varnames: - LATEST @@ -16276,6 +16390,8 @@ components: properties: executionRule: $ref: '#/components/schemas/SyntheticsTestExecutionRule' + required: + - executionRule type: object SyntheticsTestConfig: description: Configuration object for a Synthetic test. @@ -16537,6 +16653,11 @@ components: (for example, renotification).' properties: + escalation_message: + description: Message to include in the escalation notification. + type: string + notification_preset_name: + $ref: '#/components/schemas/SyntheticsTestOptionsMonitorOptionsNotificationPresetName' renotify_interval: description: 'Time interval before renotifying if the test is still failing @@ -16544,7 +16665,24 @@ components: format: int64 minimum: 0 type: integer + renotify_occurrences: + description: The number of times to renotify if the test is still failing. + format: int64 + type: integer type: object + SyntheticsTestOptionsMonitorOptionsNotificationPresetName: + description: The name of the preset for the notification for the monitor. + enum: + - show_all + - hide_all + - hide_query + - hide_handles + type: string + x-enum-varnames: + - SHOW_ALL + - HIDE_ALL + - HIDE_QUERY + - HIDE_HANDLES SyntheticsTestOptionsRetry: description: Object describing the retry strategy to apply to a Synthetic test. properties: @@ -16583,6 +16721,9 @@ components: description: Timezone in which the timeframe is based. example: America/New_York type: string + required: + - timeframes + - timezone type: object SyntheticsTestOptionsSchedulingTimeframe: description: Object describing a timeframe. @@ -16602,6 +16743,10 @@ components: description: The hour of the day on which scheduling ends. example: '16:00' type: string + required: + - day + - from + - to type: object SyntheticsTestPauseStatus: description: 'Define whether you want to start (`live`) or pause (`paused`) @@ -16838,6 +16983,30 @@ components: description: String Port number to use when performing the test. Supports templated variables. type: string + SyntheticsTestRestrictionPolicyBinding: + description: Objects describing the binding used for a mobile test. + properties: + principals: + $ref: '#/components/schemas/SyntheticsTestRestrictionPolicyBindingPrincipals' + relation: + $ref: '#/components/schemas/SyntheticsTestRestrictionPolicyBindingRelation' + type: object + SyntheticsTestRestrictionPolicyBindingPrincipals: + description: List of principals for a mobile test binding. + items: + description: A principal for a mobile test binding. + maxLength: 1500 + type: string + type: array + SyntheticsTestRestrictionPolicyBindingRelation: + description: The type of relation for the binding. + enum: + - editor + - viewer + type: string + x-enum-varnames: + - EDITOR + - VIEWER SyntheticsTestUptime: description: Object containing the uptime for a Synthetic test ID. properties: diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest.java b/examples/v1/synthetics/CreateSyntheticsAPITest.java index 986a6c1ee9c..bf2f6e0afb0 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest.java +++ b/examples/v1/synthetics/CreateSyntheticsAPITest.java @@ -18,6 +18,7 @@ import com.datadog.api.client.v1.model.SyntheticsTestOptions; import com.datadog.api.client.v1.model.SyntheticsTestOptionsHTTPVersion; import com.datadog.api.client.v1.model.SyntheticsTestOptionsMonitorOptions; +import com.datadog.api.client.v1.model.SyntheticsTestOptionsMonitorOptionsNotificationPresetName; import com.datadog.api.client.v1.model.SyntheticsTestOptionsRetry; import com.datadog.api.client.v1.model.SyntheticsTestOptionsScheduling; import com.datadog.api.client.v1.model.SyntheticsTestOptionsSchedulingTimeframe; @@ -53,7 +54,10 @@ public static void main(String[] args) { .executionRule(SyntheticsTestExecutionRule.BLOCKING)) .deviceIds(Collections.singletonList(SyntheticsDeviceID.CHROME_LAPTOP_LARGE)) .httpVersion(SyntheticsTestOptionsHTTPVersion.HTTP1) - .monitorOptions(new SyntheticsTestOptionsMonitorOptions()) + .monitorOptions( + new SyntheticsTestOptionsMonitorOptions() + .notificationPresetName( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName.SHOW_ALL)) .restrictedRoles( Collections.singletonList("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")) .retry(new SyntheticsTestOptionsRetry()) diff --git a/examples/v1/synthetics/UpdateBrowserTest.java b/examples/v1/synthetics/UpdateBrowserTest.java index 98a10e9a68a..e20e7905ec4 100644 --- a/examples/v1/synthetics/UpdateBrowserTest.java +++ b/examples/v1/synthetics/UpdateBrowserTest.java @@ -23,6 +23,7 @@ import com.datadog.api.client.v1.model.SyntheticsTestOptions; import com.datadog.api.client.v1.model.SyntheticsTestOptionsHTTPVersion; import com.datadog.api.client.v1.model.SyntheticsTestOptionsMonitorOptions; +import com.datadog.api.client.v1.model.SyntheticsTestOptionsMonitorOptionsNotificationPresetName; import com.datadog.api.client.v1.model.SyntheticsTestOptionsRetry; import com.datadog.api.client.v1.model.SyntheticsTestOptionsScheduling; import com.datadog.api.client.v1.model.SyntheticsTestOptionsSchedulingTimeframe; @@ -85,7 +86,10 @@ public static void main(String[] args) { .executionRule(SyntheticsTestExecutionRule.BLOCKING)) .deviceIds(Collections.singletonList(SyntheticsDeviceID.CHROME_LAPTOP_LARGE)) .httpVersion(SyntheticsTestOptionsHTTPVersion.HTTP1) - .monitorOptions(new SyntheticsTestOptionsMonitorOptions()) + .monitorOptions( + new SyntheticsTestOptionsMonitorOptions() + .notificationPresetName( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName.SHOW_ALL)) .restrictedRoles( Collections.singletonList("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")) .retry(new SyntheticsTestOptionsRetry()) diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStep.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStep.java index 2076e4f62b8..3008fcccd6d 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStep.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStep.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -48,7 +49,7 @@ public class SyntheticsMobileStep { private Boolean noScreenshot; public static final String JSON_PROPERTY_PARAMS = "params"; - private Object params; + private SyntheticsMobileStepParams params; public static final String JSON_PROPERTY_PUBLIC_ID = "publicId"; private String publicId; @@ -59,6 +60,21 @@ public class SyntheticsMobileStep { public static final String JSON_PROPERTY_TYPE = "type"; private SyntheticsMobileStepType type; + public SyntheticsMobileStep() {} + + @JsonCreator + public SyntheticsMobileStep( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PARAMS) + SyntheticsMobileStepParams params, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) SyntheticsMobileStepType type) { + this.name = name; + this.params = params; + this.unparsed |= params.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + public SyntheticsMobileStep allowFailure(Boolean allowFailure) { this.allowFailure = allowFailure; return this; @@ -133,9 +149,8 @@ public SyntheticsMobileStep name(String name) { * * @return name */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getName() { return name; } @@ -165,24 +180,24 @@ public void setNoScreenshot(Boolean noScreenshot) { this.noScreenshot = noScreenshot; } - public SyntheticsMobileStep params(Object params) { + public SyntheticsMobileStep params(SyntheticsMobileStepParams params) { this.params = params; + this.unparsed |= params.unparsed; return this; } /** - * The parameters of the mobile step. + * The parameters of a mobile step. * * @return params */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PARAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getParams() { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsMobileStepParams getParams() { return params; } - public void setParams(Object params) { + public void setParams(SyntheticsMobileStepParams params) { this.params = params; } @@ -239,9 +254,8 @@ public SyntheticsMobileStep type(SyntheticsMobileStepType type) { * * @return type */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public SyntheticsMobileStepType getType() { return type; } diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParams.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParams.java new file mode 100644 index 00000000000..29b7802c35f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParams.java @@ -0,0 +1,504 @@ +/* + * 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.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The parameters of a mobile step. */ +@JsonPropertyOrder({ + SyntheticsMobileStepParams.JSON_PROPERTY_CHECK, + SyntheticsMobileStepParams.JSON_PROPERTY_DELAY, + SyntheticsMobileStepParams.JSON_PROPERTY_DIRECTION, + SyntheticsMobileStepParams.JSON_PROPERTY_ELEMENT, + SyntheticsMobileStepParams.JSON_PROPERTY_ENABLE, + SyntheticsMobileStepParams.JSON_PROPERTY_MAX_SCROLLS, + SyntheticsMobileStepParams.JSON_PROPERTY_POSITIONS, + SyntheticsMobileStepParams.JSON_PROPERTY_SUBTEST_PUBLIC_ID, + SyntheticsMobileStepParams.JSON_PROPERTY_VALUE, + SyntheticsMobileStepParams.JSON_PROPERTY_VARIABLE, + SyntheticsMobileStepParams.JSON_PROPERTY_WITH_ENTER, + SyntheticsMobileStepParams.JSON_PROPERTY_X, + SyntheticsMobileStepParams.JSON_PROPERTY_Y +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsMobileStepParams { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHECK = "check"; + private SyntheticsCheckType check; + + public static final String JSON_PROPERTY_DELAY = "delay"; + private Long delay; + + public static final String JSON_PROPERTY_DIRECTION = "direction"; + private SyntheticsMobileStepParamsDirection direction; + + public static final String JSON_PROPERTY_ELEMENT = "element"; + private SyntheticsMobileStepParamsElement element; + + public static final String JSON_PROPERTY_ENABLE = "enable"; + private Boolean enable; + + public static final String JSON_PROPERTY_MAX_SCROLLS = "maxScrolls"; + private Long maxScrolls; + + public static final String JSON_PROPERTY_POSITIONS = "positions"; + private List positions = null; + + public static final String JSON_PROPERTY_SUBTEST_PUBLIC_ID = "subtestPublicId"; + private String subtestPublicId; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public static final String JSON_PROPERTY_VARIABLE = "variable"; + private SyntheticsMobileStepParamsVariable variable; + + public static final String JSON_PROPERTY_WITH_ENTER = "withEnter"; + private Boolean withEnter; + + public static final String JSON_PROPERTY_X = "x"; + private Long x; + + public static final String JSON_PROPERTY_Y = "y"; + private Long y; + + public SyntheticsMobileStepParams check(SyntheticsCheckType check) { + this.check = check; + this.unparsed |= !check.isValid(); + return this; + } + + /** + * Type of assertion to apply in an API test. + * + * @return check + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHECK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsCheckType getCheck() { + return check; + } + + public void setCheck(SyntheticsCheckType check) { + if (!check.isValid()) { + this.unparsed = true; + } + this.check = check; + } + + public SyntheticsMobileStepParams delay(Long delay) { + this.delay = delay; + return this; + } + + /** + * Number of milliseconds to wait between inputs in a typeText step type. minimum: 0 + * maximum: 5000 + * + * @return delay + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getDelay() { + return delay; + } + + public void setDelay(Long delay) { + this.delay = delay; + } + + public SyntheticsMobileStepParams direction(SyntheticsMobileStepParamsDirection direction) { + this.direction = direction; + this.unparsed |= !direction.isValid(); + return this; + } + + /** + * The direction of the scroll for a scrollToElement step type. + * + * @return direction + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DIRECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsMobileStepParamsDirection getDirection() { + return direction; + } + + public void setDirection(SyntheticsMobileStepParamsDirection direction) { + if (!direction.isValid()) { + this.unparsed = true; + } + this.direction = direction; + } + + public SyntheticsMobileStepParams element(SyntheticsMobileStepParamsElement element) { + this.element = element; + this.unparsed |= element.unparsed; + return this; + } + + /** + * Information about the element used for a step. + * + * @return element + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ELEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsMobileStepParamsElement getElement() { + return element; + } + + public void setElement(SyntheticsMobileStepParamsElement element) { + this.element = element; + } + + public SyntheticsMobileStepParams enable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Boolean to change the state of the wifi for a toggleWiFi step type. + * + * @return enable + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnable() { + return enable; + } + + public void setEnable(Boolean enable) { + this.enable = enable; + } + + public SyntheticsMobileStepParams maxScrolls(Long maxScrolls) { + this.maxScrolls = maxScrolls; + return this; + } + + /** + * Maximum number of scrolls to do for a scrollToElement step type. + * + * @return maxScrolls + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_SCROLLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMaxScrolls() { + return maxScrolls; + } + + public void setMaxScrolls(Long maxScrolls) { + this.maxScrolls = maxScrolls; + } + + public SyntheticsMobileStepParams positions( + List positions) { + this.positions = positions; + for (SyntheticsMobileStepParamsPositionsItems item : positions) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsMobileStepParams addPositionsItem( + SyntheticsMobileStepParamsPositionsItems positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + this.unparsed |= positionsItem.unparsed; + return this; + } + + /** + * List of positions for the flick step type. The maximum is 10 flicks per step + * + * @return positions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POSITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPositions() { + return positions; + } + + public void setPositions(List positions) { + this.positions = positions; + } + + public SyntheticsMobileStepParams subtestPublicId(String subtestPublicId) { + this.subtestPublicId = subtestPublicId; + return this; + } + + /** + * Public ID of the test to be played as part of a playSubTest step type. + * + * @return subtestPublicId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBTEST_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubtestPublicId() { + return subtestPublicId; + } + + public void setSubtestPublicId(String subtestPublicId) { + this.subtestPublicId = subtestPublicId; + } + + public SyntheticsMobileStepParams value(String value) { + this.value = value; + return this; + } + + /** + * Values used in the step. Used in multiple step types. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public SyntheticsMobileStepParams variable(SyntheticsMobileStepParamsVariable variable) { + this.variable = variable; + this.unparsed |= variable.unparsed; + return this; + } + + /** + * Variable object for extractVariable step type. + * + * @return variable + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VARIABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsMobileStepParamsVariable getVariable() { + return variable; + } + + public void setVariable(SyntheticsMobileStepParamsVariable variable) { + this.variable = variable; + } + + public SyntheticsMobileStepParams withEnter(Boolean withEnter) { + this.withEnter = withEnter; + return this; + } + + /** + * Boolean to indicate if Enter should be pressed at the end of the typeText + * step type. + * + * @return withEnter + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WITH_ENTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getWithEnter() { + return withEnter; + } + + public void setWithEnter(Boolean withEnter) { + this.withEnter = withEnter; + } + + public SyntheticsMobileStepParams x(Long x) { + this.x = x; + return this; + } + + /** + * Amount to scroll by on the x axis for a scroll step type. + * + * @return x + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getX() { + return x; + } + + public void setX(Long x) { + this.x = x; + } + + public SyntheticsMobileStepParams y(Long y) { + this.y = y; + return this; + } + + /** + * Amount to scroll by on the y axis for a scroll step type. + * + * @return y + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getY() { + return y; + } + + public void setY(Long y) { + this.y = y; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsMobileStepParams + */ + @JsonAnySetter + public SyntheticsMobileStepParams putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsMobileStepParams object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsMobileStepParams syntheticsMobileStepParams = (SyntheticsMobileStepParams) o; + return Objects.equals(this.check, syntheticsMobileStepParams.check) + && Objects.equals(this.delay, syntheticsMobileStepParams.delay) + && Objects.equals(this.direction, syntheticsMobileStepParams.direction) + && Objects.equals(this.element, syntheticsMobileStepParams.element) + && Objects.equals(this.enable, syntheticsMobileStepParams.enable) + && Objects.equals(this.maxScrolls, syntheticsMobileStepParams.maxScrolls) + && Objects.equals(this.positions, syntheticsMobileStepParams.positions) + && Objects.equals(this.subtestPublicId, syntheticsMobileStepParams.subtestPublicId) + && Objects.equals(this.value, syntheticsMobileStepParams.value) + && Objects.equals(this.variable, syntheticsMobileStepParams.variable) + && Objects.equals(this.withEnter, syntheticsMobileStepParams.withEnter) + && Objects.equals(this.x, syntheticsMobileStepParams.x) + && Objects.equals(this.y, syntheticsMobileStepParams.y) + && Objects.equals( + this.additionalProperties, syntheticsMobileStepParams.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + check, + delay, + direction, + element, + enable, + maxScrolls, + positions, + subtestPublicId, + value, + variable, + withEnter, + x, + y, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsMobileStepParams {\n"); + sb.append(" check: ").append(toIndentedString(check)).append("\n"); + sb.append(" delay: ").append(toIndentedString(delay)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); + sb.append(" element: ").append(toIndentedString(element)).append("\n"); + sb.append(" enable: ").append(toIndentedString(enable)).append("\n"); + sb.append(" maxScrolls: ").append(toIndentedString(maxScrolls)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" subtestPublicId: ").append(toIndentedString(subtestPublicId)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" variable: ").append(toIndentedString(variable)).append("\n"); + sb.append(" withEnter: ").append(toIndentedString(withEnter)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsDirection.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsDirection.java new file mode 100644 index 00000000000..2d143b09e9f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsDirection.java @@ -0,0 +1,65 @@ +/* + * 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 direction of the scroll for a scrollToElement step type. */ +@JsonSerialize( + using = SyntheticsMobileStepParamsDirection.SyntheticsMobileStepParamsDirectionSerializer.class) +public class SyntheticsMobileStepParamsDirection extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("up", "down", "left", "right")); + + public static final SyntheticsMobileStepParamsDirection UP = + new SyntheticsMobileStepParamsDirection("up"); + public static final SyntheticsMobileStepParamsDirection DOWN = + new SyntheticsMobileStepParamsDirection("down"); + public static final SyntheticsMobileStepParamsDirection LEFT = + new SyntheticsMobileStepParamsDirection("left"); + public static final SyntheticsMobileStepParamsDirection RIGHT = + new SyntheticsMobileStepParamsDirection("right"); + + SyntheticsMobileStepParamsDirection(String value) { + super(value, allowedValues); + } + + public static class SyntheticsMobileStepParamsDirectionSerializer + extends StdSerializer { + public SyntheticsMobileStepParamsDirectionSerializer( + Class t) { + super(t); + } + + public SyntheticsMobileStepParamsDirectionSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsMobileStepParamsDirection value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsMobileStepParamsDirection fromValue(String value) { + return new SyntheticsMobileStepParamsDirection(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElement.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElement.java new file mode 100644 index 00000000000..2ec51f6a92c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElement.java @@ -0,0 +1,348 @@ +/* + * 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.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Information about the element used for a step. */ +@JsonPropertyOrder({ + SyntheticsMobileStepParamsElement.JSON_PROPERTY_CONTEXT, + SyntheticsMobileStepParamsElement.JSON_PROPERTY_CONTEXT_TYPE, + SyntheticsMobileStepParamsElement.JSON_PROPERTY_ELEMENT_DESCRIPTION, + SyntheticsMobileStepParamsElement.JSON_PROPERTY_MULTI_LOCATOR, + SyntheticsMobileStepParamsElement.JSON_PROPERTY_RELATIVE_POSITION, + SyntheticsMobileStepParamsElement.JSON_PROPERTY_TEXT_CONTENT, + SyntheticsMobileStepParamsElement.JSON_PROPERTY_USER_LOCATOR, + SyntheticsMobileStepParamsElement.JSON_PROPERTY_VIEW_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsMobileStepParamsElement { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONTEXT = "context"; + private String context; + + public static final String JSON_PROPERTY_CONTEXT_TYPE = "contextType"; + private SyntheticsMobileStepParamsElementContextType contextType; + + public static final String JSON_PROPERTY_ELEMENT_DESCRIPTION = "elementDescription"; + private String elementDescription; + + public static final String JSON_PROPERTY_MULTI_LOCATOR = "multiLocator"; + private Object multiLocator; + + public static final String JSON_PROPERTY_RELATIVE_POSITION = "relativePosition"; + private SyntheticsMobileStepParamsElementRelativePosition relativePosition; + + public static final String JSON_PROPERTY_TEXT_CONTENT = "textContent"; + private String textContent; + + public static final String JSON_PROPERTY_USER_LOCATOR = "userLocator"; + private SyntheticsMobileStepParamsElementUserLocator userLocator; + + public static final String JSON_PROPERTY_VIEW_NAME = "viewName"; + private String viewName; + + public SyntheticsMobileStepParamsElement context(String context) { + this.context = context; + return this; + } + + /** + * Context of the element. + * + * @return context + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public SyntheticsMobileStepParamsElement contextType( + SyntheticsMobileStepParamsElementContextType contextType) { + this.contextType = contextType; + this.unparsed |= !contextType.isValid(); + return this; + } + + /** + * Type of the context that the element is in. + * + * @return contextType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsMobileStepParamsElementContextType getContextType() { + return contextType; + } + + public void setContextType(SyntheticsMobileStepParamsElementContextType contextType) { + if (!contextType.isValid()) { + this.unparsed = true; + } + this.contextType = contextType; + } + + public SyntheticsMobileStepParamsElement elementDescription(String elementDescription) { + this.elementDescription = elementDescription; + return this; + } + + /** + * Description of the element. + * + * @return elementDescription + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ELEMENT_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getElementDescription() { + return elementDescription; + } + + public void setElementDescription(String elementDescription) { + this.elementDescription = elementDescription; + } + + public SyntheticsMobileStepParamsElement multiLocator(Object multiLocator) { + this.multiLocator = multiLocator; + return this; + } + + /** + * Multi-locator to find the element. + * + * @return multiLocator + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MULTI_LOCATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getMultiLocator() { + return multiLocator; + } + + public void setMultiLocator(Object multiLocator) { + this.multiLocator = multiLocator; + } + + public SyntheticsMobileStepParamsElement relativePosition( + SyntheticsMobileStepParamsElementRelativePosition relativePosition) { + this.relativePosition = relativePosition; + this.unparsed |= relativePosition.unparsed; + return this; + } + + /** + * Position of the action relative to the element. + * + * @return relativePosition + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIVE_POSITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsMobileStepParamsElementRelativePosition getRelativePosition() { + return relativePosition; + } + + public void setRelativePosition( + SyntheticsMobileStepParamsElementRelativePosition relativePosition) { + this.relativePosition = relativePosition; + } + + public SyntheticsMobileStepParamsElement textContent(String textContent) { + this.textContent = textContent; + return this; + } + + /** + * Text content of the element. + * + * @return textContent + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTextContent() { + return textContent; + } + + public void setTextContent(String textContent) { + this.textContent = textContent; + } + + public SyntheticsMobileStepParamsElement userLocator( + SyntheticsMobileStepParamsElementUserLocator userLocator) { + this.userLocator = userLocator; + this.unparsed |= userLocator.unparsed; + return this; + } + + /** + * User locator to find the element. + * + * @return userLocator + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_LOCATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsMobileStepParamsElementUserLocator getUserLocator() { + return userLocator; + } + + public void setUserLocator(SyntheticsMobileStepParamsElementUserLocator userLocator) { + this.userLocator = userLocator; + } + + public SyntheticsMobileStepParamsElement viewName(String viewName) { + this.viewName = viewName; + return this; + } + + /** + * Name of the view of the element. + * + * @return viewName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VIEW_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getViewName() { + return viewName; + } + + public void setViewName(String viewName) { + this.viewName = viewName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsMobileStepParamsElement + */ + @JsonAnySetter + public SyntheticsMobileStepParamsElement putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsMobileStepParamsElement object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsMobileStepParamsElement syntheticsMobileStepParamsElement = + (SyntheticsMobileStepParamsElement) o; + return Objects.equals(this.context, syntheticsMobileStepParamsElement.context) + && Objects.equals(this.contextType, syntheticsMobileStepParamsElement.contextType) + && Objects.equals( + this.elementDescription, syntheticsMobileStepParamsElement.elementDescription) + && Objects.equals(this.multiLocator, syntheticsMobileStepParamsElement.multiLocator) + && Objects.equals(this.relativePosition, syntheticsMobileStepParamsElement.relativePosition) + && Objects.equals(this.textContent, syntheticsMobileStepParamsElement.textContent) + && Objects.equals(this.userLocator, syntheticsMobileStepParamsElement.userLocator) + && Objects.equals(this.viewName, syntheticsMobileStepParamsElement.viewName) + && Objects.equals( + this.additionalProperties, syntheticsMobileStepParamsElement.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + context, + contextType, + elementDescription, + multiLocator, + relativePosition, + textContent, + userLocator, + viewName, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsMobileStepParamsElement {\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" contextType: ").append(toIndentedString(contextType)).append("\n"); + sb.append(" elementDescription: ").append(toIndentedString(elementDescription)).append("\n"); + sb.append(" multiLocator: ").append(toIndentedString(multiLocator)).append("\n"); + sb.append(" relativePosition: ").append(toIndentedString(relativePosition)).append("\n"); + sb.append(" textContent: ").append(toIndentedString(textContent)).append("\n"); + sb.append(" userLocator: ").append(toIndentedString(userLocator)).append("\n"); + sb.append(" viewName: ").append(toIndentedString(viewName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementContextType.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementContextType.java new file mode 100644 index 00000000000..8c9ba6f2579 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementContextType.java @@ -0,0 +1,65 @@ +/* + * 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; + +/** Type of the context that the element is in. */ +@JsonSerialize( + using = + SyntheticsMobileStepParamsElementContextType + .SyntheticsMobileStepParamsElementContextTypeSerializer.class) +public class SyntheticsMobileStepParamsElementContextType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("native", "web")); + + public static final SyntheticsMobileStepParamsElementContextType NATIVE = + new SyntheticsMobileStepParamsElementContextType("native"); + public static final SyntheticsMobileStepParamsElementContextType WEB = + new SyntheticsMobileStepParamsElementContextType("web"); + + SyntheticsMobileStepParamsElementContextType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsMobileStepParamsElementContextTypeSerializer + extends StdSerializer { + public SyntheticsMobileStepParamsElementContextTypeSerializer( + Class t) { + super(t); + } + + public SyntheticsMobileStepParamsElementContextTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsMobileStepParamsElementContextType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsMobileStepParamsElementContextType fromValue(String value) { + return new SyntheticsMobileStepParamsElementContextType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestInitialApplicationArguments.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementRelativePosition.java similarity index 59% rename from src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestInitialApplicationArguments.java rename to src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementRelativePosition.java index 49f4a26d474..e3fd93373e2 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestInitialApplicationArguments.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementRelativePosition.java @@ -16,37 +16,61 @@ import java.util.Map; import java.util.Objects; -/** Initial application arguments for a mobile test. */ -@JsonPropertyOrder({SyntheticsMobileTestInitialApplicationArguments.JSON_PROPERTY_PROPERTY_NAMES}) +/** Position of the action relative to the element. */ +@JsonPropertyOrder({ + SyntheticsMobileStepParamsElementRelativePosition.JSON_PROPERTY_X, + SyntheticsMobileStepParamsElementRelativePosition.JSON_PROPERTY_Y +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class SyntheticsMobileTestInitialApplicationArguments { +public class SyntheticsMobileStepParamsElementRelativePosition { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_PROPERTY_NAMES = "propertyNames"; - private SyntheticsMobileTestInitialApplicationArgumentsPropertyNames propertyNames; + public static final String JSON_PROPERTY_X = "x"; + private Long x; - public SyntheticsMobileTestInitialApplicationArguments propertyNames( - SyntheticsMobileTestInitialApplicationArgumentsPropertyNames propertyNames) { - this.propertyNames = propertyNames; - this.unparsed |= propertyNames.unparsed; + public static final String JSON_PROPERTY_Y = "y"; + private Long y; + + public SyntheticsMobileStepParamsElementRelativePosition x(Long x) { + this.x = x; + return this; + } + + /** + * The relativePosition on the x axis for the element. + * + * @return x + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getX() { + return x; + } + + public void setX(Long x) { + this.x = x; + } + + public SyntheticsMobileStepParamsElementRelativePosition y(Long y) { + this.y = y; return this; } /** - * Name of the property. + * The relativePosition on the y axis for the element. * - * @return propertyNames + * @return y */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PROPERTY_NAMES) + @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SyntheticsMobileTestInitialApplicationArgumentsPropertyNames getPropertyNames() { - return propertyNames; + public Long getY() { + return y; } - public void setPropertyNames( - SyntheticsMobileTestInitialApplicationArgumentsPropertyNames propertyNames) { - this.propertyNames = propertyNames; + public void setY(Long y) { + this.y = y; } /** @@ -61,10 +85,10 @@ public void setPropertyNames( * * @param key The arbitrary key to set * @param value The associated value - * @return SyntheticsMobileTestInitialApplicationArguments + * @return SyntheticsMobileStepParamsElementRelativePosition */ @JsonAnySetter - public SyntheticsMobileTestInitialApplicationArguments putAdditionalProperty( + public SyntheticsMobileStepParamsElementRelativePosition putAdditionalProperty( String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); @@ -96,7 +120,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this SyntheticsMobileTestInitialApplicationArguments object is equal to o. */ + /** Return true if this SyntheticsMobileStepParamsElementRelativePosition object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -105,26 +129,27 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SyntheticsMobileTestInitialApplicationArguments - syntheticsMobileTestInitialApplicationArguments = - (SyntheticsMobileTestInitialApplicationArguments) o; - return Objects.equals( - this.propertyNames, syntheticsMobileTestInitialApplicationArguments.propertyNames) + SyntheticsMobileStepParamsElementRelativePosition + syntheticsMobileStepParamsElementRelativePosition = + (SyntheticsMobileStepParamsElementRelativePosition) o; + return Objects.equals(this.x, syntheticsMobileStepParamsElementRelativePosition.x) + && Objects.equals(this.y, syntheticsMobileStepParamsElementRelativePosition.y) && Objects.equals( this.additionalProperties, - syntheticsMobileTestInitialApplicationArguments.additionalProperties); + syntheticsMobileStepParamsElementRelativePosition.additionalProperties); } @Override public int hashCode() { - return Objects.hash(propertyNames, additionalProperties); + return Objects.hash(x, y, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class SyntheticsMobileTestInitialApplicationArguments {\n"); - sb.append(" propertyNames: ").append(toIndentedString(propertyNames)).append("\n"); + sb.append("class SyntheticsMobileStepParamsElementRelativePosition {\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocator.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocator.java new file mode 100644 index 00000000000..6f25e16994e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocator.java @@ -0,0 +1,189 @@ +/* + * 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.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** User locator to find the element. */ +@JsonPropertyOrder({ + SyntheticsMobileStepParamsElementUserLocator.JSON_PROPERTY_FAIL_TEST_ON_CANNOT_LOCATE, + SyntheticsMobileStepParamsElementUserLocator.JSON_PROPERTY_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsMobileStepParamsElementUserLocator { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FAIL_TEST_ON_CANNOT_LOCATE = "failTestOnCannotLocate"; + private Boolean failTestOnCannotLocate; + + public static final String JSON_PROPERTY_VALUES = "values"; + private List values = null; + + public SyntheticsMobileStepParamsElementUserLocator failTestOnCannotLocate( + Boolean failTestOnCannotLocate) { + this.failTestOnCannotLocate = failTestOnCannotLocate; + return this; + } + + /** + * Whether if the the test should fail if the element cannot be found. + * + * @return failTestOnCannotLocate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAIL_TEST_ON_CANNOT_LOCATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFailTestOnCannotLocate() { + return failTestOnCannotLocate; + } + + public void setFailTestOnCannotLocate(Boolean failTestOnCannotLocate) { + this.failTestOnCannotLocate = failTestOnCannotLocate; + } + + public SyntheticsMobileStepParamsElementUserLocator values( + List values) { + this.values = values; + for (SyntheticsMobileStepParamsElementUserLocatorValuesItems item : values) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsMobileStepParamsElementUserLocator addValuesItem( + SyntheticsMobileStepParamsElementUserLocatorValuesItems valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + this.unparsed |= valuesItem.unparsed; + return this; + } + + /** + * Values of the user locator. + * + * @return values + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsMobileStepParamsElementUserLocator + */ + @JsonAnySetter + public SyntheticsMobileStepParamsElementUserLocator putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsMobileStepParamsElementUserLocator object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsMobileStepParamsElementUserLocator syntheticsMobileStepParamsElementUserLocator = + (SyntheticsMobileStepParamsElementUserLocator) o; + return Objects.equals( + this.failTestOnCannotLocate, + syntheticsMobileStepParamsElementUserLocator.failTestOnCannotLocate) + && Objects.equals(this.values, syntheticsMobileStepParamsElementUserLocator.values) + && Objects.equals( + this.additionalProperties, + syntheticsMobileStepParamsElementUserLocator.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(failTestOnCannotLocate, values, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsMobileStepParamsElementUserLocator {\n"); + sb.append(" failTestOnCannotLocate: ") + .append(toIndentedString(failTestOnCannotLocate)) + .append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestBinding.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocatorValuesItems.java similarity index 53% rename from src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestBinding.java rename to src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocatorValuesItems.java index 75ce37a19f4..660519acb98 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestBinding.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocatorValuesItems.java @@ -16,35 +16,66 @@ import java.util.Map; import java.util.Objects; -/** Objects describing the binding used for a mobile test. */ -@JsonPropertyOrder({SyntheticsMobileTestBinding.JSON_PROPERTY_ITEMS}) +/** A single user locator object. */ +@JsonPropertyOrder({ + SyntheticsMobileStepParamsElementUserLocatorValuesItems.JSON_PROPERTY_TYPE, + SyntheticsMobileStepParamsElementUserLocatorValuesItems.JSON_PROPERTY_VALUE +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class SyntheticsMobileTestBinding { +public class SyntheticsMobileStepParamsElementUserLocatorValuesItems { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ITEMS = "items"; - private SyntheticsMobileTestBindingItems items; + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsMobileStepParamsElementUserLocatorValuesItemsType type; - public SyntheticsMobileTestBinding items(SyntheticsMobileTestBindingItems items) { - this.items = items; - this.unparsed |= items.unparsed; + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SyntheticsMobileStepParamsElementUserLocatorValuesItems type( + SyntheticsMobileStepParamsElementUserLocatorValuesItemsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of a user locator. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsMobileStepParamsElementUserLocatorValuesItemsType getType() { + return type; + } + + public void setType(SyntheticsMobileStepParamsElementUserLocatorValuesItemsType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public SyntheticsMobileStepParamsElementUserLocatorValuesItems value(String value) { + this.value = value; return this; } /** - * Object describing the binding used for a mobile test. + * Value of a user locator. * - * @return items + * @return value */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SyntheticsMobileTestBindingItems getItems() { - return items; + public String getValue() { + return value; } - public void setItems(SyntheticsMobileTestBindingItems items) { - this.items = items; + public void setValue(String value) { + this.value = value; } /** @@ -59,10 +90,11 @@ public void setItems(SyntheticsMobileTestBindingItems items) { * * @param key The arbitrary key to set * @param value The associated value - * @return SyntheticsMobileTestBinding + * @return SyntheticsMobileStepParamsElementUserLocatorValuesItems */ @JsonAnySetter - public SyntheticsMobileTestBinding putAdditionalProperty(String key, Object value) { + public SyntheticsMobileStepParamsElementUserLocatorValuesItems putAdditionalProperty( + String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -93,7 +125,10 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this SyntheticsMobileTestBinding object is equal to o. */ + /** + * Return true if this SyntheticsMobileStepParamsElementUserLocatorValuesItems object is equal to + * o. + */ @Override public boolean equals(Object o) { if (this == o) { @@ -102,22 +137,27 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SyntheticsMobileTestBinding syntheticsMobileTestBinding = (SyntheticsMobileTestBinding) o; - return Objects.equals(this.items, syntheticsMobileTestBinding.items) + SyntheticsMobileStepParamsElementUserLocatorValuesItems + syntheticsMobileStepParamsElementUserLocatorValuesItems = + (SyntheticsMobileStepParamsElementUserLocatorValuesItems) o; + return Objects.equals(this.type, syntheticsMobileStepParamsElementUserLocatorValuesItems.type) + && Objects.equals(this.value, syntheticsMobileStepParamsElementUserLocatorValuesItems.value) && Objects.equals( - this.additionalProperties, syntheticsMobileTestBinding.additionalProperties); + this.additionalProperties, + syntheticsMobileStepParamsElementUserLocatorValuesItems.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items, additionalProperties); + return Objects.hash(type, value, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class SyntheticsMobileTestBinding {\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append("class SyntheticsMobileStepParamsElementUserLocatorValuesItems {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocatorValuesItemsType.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocatorValuesItemsType.java new file mode 100644 index 00000000000..1ff66afd5fa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsElementUserLocatorValuesItemsType.java @@ -0,0 +1,75 @@ +/* + * 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; + +/** Type of a user locator. */ +@JsonSerialize( + using = + SyntheticsMobileStepParamsElementUserLocatorValuesItemsType + .SyntheticsMobileStepParamsElementUserLocatorValuesItemsTypeSerializer.class) +public class SyntheticsMobileStepParamsElementUserLocatorValuesItemsType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "accessibility-id", "id", "ios-predicate-string", "ios-class-chain", "xpath")); + + public static final SyntheticsMobileStepParamsElementUserLocatorValuesItemsType ACCESSIBILITY_ID = + new SyntheticsMobileStepParamsElementUserLocatorValuesItemsType("accessibility-id"); + public static final SyntheticsMobileStepParamsElementUserLocatorValuesItemsType ID = + new SyntheticsMobileStepParamsElementUserLocatorValuesItemsType("id"); + public static final SyntheticsMobileStepParamsElementUserLocatorValuesItemsType + IOS_PREDICATE_STRING = + new SyntheticsMobileStepParamsElementUserLocatorValuesItemsType("ios-predicate-string"); + public static final SyntheticsMobileStepParamsElementUserLocatorValuesItemsType IOS_CLASS_CHAIN = + new SyntheticsMobileStepParamsElementUserLocatorValuesItemsType("ios-class-chain"); + public static final SyntheticsMobileStepParamsElementUserLocatorValuesItemsType XPATH = + new SyntheticsMobileStepParamsElementUserLocatorValuesItemsType("xpath"); + + SyntheticsMobileStepParamsElementUserLocatorValuesItemsType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsMobileStepParamsElementUserLocatorValuesItemsTypeSerializer + extends StdSerializer { + public SyntheticsMobileStepParamsElementUserLocatorValuesItemsTypeSerializer( + Class t) { + super(t); + } + + public SyntheticsMobileStepParamsElementUserLocatorValuesItemsTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsMobileStepParamsElementUserLocatorValuesItemsType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsMobileStepParamsElementUserLocatorValuesItemsType fromValue( + String value) { + return new SyntheticsMobileStepParamsElementUserLocatorValuesItemsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestInitialApplicationArgumentsPropertyNames.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsPositionsItems.java similarity index 62% rename from src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestInitialApplicationArgumentsPropertyNames.java rename to src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsPositionsItems.java index 56b2f5b0d4e..6cf5a986ec2 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestInitialApplicationArgumentsPropertyNames.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsPositionsItems.java @@ -16,36 +16,61 @@ import java.util.Map; import java.util.Objects; -/** Name of the property. */ +/** A description of a single position for a flick step type. */ @JsonPropertyOrder({ - SyntheticsMobileTestInitialApplicationArgumentsPropertyNames.JSON_PROPERTY_PATTERN + SyntheticsMobileStepParamsPositionsItems.JSON_PROPERTY_X, + SyntheticsMobileStepParamsPositionsItems.JSON_PROPERTY_Y }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class SyntheticsMobileTestInitialApplicationArgumentsPropertyNames { +public class SyntheticsMobileStepParamsPositionsItems { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_PATTERN = "pattern"; - private String pattern; + public static final String JSON_PROPERTY_X = "x"; + private Long x; - public SyntheticsMobileTestInitialApplicationArgumentsPropertyNames pattern(String pattern) { - this.pattern = pattern; + public static final String JSON_PROPERTY_Y = "y"; + private Long y; + + public SyntheticsMobileStepParamsPositionsItems x(Long x) { + this.x = x; return this; } /** - * The propertyNames pattern. + * The x position for the flick. * - * @return pattern + * @return x */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PATTERN) + @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPattern() { - return pattern; + public Long getX() { + return x; + } + + public void setX(Long x) { + this.x = x; } - public void setPattern(String pattern) { - this.pattern = pattern; + public SyntheticsMobileStepParamsPositionsItems y(Long y) { + this.y = y; + return this; + } + + /** + * The y position for the flick. + * + * @return y + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getY() { + return y; + } + + public void setY(Long y) { + this.y = y; } /** @@ -60,11 +85,10 @@ public void setPattern(String pattern) { * * @param key The arbitrary key to set * @param value The associated value - * @return SyntheticsMobileTestInitialApplicationArgumentsPropertyNames + * @return SyntheticsMobileStepParamsPositionsItems */ @JsonAnySetter - public SyntheticsMobileTestInitialApplicationArgumentsPropertyNames putAdditionalProperty( - String key, Object value) { + public SyntheticsMobileStepParamsPositionsItems putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -95,10 +119,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** - * Return true if this SyntheticsMobileTestInitialApplicationArgumentsPropertyNames object is - * equal to o. - */ + /** Return true if this SyntheticsMobileStepParamsPositionsItems object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -107,26 +128,26 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SyntheticsMobileTestInitialApplicationArgumentsPropertyNames - syntheticsMobileTestInitialApplicationArgumentsPropertyNames = - (SyntheticsMobileTestInitialApplicationArgumentsPropertyNames) o; - return Objects.equals( - this.pattern, syntheticsMobileTestInitialApplicationArgumentsPropertyNames.pattern) + SyntheticsMobileStepParamsPositionsItems syntheticsMobileStepParamsPositionsItems = + (SyntheticsMobileStepParamsPositionsItems) o; + return Objects.equals(this.x, syntheticsMobileStepParamsPositionsItems.x) + && Objects.equals(this.y, syntheticsMobileStepParamsPositionsItems.y) && Objects.equals( this.additionalProperties, - syntheticsMobileTestInitialApplicationArgumentsPropertyNames.additionalProperties); + syntheticsMobileStepParamsPositionsItems.additionalProperties); } @Override public int hashCode() { - return Objects.hash(pattern, additionalProperties); + return Objects.hash(x, y, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class SyntheticsMobileTestInitialApplicationArgumentsPropertyNames {\n"); - sb.append(" pattern: ").append(toIndentedString(pattern)).append("\n"); + sb.append("class SyntheticsMobileStepParamsPositionsItems {\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestCiOptions.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsVariable.java similarity index 57% rename from src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestCiOptions.java rename to src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsVariable.java index 27f1e12987b..e7d09756565 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestCiOptions.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileStepParamsVariable.java @@ -17,47 +17,69 @@ import java.util.Map; import java.util.Objects; -/** CI/CD options for a Synthetic test. */ -@JsonPropertyOrder({SyntheticsMobileTestCiOptions.JSON_PROPERTY_EXECUTION_RULE}) +/** Variable object for extractVariable step type. */ +@JsonPropertyOrder({ + SyntheticsMobileStepParamsVariable.JSON_PROPERTY_EXAMPLE, + SyntheticsMobileStepParamsVariable.JSON_PROPERTY_NAME +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class SyntheticsMobileTestCiOptions { +public class SyntheticsMobileStepParamsVariable { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_EXECUTION_RULE = "executionRule"; - private SyntheticsTestExecutionRule executionRule; + public static final String JSON_PROPERTY_EXAMPLE = "example"; + private String example; - public SyntheticsMobileTestCiOptions() {} + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SyntheticsMobileStepParamsVariable() {} @JsonCreator - public SyntheticsMobileTestCiOptions( - @JsonProperty(required = true, value = JSON_PROPERTY_EXECUTION_RULE) - SyntheticsTestExecutionRule executionRule) { - this.executionRule = executionRule; - this.unparsed |= !executionRule.isValid(); + public SyntheticsMobileStepParamsVariable( + @JsonProperty(required = true, value = JSON_PROPERTY_EXAMPLE) String example, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.example = example; + this.name = name; } - public SyntheticsMobileTestCiOptions executionRule(SyntheticsTestExecutionRule executionRule) { - this.executionRule = executionRule; - this.unparsed |= !executionRule.isValid(); + public SyntheticsMobileStepParamsVariable example(String example) { + this.example = example; return this; } /** - * Execution rule for a Synthetic test. + * An example for the variable. * - * @return executionRule + * @return example */ - @JsonProperty(JSON_PROPERTY_EXECUTION_RULE) + @JsonProperty(JSON_PROPERTY_EXAMPLE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public SyntheticsTestExecutionRule getExecutionRule() { - return executionRule; + public String getExample() { + return example; } - public void setExecutionRule(SyntheticsTestExecutionRule executionRule) { - if (!executionRule.isValid()) { - this.unparsed = true; - } - this.executionRule = executionRule; + public void setExample(String example) { + this.example = example; + } + + public SyntheticsMobileStepParamsVariable name(String name) { + this.name = name; + return this; + } + + /** + * The variable name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; } /** @@ -72,10 +94,10 @@ public void setExecutionRule(SyntheticsTestExecutionRule executionRule) { * * @param key The arbitrary key to set * @param value The associated value - * @return SyntheticsMobileTestCiOptions + * @return SyntheticsMobileStepParamsVariable */ @JsonAnySetter - public SyntheticsMobileTestCiOptions putAdditionalProperty(String key, Object value) { + public SyntheticsMobileStepParamsVariable putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -106,7 +128,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this SyntheticsMobileTestCiOptions object is equal to o. */ + /** Return true if this SyntheticsMobileStepParamsVariable object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -115,22 +137,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SyntheticsMobileTestCiOptions syntheticsMobileTestCiOptions = (SyntheticsMobileTestCiOptions) o; - return Objects.equals(this.executionRule, syntheticsMobileTestCiOptions.executionRule) + SyntheticsMobileStepParamsVariable syntheticsMobileStepParamsVariable = + (SyntheticsMobileStepParamsVariable) o; + return Objects.equals(this.example, syntheticsMobileStepParamsVariable.example) + && Objects.equals(this.name, syntheticsMobileStepParamsVariable.name) && Objects.equals( - this.additionalProperties, syntheticsMobileTestCiOptions.additionalProperties); + this.additionalProperties, syntheticsMobileStepParamsVariable.additionalProperties); } @Override public int hashCode() { - return Objects.hash(executionRule, additionalProperties); + return Objects.hash(example, name, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class SyntheticsMobileTestCiOptions {\n"); - sb.append(" executionRule: ").append(toIndentedString(executionRule)).append("\n"); + sb.append("class SyntheticsMobileStepParamsVariable {\n"); + sb.append(" example: ").append(toIndentedString(example)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTest.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTest.java index a0fed4c3bb5..ed1ed3fc638 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTest.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTest.java @@ -124,7 +124,7 @@ public SyntheticsMobileTest addDeviceIdsItem(String deviceIdsItem) { } /** - * The SyntheticsMobileTest device_ids. + * Array with the different device IDs used to run the test. * * @return deviceIds */ diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestBindingItemsRole.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestBindingItemsRole.java deleted file mode 100644 index 4fe9831450d..00000000000 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestBindingItemsRole.java +++ /dev/null @@ -1,62 +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 definition of SyntheticsMobileTestBindingItemsRole object. */ -@JsonSerialize( - using = - SyntheticsMobileTestBindingItemsRole.SyntheticsMobileTestBindingItemsRoleSerializer.class) -public class SyntheticsMobileTestBindingItemsRole extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("editor", "viewer")); - - public static final SyntheticsMobileTestBindingItemsRole EDITOR = - new SyntheticsMobileTestBindingItemsRole("editor"); - public static final SyntheticsMobileTestBindingItemsRole VIEWER = - new SyntheticsMobileTestBindingItemsRole("viewer"); - - SyntheticsMobileTestBindingItemsRole(String value) { - super(value, allowedValues); - } - - public static class SyntheticsMobileTestBindingItemsRoleSerializer - extends StdSerializer { - public SyntheticsMobileTestBindingItemsRoleSerializer( - Class t) { - super(t); - } - - public SyntheticsMobileTestBindingItemsRoleSerializer() { - this(null); - } - - @Override - public void serialize( - SyntheticsMobileTestBindingItemsRole value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static SyntheticsMobileTestBindingItemsRole fromValue(String value) { - return new SyntheticsMobileTestBindingItemsRole(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestConfig.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestConfig.java index fc0f27cfc4d..64eb07e6787 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestConfig.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestConfig.java @@ -29,15 +29,23 @@ public class SyntheticsMobileTestConfig { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_INITIAL_APPLICATION_ARGUMENTS = "initialApplicationArguments"; - private SyntheticsMobileTestInitialApplicationArguments initialApplicationArguments; + private Map initialApplicationArguments = null; public static final String JSON_PROPERTY_VARIABLES = "variables"; private List variables = null; public SyntheticsMobileTestConfig initialApplicationArguments( - SyntheticsMobileTestInitialApplicationArguments initialApplicationArguments) { + Map initialApplicationArguments) { this.initialApplicationArguments = initialApplicationArguments; - this.unparsed |= initialApplicationArguments.unparsed; + return this; + } + + public SyntheticsMobileTestConfig putInitialApplicationArgumentsItem( + String key, String initialApplicationArgumentsItem) { + if (this.initialApplicationArguments == null) { + this.initialApplicationArguments = new HashMap<>(); + } + this.initialApplicationArguments.put(key, initialApplicationArgumentsItem); return this; } @@ -49,12 +57,11 @@ public SyntheticsMobileTestConfig initialApplicationArguments( @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INITIAL_APPLICATION_ARGUMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SyntheticsMobileTestInitialApplicationArguments getInitialApplicationArguments() { + public Map getInitialApplicationArguments() { return initialApplicationArguments; } - public void setInitialApplicationArguments( - SyntheticsMobileTestInitialApplicationArguments initialApplicationArguments) { + public void setInitialApplicationArguments(Map initialApplicationArguments) { this.initialApplicationArguments = initialApplicationArguments; } diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptions.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptions.java index 84fed738a80..edf3db17a51 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptions.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptions.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -46,16 +47,16 @@ public class SyntheticsMobileTestOptions { private Boolean allowApplicationCrash; public static final String JSON_PROPERTY_BINDINGS = "bindings"; - private List bindings = null; + private List bindings = null; public static final String JSON_PROPERTY_CI = "ci"; - private SyntheticsMobileTestCiOptions ci; + private SyntheticsTestCiOptions ci; public static final String JSON_PROPERTY_DEFAULT_STEP_TIMEOUT = "defaultStepTimeout"; private Integer defaultStepTimeout; public static final String JSON_PROPERTY_DEVICE_IDS = "device_ids"; - private List deviceIds = null; + private List deviceIds = new ArrayList<>(); public static final String JSON_PROPERTY_DISABLE_AUTO_ACCEPT_ALERT = "disableAutoAcceptAlert"; private Boolean disableAutoAcceptAlert; @@ -70,7 +71,7 @@ public class SyntheticsMobileTestOptions { private String monitorName; public static final String JSON_PROPERTY_MONITOR_OPTIONS = "monitor_options"; - private SyntheticsMobileTestOptionsMonitorOptions monitorOptions; + private SyntheticsTestOptionsMonitorOptions monitorOptions; public static final String JSON_PROPERTY_MONITOR_PRIORITY = "monitor_priority"; private Integer monitorPriority; @@ -93,13 +94,27 @@ public class SyntheticsMobileTestOptions { public static final String JSON_PROPERTY_VERBOSITY = "verbosity"; private Integer verbosity; + public SyntheticsMobileTestOptions() {} + + @JsonCreator + public SyntheticsMobileTestOptions( + @JsonProperty(required = true, value = JSON_PROPERTY_DEVICE_IDS) List deviceIds, + @JsonProperty(required = true, value = JSON_PROPERTY_MOBILE_APPLICATION) + SyntheticsMobileTestsMobileApplication mobileApplication, + @JsonProperty(required = true, value = JSON_PROPERTY_TICK_EVERY) Long tickEvery) { + this.deviceIds = deviceIds; + this.mobileApplication = mobileApplication; + this.unparsed |= mobileApplication.unparsed; + this.tickEvery = tickEvery; + } + public SyntheticsMobileTestOptions allowApplicationCrash(Boolean allowApplicationCrash) { this.allowApplicationCrash = allowApplicationCrash; return this; } /** - * The SyntheticsMobileTestOptions allowApplicationCrash. + * A boolean to set if an application crash would mark the test as failed. * * @return allowApplicationCrash */ @@ -114,15 +129,17 @@ public void setAllowApplicationCrash(Boolean allowApplicationCrash) { this.allowApplicationCrash = allowApplicationCrash; } - public SyntheticsMobileTestOptions bindings(List bindings) { + public SyntheticsMobileTestOptions bindings( + List bindings) { this.bindings = bindings; - for (SyntheticsMobileTestBinding item : bindings) { + for (SyntheticsTestRestrictionPolicyBinding item : bindings) { this.unparsed |= item.unparsed; } return this; } - public SyntheticsMobileTestOptions addBindingsItem(SyntheticsMobileTestBinding bindingsItem) { + public SyntheticsMobileTestOptions addBindingsItem( + SyntheticsTestRestrictionPolicyBinding bindingsItem) { if (this.bindings == null) { this.bindings = new ArrayList<>(); } @@ -139,15 +156,15 @@ public SyntheticsMobileTestOptions addBindingsItem(SyntheticsMobileTestBinding b @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINDINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getBindings() { + public List getBindings() { return bindings; } - public void setBindings(List bindings) { + public void setBindings(List bindings) { this.bindings = bindings; } - public SyntheticsMobileTestOptions ci(SyntheticsMobileTestCiOptions ci) { + public SyntheticsMobileTestOptions ci(SyntheticsTestCiOptions ci) { this.ci = ci; this.unparsed |= ci.unparsed; return this; @@ -161,11 +178,11 @@ public SyntheticsMobileTestOptions ci(SyntheticsMobileTestCiOptions ci) { @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CI) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SyntheticsMobileTestCiOptions getCi() { + public SyntheticsTestCiOptions getCi() { return ci; } - public void setCi(SyntheticsMobileTestCiOptions ci) { + public void setCi(SyntheticsTestCiOptions ci) { this.ci = ci; } @@ -175,8 +192,7 @@ public SyntheticsMobileTestOptions defaultStepTimeout(Integer defaultStepTimeout } /** - * The SyntheticsMobileTestOptions defaultStepTimeout. minimum: 1 - * maximum: 300 + * The default timeout for steps in the test (in seconds). minimum: 1 maximum: 300 * * @return defaultStepTimeout */ @@ -197,9 +213,6 @@ public SyntheticsMobileTestOptions deviceIds(List deviceIds) { } public SyntheticsMobileTestOptions addDeviceIdsItem(String deviceIdsItem) { - if (this.deviceIds == null) { - this.deviceIds = new ArrayList<>(); - } this.deviceIds.add(deviceIdsItem); return this; } @@ -209,9 +222,8 @@ public SyntheticsMobileTestOptions addDeviceIdsItem(String deviceIdsItem) { * * @return deviceIds */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEVICE_IDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getDeviceIds() { return deviceIds; } @@ -226,7 +238,7 @@ public SyntheticsMobileTestOptions disableAutoAcceptAlert(Boolean disableAutoAcc } /** - * The SyntheticsMobileTestOptions disableAutoAcceptAlert. + * A boolean to disable auto accepting alerts. * * @return disableAutoAcceptAlert */ @@ -274,9 +286,8 @@ public SyntheticsMobileTestOptions mobileApplication( * * @return mobileApplication */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MOBILE_APPLICATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public SyntheticsMobileTestsMobileApplication getMobileApplication() { return mobileApplication; } @@ -308,26 +319,25 @@ public void setMonitorName(String monitorName) { } public SyntheticsMobileTestOptions monitorOptions( - SyntheticsMobileTestOptionsMonitorOptions monitorOptions) { + SyntheticsTestOptionsMonitorOptions monitorOptions) { this.monitorOptions = monitorOptions; this.unparsed |= monitorOptions.unparsed; return this; } /** - * Object containing the options for a mobile Synthetic test as a monitor (for example, - * renotification). + * Object containing the options for a Synthetic test as a monitor (for example, renotification). * * @return monitorOptions */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MONITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SyntheticsMobileTestOptionsMonitorOptions getMonitorOptions() { + public SyntheticsTestOptionsMonitorOptions getMonitorOptions() { return monitorOptions; } - public void setMonitorOptions(SyntheticsMobileTestOptionsMonitorOptions monitorOptions) { + public void setMonitorOptions(SyntheticsTestOptionsMonitorOptions monitorOptions) { this.monitorOptions = monitorOptions; } @@ -358,7 +368,7 @@ public SyntheticsMobileTestOptions noScreenshot(Boolean noScreenshot) { } /** - * The SyntheticsMobileTestOptions noScreenshot. + * A boolean set to not take a screenshot for the step. * * @return noScreenshot */ @@ -457,9 +467,8 @@ public SyntheticsMobileTestOptions tickEvery(Long tickEvery) { * * @return tickEvery */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TICK_EVERY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public Long getTickEvery() { return tickEvery; } @@ -474,7 +483,7 @@ public SyntheticsMobileTestOptions verbosity(Integer verbosity) { } /** - * The SyntheticsMobileTestOptions verbosity. minimum: 0 maximum: 5 + * The level of verbosity for the mobile test. minimum: 0 maximum: 5 * * @return verbosity */ diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptionsMonitorOptions.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptionsMonitorOptions.java deleted file mode 100644 index 0faec432e3d..00000000000 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptionsMonitorOptions.java +++ /dev/null @@ -1,246 +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.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** - * Object containing the options for a mobile Synthetic test as a monitor (for example, - * renotification). - */ -@JsonPropertyOrder({ - SyntheticsMobileTestOptionsMonitorOptions.JSON_PROPERTY_ESCALATION_MESSAGE, - SyntheticsMobileTestOptionsMonitorOptions.JSON_PROPERTY_NOTIFICATION_PRESET_NAME, - SyntheticsMobileTestOptionsMonitorOptions.JSON_PROPERTY_RENOTIFY_INTERVAL, - SyntheticsMobileTestOptionsMonitorOptions.JSON_PROPERTY_RENOTIFY_OCCURRENCES -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class SyntheticsMobileTestOptionsMonitorOptions { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ESCALATION_MESSAGE = "escalation_message"; - private String escalationMessage; - - public static final String JSON_PROPERTY_NOTIFICATION_PRESET_NAME = "notification_preset_name"; - private SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName notificationPresetName; - - public static final String JSON_PROPERTY_RENOTIFY_INTERVAL = "renotify_interval"; - private Long renotifyInterval; - - public static final String JSON_PROPERTY_RENOTIFY_OCCURRENCES = "renotify_occurrences"; - private Long renotifyOccurrences; - - public SyntheticsMobileTestOptionsMonitorOptions escalationMessage(String escalationMessage) { - this.escalationMessage = escalationMessage; - return this; - } - - /** - * Message to include in the escalation notification. - * - * @return escalationMessage - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ESCALATION_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEscalationMessage() { - return escalationMessage; - } - - public void setEscalationMessage(String escalationMessage) { - this.escalationMessage = escalationMessage; - } - - public SyntheticsMobileTestOptionsMonitorOptions notificationPresetName( - SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName notificationPresetName) { - this.notificationPresetName = notificationPresetName; - this.unparsed |= !notificationPresetName.isValid(); - return this; - } - - /** - * The definition of SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName - * object. - * - * @return notificationPresetName - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NOTIFICATION_PRESET_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName - getNotificationPresetName() { - return notificationPresetName; - } - - public void setNotificationPresetName( - SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName notificationPresetName) { - if (!notificationPresetName.isValid()) { - this.unparsed = true; - } - this.notificationPresetName = notificationPresetName; - } - - public SyntheticsMobileTestOptionsMonitorOptions renotifyInterval(Long renotifyInterval) { - this.renotifyInterval = renotifyInterval; - return this; - } - - /** - * Time interval before renotifying if the test is still failing (in minutes). minimum: 0 - * - * @return renotifyInterval - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_RENOTIFY_INTERVAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getRenotifyInterval() { - return renotifyInterval; - } - - public void setRenotifyInterval(Long renotifyInterval) { - this.renotifyInterval = renotifyInterval; - } - - public SyntheticsMobileTestOptionsMonitorOptions renotifyOccurrences(Long renotifyOccurrences) { - this.renotifyOccurrences = renotifyOccurrences; - return this; - } - - /** - * The SyntheticsMobileTestOptionsMonitorOptions renotify_occurrences. - * - * @return renotifyOccurrences - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_RENOTIFY_OCCURRENCES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getRenotifyOccurrences() { - return renotifyOccurrences; - } - - public void setRenotifyOccurrences(Long renotifyOccurrences) { - this.renotifyOccurrences = renotifyOccurrences; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return SyntheticsMobileTestOptionsMonitorOptions - */ - @JsonAnySetter - public SyntheticsMobileTestOptionsMonitorOptions putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this SyntheticsMobileTestOptionsMonitorOptions object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SyntheticsMobileTestOptionsMonitorOptions syntheticsMobileTestOptionsMonitorOptions = - (SyntheticsMobileTestOptionsMonitorOptions) o; - return Objects.equals( - this.escalationMessage, syntheticsMobileTestOptionsMonitorOptions.escalationMessage) - && Objects.equals( - this.notificationPresetName, - syntheticsMobileTestOptionsMonitorOptions.notificationPresetName) - && Objects.equals( - this.renotifyInterval, syntheticsMobileTestOptionsMonitorOptions.renotifyInterval) - && Objects.equals( - this.renotifyOccurrences, syntheticsMobileTestOptionsMonitorOptions.renotifyOccurrences) - && Objects.equals( - this.additionalProperties, - syntheticsMobileTestOptionsMonitorOptions.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - escalationMessage, - notificationPresetName, - renotifyInterval, - renotifyOccurrences, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SyntheticsMobileTestOptionsMonitorOptions {\n"); - sb.append(" escalationMessage: ").append(toIndentedString(escalationMessage)).append("\n"); - sb.append(" notificationPresetName: ") - .append(toIndentedString(notificationPresetName)) - .append("\n"); - sb.append(" renotifyInterval: ").append(toIndentedString(renotifyInterval)).append("\n"); - sb.append(" renotifyOccurrences: ") - .append(toIndentedString(renotifyOccurrences)) - .append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName.java deleted file mode 100644 index ecfffa4ab62..00000000000 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName.java +++ /dev/null @@ -1,74 +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 definition of SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName - * object. - */ -@JsonSerialize( - using = - SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName - .SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetNameSerializer.class) -public class SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName - extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("show_all", "hide_all", "hide_query", "hide_handles")); - - public static final SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName SHOW_ALL = - new SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName("show_all"); - public static final SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName HIDE_ALL = - new SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName("hide_all"); - public static final SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName HIDE_QUERY = - new SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName("hide_query"); - public static final SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName HIDE_HANDLES = - new SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName("hide_handles"); - - SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName(String value) { - super(value, allowedValues); - } - - public static class SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetNameSerializer - extends StdSerializer { - public SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetNameSerializer( - Class t) { - super(t); - } - - public SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetNameSerializer() { - this(null); - } - - @Override - public void serialize( - SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName fromValue( - String value) { - return new SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestsMobileApplication.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestsMobileApplication.java index 4766779041f..580939ff8b5 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestsMobileApplication.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestsMobileApplication.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -35,6 +36,20 @@ public class SyntheticsMobileTestsMobileApplication { public static final String JSON_PROPERTY_REFERENCE_TYPE = "referenceType"; private SyntheticsMobileTestsMobileApplicationReferenceType referenceType; + public SyntheticsMobileTestsMobileApplication() {} + + @JsonCreator + public SyntheticsMobileTestsMobileApplication( + @JsonProperty(required = true, value = JSON_PROPERTY_APPLICATION_ID) String applicationId, + @JsonProperty(required = true, value = JSON_PROPERTY_REFERENCE_ID) String referenceId, + @JsonProperty(required = true, value = JSON_PROPERTY_REFERENCE_TYPE) + SyntheticsMobileTestsMobileApplicationReferenceType referenceType) { + this.applicationId = applicationId; + this.referenceId = referenceId; + this.referenceType = referenceType; + this.unparsed |= !referenceType.isValid(); + } + public SyntheticsMobileTestsMobileApplication applicationId(String applicationId) { this.applicationId = applicationId; return this; @@ -45,9 +60,8 @@ public SyntheticsMobileTestsMobileApplication applicationId(String applicationId * * @return applicationId */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_APPLICATION_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getApplicationId() { return applicationId; } @@ -66,9 +80,8 @@ public SyntheticsMobileTestsMobileApplication referenceId(String referenceId) { * * @return referenceId */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_REFERENCE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getReferenceId() { return referenceId; } @@ -89,9 +102,8 @@ public SyntheticsMobileTestsMobileApplication referenceType( * * @return referenceType */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_REFERENCE_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public SyntheticsMobileTestsMobileApplicationReferenceType getReferenceType() { return referenceType; } diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestCiOptions.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestCiOptions.java index d0eb215b177..ca61b92acaa 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestCiOptions.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestCiOptions.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -25,6 +26,16 @@ public class SyntheticsTestCiOptions { public static final String JSON_PROPERTY_EXECUTION_RULE = "executionRule"; private SyntheticsTestExecutionRule executionRule; + public SyntheticsTestCiOptions() {} + + @JsonCreator + public SyntheticsTestCiOptions( + @JsonProperty(required = true, value = JSON_PROPERTY_EXECUTION_RULE) + SyntheticsTestExecutionRule executionRule) { + this.executionRule = executionRule; + this.unparsed |= !executionRule.isValid(); + } + public SyntheticsTestCiOptions executionRule(SyntheticsTestExecutionRule executionRule) { this.executionRule = executionRule; this.unparsed |= !executionRule.isValid(); @@ -36,9 +47,8 @@ public SyntheticsTestCiOptions executionRule(SyntheticsTestExecutionRule executi * * @return executionRule */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXECUTION_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public SyntheticsTestExecutionRule getExecutionRule() { return executionRule; } diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsMonitorOptions.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsMonitorOptions.java index e8d64ffa270..6afde808c10 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsMonitorOptions.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsMonitorOptions.java @@ -19,14 +19,76 @@ /** * Object containing the options for a Synthetic test as a monitor (for example, renotification). */ -@JsonPropertyOrder({SyntheticsTestOptionsMonitorOptions.JSON_PROPERTY_RENOTIFY_INTERVAL}) +@JsonPropertyOrder({ + SyntheticsTestOptionsMonitorOptions.JSON_PROPERTY_ESCALATION_MESSAGE, + SyntheticsTestOptionsMonitorOptions.JSON_PROPERTY_NOTIFICATION_PRESET_NAME, + SyntheticsTestOptionsMonitorOptions.JSON_PROPERTY_RENOTIFY_INTERVAL, + SyntheticsTestOptionsMonitorOptions.JSON_PROPERTY_RENOTIFY_OCCURRENCES +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class SyntheticsTestOptionsMonitorOptions { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ESCALATION_MESSAGE = "escalation_message"; + private String escalationMessage; + + public static final String JSON_PROPERTY_NOTIFICATION_PRESET_NAME = "notification_preset_name"; + private SyntheticsTestOptionsMonitorOptionsNotificationPresetName notificationPresetName; + public static final String JSON_PROPERTY_RENOTIFY_INTERVAL = "renotify_interval"; private Long renotifyInterval; + public static final String JSON_PROPERTY_RENOTIFY_OCCURRENCES = "renotify_occurrences"; + private Long renotifyOccurrences; + + public SyntheticsTestOptionsMonitorOptions escalationMessage(String escalationMessage) { + this.escalationMessage = escalationMessage; + return this; + } + + /** + * Message to include in the escalation notification. + * + * @return escalationMessage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ESCALATION_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEscalationMessage() { + return escalationMessage; + } + + public void setEscalationMessage(String escalationMessage) { + this.escalationMessage = escalationMessage; + } + + public SyntheticsTestOptionsMonitorOptions notificationPresetName( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName notificationPresetName) { + this.notificationPresetName = notificationPresetName; + this.unparsed |= !notificationPresetName.isValid(); + return this; + } + + /** + * The name of the preset for the notification for the monitor. + * + * @return notificationPresetName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFICATION_PRESET_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestOptionsMonitorOptionsNotificationPresetName getNotificationPresetName() { + return notificationPresetName; + } + + public void setNotificationPresetName( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName notificationPresetName) { + if (!notificationPresetName.isValid()) { + this.unparsed = true; + } + this.notificationPresetName = notificationPresetName; + } + public SyntheticsTestOptionsMonitorOptions renotifyInterval(Long renotifyInterval) { this.renotifyInterval = renotifyInterval; return this; @@ -48,6 +110,27 @@ public void setRenotifyInterval(Long renotifyInterval) { this.renotifyInterval = renotifyInterval; } + public SyntheticsTestOptionsMonitorOptions renotifyOccurrences(Long renotifyOccurrences) { + this.renotifyOccurrences = renotifyOccurrences; + return this; + } + + /** + * The number of times to renotify if the test is still failing. + * + * @return renotifyOccurrences + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RENOTIFY_OCCURRENCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRenotifyOccurrences() { + return renotifyOccurrences; + } + + public void setRenotifyOccurrences(Long renotifyOccurrences) { + this.renotifyOccurrences = renotifyOccurrences; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -106,21 +189,39 @@ public boolean equals(Object o) { SyntheticsTestOptionsMonitorOptions syntheticsTestOptionsMonitorOptions = (SyntheticsTestOptionsMonitorOptions) o; return Objects.equals( + this.escalationMessage, syntheticsTestOptionsMonitorOptions.escalationMessage) + && Objects.equals( + this.notificationPresetName, syntheticsTestOptionsMonitorOptions.notificationPresetName) + && Objects.equals( this.renotifyInterval, syntheticsTestOptionsMonitorOptions.renotifyInterval) + && Objects.equals( + this.renotifyOccurrences, syntheticsTestOptionsMonitorOptions.renotifyOccurrences) && Objects.equals( this.additionalProperties, syntheticsTestOptionsMonitorOptions.additionalProperties); } @Override public int hashCode() { - return Objects.hash(renotifyInterval, additionalProperties); + return Objects.hash( + escalationMessage, + notificationPresetName, + renotifyInterval, + renotifyOccurrences, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SyntheticsTestOptionsMonitorOptions {\n"); + sb.append(" escalationMessage: ").append(toIndentedString(escalationMessage)).append("\n"); + sb.append(" notificationPresetName: ") + .append(toIndentedString(notificationPresetName)) + .append("\n"); sb.append(" renotifyInterval: ").append(toIndentedString(renotifyInterval)).append("\n"); + sb.append(" renotifyOccurrences: ") + .append(toIndentedString(renotifyOccurrences)) + .append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsMonitorOptionsNotificationPresetName.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsMonitorOptionsNotificationPresetName.java new file mode 100644 index 00000000000..fa5942f63ee --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsMonitorOptionsNotificationPresetName.java @@ -0,0 +1,69 @@ +/* + * 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 name of the preset for the notification for the monitor. */ +@JsonSerialize( + using = + SyntheticsTestOptionsMonitorOptionsNotificationPresetName + .SyntheticsTestOptionsMonitorOptionsNotificationPresetNameSerializer.class) +public class SyntheticsTestOptionsMonitorOptionsNotificationPresetName extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("show_all", "hide_all", "hide_query", "hide_handles")); + + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName SHOW_ALL = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("show_all"); + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName HIDE_ALL = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_all"); + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName HIDE_QUERY = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_query"); + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName HIDE_HANDLES = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_handles"); + + SyntheticsTestOptionsMonitorOptionsNotificationPresetName(String value) { + super(value, allowedValues); + } + + public static class SyntheticsTestOptionsMonitorOptionsNotificationPresetNameSerializer + extends StdSerializer { + public SyntheticsTestOptionsMonitorOptionsNotificationPresetNameSerializer( + Class t) { + super(t); + } + + public SyntheticsTestOptionsMonitorOptionsNotificationPresetNameSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsTestOptionsMonitorOptionsNotificationPresetName fromValue(String value) { + return new SyntheticsTestOptionsMonitorOptionsNotificationPresetName(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsScheduling.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsScheduling.java index 08e862a6920..14d8c7c8d6b 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsScheduling.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsScheduling.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -28,11 +29,22 @@ public class SyntheticsTestOptionsScheduling { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_TIMEFRAMES = "timeframes"; - private List timeframes = null; + private List timeframes = new ArrayList<>(); public static final String JSON_PROPERTY_TIMEZONE = "timezone"; private String timezone; + public SyntheticsTestOptionsScheduling() {} + + @JsonCreator + public SyntheticsTestOptionsScheduling( + @JsonProperty(required = true, value = JSON_PROPERTY_TIMEFRAMES) + List timeframes, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMEZONE) String timezone) { + this.timeframes = timeframes; + this.timezone = timezone; + } + public SyntheticsTestOptionsScheduling timeframes( List timeframes) { this.timeframes = timeframes; @@ -44,9 +56,6 @@ public SyntheticsTestOptionsScheduling timeframes( public SyntheticsTestOptionsScheduling addTimeframesItem( SyntheticsTestOptionsSchedulingTimeframe timeframesItem) { - if (this.timeframes == null) { - this.timeframes = new ArrayList<>(); - } this.timeframes.add(timeframesItem); this.unparsed |= timeframesItem.unparsed; return this; @@ -57,9 +66,8 @@ public SyntheticsTestOptionsScheduling addTimeframesItem( * * @return timeframes */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TIMEFRAMES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTimeframes() { return timeframes; } @@ -78,9 +86,8 @@ public SyntheticsTestOptionsScheduling timezone(String timezone) { * * @return timezone */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TIMEZONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTimezone() { return timezone; } diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsSchedulingTimeframe.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsSchedulingTimeframe.java index f196c35e5b2..b65842b6945 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsSchedulingTimeframe.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestOptionsSchedulingTimeframe.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -35,6 +36,18 @@ public class SyntheticsTestOptionsSchedulingTimeframe { public static final String JSON_PROPERTY_TO = "to"; private String to; + public SyntheticsTestOptionsSchedulingTimeframe() {} + + @JsonCreator + public SyntheticsTestOptionsSchedulingTimeframe( + @JsonProperty(required = true, value = JSON_PROPERTY_DAY) Integer day, + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) String from, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) String to) { + this.day = day; + this.from = from; + this.to = to; + } + public SyntheticsTestOptionsSchedulingTimeframe day(Integer day) { this.day = day; return this; @@ -45,9 +58,8 @@ public SyntheticsTestOptionsSchedulingTimeframe day(Integer day) { * * @return day */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public Integer getDay() { return day; } @@ -66,9 +78,8 @@ public SyntheticsTestOptionsSchedulingTimeframe from(String from) { * * @return from */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getFrom() { return from; } @@ -87,9 +98,8 @@ public SyntheticsTestOptionsSchedulingTimeframe to(String to) { * * @return to */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTo() { return to; } diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestBindingItems.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRestrictionPolicyBinding.java similarity index 66% rename from src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestBindingItems.java rename to src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRestrictionPolicyBinding.java index ddfc739e1e6..d058907062a 100644 --- a/src/main/java/com/datadog/api/client/v1/model/SyntheticsMobileTestBindingItems.java +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRestrictionPolicyBinding.java @@ -18,27 +18,27 @@ import java.util.Map; import java.util.Objects; -/** Object describing the binding used for a mobile test. */ +/** Objects describing the binding used for a mobile test. */ @JsonPropertyOrder({ - SyntheticsMobileTestBindingItems.JSON_PROPERTY_PRINCIPALS, - SyntheticsMobileTestBindingItems.JSON_PROPERTY_ROLE + SyntheticsTestRestrictionPolicyBinding.JSON_PROPERTY_PRINCIPALS, + SyntheticsTestRestrictionPolicyBinding.JSON_PROPERTY_RELATION }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class SyntheticsMobileTestBindingItems { +public class SyntheticsTestRestrictionPolicyBinding { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_PRINCIPALS = "principals"; private List principals = null; - public static final String JSON_PROPERTY_ROLE = "role"; - private SyntheticsMobileTestBindingItemsRole role; + public static final String JSON_PROPERTY_RELATION = "relation"; + private SyntheticsTestRestrictionPolicyBindingRelation relation; - public SyntheticsMobileTestBindingItems principals(List principals) { + public SyntheticsTestRestrictionPolicyBinding principals(List principals) { this.principals = principals; return this; } - public SyntheticsMobileTestBindingItems addPrincipalsItem(String principalsItem) { + public SyntheticsTestRestrictionPolicyBinding addPrincipalsItem(String principalsItem) { if (this.principals == null) { this.principals = new ArrayList<>(); } @@ -62,29 +62,30 @@ public void setPrincipals(List principals) { this.principals = principals; } - public SyntheticsMobileTestBindingItems role(SyntheticsMobileTestBindingItemsRole role) { - this.role = role; - this.unparsed |= !role.isValid(); + public SyntheticsTestRestrictionPolicyBinding relation( + SyntheticsTestRestrictionPolicyBindingRelation relation) { + this.relation = relation; + this.unparsed |= !relation.isValid(); return this; } /** - * The definition of SyntheticsMobileTestBindingItemsRole object. + * The type of relation for the binding. * - * @return role + * @return relation */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ROLE) + @JsonProperty(JSON_PROPERTY_RELATION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SyntheticsMobileTestBindingItemsRole getRole() { - return role; + public SyntheticsTestRestrictionPolicyBindingRelation getRelation() { + return relation; } - public void setRole(SyntheticsMobileTestBindingItemsRole role) { - if (!role.isValid()) { + public void setRelation(SyntheticsTestRestrictionPolicyBindingRelation relation) { + if (!relation.isValid()) { this.unparsed = true; } - this.role = role; + this.relation = relation; } /** @@ -99,10 +100,10 @@ public void setRole(SyntheticsMobileTestBindingItemsRole role) { * * @param key The arbitrary key to set * @param value The associated value - * @return SyntheticsMobileTestBindingItems + * @return SyntheticsTestRestrictionPolicyBinding */ @JsonAnySetter - public SyntheticsMobileTestBindingItems putAdditionalProperty(String key, Object value) { + public SyntheticsTestRestrictionPolicyBinding putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -133,7 +134,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this SyntheticsMobileTestBindingItems object is equal to o. */ + /** Return true if this SyntheticsTestRestrictionPolicyBinding object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -142,25 +143,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SyntheticsMobileTestBindingItems syntheticsMobileTestBindingItems = - (SyntheticsMobileTestBindingItems) o; - return Objects.equals(this.principals, syntheticsMobileTestBindingItems.principals) - && Objects.equals(this.role, syntheticsMobileTestBindingItems.role) + SyntheticsTestRestrictionPolicyBinding syntheticsTestRestrictionPolicyBinding = + (SyntheticsTestRestrictionPolicyBinding) o; + return Objects.equals(this.principals, syntheticsTestRestrictionPolicyBinding.principals) + && Objects.equals(this.relation, syntheticsTestRestrictionPolicyBinding.relation) && Objects.equals( - this.additionalProperties, syntheticsMobileTestBindingItems.additionalProperties); + this.additionalProperties, syntheticsTestRestrictionPolicyBinding.additionalProperties); } @Override public int hashCode() { - return Objects.hash(principals, role, additionalProperties); + return Objects.hash(principals, relation, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class SyntheticsMobileTestBindingItems {\n"); + sb.append("class SyntheticsTestRestrictionPolicyBinding {\n"); sb.append(" principals: ").append(toIndentedString(principals)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" relation: ").append(toIndentedString(relation)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRestrictionPolicyBindingRelation.java b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRestrictionPolicyBindingRelation.java new file mode 100644 index 00000000000..51ef2da7232 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/SyntheticsTestRestrictionPolicyBindingRelation.java @@ -0,0 +1,65 @@ +/* + * 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 type of relation for the binding. */ +@JsonSerialize( + using = + SyntheticsTestRestrictionPolicyBindingRelation + .SyntheticsTestRestrictionPolicyBindingRelationSerializer.class) +public class SyntheticsTestRestrictionPolicyBindingRelation extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("editor", "viewer")); + + public static final SyntheticsTestRestrictionPolicyBindingRelation EDITOR = + new SyntheticsTestRestrictionPolicyBindingRelation("editor"); + public static final SyntheticsTestRestrictionPolicyBindingRelation VIEWER = + new SyntheticsTestRestrictionPolicyBindingRelation("viewer"); + + SyntheticsTestRestrictionPolicyBindingRelation(String value) { + super(value, allowedValues); + } + + public static class SyntheticsTestRestrictionPolicyBindingRelationSerializer + extends StdSerializer { + public SyntheticsTestRestrictionPolicyBindingRelationSerializer( + Class t) { + super(t); + } + + public SyntheticsTestRestrictionPolicyBindingRelationSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsTestRestrictionPolicyBindingRelation value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsTestRestrictionPolicyBindingRelation fromValue(String value) { + return new SyntheticsTestRestrictionPolicyBindingRelation(value); + } +} 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 a980f84c43e..fb90d094941 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 @@ -52,7 +52,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-ct Scenario: Create a browser test returns "- JSON format is wrong" response Given new "CreateSyntheticsBrowserTest" request - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -79,7 +79,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-ct Scenario: Create a browser test returns "Test quota is reached" response Given new "CreateSyntheticsBrowserTest" request - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 402 Test quota is reached @@ -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": {"initialApplicationArguments": {"propertyNames": {"pattern": "^(?!_dd).*$"}}, "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": [{"items": {"principals": [], "role": "editor"}}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"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"}}, "status": "live", "steps": [{"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": ["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"} 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": {"initialApplicationArguments": {"propertyNames": {"pattern": "^(?!_dd).*$"}}, "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": [{"items": {"principals": [], "role": "editor"}}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"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"}}, "status": "live", "steps": [{"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": ["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"} When the request is sent Then the response status is 402 Test quota is reached @@ -237,21 +237,21 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-ct Scenario: Create an API test returns "- JSON format is wrong" response Given new "CreateSyntheticsAPITest" request - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 400 - JSON format is wrong @generated @skip @team:DataDog/synthetics-ct Scenario: Create an API test returns "OK - Returns the created test details." response Given new "CreateSyntheticsAPITest" request - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 200 OK - Returns the created test details. @generated @skip @team:DataDog/synthetics-ct Scenario: Create an API test returns "Test quota is reached" response Given new "CreateSyntheticsAPITest" request - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} 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": {"initialApplicationArguments": {"propertyNames": {"pattern": "^(?!_dd).*$"}}, "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": [{"items": {"principals": [], "role": "editor"}}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"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"}}, "status": "live", "steps": [{"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": ["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"} 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": {"initialApplicationArguments": {"propertyNames": {"pattern": "^(?!_dd).*$"}}, "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": [{"items": {"principals": [], "role": "editor"}}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"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"}}, "status": "live", "steps": [{"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": ["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"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user @@ -391,7 +391,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "- JSON format is wrong" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -399,7 +399,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "- Synthetic Monitoring is not activated for the user" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user @@ -407,7 +407,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "OK" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "files": [{}], "httpVersion": "http1", "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 200 OK @@ -447,7 +447,7 @@ Feature: Synthetics Scenario: Edit an API test returns "- JSON format is wrong" response Given new "UpdateAPITest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -455,7 +455,7 @@ Feature: Synthetics Scenario: Edit an API test returns "- Synthetic Monitoring is not activated for the user" response Given new "UpdateAPITest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["chrome.laptop_large"], "httpVersion": "http1", "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user