diff --git a/.apigentools-info b/.apigentools-info index 049245e1962c..4088d8ce2a3c 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-25 20:16:59.216954", - "spec_repo_commit": "849ce45c" + "regenerated": "2024-10-28 10:23:25.177654", + "spec_repo_commit": "2e09a3ec" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-25 20:16:59.235599", - "spec_repo_commit": "849ce45c" + "regenerated": "2024-10-28 10:23:25.196971", + "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 f1b3d1b0d6da..da8a645285de 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.rb b/examples/v1/synthetics/CreateSyntheticsAPITest.rb index a23680ac2b53..78a21fd7c767 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest.rb +++ b/examples/v1/synthetics/CreateSyntheticsAPITest.rb @@ -30,7 +30,9 @@ DatadogAPIClient::V1::SyntheticsDeviceID::CHROME_LAPTOP_LARGE, ], http_version: DatadogAPIClient::V1::SyntheticsTestOptionsHTTPVersion::HTTP1, - monitor_options: DatadogAPIClient::V1::SyntheticsTestOptionsMonitorOptions.new({}), + monitor_options: DatadogAPIClient::V1::SyntheticsTestOptionsMonitorOptions.new({ + notification_preset_name: DatadogAPIClient::V1::SyntheticsTestOptionsMonitorOptionsNotificationPresetName::SHOW_ALL, + }), restricted_roles: [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", ], diff --git a/examples/v1/synthetics/UpdateBrowserTest.rb b/examples/v1/synthetics/UpdateBrowserTest.rb index fbe012167160..6fa47a10a7c5 100644 --- a/examples/v1/synthetics/UpdateBrowserTest.rb +++ b/examples/v1/synthetics/UpdateBrowserTest.rb @@ -56,7 +56,9 @@ DatadogAPIClient::V1::SyntheticsDeviceID::CHROME_LAPTOP_LARGE, ], http_version: DatadogAPIClient::V1::SyntheticsTestOptionsHTTPVersion::HTTP1, - monitor_options: DatadogAPIClient::V1::SyntheticsTestOptionsMonitorOptions.new({}), + monitor_options: DatadogAPIClient::V1::SyntheticsTestOptionsMonitorOptions.new({ + notification_preset_name: DatadogAPIClient::V1::SyntheticsTestOptionsMonitorOptionsNotificationPresetName::SHOW_ALL, + }), restricted_roles: [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", ], diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index a980f84c43e7..fb90d0949413 100644 --- a/features/v1/synthetics.feature +++ b/features/v1/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 diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7b073d1fb095..40619ea0453c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -637,18 +637,20 @@ def overrides "v1.synthetics_location" => "SyntheticsLocation", "v1.synthetics_locations" => "SyntheticsLocations", "v1.synthetics_mobile_step" => "SyntheticsMobileStep", + "v1.synthetics_mobile_step_params" => "SyntheticsMobileStepParams", + "v1.synthetics_mobile_step_params_direction" => "SyntheticsMobileStepParamsDirection", + "v1.synthetics_mobile_step_params_element" => "SyntheticsMobileStepParamsElement", + "v1.synthetics_mobile_step_params_element_context_type" => "SyntheticsMobileStepParamsElementContextType", + "v1.synthetics_mobile_step_params_element_relative_position" => "SyntheticsMobileStepParamsElementRelativePosition", + "v1.synthetics_mobile_step_params_element_user_locator" => "SyntheticsMobileStepParamsElementUserLocator", + "v1.synthetics_mobile_step_params_element_user_locator_values_items" => "SyntheticsMobileStepParamsElementUserLocatorValuesItems", + "v1.synthetics_mobile_step_params_element_user_locator_values_items_type" => "SyntheticsMobileStepParamsElementUserLocatorValuesItemsType", + "v1.synthetics_mobile_step_params_positions_items" => "SyntheticsMobileStepParamsPositionsItems", + "v1.synthetics_mobile_step_params_variable" => "SyntheticsMobileStepParamsVariable", "v1.synthetics_mobile_step_type" => "SyntheticsMobileStepType", "v1.synthetics_mobile_test" => "SyntheticsMobileTest", - "v1.synthetics_mobile_test_binding" => "SyntheticsMobileTestBinding", - "v1.synthetics_mobile_test_binding_items" => "SyntheticsMobileTestBindingItems", - "v1.synthetics_mobile_test_binding_items_role" => "SyntheticsMobileTestBindingItemsRole", - "v1.synthetics_mobile_test_ci_options" => "SyntheticsMobileTestCiOptions", "v1.synthetics_mobile_test_config" => "SyntheticsMobileTestConfig", - "v1.synthetics_mobile_test_initial_application_arguments" => "SyntheticsMobileTestInitialApplicationArguments", - "v1.synthetics_mobile_test_initial_application_arguments_property_names" => "SyntheticsMobileTestInitialApplicationArgumentsPropertyNames", "v1.synthetics_mobile_test_options" => "SyntheticsMobileTestOptions", - "v1.synthetics_mobile_test_options_monitor_options" => "SyntheticsMobileTestOptionsMonitorOptions", - "v1.synthetics_mobile_test_options_monitor_options_notification_preset_name" => "SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName", "v1.synthetics_mobile_tests_mobile_application" => "SyntheticsMobileTestsMobileApplication", "v1.synthetics_mobile_tests_mobile_application_reference_type" => "SyntheticsMobileTestsMobileApplicationReferenceType", "v1.synthetics_mobile_test_type" => "SyntheticsMobileTestType", @@ -683,6 +685,7 @@ def overrides "v1.synthetics_test_options" => "SyntheticsTestOptions", "v1.synthetics_test_options_http_version" => "SyntheticsTestOptionsHTTPVersion", "v1.synthetics_test_options_monitor_options" => "SyntheticsTestOptionsMonitorOptions", + "v1.synthetics_test_options_monitor_options_notification_preset_name" => "SyntheticsTestOptionsMonitorOptionsNotificationPresetName", "v1.synthetics_test_options_retry" => "SyntheticsTestOptionsRetry", "v1.synthetics_test_options_scheduling" => "SyntheticsTestOptionsScheduling", "v1.synthetics_test_options_scheduling_timeframe" => "SyntheticsTestOptionsSchedulingTimeframe", @@ -695,6 +698,8 @@ def overrides "v1.synthetics_test_request_certificate_item" => "SyntheticsTestRequestCertificateItem", "v1.synthetics_test_request_port" => "SyntheticsTestRequestPort", "v1.synthetics_test_request_proxy" => "SyntheticsTestRequestProxy", + "v1.synthetics_test_restriction_policy_binding" => "SyntheticsTestRestrictionPolicyBinding", + "v1.synthetics_test_restriction_policy_binding_relation" => "SyntheticsTestRestrictionPolicyBindingRelation", "v1.synthetics_test_uptime" => "SyntheticsTestUptime", "v1.synthetics_timing" => "SyntheticsTiming", "v1.synthetics_trigger_body" => "SyntheticsTriggerBody", diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step.rb index 4d075c927445..a307de4e3552 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_step.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step.rb @@ -36,8 +36,8 @@ class SyntheticsMobileStep # A boolean set to not take a screenshot for the step. attr_accessor :no_screenshot - # The parameters of the mobile step. - attr_accessor :params + # The parameters of a mobile step. + attr_reader :params # The public ID of the step. attr_accessor :public_id @@ -46,7 +46,7 @@ class SyntheticsMobileStep attr_accessor :timeout # Step type used in your mobile Synthetic test. - attr_accessor :type + attr_reader :type attr_accessor :additional_properties @@ -75,7 +75,7 @@ def self.openapi_types :'is_critical' => :'Boolean', :'name' => :'String', :'no_screenshot' => :'Boolean', - :'params' => :'Object', + :'params' => :'SyntheticsMobileStepParams', :'public_id' => :'String', :'timeout' => :'Integer', :'type' => :'SyntheticsMobileStepType' @@ -141,7 +141,10 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if !@name.nil? && @name.to_s.length > 1500 + return false if @name.nil? + return false if @name.to_s.length > 1500 + return false if @params.nil? + return false if @type.nil? true end @@ -149,12 +152,35 @@ def valid? # @param name [Object] Object to be assigned # @!visibility private def name=(name) - if !name.nil? && name.to_s.length > 1500 + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + if name.to_s.length > 1500 fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 1500.' end @name = name end + # Custom attribute writer method with validation + # @param params [Object] Object to be assigned + # @!visibility private + def params=(params) + if params.nil? + fail ArgumentError, 'invalid value for "params", params cannot be nil.' + end + @params = params + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params.rb new file mode 100644 index 000000000000..f01da18c6129 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params.rb @@ -0,0 +1,249 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # The parameters of a mobile step. + class SyntheticsMobileStepParams + include BaseGenericModel + + # Type of assertion to apply in an API test. + attr_accessor :check + + # Number of milliseconds to wait between inputs in a `typeText` step type. + attr_reader :delay + + # The direction of the scroll for a `scrollToElement` step type. + attr_accessor :direction + + # Information about the element used for a step. + attr_accessor :element + + # Boolean to change the state of the wifi for a `toggleWiFi` step type. + attr_accessor :enable + + # Maximum number of scrolls to do for a `scrollToElement` step type. + attr_accessor :max_scrolls + + # List of positions for the `flick` step type. The maximum is 10 flicks per step + attr_accessor :positions + + # Public ID of the test to be played as part of a `playSubTest` step type. + attr_accessor :subtest_public_id + + # Values used in the step. Used in multiple step types. + attr_accessor :value + + # Variable object for `extractVariable` step type. + attr_accessor :variable + + # Boolean to indicate if `Enter` should be pressed at the end of the `typeText` step type. + attr_accessor :with_enter + + # Amount to scroll by on the `x` axis for a `scroll` step type. + attr_accessor :x + + # Amount to scroll by on the `y` axis for a `scroll` step type. + attr_accessor :y + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'check' => :'check', + :'delay' => :'delay', + :'direction' => :'direction', + :'element' => :'element', + :'enable' => :'enable', + :'max_scrolls' => :'maxScrolls', + :'positions' => :'positions', + :'subtest_public_id' => :'subtestPublicId', + :'value' => :'value', + :'variable' => :'variable', + :'with_enter' => :'withEnter', + :'x' => :'x', + :'y' => :'y' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'check' => :'SyntheticsCheckType', + :'delay' => :'Integer', + :'direction' => :'SyntheticsMobileStepParamsDirection', + :'element' => :'SyntheticsMobileStepParamsElement', + :'enable' => :'Boolean', + :'max_scrolls' => :'Integer', + :'positions' => :'Array', + :'subtest_public_id' => :'String', + :'value' => :'String', + :'variable' => :'SyntheticsMobileStepParamsVariable', + :'with_enter' => :'Boolean', + :'x' => :'Integer', + :'y' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileStepParams` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'check') + self.check = attributes[:'check'] + end + + if attributes.key?(:'delay') + self.delay = attributes[:'delay'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'element') + self.element = attributes[:'element'] + end + + if attributes.key?(:'enable') + self.enable = attributes[:'enable'] + end + + if attributes.key?(:'max_scrolls') + self.max_scrolls = attributes[:'max_scrolls'] + end + + if attributes.key?(:'positions') + if (value = attributes[:'positions']).is_a?(Array) + self.positions = value + end + end + + if attributes.key?(:'subtest_public_id') + self.subtest_public_id = attributes[:'subtest_public_id'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'variable') + self.variable = attributes[:'variable'] + end + + if attributes.key?(:'with_enter') + self.with_enter = attributes[:'with_enter'] + end + + if attributes.key?(:'x') + self.x = attributes[:'x'] + end + + if attributes.key?(:'y') + self.y = attributes[:'y'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@delay.nil? && @delay > 5000 + return false if !@delay.nil? && @delay < 0 + true + end + + # Custom attribute writer method with validation + # @param delay [Object] Object to be assigned + # @!visibility private + def delay=(delay) + if !delay.nil? && delay > 5000 + fail ArgumentError, 'invalid value for "delay", must be smaller than or equal to 5000.' + end + if !delay.nil? && delay < 0 + fail ArgumentError, 'invalid value for "delay", must be greater than or equal to 0.' + end + @delay = delay + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + check == o.check && + delay == o.delay && + direction == o.direction && + element == o.element && + enable == o.enable && + max_scrolls == o.max_scrolls && + positions == o.positions && + subtest_public_id == o.subtest_public_id && + value == o.value && + variable == o.variable && + with_enter == o.with_enter && + x == o.x && + y == o.y + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [check, delay, direction, element, enable, max_scrolls, positions, subtest_public_id, value, variable, with_enter, x, y].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_direction.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_direction.rb new file mode 100644 index 000000000000..a97b39511f73 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_direction.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # The direction of the scroll for a `scrollToElement` step type. + class SyntheticsMobileStepParamsDirection + include BaseEnumModel + + UP = "up".freeze + DOWN = "down".freeze + LEFT = "left".freeze + RIGHT = "right".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element.rb new file mode 100644 index 000000000000..d4a986f66d72 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Information about the element used for a step. + class SyntheticsMobileStepParamsElement + include BaseGenericModel + + # Context of the element. + attr_accessor :context + + # Type of the context that the element is in. + attr_accessor :context_type + + # Description of the element. + attr_accessor :element_description + + # Multi-locator to find the element. + attr_accessor :multi_locator + + # Position of the action relative to the element. + attr_accessor :relative_position + + # Text content of the element. + attr_accessor :text_content + + # User locator to find the element. + attr_accessor :user_locator + + # Name of the view of the element. + attr_accessor :view_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'context' => :'context', + :'context_type' => :'contextType', + :'element_description' => :'elementDescription', + :'multi_locator' => :'multiLocator', + :'relative_position' => :'relativePosition', + :'text_content' => :'textContent', + :'user_locator' => :'userLocator', + :'view_name' => :'viewName' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'context' => :'String', + :'context_type' => :'SyntheticsMobileStepParamsElementContextType', + :'element_description' => :'String', + :'multi_locator' => :'Object', + :'relative_position' => :'SyntheticsMobileStepParamsElementRelativePosition', + :'text_content' => :'String', + :'user_locator' => :'SyntheticsMobileStepParamsElementUserLocator', + :'view_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileStepParamsElement` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'context') + self.context = attributes[:'context'] + end + + if attributes.key?(:'context_type') + self.context_type = attributes[:'context_type'] + end + + if attributes.key?(:'element_description') + self.element_description = attributes[:'element_description'] + end + + if attributes.key?(:'multi_locator') + self.multi_locator = attributes[:'multi_locator'] + end + + if attributes.key?(:'relative_position') + self.relative_position = attributes[:'relative_position'] + end + + if attributes.key?(:'text_content') + self.text_content = attributes[:'text_content'] + end + + if attributes.key?(:'user_locator') + self.user_locator = attributes[:'user_locator'] + end + + if attributes.key?(:'view_name') + self.view_name = attributes[:'view_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + context == o.context && + context_type == o.context_type && + element_description == o.element_description && + multi_locator == o.multi_locator && + relative_position == o.relative_position && + text_content == o.text_content && + user_locator == o.user_locator && + view_name == o.view_name + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [context, context_type, element_description, multi_locator, relative_position, text_content, user_locator, view_name].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_context_type.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_context_type.rb new file mode 100644 index 000000000000..96b070a5c823 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_context_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Type of the context that the element is in. + class SyntheticsMobileStepParamsElementContextType + include BaseEnumModel + + NATIVE = "native".freeze + WEB = "web".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test_initial_application_arguments.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_relative_position.rb similarity index 79% rename from lib/datadog_api_client/v1/models/synthetics_mobile_test_initial_application_arguments.rb rename to lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_relative_position.rb index 2aa977a77dfc..484ec7c6af5e 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_initial_application_arguments.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_relative_position.rb @@ -17,12 +17,15 @@ require 'time' module DatadogAPIClient::V1 - # Initial application arguments for a mobile test. - class SyntheticsMobileTestInitialApplicationArguments + # Position of the action relative to the element. + class SyntheticsMobileStepParamsElementRelativePosition include BaseGenericModel - # Name of the property. - attr_accessor :property_names + # The `relativePosition` on the `x` axis for the element. + attr_accessor :x + + # The `relativePosition` on the `y` axis for the element. + attr_accessor :y attr_accessor :additional_properties @@ -30,7 +33,8 @@ class SyntheticsMobileTestInitialApplicationArguments # @!visibility private def self.attribute_map { - :'property_names' => :'propertyNames' + :'x' => :'x', + :'y' => :'y' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'property_names' => :'SyntheticsMobileTestInitialApplicationArgumentsPropertyNames' + :'x' => :'Integer', + :'y' => :'Integer' } end @@ -47,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileTestInitialApplicationArguments` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileStepParamsElementRelativePosition` initialize method" end self.additional_properties = {} @@ -60,8 +65,12 @@ def initialize(attributes = {}) end } - if attributes.key?(:'property_names') - self.property_names = attributes[:'property_names'] + if attributes.key?(:'x') + self.x = attributes[:'x'] + end + + if attributes.key?(:'y') + self.y = attributes[:'y'] end end @@ -91,7 +100,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - property_names == o.property_names + x == o.x && + y == o.y additional_properties == o.additional_properties end @@ -99,7 +109,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [property_names].hash + [x, y].hash end end end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator.rb new file mode 100644 index 000000000000..975d4db4a45e --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # User locator to find the element. + class SyntheticsMobileStepParamsElementUserLocator + include BaseGenericModel + + # Whether if the the test should fail if the element cannot be found. + attr_accessor :fail_test_on_cannot_locate + + # Values of the user locator. + attr_accessor :values + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fail_test_on_cannot_locate' => :'failTestOnCannotLocate', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fail_test_on_cannot_locate' => :'Boolean', + :'values' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileStepParamsElementUserLocator` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'fail_test_on_cannot_locate') + self.fail_test_on_cannot_locate = attributes[:'fail_test_on_cannot_locate'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + fail_test_on_cannot_locate == o.fail_test_on_cannot_locate && + values == o.values + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fail_test_on_cannot_locate, values].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test_initial_application_arguments_property_names.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator_values_items.rb similarity index 77% rename from lib/datadog_api_client/v1/models/synthetics_mobile_test_initial_application_arguments_property_names.rb rename to lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator_values_items.rb index 18b48cbebe6a..4e15521154af 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_initial_application_arguments_property_names.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator_values_items.rb @@ -17,12 +17,15 @@ require 'time' module DatadogAPIClient::V1 - # Name of the property. - class SyntheticsMobileTestInitialApplicationArgumentsPropertyNames + # A single user locator object. + class SyntheticsMobileStepParamsElementUserLocatorValuesItems include BaseGenericModel - # The `propertyNames` `pattern`. - attr_accessor :pattern + # Type of a user locator. + attr_accessor :type + + # Value of a user locator. + attr_accessor :value attr_accessor :additional_properties @@ -30,7 +33,8 @@ class SyntheticsMobileTestInitialApplicationArgumentsPropertyNames # @!visibility private def self.attribute_map { - :'pattern' => :'pattern' + :'type' => :'type', + :'value' => :'value' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'pattern' => :'String' + :'type' => :'SyntheticsMobileStepParamsElementUserLocatorValuesItemsType', + :'value' => :'String' } end @@ -47,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileTestInitialApplicationArgumentsPropertyNames` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileStepParamsElementUserLocatorValuesItems` initialize method" end self.additional_properties = {} @@ -60,8 +65,12 @@ def initialize(attributes = {}) end } - if attributes.key?(:'pattern') - self.pattern = attributes[:'pattern'] + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] end end @@ -91,7 +100,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - pattern == o.pattern + type == o.type && + value == o.value additional_properties == o.additional_properties end @@ -99,7 +109,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [pattern].hash + [type, value].hash end end end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator_values_items_type.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator_values_items_type.rb new file mode 100644 index 000000000000..daa666f12947 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator_values_items_type.rb @@ -0,0 +1,30 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Type of a user locator. + class SyntheticsMobileStepParamsElementUserLocatorValuesItemsType + include BaseEnumModel + + ACCESSIBILITY_ID = "accessibility-id".freeze + ID = "id".freeze + IOS_PREDICATE_STRING = "ios-predicate-string".freeze + IOS_CLASS_CHAIN = "ios-class-chain".freeze + XPATH = "xpath".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_positions_items.rb similarity index 80% rename from lib/datadog_api_client/v1/models/synthetics_mobile_test_binding.rb rename to lib/datadog_api_client/v1/models/synthetics_mobile_step_params_positions_items.rb index 4e384d0184eb..fde6ff4fc394 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_positions_items.rb @@ -17,12 +17,15 @@ require 'time' module DatadogAPIClient::V1 - # Objects describing the binding used for a mobile test. - class SyntheticsMobileTestBinding + # A description of a single position for a `flick` step type. + class SyntheticsMobileStepParamsPositionsItems include BaseGenericModel - # Object describing the binding used for a mobile test. - attr_accessor :items + # The `x` position for the flick. + attr_accessor :x + + # The `y` position for the flick. + attr_accessor :y attr_accessor :additional_properties @@ -30,7 +33,8 @@ class SyntheticsMobileTestBinding # @!visibility private def self.attribute_map { - :'items' => :'items' + :'x' => :'x', + :'y' => :'y' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'items' => :'SyntheticsMobileTestBindingItems' + :'x' => :'Integer', + :'y' => :'Integer' } end @@ -47,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileTestBinding` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileStepParamsPositionsItems` initialize method" end self.additional_properties = {} @@ -60,8 +65,12 @@ def initialize(attributes = {}) end } - if attributes.key?(:'items') - self.items = attributes[:'items'] + if attributes.key?(:'x') + self.x = attributes[:'x'] + end + + if attributes.key?(:'y') + self.y = attributes[:'y'] end end @@ -91,7 +100,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - items == o.items + x == o.x && + y == o.y additional_properties == o.additional_properties end @@ -99,7 +109,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [items].hash + [x, y].hash end end end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test_ci_options.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_variable.rb similarity index 69% rename from lib/datadog_api_client/v1/models/synthetics_mobile_test_ci_options.rb rename to lib/datadog_api_client/v1/models/synthetics_mobile_step_params_variable.rb index c5c090607aa6..5d1250ca2232 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_ci_options.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_variable.rb @@ -17,12 +17,15 @@ require 'time' module DatadogAPIClient::V1 - # CI/CD options for a Synthetic test. - class SyntheticsMobileTestCiOptions + # Variable object for `extractVariable` step type. + class SyntheticsMobileStepParamsVariable include BaseGenericModel - # Execution rule for a Synthetic test. - attr_reader :execution_rule + # An example for the variable. + attr_reader :example + + # The variable name. + attr_reader :name attr_accessor :additional_properties @@ -30,7 +33,8 @@ class SyntheticsMobileTestCiOptions # @!visibility private def self.attribute_map { - :'execution_rule' => :'executionRule' + :'example' => :'example', + :'name' => :'name' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'execution_rule' => :'SyntheticsTestExecutionRule' + :'example' => :'String', + :'name' => :'String' } end @@ -47,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileTestCiOptions` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileStepParamsVariable` initialize method" end self.additional_properties = {} @@ -60,8 +65,12 @@ def initialize(attributes = {}) end } - if attributes.key?(:'execution_rule') - self.execution_rule = attributes[:'execution_rule'] + if attributes.key?(:'example') + self.example = attributes[:'example'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] end end @@ -69,18 +78,29 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @execution_rule.nil? + return false if @example.nil? + return false if @name.nil? true end # Custom attribute writer method with validation - # @param execution_rule [Object] Object to be assigned + # @param example [Object] Object to be assigned + # @!visibility private + def example=(example) + if example.nil? + fail ArgumentError, 'invalid value for "example", example cannot be nil.' + end + @example = example + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned # @!visibility private - def execution_rule=(execution_rule) - if execution_rule.nil? - fail ArgumentError, 'invalid value for "execution_rule", execution_rule cannot be nil.' + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' end - @execution_rule = execution_rule + @name = name end # Returns the object in the form of hash, with additionalProperties support. @@ -109,7 +129,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - execution_rule == o.execution_rule + example == o.example && + name == o.name additional_properties == o.additional_properties end @@ -117,7 +138,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [execution_rule].hash + [example, name].hash end end end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_test.rb index 514d43c3ea65..2fa9f198d446 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_test.rb @@ -24,7 +24,7 @@ class SyntheticsMobileTest # Configuration object for a Synthetic mobile test. attr_reader :config - # The `SyntheticsMobileTest` `device_ids`. + # Array with the different device IDs used to run the test. attr_accessor :device_ids # Notification message associated with the test. diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test_config.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_test_config.rb index 9081fabe6409..e72a601dea66 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_config.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_test_config.rb @@ -42,7 +42,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'initial_application_arguments' => :'SyntheticsMobileTestInitialApplicationArguments', + :'initial_application_arguments' => :'Hash', :'variables' => :'Array' } end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test_options.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_test_options.rb index 641fcb4a44fc..0fecd6134caa 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_options.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_test_options.rb @@ -21,7 +21,7 @@ module DatadogAPIClient::V1 class SyntheticsMobileTestOptions include BaseGenericModel - # The `SyntheticsMobileTestOptions` `allowApplicationCrash`. + # A boolean to set if an application crash would mark the test as failed. attr_accessor :allow_application_crash # Array of bindings used for the mobile test. @@ -30,32 +30,32 @@ class SyntheticsMobileTestOptions # CI/CD options for a Synthetic test. attr_accessor :ci - # The `SyntheticsMobileTestOptions` `defaultStepTimeout`. + # The default timeout for steps in the test (in seconds). attr_reader :default_step_timeout # For mobile test, array with the different device IDs used to run the test. - attr_accessor :device_ids + attr_reader :device_ids - # The `SyntheticsMobileTestOptions` `disableAutoAcceptAlert`. + # A boolean to disable auto accepting alerts. attr_accessor :disable_auto_accept_alert # Minimum amount of time in failure required to trigger an alert. attr_reader :min_failure_duration # Mobile application for mobile synthetics test. - attr_accessor :mobile_application + attr_reader :mobile_application # The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs. attr_accessor :monitor_name - # Object containing the options for a mobile Synthetic test as a monitor + # Object containing the options for a Synthetic test as a monitor # (for example, renotification). attr_accessor :monitor_options # Integer from 1 (high) to 5 (low) indicating alert severity. attr_reader :monitor_priority - # The `SyntheticsMobileTestOptions` `noScreenshot`. + # A boolean set to not take a screenshot for the step. attr_accessor :no_screenshot # A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. @@ -70,7 +70,7 @@ class SyntheticsMobileTestOptions # The frequency at which to run the Synthetic test (in seconds). attr_reader :tick_every - # The `SyntheticsMobileTestOptions` `verbosity`. + # The level of verbosity for the mobile test. attr_reader :verbosity attr_accessor :additional_properties @@ -104,15 +104,15 @@ def self.attribute_map def self.openapi_types { :'allow_application_crash' => :'Boolean', - :'bindings' => :'Array', - :'ci' => :'SyntheticsMobileTestCiOptions', + :'bindings' => :'Array', + :'ci' => :'SyntheticsTestCiOptions', :'default_step_timeout' => :'Integer', :'device_ids' => :'Array', :'disable_auto_accept_alert' => :'Boolean', :'min_failure_duration' => :'Integer', :'mobile_application' => :'SyntheticsMobileTestsMobileApplication', :'monitor_name' => :'String', - :'monitor_options' => :'SyntheticsMobileTestOptionsMonitorOptions', + :'monitor_options' => :'SyntheticsTestOptionsMonitorOptions', :'monitor_priority' => :'Integer', :'no_screenshot' => :'Boolean', :'restricted_roles' => :'Array', @@ -222,12 +222,15 @@ def initialize(attributes = {}) def valid? return false if !@default_step_timeout.nil? && @default_step_timeout > 300 return false if !@default_step_timeout.nil? && @default_step_timeout < 1 + return false if @device_ids.nil? return false if !@min_failure_duration.nil? && @min_failure_duration > 7200 return false if !@min_failure_duration.nil? && @min_failure_duration < 0 + return false if @mobile_application.nil? return false if !@monitor_priority.nil? && @monitor_priority > 5 return false if !@monitor_priority.nil? && @monitor_priority < 1 - return false if !@tick_every.nil? && @tick_every > 604800 - return false if !@tick_every.nil? && @tick_every < 300 + return false if @tick_every.nil? + return false if @tick_every > 604800 + return false if @tick_every < 300 return false if !@verbosity.nil? && @verbosity > 5 return false if !@verbosity.nil? && @verbosity < 0 true @@ -246,6 +249,16 @@ def default_step_timeout=(default_step_timeout) @default_step_timeout = default_step_timeout end + # Custom attribute writer method with validation + # @param device_ids [Object] Object to be assigned + # @!visibility private + def device_ids=(device_ids) + if device_ids.nil? + fail ArgumentError, 'invalid value for "device_ids", device_ids cannot be nil.' + end + @device_ids = device_ids + end + # Custom attribute writer method with validation # @param min_failure_duration [Object] Object to be assigned # @!visibility private @@ -259,6 +272,16 @@ def min_failure_duration=(min_failure_duration) @min_failure_duration = min_failure_duration end + # Custom attribute writer method with validation + # @param mobile_application [Object] Object to be assigned + # @!visibility private + def mobile_application=(mobile_application) + if mobile_application.nil? + fail ArgumentError, 'invalid value for "mobile_application", mobile_application cannot be nil.' + end + @mobile_application = mobile_application + end + # Custom attribute writer method with validation # @param monitor_priority [Object] Object to be assigned # @!visibility private @@ -276,10 +299,13 @@ def monitor_priority=(monitor_priority) # @param tick_every [Object] Object to be assigned # @!visibility private def tick_every=(tick_every) - if !tick_every.nil? && tick_every > 604800 + if tick_every.nil? + fail ArgumentError, 'invalid value for "tick_every", tick_every cannot be nil.' + end + if tick_every > 604800 fail ArgumentError, 'invalid value for "tick_every", must be smaller than or equal to 604800.' end - if !tick_every.nil? && tick_every < 300 + if tick_every < 300 fail ArgumentError, 'invalid value for "tick_every", must be greater than or equal to 300.' end @tick_every = tick_every diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test_options_monitor_options.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_test_options_monitor_options.rb deleted file mode 100644 index fea328d49c60..000000000000 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_options_monitor_options.rb +++ /dev/null @@ -1,155 +0,0 @@ -=begin -#Datadog API V1 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V1 - # Object containing the options for a mobile Synthetic test as a monitor - # (for example, renotification). - class SyntheticsMobileTestOptionsMonitorOptions - include BaseGenericModel - - # Message to include in the escalation notification. - attr_accessor :escalation_message - - # The definition of `SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName` object. - attr_accessor :notification_preset_name - - # Time interval before renotifying if the test is still failing - # (in minutes). - attr_reader :renotify_interval - - # The `SyntheticsMobileTestOptionsMonitorOptions` `renotify_occurrences`. - attr_accessor :renotify_occurrences - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'escalation_message' => :'escalation_message', - :'notification_preset_name' => :'notification_preset_name', - :'renotify_interval' => :'renotify_interval', - :'renotify_occurrences' => :'renotify_occurrences' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'escalation_message' => :'String', - :'notification_preset_name' => :'SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName', - :'renotify_interval' => :'Integer', - :'renotify_occurrences' => :'Integer' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileTestOptionsMonitorOptions` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'escalation_message') - self.escalation_message = attributes[:'escalation_message'] - end - - if attributes.key?(:'notification_preset_name') - self.notification_preset_name = attributes[:'notification_preset_name'] - end - - if attributes.key?(:'renotify_interval') - self.renotify_interval = attributes[:'renotify_interval'] - end - - if attributes.key?(:'renotify_occurrences') - self.renotify_occurrences = attributes[:'renotify_occurrences'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if !@renotify_interval.nil? && @renotify_interval < 0 - true - end - - # Custom attribute writer method with validation - # @param renotify_interval [Object] Object to be assigned - # @!visibility private - def renotify_interval=(renotify_interval) - if !renotify_interval.nil? && renotify_interval < 0 - fail ArgumentError, 'invalid value for "renotify_interval", must be greater than or equal to 0.' - end - @renotify_interval = renotify_interval - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - escalation_message == o.escalation_message && - notification_preset_name == o.notification_preset_name && - renotify_interval == o.renotify_interval && - renotify_occurrences == o.renotify_occurrences - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [escalation_message, notification_preset_name, renotify_interval, renotify_occurrences].hash - end - end -end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_tests_mobile_application.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_tests_mobile_application.rb index 6e87ed76c63e..d21b90a01d2d 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_tests_mobile_application.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_tests_mobile_application.rb @@ -28,7 +28,7 @@ class SyntheticsMobileTestsMobileApplication attr_reader :reference_id # Reference type for the mobile application for a mobile synthetics test. - attr_accessor :reference_type + attr_reader :reference_type attr_accessor :additional_properties @@ -87,8 +87,11 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if !@application_id.nil? && @application_id.to_s.length > 1500 - return false if !@reference_id.nil? && @reference_id.to_s.length > 1500 + return false if @application_id.nil? + return false if @application_id.to_s.length > 1500 + return false if @reference_id.nil? + return false if @reference_id.to_s.length > 1500 + return false if @reference_type.nil? true end @@ -96,7 +99,10 @@ def valid? # @param application_id [Object] Object to be assigned # @!visibility private def application_id=(application_id) - if !application_id.nil? && application_id.to_s.length > 1500 + if application_id.nil? + fail ArgumentError, 'invalid value for "application_id", application_id cannot be nil.' + end + if application_id.to_s.length > 1500 fail ArgumentError, 'invalid value for "application_id", the character length must be smaller than or equal to 1500.' end @application_id = application_id @@ -106,12 +112,25 @@ def application_id=(application_id) # @param reference_id [Object] Object to be assigned # @!visibility private def reference_id=(reference_id) - if !reference_id.nil? && reference_id.to_s.length > 1500 + if reference_id.nil? + fail ArgumentError, 'invalid value for "reference_id", reference_id cannot be nil.' + end + if reference_id.to_s.length > 1500 fail ArgumentError, 'invalid value for "reference_id", the character length must be smaller than or equal to 1500.' end @reference_id = reference_id end + # Custom attribute writer method with validation + # @param reference_type [Object] Object to be assigned + # @!visibility private + def reference_type=(reference_type) + if reference_type.nil? + fail ArgumentError, 'invalid value for "reference_type", reference_type cannot be nil.' + end + @reference_type = reference_type + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v1/models/synthetics_test_ci_options.rb b/lib/datadog_api_client/v1/models/synthetics_test_ci_options.rb index 4fd4d6b43235..ba3f2fbda182 100644 --- a/lib/datadog_api_client/v1/models/synthetics_test_ci_options.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_ci_options.rb @@ -22,7 +22,7 @@ class SyntheticsTestCiOptions include BaseGenericModel # Execution rule for a Synthetic test. - attr_accessor :execution_rule + attr_reader :execution_rule attr_accessor :additional_properties @@ -65,6 +65,24 @@ def initialize(attributes = {}) end end + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @execution_rule.nil? + true + end + + # Custom attribute writer method with validation + # @param execution_rule [Object] Object to be assigned + # @!visibility private + def execution_rule=(execution_rule) + if execution_rule.nil? + fail ArgumentError, 'invalid value for "execution_rule", execution_rule cannot be nil.' + end + @execution_rule = execution_rule + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options.rb b/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options.rb index 1a1e34bb9625..62c400c72f95 100644 --- a/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options.rb @@ -22,17 +22,29 @@ module DatadogAPIClient::V1 class SyntheticsTestOptionsMonitorOptions include BaseGenericModel + # Message to include in the escalation notification. + attr_accessor :escalation_message + + # The name of the preset for the notification for the monitor. + attr_accessor :notification_preset_name + # Time interval before renotifying if the test is still failing # (in minutes). attr_reader :renotify_interval + # The number of times to renotify if the test is still failing. + attr_accessor :renotify_occurrences + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { - :'renotify_interval' => :'renotify_interval' + :'escalation_message' => :'escalation_message', + :'notification_preset_name' => :'notification_preset_name', + :'renotify_interval' => :'renotify_interval', + :'renotify_occurrences' => :'renotify_occurrences' } end @@ -40,7 +52,10 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'renotify_interval' => :'Integer' + :'escalation_message' => :'String', + :'notification_preset_name' => :'SyntheticsTestOptionsMonitorOptionsNotificationPresetName', + :'renotify_interval' => :'Integer', + :'renotify_occurrences' => :'Integer' } end @@ -62,9 +77,21 @@ def initialize(attributes = {}) end } + if attributes.key?(:'escalation_message') + self.escalation_message = attributes[:'escalation_message'] + end + + if attributes.key?(:'notification_preset_name') + self.notification_preset_name = attributes[:'notification_preset_name'] + end + if attributes.key?(:'renotify_interval') self.renotify_interval = attributes[:'renotify_interval'] end + + if attributes.key?(:'renotify_occurrences') + self.renotify_occurrences = attributes[:'renotify_occurrences'] + end end # Check to see if the all the properties in the model are valid @@ -111,7 +138,10 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - renotify_interval == o.renotify_interval + escalation_message == o.escalation_message && + notification_preset_name == o.notification_preset_name && + renotify_interval == o.renotify_interval && + renotify_occurrences == o.renotify_occurrences additional_properties == o.additional_properties end @@ -119,7 +149,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [renotify_interval].hash + [escalation_message, notification_preset_name, renotify_interval, renotify_occurrences].hash end end end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test_options_monitor_options_notification_preset_name.rb b/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options_notification_preset_name.rb similarity index 81% rename from lib/datadog_api_client/v1/models/synthetics_mobile_test_options_monitor_options_notification_preset_name.rb rename to lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options_notification_preset_name.rb index 56f4edcaa882..5b0724848602 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_options_monitor_options_notification_preset_name.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_options_monitor_options_notification_preset_name.rb @@ -17,8 +17,8 @@ require 'time' module DatadogAPIClient::V1 - # The definition of `SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName` object. - class SyntheticsMobileTestOptionsMonitorOptionsNotificationPresetName + # The name of the preset for the notification for the monitor. + class SyntheticsTestOptionsMonitorOptionsNotificationPresetName include BaseEnumModel SHOW_ALL = "show_all".freeze diff --git a/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling.rb b/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling.rb index ae829098db7a..ea8df5f130b2 100644 --- a/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling.rb @@ -22,10 +22,10 @@ class SyntheticsTestOptionsScheduling include BaseGenericModel # Array containing objects describing the scheduling pattern to apply to each day. - attr_accessor :timeframes + attr_reader :timeframes # Timezone in which the timeframe is based. - attr_accessor :timezone + attr_reader :timezone attr_accessor :additional_properties @@ -76,6 +76,35 @@ def initialize(attributes = {}) end end + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @timeframes.nil? + return false if @timezone.nil? + true + end + + # Custom attribute writer method with validation + # @param timeframes [Object] Object to be assigned + # @!visibility private + def timeframes=(timeframes) + if timeframes.nil? + fail ArgumentError, 'invalid value for "timeframes", timeframes cannot be nil.' + end + @timeframes = timeframes + end + + # Custom attribute writer method with validation + # @param timezone [Object] Object to be assigned + # @!visibility private + def timezone=(timezone) + if timezone.nil? + fail ArgumentError, 'invalid value for "timezone", timezone cannot be nil.' + end + @timezone = timezone + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling_timeframe.rb b/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling_timeframe.rb index 40c2dd589300..4d72c2d2286e 100644 --- a/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling_timeframe.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling_timeframe.rb @@ -25,10 +25,10 @@ class SyntheticsTestOptionsSchedulingTimeframe attr_reader :day # The hour of the day on which scheduling starts. - attr_accessor :from + attr_reader :from # The hour of the day on which scheduling ends. - attr_accessor :to + attr_reader :to attr_accessor :additional_properties @@ -87,8 +87,11 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if !@day.nil? && @day > 7 - return false if !@day.nil? && @day < 1 + return false if @day.nil? + return false if @day > 7 + return false if @day < 1 + return false if @from.nil? + return false if @to.nil? true end @@ -96,15 +99,38 @@ def valid? # @param day [Object] Object to be assigned # @!visibility private def day=(day) - if !day.nil? && day > 7 + if day.nil? + fail ArgumentError, 'invalid value for "day", day cannot be nil.' + end + if day > 7 fail ArgumentError, 'invalid value for "day", must be smaller than or equal to 7.' end - if !day.nil? && day < 1 + if day < 1 fail ArgumentError, 'invalid value for "day", must be greater than or equal to 1.' end @day = day end + # Custom attribute writer method with validation + # @param from [Object] Object to be assigned + # @!visibility private + def from=(from) + if from.nil? + fail ArgumentError, 'invalid value for "from", from cannot be nil.' + end + @from = from + end + + # Custom attribute writer method with validation + # @param to [Object] Object to be assigned + # @!visibility private + def to=(to) + if to.nil? + fail ArgumentError, 'invalid value for "to", to cannot be nil.' + end + @to = to + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding_items.rb b/lib/datadog_api_client/v1/models/synthetics_test_restriction_policy_binding.rb similarity index 84% rename from lib/datadog_api_client/v1/models/synthetics_mobile_test_binding_items.rb rename to lib/datadog_api_client/v1/models/synthetics_test_restriction_policy_binding.rb index 432eb356abbc..b780c24541a4 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding_items.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_restriction_policy_binding.rb @@ -17,15 +17,15 @@ require 'time' module DatadogAPIClient::V1 - # Object describing the binding used for a mobile test. - class SyntheticsMobileTestBindingItems + # Objects describing the binding used for a mobile test. + class SyntheticsTestRestrictionPolicyBinding include BaseGenericModel # List of principals for a mobile test binding. attr_accessor :principals - # The definition of `SyntheticsMobileTestBindingItemsRole` object. - attr_accessor :role + # The type of relation for the binding. + attr_accessor :relation attr_accessor :additional_properties @@ -34,7 +34,7 @@ class SyntheticsMobileTestBindingItems def self.attribute_map { :'principals' => :'principals', - :'role' => :'role' + :'relation' => :'relation' } end @@ -43,7 +43,7 @@ def self.attribute_map def self.openapi_types { :'principals' => :'Array', - :'role' => :'SyntheticsMobileTestBindingItemsRole' + :'relation' => :'SyntheticsTestRestrictionPolicyBindingRelation' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsMobileTestBindingItems` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsTestRestrictionPolicyBinding` initialize method" end self.additional_properties = {} @@ -71,8 +71,8 @@ def initialize(attributes = {}) end end - if attributes.key?(:'role') - self.role = attributes[:'role'] + if attributes.key?(:'relation') + self.relation = attributes[:'relation'] end end @@ -103,7 +103,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && principals == o.principals && - role == o.role + relation == o.relation additional_properties == o.additional_properties end @@ -111,7 +111,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [principals, role].hash + [principals, relation].hash end end end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding_items_role.rb b/lib/datadog_api_client/v1/models/synthetics_test_restriction_policy_binding_relation.rb similarity index 84% rename from lib/datadog_api_client/v1/models/synthetics_mobile_test_binding_items_role.rb rename to lib/datadog_api_client/v1/models/synthetics_test_restriction_policy_binding_relation.rb index 7d3be7fa6cf7..5ca4720202bf 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding_items_role.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_restriction_policy_binding_relation.rb @@ -17,8 +17,8 @@ require 'time' module DatadogAPIClient::V1 - # The definition of `SyntheticsMobileTestBindingItemsRole` object. - class SyntheticsMobileTestBindingItemsRole + # The type of relation for the binding. + class SyntheticsTestRestrictionPolicyBindingRelation include BaseEnumModel EDITOR = "editor".freeze