From 7dd5f0679eca9b565f2338a6ea1538002ad8ef59 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 21 Oct 2024 13:15:02 +0000 Subject: [PATCH] Regenerate client from commit 3ffafabe of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 258 +++++++++++++++--- features/v1/synthetics.feature | 8 +- lib/datadog_api_client/inflector.rb | 16 +- .../v1/models/synthetics_mobile_step.rb | 38 ++- .../models/synthetics_mobile_step_params.rb | 249 +++++++++++++++++ ...synthetics_mobile_step_params_direction.rb | 29 ++ .../synthetics_mobile_step_params_element.rb | 175 ++++++++++++ ...mobile_step_params_element_context_type.rb | 27 ++ ..._step_params_element_relative_position.rb} | 32 ++- ...mobile_step_params_element_user_locator.rb | 117 ++++++++ ...rams_element_user_locator_values_items.rb} | 38 ++- ..._element_user_locator_values_items_type.rb | 30 ++ ...ics_mobile_step_params_positions_items.rb} | 32 ++- ...synthetics_mobile_step_params_variable.rb} | 44 +-- .../models/synthetics_mobile_test_binding.rb | 28 +- ...ynthetics_mobile_test_binding_relation.rb} | 4 +- .../models/synthetics_mobile_test_config.rb | 2 +- .../models/synthetics_mobile_test_options.rb | 40 ++- ...thetics_mobile_tests_mobile_application.rb | 29 +- .../v1/models/synthetics_test_ci_options.rb | 20 +- .../synthetics_test_options_scheduling.rb | 33 ++- ...etics_test_options_scheduling_timeframe.rb | 38 ++- 23 files changed, 1146 insertions(+), 149 deletions(-) create mode 100644 lib/datadog_api_client/v1/models/synthetics_mobile_step_params.rb create mode 100644 lib/datadog_api_client/v1/models/synthetics_mobile_step_params_direction.rb create mode 100644 lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element.rb create mode 100644 lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_context_type.rb rename lib/datadog_api_client/v1/models/{synthetics_mobile_test_initial_application_arguments_property_names.rb => synthetics_mobile_step_params_element_relative_position.rb} (79%) create mode 100644 lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator.rb rename lib/datadog_api_client/v1/models/{synthetics_mobile_test_binding_items.rb => synthetics_mobile_step_params_element_user_locator_values_items.rb} (74%) create mode 100644 lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator_values_items_type.rb rename lib/datadog_api_client/v1/models/{synthetics_mobile_test_initial_application_arguments.rb => synthetics_mobile_step_params_positions_items.rb} (79%) rename lib/datadog_api_client/v1/models/{synthetics_mobile_test_ci_options.rb => synthetics_mobile_step_params_variable.rb} (75%) rename lib/datadog_api_client/v1/models/{synthetics_mobile_test_binding_items_role.rb => synthetics_mobile_test_binding_relation.rb} (84%) diff --git a/.apigentools-info b/.apigentools-info index 0f8abdc606e..d479079f71a 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-18 21:00:59.110329", - "spec_repo_commit": "37070fd4" + "regenerated": "2024-10-21 13:14:35.827076", + "spec_repo_commit": "3ffafabe" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-18 21:00:59.128824", - "spec_repo_commit": "37070fd4" + "regenerated": "2024-10-21 13:14:35.845540", + "spec_repo_commit": "3ffafabe" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 0ec2691c577..9aca7b515ce 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -15533,14 +15533,14 @@ components: type: boolean name: description: The name of the step. + example: example-name 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 @@ -15551,6 +15551,185 @@ 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: The `SyntheticsMobileStepParams` `delay`. + format: int64 + maximum: 5000 + minimum: 0 + type: integer + direction: + $ref: '#/components/schemas/SyntheticsMobileStepParamsDirection' + element: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElement' + enable: + description: The `SyntheticsMobileStepParams` `enable`. + type: boolean + maxScrolls: + description: The `SyntheticsMobileStepParams` `maxScrolls`. + format: int64 + type: integer + positions: + $ref: '#/components/schemas/SyntheticsMobileStepParamsPositions' + subtestPublicId: + description: The `SyntheticsMobileStepParams` `subtestPublicId`. + type: string + value: + description: The `SyntheticsMobileStepParams` `value`. + type: string + variable: + $ref: '#/components/schemas/SyntheticsMobileStepParamsVariable' + withEnter: + description: The `SyntheticsMobileStepParams` `withEnter`. + type: boolean + x: + description: The `SyntheticsMobileStepParams` `x`. + format: int64 + type: integer + y: + description: The `SyntheticsMobileStepParams` `y`. + format: int64 + type: integer + type: object + SyntheticsMobileStepParamsDirection: + description: The definition of `SyntheticsMobileStepParamsDirection` object. + enum: + - up + - down + - left + - right + type: string + x-enum-varnames: + - UP + - DOWN + - LEFT + - RIGHT + SyntheticsMobileStepParamsElement: + description: The definition of `SyntheticsMobileStepParamsElement` object. + properties: + context: + description: The `element` `context`. + type: string + contextType: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElementContextType' + elementDescription: + description: The `element` `elementDescription`. + type: string + multiLocator: + description: The `element` `multiLocator`. + type: object + relativePosition: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElementRelativePosition' + textContent: + description: The `element` `textContent`. + type: string + userLocator: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElementUserLocator' + viewName: + description: The `element` `viewName`. + type: string + type: object + SyntheticsMobileStepParamsElementContextType: + description: The definition of `SyntheticsMobileStepParamsElementContextType` + object. + enum: + - native + - web + type: string + x-enum-varnames: + - NATIVE + - WEB + SyntheticsMobileStepParamsElementRelativePosition: + description: The definition of `SyntheticsMobileStepParamsElementRelativePosition` + object. + properties: + x: + description: The `relativePosition` `x`. + format: int64 + type: integer + y: + description: The `relativePosition` `y`. + format: int64 + type: integer + type: object + SyntheticsMobileStepParamsElementUserLocator: + description: The definition of `SyntheticsMobileStepParamsElementUserLocator` + object. + properties: + failTestOnCannotLocate: + description: The `userLocator` `failTestOnCannotLocate`. + type: boolean + values: + description: The `userLocator` `values`. + items: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElementUserLocatorValuesItems' + type: array + type: object + SyntheticsMobileStepParamsElementUserLocatorValuesItems: + description: The definition of `SyntheticsMobileStepParamsElementUserLocatorValuesItems` + object. + properties: + type: + $ref: '#/components/schemas/SyntheticsMobileStepParamsElementUserLocatorValuesItemsType' + value: + description: The `SyntheticsMobileStepParamsElementUserLocatorValuesItems` + `value`. + type: string + type: object + SyntheticsMobileStepParamsElementUserLocatorValuesItemsType: + description: The definition of `SyntheticsMobileStepParamsElementUserLocatorValuesItemsType` + object. + 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: The definition of `SyntheticsMobileStepParamsPositions` object. + items: + $ref: '#/components/schemas/SyntheticsMobileStepParamsPositionsItems' + type: array + SyntheticsMobileStepParamsPositionsItems: + description: The definition of `SyntheticsMobileStepParamsPositionsItems` object. + properties: + x: + description: The `SyntheticsMobileStepParamsPositionsItems` `x`. + format: int64 + type: integer + y: + description: The `SyntheticsMobileStepParamsPositionsItems` `y`. + format: int64 + type: integer + type: object + SyntheticsMobileStepParamsVariable: + description: The definition of `SyntheticsMobileStepParamsVariable` object. + properties: + example: + description: The `variable` `example`. + type: string + name: + description: The `variable` `name`. + example: example-name + type: string + required: + - name type: object SyntheticsMobileStepType: description: Step type used in your mobile Synthetic test. @@ -15648,27 +15827,12 @@ components: 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' + relation: + $ref: '#/components/schemas/SyntheticsMobileTestBindingRelation' 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: @@ -15676,14 +15840,15 @@ components: 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 + SyntheticsMobileTestBindingRelation: + description: The definition of `SyntheticsMobileTestBindingRelation` object. + enum: + - editor + - viewer + type: string + x-enum-varnames: + - EDITOR + - VIEWER SyntheticsMobileTestConfig: description: Configuration object for a Synthetic mobile test. properties: @@ -15696,18 +15861,10 @@ 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. @@ -15721,7 +15878,7 @@ components: $ref: '#/components/schemas/SyntheticsMobileTestBinding' type: array ci: - $ref: '#/components/schemas/SyntheticsMobileTestCiOptions' + $ref: '#/components/schemas/SyntheticsTestCiOptions' defaultStepTimeout: description: The `SyntheticsMobileTestOptions` `defaultStepTimeout`. format: int32 @@ -15731,6 +15888,8 @@ 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 @@ -15768,6 +15927,7 @@ 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 @@ -15778,6 +15938,10 @@ components: 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 @@ -15830,14 +15994,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 @@ -15845,6 +16015,7 @@ components: enum: - latest - version + example: latest type: string x-enum-varnames: - LATEST @@ -16313,6 +16484,8 @@ components: properties: executionRule: $ref: '#/components/schemas/SyntheticsTestExecutionRule' + required: + - executionRule type: object SyntheticsTestConfig: description: Configuration object for a Synthetic test. @@ -16620,6 +16793,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. @@ -16639,6 +16815,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`) diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index a980f84c43e..f0fbe8bdb5a 100644 --- a/features/v1/synthetics.feature +++ b/features/v1/synthetics.feature @@ -128,7 +128,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-ct Scenario: Create a mobile test returns "- JSON format is wrong" response Given new "CreateSyntheticsMobileTest" request - And body with value {"config": {"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": "example-name", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"name": "example-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": "example-name", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"name": "example-name"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} When the request is sent Then the response status is 402 Test quota is reached @@ -361,7 +361,7 @@ Feature: Synthetics Scenario: Edit a Mobile test returns "- JSON format is wrong" response Given new "UpdateMobileTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"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": "example-name", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"name": "example-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": "example-name", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"name": "example-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 diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7b073d1fb09..1d58c556381 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -637,15 +637,21 @@ 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_binding_relation" => "SyntheticsMobileTestBindingRelation", "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", 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 4d075c92744..a307de4e355 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 00000000000..72533a656c5 --- /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 + + # The `SyntheticsMobileStepParams` `delay`. + attr_reader :delay + + # The definition of `SyntheticsMobileStepParamsDirection` object. + attr_accessor :direction + + # The definition of `SyntheticsMobileStepParamsElement` object. + attr_accessor :element + + # The `SyntheticsMobileStepParams` `enable`. + attr_accessor :enable + + # The `SyntheticsMobileStepParams` `maxScrolls`. + attr_accessor :max_scrolls + + # The definition of `SyntheticsMobileStepParamsPositions` object. + attr_accessor :positions + + # The `SyntheticsMobileStepParams` `subtestPublicId`. + attr_accessor :subtest_public_id + + # The `SyntheticsMobileStepParams` `value`. + attr_accessor :value + + # The definition of `SyntheticsMobileStepParamsVariable` object. + attr_accessor :variable + + # The `SyntheticsMobileStepParams` `withEnter`. + attr_accessor :with_enter + + # The `SyntheticsMobileStepParams` `x`. + attr_accessor :x + + # The `SyntheticsMobileStepParams` `y`. + 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 00000000000..ac8ba1a6cd9 --- /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 definition of `SyntheticsMobileStepParamsDirection` object. + 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 00000000000..36cfd4ea23d --- /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 + # The definition of `SyntheticsMobileStepParamsElement` object. + class SyntheticsMobileStepParamsElement + include BaseGenericModel + + # The `element` `context`. + attr_accessor :context + + # The definition of `SyntheticsMobileStepParamsElementContextType` object. + attr_accessor :context_type + + # The `element` `elementDescription`. + attr_accessor :element_description + + # The `element` `multiLocator`. + attr_accessor :multi_locator + + # The definition of `SyntheticsMobileStepParamsElementRelativePosition` object. + attr_accessor :relative_position + + # The `element` `textContent`. + attr_accessor :text_content + + # The definition of `SyntheticsMobileStepParamsElementUserLocator` object. + attr_accessor :user_locator + + # The `element` `viewName`. + 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 00000000000..ce435519d98 --- /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 + # The definition of `SyntheticsMobileStepParamsElementContextType` object. + 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_property_names.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_property_names.rb rename to lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_relative_position.rb index 18b48cbebe6..4560db14e34 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_relative_position.rb @@ -17,12 +17,15 @@ require 'time' module DatadogAPIClient::V1 - # Name of the property. - class SyntheticsMobileTestInitialApplicationArgumentsPropertyNames + # The definition of `SyntheticsMobileStepParamsElementRelativePosition` object. + class SyntheticsMobileStepParamsElementRelativePosition include BaseGenericModel - # The `propertyNames` `pattern`. - attr_accessor :pattern + # The `relativePosition` `x`. + attr_accessor :x + + # The `relativePosition` `y`. + attr_accessor :y attr_accessor :additional_properties @@ -30,7 +33,8 @@ class SyntheticsMobileTestInitialApplicationArgumentsPropertyNames # @!visibility private def self.attribute_map { - :'pattern' => :'pattern' + :'x' => :'x', + :'y' => :'y' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'pattern' => :'String' + :'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::SyntheticsMobileTestInitialApplicationArgumentsPropertyNames` 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?(:'pattern') - self.pattern = attributes[:'pattern'] + 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 && - pattern == o.pattern + 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 - [pattern].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 00000000000..36e2c2c3eaf --- /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 + # The definition of `SyntheticsMobileStepParamsElementUserLocator` object. + class SyntheticsMobileStepParamsElementUserLocator + include BaseGenericModel + + # The `userLocator` `failTestOnCannotLocate`. + attr_accessor :fail_test_on_cannot_locate + + # The `userLocator` `values`. + 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_binding_items.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator_values_items.rb similarity index 74% rename from lib/datadog_api_client/v1/models/synthetics_mobile_test_binding_items.rb rename to lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator_values_items.rb index 432eb356abb..20a0ca381c9 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding_items.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_user_locator_values_items.rb @@ -17,15 +17,15 @@ require 'time' module DatadogAPIClient::V1 - # Object describing the binding used for a mobile test. - class SyntheticsMobileTestBindingItems + # The definition of `SyntheticsMobileStepParamsElementUserLocatorValuesItems` object. + class SyntheticsMobileStepParamsElementUserLocatorValuesItems include BaseGenericModel - # List of principals for a mobile test binding. - attr_accessor :principals + # The definition of `SyntheticsMobileStepParamsElementUserLocatorValuesItemsType` object. + attr_accessor :type - # The definition of `SyntheticsMobileTestBindingItemsRole` object. - attr_accessor :role + # The `SyntheticsMobileStepParamsElementUserLocatorValuesItems` `value`. + attr_accessor :value attr_accessor :additional_properties @@ -33,8 +33,8 @@ class SyntheticsMobileTestBindingItems # @!visibility private def self.attribute_map { - :'principals' => :'principals', - :'role' => :'role' + :'type' => :'type', + :'value' => :'value' } end @@ -42,8 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'principals' => :'Array', - :'role' => :'SyntheticsMobileTestBindingItemsRole' + :'type' => :'SyntheticsMobileStepParamsElementUserLocatorValuesItemsType', + :'value' => :'String' } 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::SyntheticsMobileStepParamsElementUserLocatorValuesItems` initialize method" end self.additional_properties = {} @@ -65,14 +65,12 @@ def initialize(attributes = {}) end } - if attributes.key?(:'principals') - if (value = attributes[:'principals']).is_a?(Array) - self.principals = value - end + if attributes.key?(:'type') + self.type = attributes[:'type'] end - if attributes.key?(:'role') - self.role = attributes[:'role'] + if attributes.key?(:'value') + self.value = attributes[:'value'] end end @@ -102,8 +100,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - principals == o.principals && - role == o.role + type == o.type && + value == o.value additional_properties == o.additional_properties end @@ -111,7 +109,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [principals, role].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 00000000000..6c0872cea49 --- /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 + # The definition of `SyntheticsMobileStepParamsElementUserLocatorValuesItemsType` object. + 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_initial_application_arguments.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_positions_items.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_positions_items.rb index 2aa977a77df..9de02844943 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_positions_items.rb @@ -17,12 +17,15 @@ require 'time' module DatadogAPIClient::V1 - # Initial application arguments for a mobile test. - class SyntheticsMobileTestInitialApplicationArguments + # The definition of `SyntheticsMobileStepParamsPositionsItems` object. + class SyntheticsMobileStepParamsPositionsItems include BaseGenericModel - # Name of the property. - attr_accessor :property_names + # The `SyntheticsMobileStepParamsPositionsItems` `x`. + attr_accessor :x + + # The `SyntheticsMobileStepParamsPositionsItems` `y`. + 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::SyntheticsMobileStepParamsPositionsItems` 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_test_ci_options.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_variable.rb similarity index 75% 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 c5c090607aa..3163a2b7929 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 + # The definition of `SyntheticsMobileStepParamsVariable` object. + class SyntheticsMobileStepParamsVariable include BaseGenericModel - # Execution rule for a Synthetic test. - attr_reader :execution_rule + # The `variable` `example`. + attr_accessor :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,18 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @execution_rule.nil? + return false if @name.nil? true end # Custom attribute writer method with validation - # @param execution_rule [Object] Object to be assigned + # @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 +118,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 +127,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_binding.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding.rb index 4e384d0184e..db8899d7f91 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding.rb @@ -21,8 +21,11 @@ module DatadogAPIClient::V1 class SyntheticsMobileTestBinding include BaseGenericModel - # Object describing the binding used for a mobile test. - attr_accessor :items + # List of principals for a mobile test binding. + attr_accessor :principals + + # The definition of `SyntheticsMobileTestBindingRelation` object. + attr_accessor :relation attr_accessor :additional_properties @@ -30,7 +33,8 @@ class SyntheticsMobileTestBinding # @!visibility private def self.attribute_map { - :'items' => :'items' + :'principals' => :'principals', + :'relation' => :'relation' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'items' => :'SyntheticsMobileTestBindingItems' + :'principals' => :'Array', + :'relation' => :'SyntheticsMobileTestBindingRelation' } end @@ -60,8 +65,14 @@ def initialize(attributes = {}) end } - if attributes.key?(:'items') - self.items = attributes[:'items'] + if attributes.key?(:'principals') + if (value = attributes[:'principals']).is_a?(Array) + self.principals = value + end + end + + if attributes.key?(:'relation') + self.relation = attributes[:'relation'] end end @@ -91,7 +102,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - items == o.items + principals == o.principals && + relation == o.relation additional_properties == o.additional_properties end @@ -99,7 +111,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [items].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_mobile_test_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_mobile_test_binding_relation.rb index 7d3be7fa6cf..64434435ca0 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding_items_role.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_test_binding_relation.rb @@ -17,8 +17,8 @@ require 'time' module DatadogAPIClient::V1 - # The definition of `SyntheticsMobileTestBindingItemsRole` object. - class SyntheticsMobileTestBindingItemsRole + # The definition of `SyntheticsMobileTestBindingRelation` object. + class SyntheticsMobileTestBindingRelation include BaseEnumModel EDITOR = "editor".freeze 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 9081fabe640..e72a601dea6 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 641fcb4a44f..bd77473d177 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 @@ -34,7 +34,7 @@ class SyntheticsMobileTestOptions 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`. attr_accessor :disable_auto_accept_alert @@ -43,7 +43,7 @@ class SyntheticsMobileTestOptions 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 @@ -105,7 +105,7 @@ def self.openapi_types { :'allow_application_crash' => :'Boolean', :'bindings' => :'Array', - :'ci' => :'SyntheticsMobileTestCiOptions', + :'ci' => :'SyntheticsTestCiOptions', :'default_step_timeout' => :'Integer', :'device_ids' => :'Array', :'disable_auto_accept_alert' => :'Boolean', @@ -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_tests_mobile_application.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_tests_mobile_application.rb index 6e87ed76c63..d21b90a01d2 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 4fd4d6b4323..ba3f2fbda18 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_scheduling.rb b/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling.rb index ae829098db7..ea8df5f130b 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 40c2dd58930..4d72c2d2286 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